scrivito_elastic_slider_widget 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4b5029d091e2a9fe42312b47d4821f20279cb9c
4
- data.tar.gz: 7649182f0b7136d1950e3b33eac7601f35a63a8a
3
+ metadata.gz: e6f29229a0b9c3fc7fbea155f31f0433be263d0b
4
+ data.tar.gz: 5e890b4310359e2fcf75715f33de9011876cd173
5
5
  SHA512:
6
- metadata.gz: 28841744ed3fd1749c63b8bde2565a507cd5ceb06f18f2b1a404abba461d8185a0d8f41db14a75c44f264a36576fe3d0c269f8ba4a0887aa64a6cc14a256905e
7
- data.tar.gz: 00285a42b5aca8a7b4a959da5aa91b1839c896298325b69b6821d69e3fbdd34323cab4696a8906ca7882b8999d1d3167613ac9ddf97a6f332c2035c8d7069d06
6
+ metadata.gz: 543078f704cb52931fa44a9646d70f38db8b477f87ded4415cef46e5dc7e99728beb32292a30fc1597da1c31ea533c2f53c33acc4e840c2d12ba33bc62bbe9ca
7
+ data.tar.gz: bfa0b364a5b44aab63a81aa8acc366b808b28b2292d52b3b3ad36986c39cb85028955cd426212cca8742e211bea17b83d76aa1d1aba7324747d7846d8e5c1ab3
data/README.md CHANGED
@@ -20,6 +20,14 @@ Add this line to your app/assets/stylesheets/application.css:
20
20
 
21
21
  *= require scrivito_elastic_slider_widget/application
22
22
 
23
+ Add this line to your app/assets/stylesheets/editing.css:
24
+
25
+ *= require scrivito_elastic_slider_widget/editing
26
+
27
+ Add this line to your app/assets/javascripts/editing.js:
28
+
29
+ // require scrivito_elastic_slider_widget/editing
30
+
23
31
  Run
24
32
 
25
33
  $ rake scrivito:migrate:install
@@ -0,0 +1,7 @@
1
+ $(".scrivito_elastic_slider_widget_add-new-panel").bind("click", function(e) {
2
+ e.preventDefault();
3
+ $.get("/scrivito_elastic_slider_widget/add_new_panel?obj=" + scrivito.obj.current_page.id() + "&widget=" + $(this).attr("widgetid"), function(data) {
4
+ location.reload();
5
+ });
6
+
7
+ });
@@ -18,18 +18,9 @@
18
18
  ================================================== */
19
19
 
20
20
  .carousel-inner .item {height:400px;}
21
- .carousel-inner > .item > img,
22
- .carousel-inner > .item > a > img { display: block; height: auto; line-height: 1; min-width: 1200px; width: 100%;}
21
+ .carousel-inner .item > img,
22
+ .carousel-inner .item > a > img { display: block; height: auto; line-height: 1; min-width: 1200px; width: 100%;}
23
23
  .carousel-inner .container {position:static;}
24
24
  .carousel-control {width:7%; opacity:.2; /* @include transition(all .3s ease-in-out); */ }
25
25
  .carousel-control i {font-size:30px; line-height:400px;}
26
26
 
27
- /* Editing-View of Carousel */
28
- /* body[data-scrivito-display-mode='editing'] .carousel-inner .item {height:150px;}
29
- body[data-scrivito-display-mode='editing'] .carousel-inner .item > img {height: 100%; }
30
- body[data-scrivito-display-mode='editing'] .carousel-inner .item .carousel-caption {top: 0; padding: 0;}
31
- body[data-scrivito-display-mode='editing'] .carousel-inner .item .container .carousel-caption h1 {font-size: 20px; color: #465b66; text-shadow: none;}
32
- body[data-scrivito-display-mode='editing'] .carousel-inner .item .container .carousel-caption p {font-size: 15px; color: darkgrey; text-shadow: none;}
33
- body[data-scrivito-display-mode='editing'] .carousel-inner .item .container .btn {font-size: 15px; padding: 3px;}
34
- */
35
-
@@ -0,0 +1,19 @@
1
+ /* Editing styles for the Elastic Slider */
2
+
3
+ /* basic display settings */
4
+
5
+ body[data-scrivito-display-mode='editing'] .carousel {padding-top: 30px;}
6
+
7
+ /* additional tools */
8
+ .scrivito_elastic_slider_widget_add-new-panel {background-color: #439439; color: white; display: block; padding: 0 5px; position: absolute; right: 120px; top: 0;}
9
+
10
+ /* Details view */
11
+ .details-view .item {display: block; height: 100px; margin-bottom: 10px; overflow: hidden;}
12
+ .details-view .item img {clear: left; max-height: 100%; float: left; width: 20%;}
13
+ .details-view .item .container {margin: 0; max-width: 100%; padding: 0;}
14
+ .details-view .item .carousel-caption {bottom: 0; left: 0; padding: 0; position: relative;}
15
+ .details-view .item .carousel-caption h1 {font-size: 16px; min-height: 25px; padding: 0 20px; text-align: left; width: 80%;}
16
+ .details-view .item .carousel-caption .content {float: left; max-width: 80%; padding: 0 0 0 20px;}
17
+ .details-view .item .carousel-caption .content p {float: left; font-size: 14px; padding: 0 8px 0 0;}
18
+ .details-view .item .carousel-caption .content p a {font-size: 14px; padding: 2px 8px;}
19
+
@@ -0,0 +1,17 @@
1
+ module ScrivitoElasticSliderWidget
2
+
3
+ class ElasticSliderWidgetController < CmsController
4
+
5
+ layout false
6
+
7
+ def add_new_panel
8
+ widget = Obj.find(params[:obj]).widget_from_pool(params[:widget])
9
+ widget.update(panels: widget.panels << ElasticSliderPanelWidget.new())
10
+ #TODO: check for success and return appropriate result
11
+ render "elastic_slider_widget/add_new_panel"
12
+ end
13
+
14
+ end
15
+
16
+ end
17
+
@@ -6,5 +6,9 @@ class ElasticSliderPanelWidget < Widget
6
6
  rescue
7
7
  end
8
8
  end
9
-
9
+
10
+ def description_for_editor
11
+ "Elastic Slider Panel"
12
+ end
13
+
10
14
  end
@@ -1,7 +1,11 @@
1
1
  class ElasticSliderWidget < Widget
2
2
 
3
- def self.valid_widget_classes_for(field_name)
4
- %w[ElastricSliderPanelWidget]
3
+ def valid_widget_classes_for(field_name)
4
+ %w(ElasticSliderPanelWidget)
5
+ end
6
+
7
+ def description_for_editor
8
+ "Elastic Slider"
5
9
  end
6
10
 
7
11
  end
@@ -1,11 +1,3 @@
1
- <div class="editing-dialog-thumbnail">
2
- <div class="visualization">
3
- <span class="icon editing-icon-image"></span>
4
- </div>
5
- <div class="title">
6
- Image Panel for Elastic Slider
7
- </div>
8
- <div class="description">
9
- Serves an image background panel for the Elastic Slider.
10
- </div>
11
- </div>
1
+ <%= scrivito_thumbnail 'Elastic Slider Panel', image_tag("scrivito_elastic_slider_widget/widget_preview_teaser_slider_panel.png") do %>
2
+ Image Slide for Elastic Slider.
3
+ <% end %>
@@ -1,20 +1,25 @@
1
-
2
- <% widget.panels.each_with_index do |panel, index| %>
3
- <% unless index == 0 %>
4
- <hr />
5
- <% end %>
6
- <div class="row">
7
- <div class="col-md-4">
8
- <%= scrivito_image_tag(panel, :image, style: "max-height: 100px; max-width: 250px; margin-bottom: 1em;") %>
9
- </div>
10
- <div class="col-md-3">
11
- <h4>Headline</h4>
12
- <%= scrivito_tag(:p, panel, :headline) %>
1
+ <!-- div class="details-view" data-scrivito-modal-size="large">
2
+ <% widget.panels.each_with_index do |panel, index| %>
3
+ <% unless index == 0 %>
4
+ <hr />
5
+ <% end %>
6
+ <div class="row">
7
+ <div class="col-md-4">
8
+ <%= scrivito_image_tag(panel, :image, style: "max-height: 100px; max-width: 250px; margin-bottom: 1em;") %>
9
+ </div>
10
+ <div class="col-md-3">
11
+ <h4>Headline</h4>
12
+ <%= scrivito_tag(:p, panel, :headline) %>
13
+ </div>
14
+ <div class="col-md-5">
15
+ <h4>Text</h4>
16
+ <%= scrivito_tag(:p, panel, :content) %>
17
+ </div>
13
18
  </div>
14
- <div class="col-md-5">
15
- <h4>Text</h4>
16
- <%= scrivito_tag(:p, panel, :content) %>
17
- </div>
18
- </div>
19
- <%= scrivito_edit_link(panel, :button, data: {placeholder: "Where should the button take the user ..."}) %>
20
- <% end %>
19
+ <%= scrivito_edit_link(panel, :button, data: {placeholder: "Where should the button take the user ..."}) %>
20
+ <% end %>
21
+ </div -->
22
+
23
+ <div class="details-view" data-scrivito-modal-size="large">
24
+ <%= scrivito_tag :div, widget, :panels %>
25
+ </div>
@@ -1,15 +1,18 @@
1
1
  <!-- Carousel -->
2
- <div id="myCarousel" class="carousel slide" data-ride="carousel">
2
+ <div id="carousel<%= widget.id %>" class="carousel slide" data-ride="carousel">
3
+ <% if scrivito_in_editable_view? %>
4
+ <%= link_to "Add new Panel", "#", widgetid: widget.id, class: "scrivito_elastic_slider_widget_add-new-panel" %>
5
+ <% end %>
3
6
  <ol class="carousel-indicators">
4
7
  <% (0..widget.panels.size-1).each do |index| %>
5
- <li data-target="#myCarousel" data-slide-to="<%= index %>" <% if index == 0 %>class="active"<% end %>></li>
8
+ <li data-target="#carousel<%= widget.id %>" data-slide-to="<%= index %>" <% if index == 0 %>class="active"<% end %>></li>
6
9
  <% end %>
7
10
  </ol>
8
- <div class="carousel-inner">
11
+ <div class="carousel-inner">
9
12
  <% widget.panels.each do |panel| %>
10
13
  <%= render template: 'elastic_slider_panel_widget/show', locals: {widget: panel} %>
11
14
  <% end %>
12
15
  </div>
13
- <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
14
- <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
16
+ <a class="left carousel-control" href="#carousel<%= widget.id %>" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
17
+ <a class="right carousel-control" href="#carousel<%= widget.id %>" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
15
18
  </div><!-- /.carousel -->
@@ -1,11 +1,3 @@
1
- <div class="editing-dialog-thumbnail">
2
- <div class="visualization">
3
- <span class="icon editing-icon-slider"></span>
4
- </div>
5
- <div class="title">
6
- Elastic Slider
7
- </div>
8
- <div class="description">
9
- Displays an elastic slider. Fill with Elastic Slider Panels.
10
- </div>
11
- </div>
1
+ <%= scrivito_thumbnail 'Elastic Slider', image_tag("scrivito_elastic_slider_widget/widget_preview_teaser_slider.png") do %>
2
+ Fill with Elastic Slider Panels.
3
+ <% end %>
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ get '/scrivito_elastic_slider_widget/add_new_panel', to: 'scrivito_elastic_slider_widget/elastic_slider_widget#add_new_panel'
3
+ end
4
+
@@ -1,3 +1,3 @@
1
1
  module ScrivitoElasticSliderWidget
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_elastic_slider_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-24 00:00:00.000000000 Z
11
+ date: 2014-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,16 +62,23 @@ files:
62
62
  - LICENSE
63
63
  - README.md
64
64
  - Rakefile
65
+ - app/assets/images/scrivito_elastic_slider_widget/widget_preview_teaser_slider.png
66
+ - app/assets/images/scrivito_elastic_slider_widget/widget_preview_teaser_slider_panel.png
65
67
  - app/assets/javascripts/scrivito_elastic_slider_widget/application.js
68
+ - app/assets/javascripts/scrivito_elastic_slider_widget/editing.js
66
69
  - app/assets/stylesheets/scrivito_elastic_slider_widget/application.css
70
+ - app/assets/stylesheets/scrivito_elastic_slider_widget/editing.css
71
+ - app/controllers/scrivito_elastic_slider_widget/elastic_slider_widget_controller.rb
67
72
  - app/models/elastic_slider_panel_widget.rb
68
73
  - app/models/elastic_slider_widget.rb
69
74
  - app/views/elastic_slider_panel_widget/details.html.erb
70
75
  - app/views/elastic_slider_panel_widget/show.html.erb
71
76
  - app/views/elastic_slider_panel_widget/thumbnail.html.erb
77
+ - app/views/elastic_slider_widget/add_new_panel.html.erb
72
78
  - app/views/elastic_slider_widget/details.html.erb
73
79
  - app/views/elastic_slider_widget/show.html.erb
74
80
  - app/views/elastic_slider_widget/thumbnail.html.erb
81
+ - config/routes.rb
75
82
  - lib/scrivito_elastic_slider_widget.rb
76
83
  - lib/scrivito_elastic_slider_widget/engine.rb
77
84
  - lib/scrivito_elastic_slider_widget/version.rb