scrivito_accordion_widget 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -9
- data/app/assets/javascripts/scrivito_accordion_widget.js +18 -9
- data/app/assets/stylesheets/scrivito_accordion_widget.css.scss +18 -0
- data/app/models/accordion_panel_widget.rb +8 -7
- data/app/models/accordion_widget.rb +8 -6
- data/app/views/accordion_panel_widget/details.html.erb +10 -0
- data/app/views/accordion_widget/details.html.erb +3 -0
- data/app/views/accordion_widget/show.html.erb +6 -10
- data/lib/scrivito_accordion_widget/version.rb +1 -1
- metadata +6 -6
- data/app/assets/stylesheets/scrivito_accordion_widget.css +0 -11
- data/app/views/accordion_panel_widget/_show.html.erb +0 -11
- data/app/views/accordion_panel_widget/thumbnail.html.erb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dca34b6bf305573c5e0a3c60a7e49a6e595df31
|
4
|
+
data.tar.gz: 05bf5f62784514f1b524738eb1a9b68b60fbd9dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c8750ea96514bb26a529af8c6f89e7ef3921a6f94a7e4f63aa32aff91ebcfe36385b20585d65a27810915a21f79903f8431a9865ee56890eead9413f5cb4f79
|
7
|
+
data.tar.gz: e56e0ef6aec00165b44bbae3000e1db262f0743e9fd730e8bae15ae0199082a3d9455cfaa9b6e22238bc55375dcb6d012080f4e383ac25d7450b738f56391acd
|
data/README.md
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
# scrivito_accordion_widget
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/scrivito_accordion_widget.svg)](http://badge.fury.io/rb/scrivito_accordion_widget)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/Scrivito/scrivito_accordion_widget/badges/gpa.svg)](https://codeclimate.com/github/Scrivito/scrivito_accordion_widget)
|
5
4
|
|
6
5
|
## Installation
|
7
6
|
|
8
|
-
A Widget for Scrivito for an accordion.
|
9
|
-
|
10
|
-
If they use a different framework, then they should overwrite the views and the javascript.
|
7
|
+
A Widget for Scrivito for an accordion.
|
11
8
|
|
12
9
|
## Installation
|
13
10
|
|
@@ -19,12 +16,9 @@ Than add to your stylesheet manifest:
|
|
19
16
|
|
20
17
|
*= require scrivito_accordion_widget
|
21
18
|
|
22
|
-
|
19
|
+
Than add to your Javascript manifest:
|
23
20
|
|
24
|
-
|
25
|
-
$ rake scrivito:migrate:install
|
26
|
-
$ rake scrivito:migrate
|
27
|
-
$ rake scrivito:migrate:publish
|
21
|
+
*//= require scrivito_accordion_widget
|
28
22
|
|
29
23
|
## Changelog
|
30
24
|
See [Changelog](https://github.com/Scrivito/scrivito_accordion_widget/blob/master/CHANGELOG.md) for more
|
@@ -1,11 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
(function($, App) {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
$(function() {
|
5
|
+
scrivito.on('content', function(content) {
|
6
|
+
$(content).find('.scrivito-accordion-group').each(function(i, group) {
|
7
|
+
var accordion_group = $(group);
|
8
|
+
accordion_group.find('.scrivito-accordion-title').each(function(i, accordion_title) {
|
9
|
+
var accordion_title = $(accordion_title);
|
10
|
+
accordion_title.click(function() {
|
11
|
+
accordion_group.find('.scrivito-accordion-title').removeClass('scrivito-accordion-active');
|
12
|
+
accordion_title.addClass('scrivito-accordion-active');
|
13
|
+
accordion_group.find('.scrivito-accordion-content').removeClass('scrivito-accordion-active');
|
14
|
+
accordion_title.next().addClass('scrivito-accordion-active');
|
15
|
+
});
|
16
|
+
});
|
17
|
+
});
|
9
18
|
});
|
10
19
|
});
|
11
|
-
});
|
20
|
+
})(jQuery, this);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
.scrivito-accordion-group {
|
2
|
+
.scrivito-accordion-title {
|
3
|
+
background-color: #fff;
|
4
|
+
padding: 10px;
|
5
|
+
font-size: 14px;
|
6
|
+
line-height: 14px;
|
7
|
+
cursor: pointer;
|
8
|
+
&.scrivito-accordion-active {
|
9
|
+
background-color: #ddd;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
.scrivito-accordion-content {
|
13
|
+
display: none;
|
14
|
+
}
|
15
|
+
.scrivito-accordion-content.scrivito-accordion-active {
|
16
|
+
display: block;
|
17
|
+
}
|
18
|
+
}
|
@@ -1,13 +1,14 @@
|
|
1
1
|
class AccordionPanelWidget < Widget
|
2
|
-
attribute :
|
2
|
+
attribute :title, :string, default: 'New Panel'
|
3
3
|
attribute :content, :widgetlist
|
4
4
|
|
5
|
-
|
6
|
-
"in" if self.container.panels.first == self
|
7
|
-
end
|
5
|
+
attribute :background_color, :string
|
8
6
|
|
9
|
-
def
|
10
|
-
|
7
|
+
def self.valid_container_classes
|
8
|
+
[AccordionWidget]
|
11
9
|
end
|
12
10
|
|
13
|
-
|
11
|
+
def self.description_for_editor
|
12
|
+
'Panel'
|
13
|
+
end
|
14
|
+
end
|
@@ -1,12 +1,14 @@
|
|
1
1
|
class AccordionWidget < Widget
|
2
|
-
attribute :panels, :widgetlist
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
end
|
2
|
+
attribute :panels, :widgetlist, default: [
|
3
|
+
AccordionPanelWidget.new(title: 'First Panel'),
|
4
|
+
AccordionPanelWidget.new(title: 'Second Panel')
|
5
|
+
]
|
7
6
|
|
8
7
|
def valid_widget_classes_for(field_name)
|
9
|
-
|
8
|
+
[AccordionPanelWidget]
|
10
9
|
end
|
11
10
|
|
11
|
+
def self.description_for_editor
|
12
|
+
'Accordion'
|
13
|
+
end
|
12
14
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="scrivito-tab-title-details">
|
2
|
+
<%= scrivito_tag :h4, widget, :title %>
|
3
|
+
<%= link_to '(details)', '#', 'data-scrivito-tab-toggle-details' => widget.id %>
|
4
|
+
<div class="scrivito-tab-details-<%= widget.id %>">
|
5
|
+
<div>
|
6
|
+
<b>Background Color</b>
|
7
|
+
<%= render 'scrivito_advanced_editors/color_picker', widget: widget, attribute: :background_color %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -1,12 +1,8 @@
|
|
1
|
-
<div class=
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<div class="scrivito-accordion-group">
|
2
|
+
<% widget.panels.each_with_index do |panel, i| %>
|
3
|
+
<div class="scrivito-accordion-title <%= 'scrivito-accordion-active' if i == 0 %>">
|
4
|
+
<%= scrivito_value panel.title %>
|
5
|
+
</div>
|
6
|
+
<%= scrivito_tag :div, panel, :content, class: "scrivito-accordion-content #{'scrivito-accordion-active' if i == 0}" %>
|
5
7
|
<% end %>
|
6
|
-
|
7
8
|
</div>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<%#= scrivito_tag(:div, widget, :panels, class: 'panel-group', id: "accordion-#{widget.id}", role: "tablist") %>
|
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.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -64,11 +64,11 @@ files:
|
|
64
64
|
- Rakefile
|
65
65
|
- app/assets/images/widget_preview_accordion.png
|
66
66
|
- app/assets/javascripts/scrivito_accordion_widget.js
|
67
|
-
- app/assets/stylesheets/scrivito_accordion_widget.css
|
67
|
+
- app/assets/stylesheets/scrivito_accordion_widget.css.scss
|
68
68
|
- app/models/accordion_panel_widget.rb
|
69
69
|
- app/models/accordion_widget.rb
|
70
|
-
- app/views/accordion_panel_widget/
|
71
|
-
- app/views/
|
70
|
+
- app/views/accordion_panel_widget/details.html.erb
|
71
|
+
- app/views/accordion_widget/details.html.erb
|
72
72
|
- app/views/accordion_widget/show.html.erb
|
73
73
|
- app/views/accordion_widget/thumbnail.html.erb
|
74
74
|
- lib/scrivito_accordion_widget.rb
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.4.5
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Scrivito Accordion Widget.
|
@@ -1,11 +0,0 @@
|
|
1
|
-
.scrivito_editing_active .panel-group .panel-body.scrivito_empty_widget_field {
|
2
|
-
margin: 10px !important;
|
3
|
-
}
|
4
|
-
|
5
|
-
.scrivito_editing_active .panel-group .panel-body {
|
6
|
-
margin: 0px !important;
|
7
|
-
}
|
8
|
-
|
9
|
-
.scrivito_editing_active .panel-group {
|
10
|
-
padding-top: 30px;
|
11
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<div class="panel panel-default">
|
2
|
-
<div class="panel-heading">
|
3
|
-
<h4 class="panel-title">
|
4
|
-
<%= scrivito_tag(:a, widget, :headline, href: "#collapse-panel-#{widget.id}", data: { toggle: 'collapse', parent: "#accordion-#{widget.container.id}" }) %>
|
5
|
-
</h4>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<div class="panel-collapse collapse <%= widget.active_class %>" id="collapse-panel-<%= widget.id %>">
|
9
|
-
<%= scrivito_tag(:div, widget, :content, class: 'panel-body') %>
|
10
|
-
</div>
|
11
|
-
</div>
|