package com.sb.elsinore.html;

import java.io.IOException;

import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;

import com.sb.elsinore.LaunchControl;

import static org.rendersnake.HtmlAttributesFactory.*;

/**
 * Create a top bar for the web page.
 * @author Doug Edey
 */
public class TopBar implements Renderable {

    @Override
    public final void renderOn(HtmlCanvas htmlCanvas) throws IOException {
        htmlCanvas.div(id("topbar").class_("col-md-12"))
            .div(id("breweryTitle").class_("left  col-md-2"))
                .h1(class_("breweryNameHeader").onClick("editBreweryName()"))
                    .div(id("breweryName")).write("Elsinore")._div()
                    .small()
                        .a(href(LaunchControl.RepoURL))
                            .content("StrangeBrew Elsinore")
                    ._small()
                ._h1()
            ._div()
            .div(class_("center-left col-md-4"))._div()
            .div(class_("center-right col-md-4"))._div()
        ._div()
        .div(id("messages").style("display:none"))
            .div(class_("panel panel-warning"))
                .div(id("messages-title").class_("title panel-heading"))._div()
                .div(id("messages-body").class_("panel-body"))._div()
            ._div()
        ._div();
    }

}

@@ -468,17 +468,11 @@
 s_(%22
-col-md-12
+row
 %22))%0A
@@ -520,17 +520,16 @@
 _(%22left 
- 
 col-md-2
@@ -1055,16 +1055,30 @@
 sages%22).
+class_(%22row%22).
 style(%22d

Improve the top bar for the error messages.