Skip to content
This repository was archived by the owner on May 29, 2020. It is now read-only.

Commit ccf66bf

Browse files
committed
Merge branch 'master' into not_deploy_on_pull_req
2 parents bef602d + 5683714 commit ccf66bf

19 files changed

+98
-56
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ gem 'faker'
4848
gem "cancan", :git => "git://github.com/ryanb/cancan.git", :branch => "2.0"
4949
gem 'therubyracer'
5050
gem "less-rails"
51-
gem "twitter-bootstrap-rails"
51+
gem "twitter-bootstrap-rails", github: 'seyhunak/twitter-bootstrap-rails'
5252
gem "jquery-ui-rails"
5353
gem "ransack", github: 'ernie/ransack', branch: "rails-4"
5454
gem "dalli"

Gemfile.lock

+11-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ GIT
3030
specs:
3131
cancan (2.0.0.alpha)
3232

33+
GIT
34+
remote: git://github.com/seyhunak/twitter-bootstrap-rails.git
35+
revision: 3ac1736365a14253b34b4798ee2dc0215896be9a
36+
specs:
37+
twitter-bootstrap-rails (2.2.6)
38+
actionpack (>= 3.1)
39+
execjs
40+
rails (>= 3.1)
41+
railties (>= 3.1)
42+
3343
GIT
3444
remote: git://github.com/smartinez87/exception_notification.git
3545
revision: 11d61df3cb435381929757b8d7e47209b5ab2b14
@@ -259,10 +269,6 @@ GEM
259269
polyglot (>= 0.3.1)
260270
turbolinks (1.1.1)
261271
coffee-rails
262-
twitter-bootstrap-rails (2.2.6)
263-
actionpack (>= 3.1)
264-
execjs
265-
railties (>= 3.1)
266272
tzinfo (0.3.37)
267273
uglifier (2.0.1)
268274
execjs (>= 0.3.0)
@@ -314,6 +320,6 @@ DEPENDENCIES
314320
test_after_commit
315321
therubyracer
316322
turbolinks
317-
twitter-bootstrap-rails
323+
twitter-bootstrap-rails!
318324
uglifier (>= 1.0.3)
319325
webrat

app/assets/stylesheets/bootstrap_and_overrides.css.less

+10
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@
2929
//
3030
// Example:
3131
// @linkColor: #ff0000;
32+
33+
.error_notification {
34+
.alert();
35+
.alert-error();
36+
.alert-block();
37+
}
38+
39+
.field_with_errors {
40+
.control-group.error();
41+
}

app/views/layouts/application.html.haml

+1-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
%link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
1616
%link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
1717
%link(href="/favicon.ico" rel="shortcut icon")
18-
18+
= javascript_include_tag "application"
1919

2020
%body
2121
.navbar.navbar-fluid-top
@@ -53,8 +53,3 @@
5353

5454
%footer
5555
%p © Company 2013
56-
/
57-
Javascripts
58-
\==================================================
59-
/ Placed at the end of the document so the pages load faster
60-
= javascript_include_tag "application"

app/views/posts/_post.html.haml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%tr
2+
- if local_assigns.fetch(:with_user, true)
3+
%td= link_to_user(post.user)
4+
%td= link_to l(post.created_at), post
5+
%td= post.text
6+
%td= link_to post.url,post.url
7+
%td= post.comments_count
8+
%td
9+
= link_to t('.edit', :default => t("helpers.links.edit")), edit_post_path(post), :class => 'btn btn-mini' if can? :edit, post
10+
= link_to t('.destroy', :default => t("helpers.links.destroy")), post_path(post), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger' if can? :destroy, post

app/views/posts/index.html.haml

+5-14
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,12 @@
77
= paginate posts
88
%table.table
99
%tr
10-
%th= User
10+
%th= User.human_attribute_name(:username)
1111
%th= sort_link @q, :created_at, "投稿日時"
12-
%th 本文
13-
%th Url
12+
%th= Post.human_attribute_name(:text)
13+
%th= Post.human_attribute_name(:url)
1414
%th= sort_link @q, :comments_count, 'コメント数'
1515
%th=t '.actions', :default => t("helpers.actions")
1616

17-
- posts.each do |post|
18-
%tr
19-
%td= link_to_user(post.user)
20-
%td= link_to l(post.created_at), post
21-
%td= post.text
22-
%td= link_to post.url,post.url
23-
%td= post.comments_count
24-
%td
25-
= link_to t('.edit', :default => t("helpers.links.edit")), edit_post_path(post), :class => 'btn btn-mini' if can? :edit, post
26-
= link_to t('.destroy', :default => t("helpers.links.destroy")), post_path(post), :method => :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-mini btn-danger' if can? :destroy, post
27-
= paginate posts
17+
= render posts
18+
= paginate posts

app/views/posts/show.html.haml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
%h1=t '.title', :default => model_class.model_name.human
44

55
%dl
6-
%dt User
7-
%dd= @post.user.username
8-
%dt Text
6+
%dt= User.human_attribute_name(:username)
7+
%dd= link_to_user @post.user
8+
%dt= model_class.human_attribute_name(:text)
99
%dd= @post.text
10-
%dt Url
11-
%dd= @post.url
10+
%dt= model_class.human_attribute_name(:url)
11+
%dd= link_to @post.url, @post.url
1212

1313
.form-actions
1414
= link_to t('.back', :default => t("helpers.links.back")), :back, :class => 'btn'

app/views/users/show.html.haml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
- model_class = User
22
.page-header
3-
%h1=t '.title', :default => model_class.model_name.human
4-
5-
%dl
6-
%dt Username
7-
%dd= @user.username
3+
%h1= @user.username
84

95
.form-actions
106
= link_to t('.back', :default => t("helpers.links.back")), :back, :class => 'btn'
117
= link_to t('.edit', :default => t("helpers.links.edit")), edit_user_path(@user), :class => 'btn' if can? :update, @user
128
= link_to t('.destroy', :default => t("helpers.links.destroy")), user_path(@user), :method => "delete", :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }, :class => 'btn btn-danger' if can? :destroy, @user
9+
10+
%h2 最近の投稿
11+
%table.table
12+
%tr
13+
%th= Post.human_attribute_name(:created_at)
14+
%th= Post.human_attribute_name(:text)
15+
%th= Post.human_attribute_name(:url)
16+
%th= Post.human_attribute_name(:comments_count)
17+
%th=t '.actions', :default => t("helpers.actions")
18+
19+
= render @user.posts.order("created_at DESC").first(10), with_user: false

config/locales/ja.bootstrap.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ja:
2+
helpers:
3+
actions: "アクション"
4+
links:
5+
back: "戻る"
6+
cancel: "キャンセル"
7+
confirm: "よろしいですか?"
8+
edit: 編集
9+
destroy: "削除"
10+
new: "新規"
11+
titles:
12+
edit: "%{model}の編集"
13+
index: "%{model}の一覧"
14+
save: "保存"
15+
new: "新規%{model}"
16+
delete: "削除"
17+
notices:
18+
created: "%{model}を作成しました。"
19+
updated: "%{model}を更新しました。"
20+
destroyed: "%{model}を削除しました。"
21+
22+
views:
23+
pagination:
24+
first: "<<"
25+
last: ">>"
26+
previous: "<"
27+
next: ">"
28+
truncate: "..."
29+
30+
simple_form:
31+
error_notification:
32+
default_message: 修正が必要な項目があります。
33+
34+
ransack:
35+
search: 検索する

config/locales/ja.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ja:
100100
messages:
101101
accepted: を受諾してください。
102102
blank: を入力してください。
103-
confirmation: と確認の入力が一致しません
103+
confirmation: が一致しません
104104
empty: を入力してください。
105105
equal_to: は%{count}にしてください。
106106
even: は偶数にしてください。

config/locales/translation_ja.yml

+4-16
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,14 @@ ja:
1212
user: :activerecord.models.user #g
1313

1414
post:
15+
created_at: 投稿日
1516
comments: コメント #g
17+
comments_count: コメント数
1618
text: 本文 #g
1719
url: URL #g
1820
user: :activerecord.models.user #g
1921

2022
user:
21-
password_digest:
22-
salt:
23+
password: パスワード
24+
password_confirmation: パスワード (確認)
2325
username: ユーザー名 #g
24-
25-
helpers:
26-
notices:
27-
created: "%{model}を作成しました。"
28-
updated: "%{model}を更新しました。"
29-
destroyed: "%{model}を削除しました。"
30-
31-
views:
32-
pagination:
33-
first: "<<"
34-
last: ">>"
35-
previous: "<"
36-
next: ">"
37-
truncate: "..."

lib/templates/haml/scaffold/index.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
%table.table
66
%tr
77
<% for attribute in attributes -%>
8-
%th <%= attribute.human_name %>
8+
%th= model_class.human_attribute_name(:<%= attribute.name %>)
99
<% end -%>
1010
%th=t '.actions', :default => t("helpers.actions")
1111

lib/templates/haml/scaffold/show.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
%dl
66
<% for attribute in attributes -%>
7-
%dt <%= attribute.human_name %>
7+
%dt= model_class.human_attribute_name(:<%= attribute.name %>)
88
%dd= @<%= singular_table_name %>.<%= attribute.name %>
99
<% end -%>
1010

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)