scrivito_three_column_widget 0.90.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -4
- data/app/assets/stylesheets/scrivito_three_column_widget.scss +39 -0
- data/app/models/three_column_widget.rb +15 -0
- data/app/views/three_column_widget/details.html.erb +10 -2
- data/app/views/three_column_widget/show.html.erb +4 -4
- data/app/views/three_column_widget/thumbnail.html.erb +2 -2
- data/lib/scrivito_three_column_widget/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c33a5ef26ca0a2b82f9ca56e167d8108eaa7e87f
|
4
|
+
data.tar.gz: cfa9e08bcf0bbc74dcb4f5129f1406509e775f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476c0e06e51cfb7ae758d73ca4e1528f49a133d04b65da1fadd86e787ea0b6b4f12c5c6c46d232c6db9139e260f8383f80873bdd9219cf95e0a5e41840189970
|
7
|
+
data.tar.gz: 58f52227eaf48953c8f0cfb0673e5995513f86c2f0fdd330b135229644069acf9ae7999b460b90bc06592fbf307df79c78e2707213ef088ee21522f4d1443213
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# ScrivitoThreeColumnWidget
|
2
2
|
|
3
|
-
This
|
3
|
+
This gem adds a Scrivito widget for dividing pages and page sections into three columns to your app.
|
4
4
|
|
5
5
|
## Prerequisites
|
6
6
|
|
7
|
-
|
7
|
+
Requires Bootstrap in your Rails app.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -12,6 +12,27 @@ Add the gem to your Gemfile:
|
|
12
12
|
|
13
13
|
gem 'scrivito_three_column_widget'
|
14
14
|
|
15
|
+
Add this line to your application Css manifest:
|
16
|
+
|
17
|
+
*= require scrivito_three_column_widget
|
18
|
+
|
15
19
|
## Customization
|
16
20
|
|
17
|
-
We
|
21
|
+
We recommend to use [Scrivito Advanced Editors](https://github.com/Scrivito/scrivito_advanced_editors) which provides nicer controls.
|
22
|
+
|
23
|
+
## Localization
|
24
|
+
|
25
|
+
The following code represents the default localization for English. Copy it to your `en.yml` and change it if necessary:
|
26
|
+
|
27
|
+
```yaml
|
28
|
+
en:
|
29
|
+
scrivito_three_column_widget:
|
30
|
+
thumbnail:
|
31
|
+
title: Three Columns
|
32
|
+
description: Three columns that can be filled with widgets
|
33
|
+
details:
|
34
|
+
column_1_width: Width for column 1
|
35
|
+
column_2_width: Width for column 2
|
36
|
+
grid_size: Gird Size
|
37
|
+
keep_columns: Show columns on mobile
|
38
|
+
```
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.scrivito-column-widget.small-grid {
|
2
|
+
margin-left: 0;
|
3
|
+
margin-right: 0;
|
4
|
+
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1,
|
5
|
+
.col-xs-2, .col-sm-2, .col-md-2, .col-lg-2,
|
6
|
+
.col-xs-3, .col-sm-3, .col-md-3, .col-lg-3,
|
7
|
+
.col-xs-4, .col-sm-4, .col-md-4, .col-lg-4,
|
8
|
+
.col-xs-5, .col-sm-5, .col-md-5, .col-lg-5,
|
9
|
+
.col-xs-6, .col-sm-6, .col-md-6, .col-lg-6,
|
10
|
+
.col-xs-7, .col-sm-7, .col-md-7, .col-lg-7,
|
11
|
+
.col-xs-8, .col-sm-8, .col-md-8, .col-lg-8,
|
12
|
+
.col-xs-9, .col-sm-9, .col-md-9, .col-lg-9,
|
13
|
+
.col-xs-10, .col-sm-10, .col-md-10, .col-lg-10,
|
14
|
+
.col-xs-11, .col-sm-11, .col-md-11, .col-lg-11,
|
15
|
+
.col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
16
|
+
padding-left: 0px;
|
17
|
+
padding-right: 0px;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
.scrivito-column-widget.large-grid {
|
22
|
+
margin-left: -30px;
|
23
|
+
margin-right: -30px;
|
24
|
+
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1,
|
25
|
+
.col-xs-2, .col-sm-2, .col-md-2, .col-lg-2,
|
26
|
+
.col-xs-3, .col-sm-3, .col-md-3, .col-lg-3,
|
27
|
+
.col-xs-4, .col-sm-4, .col-md-4, .col-lg-4,
|
28
|
+
.col-xs-5, .col-sm-5, .col-md-5, .col-lg-5,
|
29
|
+
.col-xs-6, .col-sm-6, .col-md-6, .col-lg-6,
|
30
|
+
.col-xs-7, .col-sm-7, .col-md-7, .col-lg-7,
|
31
|
+
.col-xs-8, .col-sm-8, .col-md-8, .col-lg-8,
|
32
|
+
.col-xs-9, .col-sm-9, .col-md-9, .col-lg-9,
|
33
|
+
.col-xs-10, .col-sm-10, .col-md-10, .col-lg-10,
|
34
|
+
.col-xs-11, .col-sm-11, .col-md-11, .col-lg-11,
|
35
|
+
.col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
36
|
+
padding-left: 30px;
|
37
|
+
padding-right: 30px;
|
38
|
+
}
|
39
|
+
}
|
@@ -4,8 +4,23 @@ class ThreeColumnWidget < Widget
|
|
4
4
|
attribute :column_3, :widgetlist
|
5
5
|
attribute :column_1_width, :enum, values: (1..12).to_a.map{|e| e.to_s}, default: '4'
|
6
6
|
attribute :column_2_width, :enum, values: (1..12).to_a.map{|e| e.to_s}, default: '4'
|
7
|
+
attribute :grid_size, :enum, values: ['small','default','large'], default: 'default'
|
8
|
+
attribute :keep_columns, :enum, values: ['Yes','No'], default: 'No'
|
7
9
|
|
8
10
|
def column_3_width
|
11
|
+
val = column_3_width_value
|
12
|
+
val < 1 ? 1 : val
|
13
|
+
end
|
14
|
+
|
15
|
+
def column_3_width_value
|
9
16
|
12 - self.column_1_width.to_i - self.column_2_width.to_i
|
10
17
|
end
|
18
|
+
|
19
|
+
def grid_size_class
|
20
|
+
"#{grid_size || 'default'}-grid"
|
21
|
+
end
|
22
|
+
|
23
|
+
def device_class
|
24
|
+
keep_columns == 'Yes' ? 'xs' : 'md'
|
25
|
+
end
|
11
26
|
end
|
@@ -1,7 +1,15 @@
|
|
1
|
-
<%= scrivito_details_for 'Width for column 1' do %>
|
1
|
+
<%= scrivito_details_for t('scrivito_three_column_widget.details.column_1_width', default: 'Width for column 1') do %>
|
2
2
|
<%= scrivito_tag(:div, widget, :column_1_width) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
<%= scrivito_details_for 'Width for column 2' do %>
|
5
|
+
<%= scrivito_details_for t('scrivito_three_column_widget.details.column_2_width', default: 'Width for column 2') do %>
|
6
6
|
<%= scrivito_tag(:div, widget, :column_2_width) %>
|
7
7
|
<% end %>
|
8
|
+
|
9
|
+
<%= scrivito_details_for t('scrivito_three_column_widget.details.grid_size', default: 'Grid Size') do %>
|
10
|
+
<%= scrivito_tag(:div, widget, :grid_size) %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= scrivito_details_for t('scrivito_three_column_widget.details.keep_columns', default: 'Show columns on mobile') do %>
|
14
|
+
<%= scrivito_tag(:div, widget, :keep_columns) %>
|
15
|
+
<% end %>
|
@@ -1,13 +1,13 @@
|
|
1
|
-
<div class="row">
|
2
|
-
<div class="col
|
1
|
+
<div class="scrivito-column-widget row <%= widget.grid_size_class %>">
|
2
|
+
<div class="col-<%= widget.device_class %>-<%= widget.column_1_width %>">
|
3
3
|
<%= scrivito_tag(:div, widget, :column_1) %>
|
4
4
|
</div>
|
5
5
|
|
6
|
-
<div class="col
|
6
|
+
<div class="col-<%= widget.device_class %>-<%= widget.column_2_width %>">
|
7
7
|
<%= scrivito_tag(:div, widget, :column_2) %>
|
8
8
|
</div>
|
9
9
|
|
10
|
-
<div class="col
|
10
|
+
<div class="col-<%= widget.device_class %>-<%= widget.column_3_width %>">
|
11
11
|
<%= scrivito_tag(:div, widget, :column_3) %>
|
12
12
|
</div>
|
13
13
|
</div>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= scrivito_thumbnail 'Three
|
2
|
-
Three columns that can be filled with widgets
|
1
|
+
<%= scrivito_thumbnail t('scrivito_three_column_widget.thumbnail.title', default: 'Three Coumns'), image_tag("scrivito_three_column_widget/widget_preview_3cols.png") do %>
|
2
|
+
<%= t('scrivito_three_column_widget.thumbnail.description', default: 'Three columns that can be filled with widgets') %>
|
3
3
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scrivito_three_column_widget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scrivito
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- README.md
|
37
37
|
- Rakefile
|
38
38
|
- app/assets/images/scrivito_three_column_widget/widget_preview_3cols.png
|
39
|
+
- app/assets/stylesheets/scrivito_three_column_widget.scss
|
39
40
|
- app/models/three_column_widget.rb
|
40
41
|
- app/views/three_column_widget/details.html.erb
|
41
42
|
- app/views/three_column_widget/show.html.erb
|