Skip to content

Commit b84dd01

Browse files
authored
Merge pull request #214 from coderdojo-japan/use-haml
Use `haml-rails` and convert erb to haml
2 parents f95499d + 6fc827b commit b84dd01

File tree

74 files changed

+577
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+577
-752
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ gem "bootstrap-sass"
1616
gem 'sass-rails'
1717
gem 'uglifier'
1818
gem 'font-awesome-rails'
19+
gem 'haml-rails'
1920

2021
# For redirection
2122
gem 'rack-host-redirect'

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GEM
7575
debug_inspector (0.0.3)
7676
diff-lcs (1.3)
7777
erubi (1.7.0)
78+
erubis (2.7.0)
7879
ethon (0.11.0)
7980
ffi (>= 1.3.0)
8081
execjs (2.7.0)
@@ -94,7 +95,21 @@ GEM
9495
net-http-pipeline
9596
globalid (0.4.1)
9697
activesupport (>= 4.2.0)
98+
haml (5.0.4)
99+
temple (>= 0.8.0)
100+
tilt
101+
haml-rails (1.0.0)
102+
actionpack (>= 4.0.1)
103+
activesupport (>= 4.0.1)
104+
haml (>= 4.0.6, < 6.0)
105+
html2haml (>= 1.0.1)
106+
railties (>= 4.0.1)
97107
highline (1.7.8)
108+
html2haml (2.2.0)
109+
erubis (~> 2.7.0)
110+
haml (>= 4.0, < 6)
111+
nokogiri (>= 1.6.0)
112+
ruby_parser (~> 3.5)
98113
hyp_diff (0.0.5)
99114
diff-lcs (~> 1.2, >= 1.2.5)
100115
nokogiri (~> 1.6, >= 1.6.5)
@@ -224,6 +239,8 @@ GEM
224239
rspec-core (~> 3.3)
225240
rspec-support (3.7.0)
226241
ruby_dep (1.5.0)
242+
ruby_parser (3.10.1)
243+
sexp_processor (~> 4.9)
227244
rubyzip (1.2.1)
228245
sass (3.5.3)
229246
sass-listen (~> 4.0.0)
@@ -273,6 +290,7 @@ GEM
273290
selenium-webdriver (3.6.0)
274291
childprocess (~> 0.5)
275292
rubyzip (~> 1.0)
293+
sexp_processor (4.10.0)
276294
simple_grid_rails (0.1.0)
277295
spring (2.0.2)
278296
activesupport (>= 4.2)
@@ -284,6 +302,7 @@ GEM
284302
activesupport (>= 4.0)
285303
sprockets (>= 3.0.0)
286304
sqlite3 (1.3.13)
305+
temple (0.8.0)
287306
thor (0.20.0)
288307
thread_safe (0.3.6)
289308
tilt (2.0.8)
@@ -327,6 +346,7 @@ DEPENDENCIES
327346
faraday
328347
faraday_middleware (= 0.10)
329348
font-awesome-rails
349+
haml-rails
330350
jbuilder
331351
jquery-rails
332352
koala

app/views/blog_post_page/details.html.erb

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= scrivito_details_for 'Permalink' do
2+
= scrivito_tag :div, @obj, :_permalink
3+
= scrivito_medium_dialog do
4+
= scrivito_details_for "Title" do
5+
= scrivito_tag :div, @obj, :title

app/views/blog_post_page/index.html.erb

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%article
2+
.container
3+
.row
4+
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
5+
.fontsize-bigger
6+
= scrivito_tag_list :ul, @obj, :toclist do |list, child|
7+
= list.tag :li do
8+
= link_to child.display_title, scrivito_path(child)
9+
= scrivito_tag :h1, @obj, :title
10+
= scrivito_tag :div, @obj, :abstract
11+
= scrivito_image_tag @obj, :image, class: "img-responsive"
12+
= scrivito_tag :div, @obj, :body
13+
%hr/
14+
= content_tag :div, scrivito_value(@obj.last_changed.strftime("更新日: %Y年%m月%d日")), class: "text-muted text-right h5"
15+
%div{:style => "margin-left: 0px; padding-bottom: 30px;"}
16+
= render 'shared/sitemap_sotechsha' if @sts_posts

app/views/blog_post_page/thumbnail.html.erb

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= scrivito_thumbnail BlogPostPage.description_for_editor, :content

app/views/docs/index.html.erb

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/views/docs/index.html.haml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- provide(:title, @title)
2+
- provide(:url, @url )
3+
.container{:style => "line-height: 2.2em;"}
4+
%section.keiyaku{:style => "padding: 50px 0px 50px 0px;"}
5+
%h2{:style => "text-align: center; padding-bottom: 50px;"}= @title
6+
%ul{:style => "font-size: 120%"}
7+
- @docs.each do |doc|
8+
%li= link_to doc.title, doc.url

app/views/docs/show.html.erb

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/views/docs/show.html.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- provide(:title, @doc.title)
2+
- provide(:url, @url)
3+
.container{:style => "line-height: 1.9em;"}
4+
%section.keiyaku{:style => "padding: 50px 0px 100px 0px;"}
5+
= raw @content

app/views/download/details.html.erb

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/views/download/details.html.haml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
= scrivito_medium_dialog do
2+
= scrivito_details_for do
3+
= scrivito_tag :div, @obj, :blob do
4+
= link_to @obj.description_for_editor, scrivito_path(@obj), :target => :blank
5+
= scrivito_details_for do
6+
= number_to_human_size @obj.meta_data[:content_length]

app/views/footer_widget/details.html.erb

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
= scrivito_medium_dialog do
2+
= scrivito_details_for FooterWidget.description_for_editor do

app/views/footer_widget/show.html.erb

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.col-12
2+
.col-3.cover-bg-blue
3+
= scrivito_tag :h5, widget, :headline, class:'cover-text-white', style:'padding-top:20px;'
4+
= scrivito_tag :p, widget, :paragraph, class:'cover-text-white', style:'padding-bottom:60; padding-top:20px;'

app/views/footer_widget/thumbnail.html.erb

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= scrivito_thumbnail FooterWidget.description_for_editor

app/views/headline_widget/details.html.erb

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= scrivito_small_dialog do
2+
= scrivito_details_for 'Anchor' do
3+
= scrivito_tag(:div, widget, :anchor)

app/views/headline_widget/show.html.erb

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.headline-anchor{:id => "#{widget.anchor}"}
2+
= scrivito_tag :h2, widget, :headline, class: "headline"

app/views/headline_widget/thumbnail.html.erb

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
= scrivito_thumbnail HeadlineWidget.description_for_editor, :headline do
2+
A headline widget with an Anchor ID attribute.

app/views/image/details.html.erb

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/views/image/details.html.haml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
= scrivito_medium_dialog do
2+
= scrivito_details_for do
3+
= scrivito_image_tag @obj
4+
= scrivito_details_for do
5+
- if @obj.meta_data[:width] && @obj.meta_data[:height]
6+
%div
7+
= @obj.meta_data[:width]
8+
× #{@obj.meta_data[:height]} px
9+
%div
10+
= number_to_human_size @obj.meta_data[:content_length]

app/views/image_widget/show.html.erb

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/views/image_widget/show.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= scrivito_image_tag widget, :image, style:'padding-top:-50px;', class: "img-responsive"

app/views/image_widget/thumbnail.html.erb

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
= scrivito_thumbnail ImageWidget.description_for_editor, :image do
2+
A widget with an image.

app/views/layouts/application.html.erb

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)