lato_core 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/fonts/lato_core/Lato-Bold.eot +0 -0
- data/app/assets/fonts/lato_core/Lato-Bold.ttf +0 -0
- data/app/assets/fonts/lato_core/Lato-Bold.woff +0 -0
- data/app/assets/fonts/lato_core/Lato-Bold.woff2 +0 -0
- data/app/assets/fonts/lato_core/Lato-Light.eot +0 -0
- data/app/assets/fonts/lato_core/Lato-Light.ttf +0 -0
- data/app/assets/fonts/lato_core/Lato-Light.woff +0 -0
- data/app/assets/fonts/lato_core/Lato-Light.woff2 +0 -0
- data/app/assets/fonts/lato_core/Lato-Regular.eot +0 -0
- data/app/assets/fonts/lato_core/Lato-Regular.ttf +0 -0
- data/app/assets/fonts/lato_core/Lato-Regular.woff +0 -0
- data/app/assets/fonts/lato_core/Lato-Regular.woff2 +0 -0
- data/app/assets/javascripts/lato_core/application.js +1 -1
- data/app/assets/javascripts/lato_core/initializers/Inputs.js +49 -1
- data/app/assets/javascripts/lato_core/initializers/inputs/MultipleSelect.js +0 -0
- data/app/assets/javascripts/lato_core/initializers/{SortableManager.js → inputs/SortableManager.js} +0 -0
- data/app/assets/stylesheets/lato_core/base/_typography.scss +21 -12
- data/app/assets/stylesheets/lato_core/cells/elements/_modal.scss +1 -1
- data/app/assets/stylesheets/lato_core/cells/elements/_title.scss +5 -0
- data/app/assets/stylesheets/lato_core/cells/inputs/_date.scss +3 -0
- data/app/assets/stylesheets/lato_core/cells/inputs/_datetime.scss +1 -1
- data/app/assets/stylesheets/lato_core/cells/inputs/_inputs.scss +2 -0
- data/app/assets/stylesheets/lato_core/cells/inputs/_youtube.scss +26 -0
- data/app/assets/stylesheets/lato_core/layouts/_admin.scss +17 -3
- data/app/assets/stylesheets/lato_core/theme.scss.erb +2 -2
- data/app/cells/lato_core/elements/title/cell.rb +24 -22
- data/app/cells/lato_core/elements/title/views/show.html.erb +6 -1
- data/app/cells/lato_core/inputs/date/cell.rb +53 -0
- data/app/cells/lato_core/inputs/date/views/show.html.erb +19 -0
- data/app/cells/lato_core/inputs/multipleselect/cell.rb +0 -0
- data/app/cells/lato_core/inputs/multipleselect/views/show.html.erb +0 -0
- data/app/cells/lato_core/inputs/select/cell.rb +2 -0
- data/app/cells/lato_core/inputs/select/views/show.html.erb +2 -0
- data/app/cells/lato_core/inputs/text/views/show.html.erb +1 -1
- data/app/cells/lato_core/inputs/textarea/cell.rb +5 -5
- data/app/cells/lato_core/inputs/youtube/cell.rb +39 -0
- data/app/cells/lato_core/inputs/youtube/views/show.html.erb +20 -0
- data/app/controllers/lato_core/back/superusers_controller.rb +23 -13
- data/app/controllers/lato_core/doc/cells_inputs_controller.rb +4 -0
- data/app/views/lato_core/doc/cells_elements/title.html.erb +31 -0
- data/app/views/lato_core/doc/cells_inputs/date.html.erb +178 -0
- data/app/views/lato_core/doc/cells_inputs/select.html.erb +78 -0
- data/app/views/lato_core/doc/cells_inputs/text.html.erb +2 -2
- data/app/views/lato_core/doc/cells_inputs/youtube.html.erb +98 -0
- data/app/views/lato_core/doc/doc/index.html.erb +2 -0
- data/app/views/lato_core/doc/general/generators.html.erb +0 -22
- data/app/views/layouts/lato_core/admin.html.erb +2 -0
- data/app/views/layouts/lato_core/authentication.html.erb +2 -0
- data/config/configs.yml +7 -1
- data/config/initializers/init_system.rb +1 -1
- data/config/routes/doc.rb +3 -0
- data/lib/lato_core/cell.rb +3 -0
- data/lib/lato_core/version.rb +1 -1
- metadata +29 -22
- data/app/assets/fonts/lato_core/lato-bold-webfont.eot +0 -0
- data/app/assets/fonts/lato_core/lato-bold-webfont.svg +0 -4551
- data/app/assets/fonts/lato_core/lato-bold-webfont.ttf +0 -0
- data/app/assets/fonts/lato_core/lato-bold-webfont.woff +0 -0
- data/app/assets/fonts/lato_core/lato-bold-webfont.woff2 +0 -0
- data/app/assets/fonts/lato_core/lato-regular-webfont.eot +0 -0
- data/app/assets/fonts/lato_core/lato-regular-webfont.svg +0 -4241
- data/app/assets/fonts/lato_core/lato-regular-webfont.ttf +0 -0
- data/app/assets/fonts/lato_core/lato-regular-webfont.woff +0 -0
- data/app/assets/fonts/lato_core/lato-regular-webfont.woff2 +0 -0
- data/lib/generators/lato_core/templates/controllers/crud_controller.rb +0 -87
- data/lib/generators/lato_core/templates/views/crud/edit.html.erb +0 -18
- data/lib/generators/lato_core/templates/views/crud/index.html.erb +0 -29
- data/lib/generators/lato_core/templates/views/crud/new.html.erb +0 -18
- data/lib/generators/lato_core/templates/views/crud/shared/_form.html.erb +0 -25
- data/lib/generators/lato_core/templates/views/crud/show.html.erb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f4211f6915556b1d0fde041227bea548304fce4
|
4
|
+
data.tar.gz: 8f63acc58fe73ee0818e0f518d8a52c97855d324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb052e5c212bd1d62beecf76842fd462716bf018fca36fb3f617d24960e947d836cb47ee1f9e4566cf935d3b81a51a90f4a7af35a2e54166efcb281ad48b012f
|
7
|
+
data.tar.gz: abb566a77dc9c1e53287a6920be505c69a2b9bf5488b50857e23a7ac1c504c37e96ad1358e7f4f2562e358b36d23ba493171b4a78b2f26b53ca8a5a338fdc32f
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -14,6 +14,7 @@
|
|
14
14
|
//= require jquery_ujs
|
15
15
|
//= require_tree ./vendors
|
16
16
|
//= require_tree ./initializers
|
17
|
+
//= require_tree ./initializers/inputs
|
17
18
|
//= require_tree ./interfaces
|
18
19
|
|
19
20
|
$(window).load(function () {
|
@@ -24,5 +25,4 @@ $(document).ready(function() {
|
|
24
25
|
ChartsInitializer.init()
|
25
26
|
ElementsInitializer.init()
|
26
27
|
LayoutInitializer.init()
|
27
|
-
SortableManager.init()
|
28
28
|
})
|
@@ -3,7 +3,12 @@ var InputsInitializer = (function () {
|
|
3
3
|
// Init plugins:
|
4
4
|
|
5
5
|
function initializeSelect () {
|
6
|
-
$('.inputs__select').
|
6
|
+
$('.inputs__select').each(function () {
|
7
|
+
$(this).selectize({
|
8
|
+
create: $(this).attr('data-create') === 'true',
|
9
|
+
maxItems: $(this).attr('data-multiple') === 'true' ? null : 1
|
10
|
+
})
|
11
|
+
})
|
7
12
|
}
|
8
13
|
|
9
14
|
function initializeDatetime () {
|
@@ -12,6 +17,13 @@ var InputsInitializer = (function () {
|
|
12
17
|
})
|
13
18
|
}
|
14
19
|
|
20
|
+
function initializeDate () {
|
21
|
+
$('.inputs__input--date').datetimepicker({
|
22
|
+
timepicker: false,
|
23
|
+
format: 'd/m/Y'
|
24
|
+
})
|
25
|
+
}
|
26
|
+
|
15
27
|
function initializeEditor () {
|
16
28
|
$('.inputs__editor').trumbowyg({
|
17
29
|
svgPath: $('#ddtj__editor-icons-path').html()
|
@@ -95,6 +107,38 @@ var InputsInitializer = (function () {
|
|
95
107
|
})
|
96
108
|
}
|
97
109
|
|
110
|
+
function initializeYoutube () {
|
111
|
+
// manage input change
|
112
|
+
$('.inputs-youtube .inputs__input').change(function () {
|
113
|
+
var inputVal = $(this).val()
|
114
|
+
var videoId = getId(inputVal)
|
115
|
+
var iframeMarkup = '<iframe src="//www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>'
|
116
|
+
var videoContainer = $(this).parent().find('.inputs-youtube__video')
|
117
|
+
if (inputVal && inputVal !== '') {
|
118
|
+
$(videoContainer).html(iframeMarkup)
|
119
|
+
$(videoContainer).addClass('inputs-youtube__video--active')
|
120
|
+
} else {
|
121
|
+
$(videoContainer).html('')
|
122
|
+
$(videoContainer).removeClass('inputs-youtube__video--active')
|
123
|
+
}
|
124
|
+
})
|
125
|
+
|
126
|
+
// trigger initial change
|
127
|
+
$('.inputs-youtube .inputs__input').trigger('change')
|
128
|
+
|
129
|
+
// function to get youtube video
|
130
|
+
function getId (url) {
|
131
|
+
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
|
132
|
+
var match = url.match(regExp)
|
133
|
+
|
134
|
+
if (match && match[2].length === 11) {
|
135
|
+
return match[2]
|
136
|
+
} else {
|
137
|
+
return 'error'
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
98
142
|
// Validations:
|
99
143
|
|
100
144
|
function formInputsValidator () {
|
@@ -188,10 +232,14 @@ var InputsInitializer = (function () {
|
|
188
232
|
function init () {
|
189
233
|
initializeSelect()
|
190
234
|
initializeDatetime()
|
235
|
+
initializeDate()
|
191
236
|
initializeEditor()
|
192
237
|
initializeDropzone()
|
193
238
|
initializeGeolocalizationMap()
|
239
|
+
initializeYoutube()
|
194
240
|
formInputsValidator()
|
241
|
+
|
242
|
+
SortableManager.init()
|
195
243
|
}
|
196
244
|
|
197
245
|
return {
|
File without changes
|
data/app/assets/javascripts/lato_core/initializers/{SortableManager.js → inputs/SortableManager.js}
RENAMED
File without changes
|
@@ -1,23 +1,32 @@
|
|
1
1
|
@font-face {
|
2
2
|
font-family: 'latoregular';
|
3
|
-
src: font-url('lato_core/
|
4
|
-
src: font-url('lato_core/
|
5
|
-
font-url('lato_core/
|
6
|
-
font-url('lato_core/
|
7
|
-
font-url('lato_core/
|
8
|
-
font-url('lato_core/lato-regular-webfont.svg#latoregular') format('svg');
|
3
|
+
src: font-url('lato_core/Lato-Regular.eot');
|
4
|
+
src: font-url('lato_core/Lato-Regular.eot?#iefix') format('embedded-opentype'),
|
5
|
+
font-url('lato_core/Lato-Regular.woff2') format('woff2'),
|
6
|
+
font-url('lato_core/Lato-Regular.woff') format('woff'),
|
7
|
+
font-url('lato_core/Lato-Regular.ttf') format('truetype');
|
9
8
|
font-weight: normal;
|
10
9
|
font-style: normal;
|
11
10
|
}
|
12
11
|
|
13
12
|
@font-face {
|
14
13
|
font-family: 'latobold';
|
15
|
-
src: font-url('lato_core/
|
16
|
-
src: font-url('lato_core/
|
17
|
-
font-url('lato_core/
|
18
|
-
font-url('lato_core/
|
19
|
-
font-url('lato_core/
|
20
|
-
|
14
|
+
src: font-url('lato_core/Lato-Bold.eot');
|
15
|
+
src: font-url('lato_core/Lato-Bold.eot?#iefix') format('embedded-opentype'),
|
16
|
+
font-url('lato_core/Lato-Bold.woff2') format('woff2'),
|
17
|
+
font-url('lato_core/Lato-Bold.woff') format('woff'),
|
18
|
+
font-url('lato_core/Lato-Bold.ttf') format('truetype');
|
19
|
+
font-weight: normal;
|
20
|
+
font-style: normal;
|
21
|
+
}
|
22
|
+
|
23
|
+
@font-face {
|
24
|
+
font-family: 'latolight';
|
25
|
+
src: font-url('lato_core/Lato-Light.eot');
|
26
|
+
src: font-url('lato_core/Lato-Light.eot?#iefix') format('embedded-opentype'),
|
27
|
+
font-url('lato_core/Lato-Light.woff2') format('woff2'),
|
28
|
+
font-url('lato_core/Lato-Light.woff') format('woff'),
|
29
|
+
font-url('lato_core/Lato-Light.ttf') format('truetype');
|
21
30
|
font-weight: normal;
|
22
31
|
font-style: normal;
|
23
32
|
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.inputs-youtube {
|
2
|
+
|
3
|
+
}
|
4
|
+
|
5
|
+
.inputs-youtube__video {
|
6
|
+
|
7
|
+
}
|
8
|
+
|
9
|
+
.inputs-youtube__video--active {
|
10
|
+
margin-top: 10px;
|
11
|
+
height: 0;
|
12
|
+
overflow: hidden;
|
13
|
+
padding-bottom: 56.25%;
|
14
|
+
padding-top: 30px;
|
15
|
+
position: relative;
|
16
|
+
}
|
17
|
+
|
18
|
+
.inputs-youtube__video iframe,
|
19
|
+
.inputs-youtube__video object,
|
20
|
+
.inputs-youtube__video embed {
|
21
|
+
height: 100%;
|
22
|
+
left: 0;
|
23
|
+
position: absolute;
|
24
|
+
top: 0;
|
25
|
+
width: 100%;
|
26
|
+
}
|
@@ -4,6 +4,7 @@
|
|
4
4
|
min-height: 100vh;
|
5
5
|
padding-left: 160px;
|
6
6
|
background: $layout_admin_background;
|
7
|
+
padding-top: 60px;
|
7
8
|
}
|
8
9
|
|
9
10
|
// Sidebar section:
|
@@ -46,6 +47,7 @@
|
|
46
47
|
.layout-admin__menu-item {
|
47
48
|
border-bottom: solid 1px lighten($layout_admin_sidebar_background, 2);
|
48
49
|
position: relative;
|
50
|
+
font-family: 'latolight';
|
49
51
|
|
50
52
|
&:hover {
|
51
53
|
background: darken($layout_admin_sidebar_background, 5);
|
@@ -127,18 +129,25 @@
|
|
127
129
|
|
128
130
|
.layout-admin__header-container {
|
129
131
|
background: $layout_admin_header_background;
|
130
|
-
height: 55px;
|
131
132
|
box-shadow: 0px 11px 20px rgba(41,59,90,0.08);
|
133
|
+
position: fixed;
|
134
|
+
top: 0;
|
135
|
+
left: 160px;
|
136
|
+
width: calc(100% - 160px);
|
137
|
+
height: 55px;
|
138
|
+
z-index: 99;
|
132
139
|
}
|
133
140
|
|
134
141
|
.layout-admin__title-container {
|
135
142
|
display: inline-block;
|
136
|
-
margin-left:
|
137
|
-
margin-top:
|
143
|
+
margin-left: 10px;
|
144
|
+
margin-top: 15px;
|
138
145
|
max-width: 30%;
|
139
146
|
|
140
147
|
h1 {
|
141
148
|
color: $layout_admin_header_color_title;
|
149
|
+
font-family: 'latolight';
|
150
|
+
text-transform: uppercase;
|
142
151
|
font-size: 20px;
|
143
152
|
margin: 0;
|
144
153
|
padding-right: 30px;
|
@@ -315,6 +324,11 @@
|
|
315
324
|
padding-left: 60px;
|
316
325
|
}
|
317
326
|
|
327
|
+
.layout-admin__header-container {
|
328
|
+
left: 60px;
|
329
|
+
width: calc(100% - 60px);
|
330
|
+
}
|
331
|
+
|
318
332
|
.layout-admin__logo-container {
|
319
333
|
padding: 0;
|
320
334
|
height: 55px;
|
@@ -120,8 +120,8 @@ $pagination_color_background_hover: $color_grey;
|
|
120
120
|
|
121
121
|
// Modal configurations:
|
122
122
|
|
123
|
-
$
|
123
|
+
$modal_color_transparent_background: $color_black;
|
124
124
|
$modal_color_background: $color_white;
|
125
|
-
$modal_color_title: $
|
125
|
+
$modal_color_title: $color_black;
|
126
126
|
$modal_color_header_border: $color_grey;
|
127
127
|
|
@@ -5,7 +5,8 @@ module LatoCore
|
|
5
5
|
@@requested_args = [:label]
|
6
6
|
|
7
7
|
@@default_args = {
|
8
|
-
size: 1
|
8
|
+
size: 1,
|
9
|
+
icon: nil
|
9
10
|
}
|
10
11
|
|
11
12
|
def initialize(args = {})
|
@@ -24,28 +25,29 @@ module LatoCore
|
|
24
25
|
|
25
26
|
private
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
28
|
+
def set_conditions
|
29
|
+
@html_tag = get_html_tag
|
30
|
+
@show_icon = @args[:icon] ? true : false
|
31
|
+
end
|
32
|
+
|
33
|
+
def get_html_tag
|
34
|
+
case @args[:size]
|
35
|
+
when 1
|
36
|
+
return 'h1'
|
37
|
+
when 2
|
38
|
+
return 'h2'
|
39
|
+
when 3
|
40
|
+
return 'h3'
|
41
|
+
when 4
|
42
|
+
return 'h4'
|
43
|
+
when 5
|
44
|
+
return 'h5'
|
45
|
+
when 6
|
46
|
+
return 'h6'
|
47
|
+
else
|
48
|
+
return 'h1'
|
48
49
|
end
|
50
|
+
end
|
49
51
|
|
50
52
|
end
|
51
53
|
|
@@ -1,4 +1,9 @@
|
|
1
1
|
<<%= @html_tag %>
|
2
2
|
class="elements-title
|
3
3
|
elements-title--size-<%= @args[:size] %>"
|
4
|
-
|
4
|
+
>
|
5
|
+
<% if @show_icon %>
|
6
|
+
<i class="fa fa-<%= @args[:icon] %> icon" aria-hidden="true"></i>
|
7
|
+
<% end %>
|
8
|
+
<%= @args[:label] %>
|
9
|
+
</<%= @html_tag %>>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module LatoCore
|
2
|
+
|
3
|
+
class Inputs::Date::Cell < Cell
|
4
|
+
|
5
|
+
@@requested_args = [:name]
|
6
|
+
|
7
|
+
@@default_args = {
|
8
|
+
value: '',
|
9
|
+
label: '',
|
10
|
+
placeholder: '',
|
11
|
+
help: '',
|
12
|
+
required: false,
|
13
|
+
disabled: false,
|
14
|
+
class: 'md-12'
|
15
|
+
}
|
16
|
+
|
17
|
+
def initialize(args = {})
|
18
|
+
@args = validate_args(
|
19
|
+
args: args,
|
20
|
+
requested_args: @@requested_args,
|
21
|
+
default_args: @@default_args
|
22
|
+
)
|
23
|
+
|
24
|
+
set_conditions
|
25
|
+
end
|
26
|
+
|
27
|
+
def show
|
28
|
+
render 'show.html'
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def set_conditions
|
34
|
+
@show_label = !@args[:label].nil? && !@args[:label].blank?
|
35
|
+
@show_help = !@args[:help].nil? && !@args[:help].blank?
|
36
|
+
|
37
|
+
@value = generate_value
|
38
|
+
end
|
39
|
+
|
40
|
+
# This function generate the value for the input if it is possible.
|
41
|
+
def generate_value
|
42
|
+
return unless @args[:value]
|
43
|
+
|
44
|
+
if @args[:value].is_a?(DateTime) || @args[:value].is_a?(Time) || @args[:value].is_a?(Date)
|
45
|
+
return @args[:value].strftime('%d/%m/%Y')
|
46
|
+
end
|
47
|
+
|
48
|
+
@args[:value]
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|