Skip to content

Use haml-rails and convert erb to haml #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gem "bootstrap-sass"
gem 'sass-rails'
gem 'uglifier'
gem 'font-awesome-rails'
gem 'haml-rails'

# For redirection
gem 'rack-host-redirect'
Expand Down
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GEM
debug_inspector (0.0.3)
diff-lcs (1.3)
erubi (1.7.0)
erubis (2.7.0)
ethon (0.11.0)
ffi (>= 1.3.0)
execjs (2.7.0)
Expand All @@ -94,7 +95,21 @@ GEM
net-http-pipeline
globalid (0.4.1)
activesupport (>= 4.2.0)
haml (5.0.4)
temple (>= 0.8.0)
tilt
haml-rails (1.0.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
highline (1.7.8)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
hyp_diff (0.0.5)
diff-lcs (~> 1.2, >= 1.2.5)
nokogiri (~> 1.6, >= 1.6.5)
Expand Down Expand Up @@ -224,6 +239,8 @@ GEM
rspec-core (~> 3.3)
rspec-support (3.7.0)
ruby_dep (1.5.0)
ruby_parser (3.10.1)
sexp_processor (~> 4.9)
rubyzip (1.2.1)
sass (3.5.3)
sass-listen (~> 4.0.0)
Expand Down Expand Up @@ -273,6 +290,7 @@ GEM
selenium-webdriver (3.6.0)
childprocess (~> 0.5)
rubyzip (~> 1.0)
sexp_processor (4.10.0)
simple_grid_rails (0.1.0)
spring (2.0.2)
activesupport (>= 4.2)
Expand All @@ -284,6 +302,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
temple (0.8.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
Expand Down Expand Up @@ -327,6 +346,7 @@ DEPENDENCIES
faraday
faraday_middleware (= 0.10)
font-awesome-rails
haml-rails
jbuilder
jquery-rails
koala
Expand Down
9 changes: 0 additions & 9 deletions app/views/blog_post_page/details.html.erb

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/blog_post_page/details.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
= scrivito_details_for 'Permalink' do
= scrivito_tag :div, @obj, :_permalink
= scrivito_medium_dialog do
= scrivito_details_for "Title" do
= scrivito_tag :div, @obj, :title
25 changes: 0 additions & 25 deletions app/views/blog_post_page/index.html.erb

This file was deleted.

16 changes: 16 additions & 0 deletions app/views/blog_post_page/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%article
.container
.row
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
.fontsize-bigger
= scrivito_tag_list :ul, @obj, :toclist do |list, child|
= list.tag :li do
= link_to child.display_title, scrivito_path(child)
= scrivito_tag :h1, @obj, :title
= scrivito_tag :div, @obj, :abstract
= scrivito_image_tag @obj, :image, class: "img-responsive"
= scrivito_tag :div, @obj, :body
%hr/
= content_tag :div, scrivito_value(@obj.last_changed.strftime("更新日: %Y年%m月%d日")), class: "text-muted text-right h5"
%div{:style => "margin-left: 0px; padding-bottom: 30px;"}
= render 'shared/sitemap_sotechsha' if @sts_posts
1 change: 0 additions & 1 deletion app/views/blog_post_page/thumbnail.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions app/views/blog_post_page/thumbnail.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= scrivito_thumbnail BlogPostPage.description_for_editor, :content
13 changes: 0 additions & 13 deletions app/views/docs/index.html.erb

This file was deleted.

8 changes: 8 additions & 0 deletions app/views/docs/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- provide(:title, @title)
- provide(:url, @url )
.container{:style => "line-height: 2.2em;"}
%section.keiyaku{:style => "padding: 50px 0px 50px 0px;"}
%h2{:style => "text-align: center; padding-bottom: 50px;"}= @title
%ul{:style => "font-size: 120%"}
- @docs.each do |doc|
%li= link_to doc.title, doc.url
8 changes: 0 additions & 8 deletions app/views/docs/show.html.erb

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/docs/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- provide(:title, @doc.title)
- provide(:url, @url)
.container{:style => "line-height: 1.9em;"}
%section.keiyaku{:style => "padding: 50px 0px 100px 0px;"}
= raw @content
11 changes: 0 additions & 11 deletions app/views/download/details.html.erb

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/download/details.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
= scrivito_medium_dialog do
= scrivito_details_for do
= scrivito_tag :div, @obj, :blob do
= link_to @obj.description_for_editor, scrivito_path(@obj), :target => :blank
= scrivito_details_for do
= number_to_human_size @obj.meta_data[:content_length]
4 changes: 0 additions & 4 deletions app/views/footer_widget/details.html.erb

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/footer_widget/details.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= scrivito_medium_dialog do
= scrivito_details_for FooterWidget.description_for_editor do
7 changes: 0 additions & 7 deletions app/views/footer_widget/show.html.erb

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/footer_widget/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.col-12
.col-3.cover-bg-blue
= scrivito_tag :h5, widget, :headline, class:'cover-text-white', style:'padding-top:20px;'
= scrivito_tag :p, widget, :paragraph, class:'cover-text-white', style:'padding-bottom:60; padding-top:20px;'
1 change: 0 additions & 1 deletion app/views/footer_widget/thumbnail.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions app/views/footer_widget/thumbnail.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= scrivito_thumbnail FooterWidget.description_for_editor
5 changes: 0 additions & 5 deletions app/views/headline_widget/details.html.erb

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/headline_widget/details.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= scrivito_small_dialog do
= scrivito_details_for 'Anchor' do
= scrivito_tag(:div, widget, :anchor)
2 changes: 0 additions & 2 deletions app/views/headline_widget/show.html.erb

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/headline_widget/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.headline-anchor{:id => "#{widget.anchor}"}
= scrivito_tag :h2, widget, :headline, class: "headline"
3 changes: 0 additions & 3 deletions app/views/headline_widget/thumbnail.html.erb

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/headline_widget/thumbnail.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= scrivito_thumbnail HeadlineWidget.description_for_editor, :headline do
A headline widget with an Anchor ID attribute.
17 changes: 0 additions & 17 deletions app/views/image/details.html.erb

This file was deleted.

10 changes: 10 additions & 0 deletions app/views/image/details.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= scrivito_medium_dialog do
= scrivito_details_for do
= scrivito_image_tag @obj
= scrivito_details_for do
- if @obj.meta_data[:width] && @obj.meta_data[:height]
%div
= @obj.meta_data[:width]
× #{@obj.meta_data[:height]} px
%div
= number_to_human_size @obj.meta_data[:content_length]
2 changes: 0 additions & 2 deletions app/views/image_widget/show.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions app/views/image_widget/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
= scrivito_image_tag widget, :image, style:'padding-top:-50px;', class: "img-responsive"
3 changes: 0 additions & 3 deletions app/views/image_widget/thumbnail.html.erb

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/image_widget/thumbnail.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= scrivito_thumbnail ImageWidget.description_for_editor, :image do
A widget with an image.
92 changes: 0 additions & 92 deletions app/views/layouts/application.html.erb

This file was deleted.

Loading