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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/lato_core/Lato-Bold.eot +0 -0
  3. data/app/assets/fonts/lato_core/Lato-Bold.ttf +0 -0
  4. data/app/assets/fonts/lato_core/Lato-Bold.woff +0 -0
  5. data/app/assets/fonts/lato_core/Lato-Bold.woff2 +0 -0
  6. data/app/assets/fonts/lato_core/Lato-Light.eot +0 -0
  7. data/app/assets/fonts/lato_core/Lato-Light.ttf +0 -0
  8. data/app/assets/fonts/lato_core/Lato-Light.woff +0 -0
  9. data/app/assets/fonts/lato_core/Lato-Light.woff2 +0 -0
  10. data/app/assets/fonts/lato_core/Lato-Regular.eot +0 -0
  11. data/app/assets/fonts/lato_core/Lato-Regular.ttf +0 -0
  12. data/app/assets/fonts/lato_core/Lato-Regular.woff +0 -0
  13. data/app/assets/fonts/lato_core/Lato-Regular.woff2 +0 -0
  14. data/app/assets/javascripts/lato_core/application.js +1 -1
  15. data/app/assets/javascripts/lato_core/initializers/Inputs.js +49 -1
  16. data/app/assets/javascripts/lato_core/initializers/inputs/MultipleSelect.js +0 -0
  17. data/app/assets/javascripts/lato_core/initializers/{SortableManager.js → inputs/SortableManager.js} +0 -0
  18. data/app/assets/stylesheets/lato_core/base/_typography.scss +21 -12
  19. data/app/assets/stylesheets/lato_core/cells/elements/_modal.scss +1 -1
  20. data/app/assets/stylesheets/lato_core/cells/elements/_title.scss +5 -0
  21. data/app/assets/stylesheets/lato_core/cells/inputs/_date.scss +3 -0
  22. data/app/assets/stylesheets/lato_core/cells/inputs/_datetime.scss +1 -1
  23. data/app/assets/stylesheets/lato_core/cells/inputs/_inputs.scss +2 -0
  24. data/app/assets/stylesheets/lato_core/cells/inputs/_youtube.scss +26 -0
  25. data/app/assets/stylesheets/lato_core/layouts/_admin.scss +17 -3
  26. data/app/assets/stylesheets/lato_core/theme.scss.erb +2 -2
  27. data/app/cells/lato_core/elements/title/cell.rb +24 -22
  28. data/app/cells/lato_core/elements/title/views/show.html.erb +6 -1
  29. data/app/cells/lato_core/inputs/date/cell.rb +53 -0
  30. data/app/cells/lato_core/inputs/date/views/show.html.erb +19 -0
  31. data/app/cells/lato_core/inputs/multipleselect/cell.rb +0 -0
  32. data/app/cells/lato_core/inputs/multipleselect/views/show.html.erb +0 -0
  33. data/app/cells/lato_core/inputs/select/cell.rb +2 -0
  34. data/app/cells/lato_core/inputs/select/views/show.html.erb +2 -0
  35. data/app/cells/lato_core/inputs/text/views/show.html.erb +1 -1
  36. data/app/cells/lato_core/inputs/textarea/cell.rb +5 -5
  37. data/app/cells/lato_core/inputs/youtube/cell.rb +39 -0
  38. data/app/cells/lato_core/inputs/youtube/views/show.html.erb +20 -0
  39. data/app/controllers/lato_core/back/superusers_controller.rb +23 -13
  40. data/app/controllers/lato_core/doc/cells_inputs_controller.rb +4 -0
  41. data/app/views/lato_core/doc/cells_elements/title.html.erb +31 -0
  42. data/app/views/lato_core/doc/cells_inputs/date.html.erb +178 -0
  43. data/app/views/lato_core/doc/cells_inputs/select.html.erb +78 -0
  44. data/app/views/lato_core/doc/cells_inputs/text.html.erb +2 -2
  45. data/app/views/lato_core/doc/cells_inputs/youtube.html.erb +98 -0
  46. data/app/views/lato_core/doc/doc/index.html.erb +2 -0
  47. data/app/views/lato_core/doc/general/generators.html.erb +0 -22
  48. data/app/views/layouts/lato_core/admin.html.erb +2 -0
  49. data/app/views/layouts/lato_core/authentication.html.erb +2 -0
  50. data/config/configs.yml +7 -1
  51. data/config/initializers/init_system.rb +1 -1
  52. data/config/routes/doc.rb +3 -0
  53. data/lib/lato_core/cell.rb +3 -0
  54. data/lib/lato_core/version.rb +1 -1
  55. metadata +29 -22
  56. data/app/assets/fonts/lato_core/lato-bold-webfont.eot +0 -0
  57. data/app/assets/fonts/lato_core/lato-bold-webfont.svg +0 -4551
  58. data/app/assets/fonts/lato_core/lato-bold-webfont.ttf +0 -0
  59. data/app/assets/fonts/lato_core/lato-bold-webfont.woff +0 -0
  60. data/app/assets/fonts/lato_core/lato-bold-webfont.woff2 +0 -0
  61. data/app/assets/fonts/lato_core/lato-regular-webfont.eot +0 -0
  62. data/app/assets/fonts/lato_core/lato-regular-webfont.svg +0 -4241
  63. data/app/assets/fonts/lato_core/lato-regular-webfont.ttf +0 -0
  64. data/app/assets/fonts/lato_core/lato-regular-webfont.woff +0 -0
  65. data/app/assets/fonts/lato_core/lato-regular-webfont.woff2 +0 -0
  66. data/lib/generators/lato_core/templates/controllers/crud_controller.rb +0 -87
  67. data/lib/generators/lato_core/templates/views/crud/edit.html.erb +0 -18
  68. data/lib/generators/lato_core/templates/views/crud/index.html.erb +0 -29
  69. data/lib/generators/lato_core/templates/views/crud/new.html.erb +0 -18
  70. data/lib/generators/lato_core/templates/views/crud/shared/_form.html.erb +0 -25
  71. 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: fbd4baa00665b8f5e9b0fd6629c3886a2a83b7ed
4
- data.tar.gz: 49e231c0e61b8044fa5b21a721896f7b32fadfb1
3
+ metadata.gz: 7f4211f6915556b1d0fde041227bea548304fce4
4
+ data.tar.gz: 8f63acc58fe73ee0818e0f518d8a52c97855d324
5
5
  SHA512:
6
- metadata.gz: 21cb67e61670a2a1e3de73a84538ad8a0631e1732b58b9327bf40a538c0c3830ef6d42e6ea1f5d5d92b5f03d5b9474e61d548a74ab62bec973dc2c0b43d386f3
7
- data.tar.gz: 5282d9392d3a22ad0cbf204a20aa901e0e5435f25a4ba2bef0c908b12ccd6e59577f46718d589d542c6eb6e1e25ae361bd1aa0d0feaee6807c335e551c58d3c7
6
+ metadata.gz: bb052e5c212bd1d62beecf76842fd462716bf018fca36fb3f617d24960e947d836cb47ee1f9e4566cf935d3b81a51a90f4a7af35a2e54166efcb281ad48b012f
7
+ data.tar.gz: abb566a77dc9c1e53287a6920be505c69a2b9bf5488b50857e23a7ac1c504c37e96ad1358e7f4f2562e358b36d23ba493171b4a78b2f26b53ca8a5a338fdc32f
@@ -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').selectize()
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 {
@@ -1,23 +1,32 @@
1
1
  @font-face {
2
2
  font-family: 'latoregular';
3
- src: font-url('lato_core/lato-regular-webfont.eot');
4
- src: font-url('lato_core/lato-regular-webfont.eot?#iefix') format('embedded-opentype'),
5
- font-url('lato_core/lato-regular-webfont.woff2') format('woff2'),
6
- font-url('lato_core/lato-regular-webfont.woff') format('woff'),
7
- font-url('lato_core/lato-regular-webfont.ttf') format('truetype'),
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/lato-bold-webfont.eot');
16
- src: font-url('lato_core/lato-bold-webfont.eot?#iefix') format('embedded-opentype'),
17
- font-url('lato_core/lato-bold-webfont.woff2') format('woff2'),
18
- font-url('lato_core/lato-bold-webfont.woff') format('woff'),
19
- font-url('lato_core/lato-bold-webfont.ttf') format('truetype'),
20
- font-url('lato_core/lato-bold-webfont.svg#latobold') format('svg');
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
  }
@@ -13,7 +13,7 @@
13
13
 
14
14
  .elements-modal--active {
15
15
  transform: scale(1);
16
- background-color: rgba($modal_color_transarent_background, 0.5);
16
+ background-color: rgba($modal_color_transparent_background, 0.5);
17
17
  transition: transform 0.25s, background-color 1s;
18
18
  }
19
19
 
@@ -5,6 +5,11 @@
5
5
  border-bottom: solid 1px $title_color_border;
6
6
  padding-bottom: 5px;
7
7
  margin: 5px 0;
8
+
9
+ .icon {
10
+ display: inline-block;
11
+ margin-right: 10px;
12
+ }
8
13
  }
9
14
 
10
15
  .elements-title--size-1 {
@@ -2,7 +2,7 @@
2
2
 
3
3
  }
4
4
 
5
- // plugin style
5
+ // plugin style (used also for date input)
6
6
  .xdsoft_datetimepicker {
7
7
  border: 1px solid $input_color_border;
8
8
  border-bottom-left-radius: 10px;
@@ -7,8 +7,10 @@
7
7
  @import "select";
8
8
  @import "textarea";
9
9
  @import "datetime";
10
+ @import "date";
10
11
  @import "editor";
11
12
  @import "checkbox";
12
13
  @import "dropzone";
13
14
  @import "geolocalization";
14
15
  @import "sortableblock";
16
+ @import "youtube";
@@ -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: 5px;
137
- margin-top: 16px;
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
- $modal_color_transarent_background: $color_main;
123
+ $modal_color_transparent_background: $color_black;
124
124
  $modal_color_background: $color_white;
125
- $modal_color_title: $color_main;
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
- def set_conditions
28
- @html_tag = get_html_tag
29
- end
30
-
31
- def get_html_tag
32
- case @args[:size]
33
- when 1
34
- return 'h1'
35
- when 2
36
- return 'h2'
37
- when 3
38
- return 'h3'
39
- when 4
40
- return 'h4'
41
- when 5
42
- return 'h5'
43
- when 6
44
- return 'h6'
45
- else
46
- return 'h1'
47
- end
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
- ><%= @args[:label] %></<%= @html_tag %>>
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