[Groonga-commit] groonga/heroku-sample-rroonga-blog at ecdaa08 [master] Add Twitter Bootstrap

Back to archive index

mallowlabs null+****@clear*****
Mon May 26 23:25:11 JST 2014


mallowlabs	2014-05-26 23:25:11 +0900 (Mon, 26 May 2014)

  New Revision: ecdaa082270198e1ca49fb546c7598ec7a2a1ffb
  https://github.com/groonga/heroku-sample-rroonga-blog/commit/ecdaa082270198e1ca49fb546c7598ec7a2a1ffb

  Merged 4392b85: Merge pull request #1 from mallowlabs/twitter-bootstrap

  Message:
    Add Twitter Bootstrap

  Removed files:
    app/assets/stylesheets/posts.css.scss
    app/assets/stylesheets/scaffolds.css.scss
  Modified files:
    Gemfile
    Gemfile.lock
    app/assets/javascripts/application.js
    app/views/layouts/application.html.erb
    app/views/posts/_form.html.erb
    app/views/posts/edit.html.erb
    app/views/posts/index.html.erb
    app/views/posts/new.html.erb
    app/views/posts/show.html.erb
  Renamed files:
    app/assets/stylesheets/application.css.scss
      (from app/assets/stylesheets/application.css)

  Modified: Gemfile (+2 -0)
===================================================================
--- Gemfile    2014-05-25 19:35:35 +0900 (2decd7b)
+++ Gemfile    2014-05-26 23:25:11 +0900 (018ae43)
@@ -39,6 +39,8 @@ gem 'spring',        group: :development
 # Use debugger
 # gem 'debugger', group: [:development, :test]
 
+gem 'bootstrap-sass'
+
 gem 'rails_12factor', group: :production
 
 gem 'rroonga'

  Modified: Gemfile.lock (+3 -0)
===================================================================
--- Gemfile.lock    2014-05-25 19:35:35 +0900 (5a16661)
+++ Gemfile.lock    2014-05-26 23:25:11 +0900 (7c8feb9)
@@ -30,6 +30,8 @@ GEM
     archive-zip (0.6.0)
       io-like (>= 0.3.0)
     arel (5.0.1.20140414130214)
+    bootstrap-sass (3.1.1.1)
+      sass (~> 3.2)
     builder (3.2.2)
     coffee-rails (4.0.1)
       coffee-script (>= 2.2.0)
@@ -156,6 +158,7 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
+  bootstrap-sass
   coffee-rails (~> 4.0.0)
   jbuilder (~> 2.0)
   jquery-rails

  Modified: app/assets/javascripts/application.js (+1 -0)
===================================================================
--- app/assets/javascripts/application.js    2014-05-25 19:35:35 +0900 (d6925fa)
+++ app/assets/javascripts/application.js    2014-05-26 23:25:11 +0900 (cd5c291)
@@ -13,4 +13,5 @@
 //= require jquery
 //= require jquery_ujs
 //= require turbolinks
+//= require bootstrap
 //= require_tree .

  Renamed: app/assets/stylesheets/application.css.scss (+5 -0) 89%
===================================================================
--- app/assets/stylesheets/application.css    2014-05-25 19:35:35 +0900 (a443db3)
+++ app/assets/stylesheets/application.css.scss    2014-05-26 23:25:11 +0900 (a7bd048)
@@ -13,3 +13,8 @@
  *= require_tree .
  *= require_self
  */
+
+body { padding-top: 60px }
+.keyword { color: #f33; }
+
+ �� import "bootstrap";

  Deleted: app/assets/stylesheets/posts.css.scss (+0 -3) 100644
===================================================================
--- app/assets/stylesheets/posts.css.scss    2014-05-25 19:35:35 +0900 (1a7e153)
+++ /dev/null
@@ -1,3 +0,0 @@
-// Place all the styles related to the posts controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/

  Deleted: app/assets/stylesheets/scaffolds.css.scss (+0 -73) 100644
===================================================================
--- app/assets/stylesheets/scaffolds.css.scss    2014-05-25 19:35:35 +0900 (2b39bd8)
+++ /dev/null
@@ -1,73 +0,0 @@
-body {
-  background-color: #fff;
-  color: #333;
-  font-family: verdana, arial, helvetica, sans-serif;
-  font-size: 13px;
-  line-height: 18px;
-}
-
-p, ol, ul, td {
-  font-family: verdana, arial, helvetica, sans-serif;
-  font-size: 13px;
-  line-height: 18px;
-}
-
-pre {
-  background-color: #eee;
-  padding: 10px;
-  font-size: 11px;
-}
-
-a {
-  color: #000;
-  &:visited {
-    color: #666;
-  }
-  &:hover {
-    color: #fff;
-    background-color: #000;
-  }
-}
-
-div {
-  &.field, &.actions {
-    margin-bottom: 10px;
-  }
-}
-
-#notice {
-  color: green;
-}
-
-.field_with_errors {
-  padding: 2px;
-  background-color: red;
-  display: table;
-}
-
-#error_explanation {
-  width: 450px;
-  border: 2px solid red;
-  padding: 7px;
-  padding-bottom: 0;
-  margin-bottom: 20px;
-  background-color: #f0f0f0;
-  h2 {
-    text-align: left;
-    font-weight: bold;
-    padding: 5px 5px 5px 15px;
-    font-size: 12px;
-    margin: -7px;
-    margin-bottom: 0px;
-    background-color: #c00;
-    color: #fff;
-  }
-  ul li {
-    font-size: 12px;
-    list-style: square;
-  }
-}
-
-.keyword {
-  color: #f33;
-}

  Modified: app/views/layouts/application.html.erb (+30 -1)
===================================================================
--- app/views/layouts/application.html.erb    2014-05-25 19:35:35 +0900 (b8c4523)
+++ app/views/layouts/application.html.erb    2014-05-26 23:25:11 +0900 (0aa48b1)
@@ -1,14 +1,43 @@
 <!DOCTYPE html>
 <html>
 <head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
   <title>HerokuBlog</title>
   <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
+  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+  <!--[if lt IE 9]>
+    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
+  <![endif]-->
   <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
   <%= csrf_meta_tags %>
 </head>
 <body>
+  <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+    <div class="container">
+      <div class="navbar-header">
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <%= link_to 'HerokuBlog', root_path, class: 'navbar-brand' %>
+      </div>
+      <%= form_tag(posts_path, method: "get", class: "navbar-form navbar-right collapse navbar-collapse") do %>
+        <div class="input-group">
+          <span class="input-group-addon"><span class="glyphicon glyphicon-search"></span></span>
+          <%= search_field_tag :query, @search_condition ? @search_condition.query : nil, class: "form-control", placeholder: "Search" %>
+        </div>
+      <% end %>
+    </div>
+  </div>
 
-<%= yield %>
+  <div class="container">
+    <%= yield %>
+  </div>
 
 </body>
 </html>

  Modified: app/views/posts/_form.html.erb (+9 -9)
===================================================================
--- app/views/posts/_form.html.erb    2014-05-25 19:35:35 +0900 (d4faf01)
+++ app/views/posts/_form.html.erb    2014-05-26 23:25:11 +0900 (dcad0fa)
@@ -1,7 +1,7 @@
 <%= form_for(@post) do |f| %>
   <% if****@post*****? %>
-    <div id="error_explanation">
-      <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
+    <div class="alert alert-danger">
+      <h4><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h4>
 
       <ul>
       <% @post.errors.full_messages.each do |message| %>
@@ -11,15 +11,15 @@
     </div>
   <% end %>
 
-  <div class="field">
-    <%= f.label :title %><br>
-    <%= f.text_field :title %>
+  <div class="form-group">
+    <%= f.label :title %>
+    <%= f.text_field :title, class: "form-control" %>
   </div>
-  <div class="field">
-    <%= f.label :content %><br>
-    <%= f.text_area :content %>
+  <div class="form-group">
+    <%= f.label :content %>
+    <%= f.text_area :content, rows: 6, class: "form-control" %>
   </div>
   <div class="actions">
-    <%= f.submit %>
+    <%= f.submit class: "btn btn-primary" %>
   </div>
 <% end %>

  Modified: app/views/posts/edit.html.erb (+3 -3)
===================================================================
--- app/views/posts/edit.html.erb    2014-05-25 19:35:35 +0900 (7205802)
+++ app/views/posts/edit.html.erb    2014-05-26 23:25:11 +0900 (8871647)
@@ -1,6 +1,6 @@
-<h1>Editing post</h1>
+<h3>Editing post</h3>
 
 <%= render 'form' %>
 
-<%= link_to 'Show', @post %> |
-<%= link_to 'Back', posts_path %>
+<%= link_to 'Back', posts_path, class: 'btn' %>
+

  Modified: app/views/posts/index.html.erb (+10 -13)
===================================================================
--- app/views/posts/index.html.erb    2014-05-25 19:35:35 +0900 (684faad)
+++ app/views/posts/index.html.erb    2014-05-26 23:25:11 +0900 (7dfd940)
@@ -1,32 +1,29 @@
-<h1>Listing posts</h1>
+<h3>Listing posts</h3>
 
-<%= form_tag(posts_path, method: "get") do %>
-  <%= search_field_tag :query, @search_condition.query %>
-  <%= submit_tag 'Search' %>
-<% end %>
-
-<table>
+<% if****@posts*****? %>
+<p class="alert alert-warning">No posts available.</p>
+<% else %>
+<table class="table table-striped">
   <thead>
     <tr>
       <th>Title</th>
       <th>Content</th>
-      <th colspan="3"></th>
+      <th>Last updated</th>
     </tr>
   </thead>
 
   <tbody>
     <% @posts.each do |post| %>
       <tr>
-        <td><%= highlight(post.title) %></td>
+        <td><%= link_to highlight(post.title), post %></td>
         <td><%= highlight(post.content) %></td>
-        <td><%= link_to 'Show', post %></td>
-        <td><%= link_to 'Edit', edit_post_path(post) %></td>
-        <td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+        <td><%= time_ago_in_words(post.updated_at) + ' ago' %></td>
       </tr>
     <% end %>
   </tbody>
 </table>
+<% end %>
 
 <br>
 
-<%= link_to 'New Post', new_post_path %>
+<%= link_to 'New Post', new_post_path, class: 'btn btn-default' %>

  Modified: app/views/posts/new.html.erb (+2 -2)
===================================================================
--- app/views/posts/new.html.erb    2014-05-25 19:35:35 +0900 (36ad742)
+++ app/views/posts/new.html.erb    2014-05-26 23:25:11 +0900 (6ad09c6)
@@ -1,5 +1,5 @@
-<h1>New post</h1>
+<h3>New post</h3>
 
 <%= render 'form' %>
 
-<%= link_to 'Back', posts_path %>
+<%= link_to 'Back', posts_path, class: 'btn' %>

  Modified: app/views/posts/show.html.erb (+13 -12)
===================================================================
--- app/views/posts/show.html.erb    2014-05-25 19:35:35 +0900 (e03ead5)
+++ app/views/posts/show.html.erb    2014-05-26 23:25:11 +0900 (57ed163)
@@ -1,14 +1,15 @@
-<p id="notice"><%= notice %></p>
+<% if notice %>
+  <p class="alert alert-success">
+    <%= notice %>
+    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+  </p>
+<% end %>
 
-<p>
-  <strong>Title:</strong>
-  <%=****@post***** %>
-</p>
+<div>
+  <h4><%=****@post***** %></h4>
+  <pre><%=****@post***** %></pre>
+</div>
 
-<p>
-  <strong>Content:</strong>
-  <%=****@post***** %>
-</p>
-
-<%= link_to 'Edit', edit_post_path(@post) %> |
-<%= link_to 'Back', posts_path %>
+<%= link_to 'Edit Post', edit_post_path(@post), class: 'btn btn-default' %>
+<%= link_to 'Back', posts_path, class: 'btn' %>
+<%= link_to 'Destroy Post', @post, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger pull-right' %>
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index