From ae9947b32bc8071eb2f0a8359328d83bc574c237 Mon Sep 17 00:00:00 2001 From: Kesin Date: Wed, 23 Sep 2015 22:31:53 +0800 Subject: [PATCH] initial bootstrap --- app/assets/javascripts/application.js | 1 + app/assets/javascripts/bootstrap.js.coffee | 3 + .../bootstrap_and_overrides.css.less | 29 ++++++ app/views/layouts/application.html.erb | 91 +++++++++++++++++-- config/locales/en.bootstrap.yml | 23 +++++ 5 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 app/assets/javascripts/bootstrap.js.coffee create mode 100644 app/assets/stylesheets/bootstrap_and_overrides.css.less create mode 100644 config/locales/en.bootstrap.yml diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e07c5a8..bcb49bf 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,5 +12,6 @@ // //= require jquery //= require jquery_ujs +//= require twitter/bootstrap //= require turbolinks //= require_tree . diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee new file mode 100644 index 0000000..9440679 --- /dev/null +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -0,0 +1,3 @@ +jQuery -> + $("a[rel~=popover], .has-popover").popover() + $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less new file mode 100644 index 0000000..1da231a --- /dev/null +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -0,0 +1,29 @@ +@import "twitter/bootstrap/bootstrap"; + +// Set the correct sprite paths +@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png"); +@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png"); + +// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) +@fontAwesomeEotPath: font-url("fontawesome-webfont.eot"); +@fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix"); +@fontAwesomeWoffPath: font-url("fontawesome-webfont.woff"); +@fontAwesomeTtfPath: font-url("fontawesome-webfont.ttf"); +@fontAwesomeSvgPath: font-url("fontawesome-webfont.svg#fontawesomeregular"); + +// Font Awesome +@import "fontawesome/font-awesome"; + +// Glyphicons +//@import "twitter/bootstrap/glyphicons.less"; + +// Your custom LESS stylesheets goes here +// +// Since bootstrap was imported above you have access to its mixins which +// you may use and inherit here +// +// If you'd like to override bootstrap's own variables, you can do so here as well +// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation +// +// Example: +// @link-color: #ff0000; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 950b22c..7c918c3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,85 @@ - - - OhMyEvent - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <%= csrf_meta_tags %> - - + + + + + + <%= content_for?(:title) ? yield(:title) : "OhMyEvent" %> + <%= csrf_meta_tags %> -<%= yield %> + + - + <%= stylesheet_link_tag "application", :media => "all" %> + + + + <%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %> + + + + <%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %> + + + + <%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %> + + + + <%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %> + + + + <%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %> + + <%= javascript_include_tag "application" %> + + + + + +
+
+
+ <%= bootstrap_flash %> + <%= yield %> +
+
+ +
+
+ +
+

© Company 2015

+
+ +
+ + diff --git a/config/locales/en.bootstrap.yml b/config/locales/en.bootstrap.yml new file mode 100644 index 0000000..8d75119 --- /dev/null +++ b/config/locales/en.bootstrap.yml @@ -0,0 +1,23 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + breadcrumbs: + application: + root: "Index" + pages: + pages: "Pages" + helpers: + actions: "Actions" + links: + back: "Back" + cancel: "Cancel" + confirm: "Are you sure?" + destroy: "Delete" + new: "New" + edit: "Edit" + titles: + edit: "Edit %{model}" + save: "Save %{model}" + new: "New %{model}" + delete: "Delete %{model}"