scrivito_accordion_widget 1.1.3 → 1.2.0

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: 6287c85c54a84b821bf3246e32679f96ab429f39
4
- data.tar.gz: 3df0190a2e2ee7b3ce164e08d90a1542211775be
3
+ metadata.gz: 548cb9c05bff5d5857606fb6331b8c602e6b5648
4
+ data.tar.gz: f5ea91cd7a45207dcafa705c7d856c5f1a8238e0
5
5
  SHA512:
6
- metadata.gz: 102ad0d1e070472c02b6e40fc866070bba732e4e9bef959e4c1e8b6bd7c333a641e531c90e8d4a95bb3dab4c844b171ec86dc23a758387f207045ce2d47570af
7
- data.tar.gz: d8c7b458926d43e36152ccdb651df8307a1b5abb220258059d2265a64c419f801c8819a3e6fdc52acb753f857e139234c1ae0a060d08f516da5222a5cd0971d2
6
+ metadata.gz: a90135907b535d37072186d56a7deb4941560eeca3a935bfe116e3fb6fc03005660121063ffdcd57a8adf8276f637862c3e0f6643cf60833ec173aab64c4b39f
7
+ data.tar.gz: bbe91aafbb1e17f68d6f4d618c68551b201835985315a9a162295ad2247cf943365e86ed9bf289a122d571d4191ae5e56b9e15d17028faeea848bb19a1e72a0f
data/README.md CHANGED
@@ -23,6 +23,7 @@ en:
23
23
  title: Accordion
24
24
  description: Displays collapsible content panels
25
25
  details:
26
+ expand: Expand first panel
26
27
  background_color: Background color
27
28
  title: Title
28
29
  ```
@@ -1,5 +1,6 @@
1
1
  class AccordionWidget < Widget
2
2
  attribute :panels, :widgetlist
3
+ attribute :expanded, :enum, values: ['Yes','No']
3
4
 
4
5
  default_for :panels do |attributes|
5
6
  [
@@ -15,4 +16,8 @@ class AccordionWidget < Widget
15
16
  def self.description_for_editor
16
17
  'Accordion'
17
18
  end
19
+
20
+ def expanded?
21
+ self.expanded == "Yes"
22
+ end
18
23
  end
@@ -1 +1,5 @@
1
+ <%= scrivito_details_for t('scrivito_content_box_widget.details.expanded', default: 'Expand first panel') do %>
2
+ <%= scrivito_tag :div, widget, :expanded %>
3
+ <% end %>
4
+
1
5
  <%= scrivito_tag :div, widget, :panels, 'data-scrivito-modal-size' => 'large' %>
@@ -3,13 +3,13 @@
3
3
  <div class="panel panel-default">
4
4
  <div class="panel-heading <%= panel.background_color %>" role="tab" id="headingOne">
5
5
  <h4 class="panel-title">
6
- <a role="button" data-toggle="collapse" data-parent="#accordion-<%= widget.id %>" href="#collapse-<%= widget.id %>-<%= i %>" aria-expanded="<%= i == 0 ? 'true' : 'false'%>" aria-controls="collapse<%= i %>">
6
+ <a role="button" data-toggle="collapse" data-parent="#accordion-<%= widget.id %>" href="#collapse-<%= widget.id %>-<%= i %>" aria-expanded="<%= (widget.expanded? && i == 0) ? 'true' : 'false'%>" aria-controls="collapse<%= i %>">
7
7
  <%= scrivito_value panel.title %>
8
8
  </a>
9
9
  </h4>
10
10
  </div>
11
11
 
12
- <div id="collapse-<%= widget.id %>-<%= i %>" class="panel-collapse collapse <%= i == 0 ? 'in' : '' %>" role="tabpanel">
12
+ <div id="collapse-<%= widget.id %>-<%= i %>" class="panel-collapse collapse <%= (widget.expanded? && i == 0) ? 'in' : '' %>" role="tabpanel">
13
13
  <div class="panel-body <%= panel.background_color %>">
14
14
  <%= scrivito_tag :div, panel, :content %>
15
15
  </div>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoAccordionWidget
2
- VERSION = "1.1.3"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_accordion_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2017-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scrivito
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project:
68
- rubygems_version: 2.4.5
68
+ rubygems_version: 2.5.1
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Scrivito Accordion Widget.