scrivito_accordion_widget 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a61af581ce01d2927858b07d4d8cdff208ec7814
4
+ data.tar.gz: de908a58fdb4c422e8928d5df1bdf71189fd0131
5
+ SHA512:
6
+ metadata.gz: fbf9ddc67d3519c0c7b30ed01bc9ca8cebafdc554c33a5f2e5f0f31a6310f654915f91a928576148d2adc3c31ece3b99583eb9ce24563b9583dbaa08689ebedb
7
+ data.tar.gz: b0ade8c4af41e3170d03d70873af64bec28c66b44b2fd66554e01a4ab7625aee9be6d1e10e986b01c30f51d40acea6e0c8411c08a5c4ca37842dbc9320fb982e
data/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ Copyright (c) 2009 - 2014 Infopark AG (http://www.infopark.com)
2
+
3
+ This software can be used and modified under the LGPL-3.0. Please refer to
4
+ http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # scrivito_accordion_widget
2
+
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
+
6
+ ## Installation
7
+
8
+ A Widget for Scrivito for an accordion. It is using Bootstrap 3.
9
+
10
+ If they use a different framework, then they should overwrite the views and the javascript.
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's `Gemfile`:
15
+
16
+ gem 'scrivito_accordion_widget'
17
+
18
+ You should add this line to your editing Stylesheet manifest for better usage in edit mode:
19
+
20
+ *= require accordion_widget/editing
21
+
22
+ Add this line to your application javascript manifest:
23
+
24
+ /= require accordion_widget/application
25
+
26
+ After that, execute:
27
+
28
+ $ bundle
29
+ $ rake scrivito:migrate:install
30
+ $ rake scrivito:migrate
31
+ $ rake scrivito:migrate:publish
32
+
33
+ ## Changelog
34
+ See [Changelog](https://github.com/Scrivito/scrivito_accordion_widget/blob/master/CHANGELOG.md) for more
35
+ details.
36
+
37
+ ## Contributing
38
+
39
+ 1. Fork it ( https://github.com/Scrivito/scrivito_accordion_widget/fork )
40
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
41
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
42
+ 4. Push to the branch (`git push origin my-new-feature`)
43
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'ScrivitoAccordionWidget'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
@@ -0,0 +1,8 @@
1
+ $ ->
2
+ # The accordion widget uses the Twitter Bootstrap 3 panel JavaScript. In edit mode, all panels
3
+ # should unfold, so that the editor can manipulate their contents directly.
4
+
5
+ if scrivito
6
+ scrivito.on 'load', ->
7
+ if scrivito.in_editable_view()
8
+ $('.panel-collapse').collapse('show')
@@ -0,0 +1,7 @@
1
+ body[data-scrivito-display-mode='editing'] .panel-collapse.collapse {
2
+ min-height: 80px;
3
+ }
4
+
5
+ body[data-scrivito-display-mode='editing'] .accordion {
6
+ overflow: hidden;
7
+ }
@@ -0,0 +1,11 @@
1
+ class AccordionPanelWidget < Widget
2
+
3
+ def active_class
4
+ "in" if self.container.panels.first == self
5
+ end
6
+
7
+ def description_for_editor
8
+ "Accordion Panel"
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
1
+ class AccordionWidget < Widget
2
+
3
+ def description_for_editor
4
+ "Accordion"
5
+ end
6
+
7
+ def valid_widget_classes_for(field_name)
8
+ %w[AccordionPanelWidget]
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
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>
@@ -0,0 +1,13 @@
1
+ <div class="editing-dialog-thumbnail">
2
+ <div class="visualization">
3
+ <span class="icon editing-icon-1col"></span>
4
+ </div>
5
+
6
+ <div class="title">
7
+ Accordion Panel
8
+ </div>
9
+
10
+ <div class="description">
11
+ Displays a collapsible content panel inside an accordion widget.
12
+ </div>
13
+ </div>
@@ -0,0 +1,9 @@
1
+ <div class='panel-group' id='<%= "accordion-#{widget.id}" %>'>
2
+ <% if scrivito_in_editable_view? %>
3
+ <%= scrivito_tag(:div, widget, :panels) %>
4
+ <% else %>
5
+ <% widget.panels.each do |panel| %>
6
+ <%= scrivito_value(panel) %>
7
+ <% end %>
8
+ <% end %>
9
+ </div>
@@ -0,0 +1,13 @@
1
+ <div class="editing-dialog-thumbnail">
2
+ <div class="visualization">
3
+ <span class="icon editing-icon-list"></span>
4
+ </div>
5
+
6
+ <div class="title">
7
+ Accordion
8
+ </div>
9
+
10
+ <div class="description">
11
+ Displays collapsible content panels.
12
+ </div>
13
+ </div>
@@ -0,0 +1,4 @@
1
+ require "scrivito_accordion_widget/engine"
2
+
3
+ module ScrivitoAccordionWidget
4
+ end
@@ -0,0 +1,5 @@
1
+ module ScrivitoAccordionWidget
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace ScrivitoAccordionWidget
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module ScrivitoAccordionWidget
2
+ VERSION = "1.0.2"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :scrivito_accordion_widget do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,29 @@
1
+ class CreateAccordionWidget < ::Scrivito::Migration
2
+ def up
3
+ Scrivito::ObjClass.create(
4
+ name: 'AccordionWidget',
5
+ is_binary: false,
6
+ attributes: [
7
+ {
8
+ name: 'panels',
9
+ type: :widget,
10
+ },
11
+ ]
12
+ )
13
+
14
+ Scrivito::ObjClass.create(
15
+ name: 'AccordionPanelWidget',
16
+ is_binary: false,
17
+ attributes: [
18
+ {
19
+ name: 'headline',
20
+ type: :string,
21
+ },
22
+ {
23
+ name: 'content',
24
+ type: :widget,
25
+ },
26
+ ]
27
+ )
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scrivito_accordion_widget
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Scrivito
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: scrivito
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Scrivito Accordion Widget.
56
+ email:
57
+ - support@scrivito.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - LICENSE
63
+ - README.md
64
+ - Rakefile
65
+ - app/assets/javascripts/accordion_widget/application.js.coffee
66
+ - app/assets/stylesheets/accordion_widget/editing.css
67
+ - app/models/accordion_panel_widget.rb
68
+ - app/models/accordion_widget.rb
69
+ - app/views/accordion_panel_widget/show.html.erb
70
+ - app/views/accordion_panel_widget/thumbnail.html.erb
71
+ - app/views/accordion_widget/show.html.erb
72
+ - app/views/accordion_widget/thumbnail.html.erb
73
+ - lib/scrivito_accordion_widget.rb
74
+ - lib/scrivito_accordion_widget/engine.rb
75
+ - lib/scrivito_accordion_widget/version.rb
76
+ - lib/tasks/scrivito_accordion_widget_tasks.rake
77
+ - scrivito/migrate/0_create_accordion_widget.rb
78
+ homepage: https://www.scrivito.com
79
+ licenses:
80
+ - LGPL-3.0
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.3.0
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Scrivito Accordion Widget.
102
+ test_files: []