From 310e7e80b46da32da0587bf2a22b638d6abf7012 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 1 Aug 2014 11:55:50 +0200 Subject: [PATCH] added basic bootstrap navbar and layout and everything --- app/assets/javascripts/application.coffee | 4 ++++ app/assets/javascripts/application.js | 16 ---------------- app/assets/stylesheets/application.css | 15 --------------- app/assets/stylesheets/application.css.scss | 5 +++++ app/assets/stylesheets/base.css.scss | 1 + app/views/layouts/application.html.haml | 11 +++++++++++ app/views/static/about.html.haml | 5 +++-- app/views/static/index.html.haml | 5 +++-- 8 files changed, 27 insertions(+), 35 deletions(-) create mode 100644 app/assets/javascripts/application.coffee delete mode 100644 app/assets/javascripts/application.js delete mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/application.css.scss create mode 100644 app/assets/stylesheets/base.css.scss diff --git a/app/assets/javascripts/application.coffee b/app/assets/javascripts/application.coffee new file mode 100644 index 00000000..a37af364 --- /dev/null +++ b/app/assets/javascripts/application.coffee @@ -0,0 +1,4 @@ +#= require jquery +#= require jquery_ujs +#= require turbolinks +#= require_tree . diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index d6925fa4..00000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,16 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require jquery -//= require jquery_ujs -//= require turbolinks -//= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index a443db34..00000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss new file mode 100644 index 00000000..0aceec67 --- /dev/null +++ b/app/assets/stylesheets/application.css.scss @@ -0,0 +1,5 @@ +@import "bootswatch/flatly/variables"; +@import "bootstrap"; +body { padding-top: $navbar-height; } +@import "bootswatch/flatly/bootswatch"; +@import "base"; diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss new file mode 100644 index 00000000..d368c020 --- /dev/null +++ b/app/assets/stylesheets/base.css.scss @@ -0,0 +1 @@ +/* all custom SCSS should go into here */ \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 11444f6f..b8afab45 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,4 +6,15 @@ = javascript_include_tag 'application', 'data-turbolinks-track' => true = csrf_meta_tags %body + %nav.navbar.navbar-default.navbar-fixed-top{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-main-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} justask2 + #j2-main-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav = yield \ No newline at end of file diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index 0a964f00..b04b359f 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -1,2 +1,3 @@ -%h1 Static#about -%p Find me in app/views/static/about.html.haml +.container + %h1 Static#about + %p Find me in app/views/static/about.html.haml diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index e5cd5a12..0193b40e 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -1,2 +1,3 @@ -%h1 Static#index -%p Find me in app/views/static/index.html.haml \ No newline at end of file +.container + %h1 Static#index + %p Find me in app/views/static/index.html.haml \ No newline at end of file