From d9cbb815730e4936bc9b4ee11011b4a765f81990 Mon Sep 17 00:00:00 2001 From: nanophate Date: Sun, 22 May 2016 23:45:19 +0900 Subject: [PATCH 1/5] Create new widget for footer section --- app/models/footer_widget.rb | 2 ++ app/views/footer_widget/details.html.erb | 4 ++++ app/views/footer_widget/show.html.erb | 1 + app/views/footer_widget/thumbnail.html.erb | 1 + 4 files changed, 8 insertions(+) create mode 100644 app/models/footer_widget.rb create mode 100644 app/views/footer_widget/details.html.erb create mode 100644 app/views/footer_widget/show.html.erb create mode 100644 app/views/footer_widget/thumbnail.html.erb diff --git a/app/models/footer_widget.rb b/app/models/footer_widget.rb new file mode 100644 index 000000000..b48526b73 --- /dev/null +++ b/app/models/footer_widget.rb @@ -0,0 +1,2 @@ +class FooterWidget < Widget +end diff --git a/app/views/footer_widget/details.html.erb b/app/views/footer_widget/details.html.erb new file mode 100644 index 000000000..5f01b0679 --- /dev/null +++ b/app/views/footer_widget/details.html.erb @@ -0,0 +1,4 @@ +<%= scrivito_medium_dialog do %> + <%= scrivito_details_for FooterWidget.description_for_editor do %> + <% end %> +<% end %> diff --git a/app/views/footer_widget/show.html.erb b/app/views/footer_widget/show.html.erb new file mode 100644 index 000000000..223c87d68 --- /dev/null +++ b/app/views/footer_widget/show.html.erb @@ -0,0 +1 @@ +This is the show view of the <%= FooterWidget.description_for_editor %>. diff --git a/app/views/footer_widget/thumbnail.html.erb b/app/views/footer_widget/thumbnail.html.erb new file mode 100644 index 000000000..5ad9f425e --- /dev/null +++ b/app/views/footer_widget/thumbnail.html.erb @@ -0,0 +1 @@ +<%= scrivito_thumbnail FooterWidget.description_for_editor %> From 6f91f608d3c848bde9b4f0f7723b9b1ddc370f05 Mon Sep 17 00:00:00 2001 From: nanophate Date: Sun, 22 May 2016 23:54:29 +0900 Subject: [PATCH 2/5] Fix problem of the row --- app/views/footer_widget/show.html.erb | 7 ++++++- app/views/layouts/application.html.erb | 6 ++++-- app/views/paragraph_widget/show.html.erb | 14 ++++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/views/footer_widget/show.html.erb b/app/views/footer_widget/show.html.erb index 223c87d68..1cda2e1bb 100644 --- a/app/views/footer_widget/show.html.erb +++ b/app/views/footer_widget/show.html.erb @@ -1 +1,6 @@ -This is the show view of the <%= FooterWidget.description_for_editor %>. +
+
+ <%= scrivito_tag :h6, widget, :headline, data: {newlines: false}, class:'cover-text-white' style:'padding-top:10px; '%> + <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px; padding-top:25px;'%> +
+
\ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d6b5052f4..9d0a9dddb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,8 +10,10 @@
- <%= yield %> - <%= scrivito_body_tags %> + + <%= yield %> + <%= scrivito_body_tags %> + >
diff --git a/app/views/paragraph_widget/show.html.erb b/app/views/paragraph_widget/show.html.erb index 9696fdc1e..15f2f1b39 100644 --- a/app/views/paragraph_widget/show.html.erb +++ b/app/views/paragraph_widget/show.html.erb @@ -1,9 +1,7 @@ -
-
-
- <%= scrivito_image_tag widget, :image, class:'image-responsive'%> - <%= scrivito_tag :h1, widget, :headline, data: {newlines: false}, class:'cover-text-white' %> - <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px;'%> -
+
+
+ <%= scrivito_image_tag widget, :image, class:'image-responsive'%> + <%= scrivito_tag :h1, widget, :headline, data: {newlines: false}, class:'cover-text-white' %> + <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px;'%>
-
+
\ No newline at end of file From 75f5c13eb55cf5ec092461160dca0b2851eb6176 Mon Sep 17 00:00:00 2001 From: nanophate Date: Mon, 23 May 2016 00:03:43 +0900 Subject: [PATCH 3/5] Add code to model to enable text to be written --- app/models/footer_widget.rb | 1 + app/views/footer_widget/show.html.erb | 6 +++--- app/views/layouts/application.html.erb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/footer_widget.rb b/app/models/footer_widget.rb index b48526b73..33acbe5e2 100644 --- a/app/models/footer_widget.rb +++ b/app/models/footer_widget.rb @@ -1,2 +1,3 @@ class FooterWidget < Widget + attribute :text, :string end diff --git a/app/views/footer_widget/show.html.erb b/app/views/footer_widget/show.html.erb index 1cda2e1bb..dd0dd2272 100644 --- a/app/views/footer_widget/show.html.erb +++ b/app/views/footer_widget/show.html.erb @@ -1,6 +1,6 @@
-
- <%= scrivito_tag :h6, widget, :headline, data: {newlines: false}, class:'cover-text-white' style:'padding-top:10px; '%> - <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px; padding-top:25px;'%> +
+ <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-top:10px;' %> + <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px; padding-top:25px;' %>
\ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9d0a9dddb..495446df9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -13,7 +13,7 @@ <%= yield %> <%= scrivito_body_tags %> - > + From 0f499f249cd20d421c2bb3dabfab3a158bf0e2b4 Mon Sep 17 00:00:00 2001 From: nanophate Date: Mon, 23 May 2016 00:44:37 +0900 Subject: [PATCH 4/5] Add css to enable and copy the spacing --- app/assets/stylesheets/application.scss | 3 ++- app/models/footer_widget.rb | 3 ++- app/views/footer_widget/show.html.erb | 9 +++++---- app/views/paragraph_widget/show.html.erb | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index c4bb91aa5..a58464c09 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -18,4 +18,5 @@ @import "bootstrap"; .cover-bg-blue{background-color:#2275CA;} -.cover-text-white{color:#FFFFFF;} \ No newline at end of file +.cover-text-white{color:#FFFFFF;} +a {color:#FFFFF;} \ No newline at end of file diff --git a/app/models/footer_widget.rb b/app/models/footer_widget.rb index 33acbe5e2..92c88c55f 100644 --- a/app/models/footer_widget.rb +++ b/app/models/footer_widget.rb @@ -1,3 +1,4 @@ class FooterWidget < Widget - attribute :text, :string + attribute :headline, :html + attribute :text, :html end diff --git a/app/views/footer_widget/show.html.erb b/app/views/footer_widget/show.html.erb index dd0dd2272..d2803ba28 100644 --- a/app/views/footer_widget/show.html.erb +++ b/app/views/footer_widget/show.html.erb @@ -1,6 +1,7 @@
-
- <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-top:10px;' %> - <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px; padding-top:25px;' %> + -
\ No newline at end of file +
+ diff --git a/app/views/paragraph_widget/show.html.erb b/app/views/paragraph_widget/show.html.erb index 15f2f1b39..bbf768762 100644 --- a/app/views/paragraph_widget/show.html.erb +++ b/app/views/paragraph_widget/show.html.erb @@ -2,6 +2,6 @@
<%= scrivito_image_tag widget, :image, class:'image-responsive'%> <%= scrivito_tag :h1, widget, :headline, data: {newlines: false}, class:'cover-text-white' %> - <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:25px;'%> + <%= scrivito_tag :p, widget, :text, class:'cover-text-white', style:'padding-bottom:30px;'%>
-
\ No newline at end of file +
\ No newline at end of file From 9733137967f029b129bae86ef9ac7d2b48b2bb73 Mon Sep 17 00:00:00 2001 From: nanophate Date: Mon, 30 May 2016 16:29:09 +0900 Subject: [PATCH 5/5] Fix spacing error and duplicate --- app/assets/stylesheets/application.scss | 2 +- app/models/footer_widget.rb | 2 +- app/views/footer_widget/show.html.erb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a58464c09..681502c38 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -19,4 +19,4 @@ .cover-bg-blue{background-color:#2275CA;} .cover-text-white{color:#FFFFFF;} -a {color:#FFFFF;} \ No newline at end of file +.a {color:#FFFFF;} \ No newline at end of file diff --git a/app/models/footer_widget.rb b/app/models/footer_widget.rb index 92c88c55f..29b47d57a 100644 --- a/app/models/footer_widget.rb +++ b/app/models/footer_widget.rb @@ -1,4 +1,4 @@ class FooterWidget < Widget attribute :headline, :html - attribute :text, :html + attribute :paragraph, :html end diff --git a/app/views/footer_widget/show.html.erb b/app/views/footer_widget/show.html.erb index d2803ba28..6d1d66f36 100644 --- a/app/views/footer_widget/show.html.erb +++ b/app/views/footer_widget/show.html.erb @@ -1,7 +1,7 @@
-