kuhsaft 2.2.6 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -0
  3. data/Rakefile +6 -5
  4. data/app/assets/javascripts/ckeditor/plugins/adv_link/LICENSE.txt +674 -0
  5. data/app/assets/javascripts/ckeditor/plugins/adv_link/README.md +62 -0
  6. data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/anchor.js.coffee +81 -0
  7. data/app/assets/javascripts/ckeditor/plugins/adv_link/dialogs/link.js.coffee +1353 -0
  8. data/app/assets/javascripts/ckeditor/plugins/adv_link/images/anchor.png +0 -0
  9. data/app/assets/javascripts/ckeditor/plugins/adv_link/images/hidpi/anchor.png +0 -0
  10. data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/de.js +68 -0
  11. data/app/assets/javascripts/ckeditor/plugins/adv_link/lang/en.js +68 -0
  12. data/app/assets/javascripts/ckeditor/plugins/adv_link/plugin.js.coffee +282 -0
  13. data/app/assets/javascripts/kuhsaft/cms/application.js.coffee.erb +42 -4
  14. data/app/assets/stylesheets/kuhsaft/application.css.sass +0 -3
  15. data/app/assets/stylesheets/kuhsaft/cms/application.css.sass +26 -11
  16. data/app/controllers/kuhsaft/api/pages_controller.rb +14 -0
  17. data/app/controllers/kuhsaft/cms/admin_controller.rb +1 -1
  18. data/app/controllers/kuhsaft/cms/assets_controller.rb +7 -7
  19. data/app/controllers/kuhsaft/cms/bricks_controller.rb +15 -4
  20. data/app/controllers/kuhsaft/cms/pages_controller.rb +8 -15
  21. data/app/controllers/kuhsaft/pages_controller.rb +16 -6
  22. data/app/controllers/kuhsaft/sitemaps_controller.rb +13 -0
  23. data/app/helpers/cms_helper.rb +4 -4
  24. data/app/helpers/kuhsaft/admin_helper.rb +0 -1
  25. data/app/helpers/kuhsaft/cms/admin_helper.rb +1 -2
  26. data/app/helpers/kuhsaft/cms/pages_helper.rb +2 -7
  27. data/app/helpers/pages_helper.rb +8 -37
  28. data/app/helpers/sitemaps_helper.rb +12 -0
  29. data/app/models/kuhsaft/accordion_item_brick.rb +1 -1
  30. data/app/models/kuhsaft/anchor_brick.rb +1 -1
  31. data/app/models/kuhsaft/asset.rb +26 -23
  32. data/app/models/kuhsaft/asset_brick.rb +2 -1
  33. data/app/models/kuhsaft/brick.rb +38 -16
  34. data/app/models/kuhsaft/brick_type.rb +2 -2
  35. data/app/models/kuhsaft/brick_type_filter.rb +0 -2
  36. data/app/models/kuhsaft/column_brick.rb +0 -1
  37. data/app/models/kuhsaft/image_brick.rb +2 -2
  38. data/app/models/kuhsaft/image_size.rb +0 -1
  39. data/app/models/kuhsaft/link_brick.rb +1 -1
  40. data/app/models/kuhsaft/page.rb +111 -107
  41. data/app/models/kuhsaft/page_type.rb +1 -1
  42. data/app/models/kuhsaft/partition.rb +12 -12
  43. data/app/models/kuhsaft/placeholder_brick.rb +8 -0
  44. data/app/models/kuhsaft/publish_state.rb +9 -10
  45. data/app/models/kuhsaft/slider_brick.rb +0 -2
  46. data/app/models/kuhsaft/text_brick.rb +1 -1
  47. data/app/models/kuhsaft/two_column_brick.rb +0 -1
  48. data/app/models/kuhsaft/video_brick.rb +1 -2
  49. data/app/uploaders/kuhsaft/asset_brick_asset_uploader.rb +39 -38
  50. data/app/uploaders/kuhsaft/asset_uploader.rb +43 -43
  51. data/app/uploaders/kuhsaft/image_brick_image_uploader.rb +7 -34
  52. data/app/views/kuhsaft/asset_bricks/asset_brick/_edit.html.haml +3 -2
  53. data/app/views/kuhsaft/cms/admin/_brick_type_dropdown.html.haml +2 -2
  54. data/app/views/kuhsaft/cms/bricks/_brick_item.html.haml +17 -10
  55. data/app/views/kuhsaft/cms/bricks/_new.html.haml +34 -0
  56. data/app/views/kuhsaft/cms/bricks/create.js.haml +6 -0
  57. data/app/views/kuhsaft/cms/bricks/destroy.js.haml +4 -0
  58. data/app/views/kuhsaft/cms/bricks/new.js.haml +11 -0
  59. data/app/views/kuhsaft/cms/pages/_branch.html.haml +2 -2
  60. data/app/views/kuhsaft/cms/pages/_form.html.haml +29 -18
  61. data/app/views/kuhsaft/image_bricks/_image_brick.html.haml +9 -7
  62. data/app/views/kuhsaft/image_bricks/image_brick/_edit.html.haml +3 -0
  63. data/app/views/kuhsaft/pages/show.html.haml +1 -9
  64. data/app/views/kuhsaft/placeholder_bricks/_placeholder_brick.html.haml +1 -1
  65. data/app/views/kuhsaft/sitemaps/index.xml.haml +9 -0
  66. data/app/views/kuhsaft/video_bricks/_video_brick.html.haml +4 -4
  67. data/app/views/layouts/kuhsaft/cms/application.html.haml +4 -3
  68. data/config/initializers/simple_form.rb +4 -4
  69. data/config/initializers/simple_form_bootstrap.rb +14 -14
  70. data/config/locales/de.yml +203 -0
  71. data/config/locales/en.yml +282 -0
  72. data/config/locales/kuhsaft.de.yml +14 -0
  73. data/config/locales/kuhsaft.en.yml +60 -0
  74. data/config/locales/models/kuhsaft/image_brick/de.yml +1 -0
  75. data/config/locales/models/kuhsaft/image_brick/en.yml +16 -0
  76. data/config/locales/models/kuhsaft/text_brick/de.yml +3 -0
  77. data/config/locales/models/kuhsaft/text_brick/en.yml +16 -0
  78. data/config/locales/models/kuhsaft/video_brick/en.yml +15 -0
  79. data/config/locales/views/kuhsaft/cms/pages/de.yml +3 -0
  80. data/config/locales/views/kuhsaft/cms/video_bricks/de.yml +1 -1
  81. data/config/routes.rb +18 -9
  82. data/db/migrate/10_add_redirect_url_to_kuhsaft_pages.rb +1 -1
  83. data/db/migrate/11_update_url_and_redirect_url_value.rb +4 -4
  84. data/db/migrate/13_add_page_title_to_pages.rb +1 -1
  85. data/db/migrate/15_add_alt_text_to_bricks.rb +5 -0
  86. data/db/migrate/16_update_default_value_for_page_type.rb +9 -0
  87. data/db/migrate/17_set_page_type_to_content_for_empty_fields.rb +7 -0
  88. data/lib/generators/kuhsaft/assets/install_generator.rb +1 -2
  89. data/lib/generators/kuhsaft/translations/add_generator.rb +19 -4
  90. data/lib/kuhsaft.rb +1 -0
  91. data/lib/kuhsaft/brick_list.rb +6 -8
  92. data/lib/kuhsaft/engine.rb +5 -1
  93. data/lib/kuhsaft/orderable.rb +22 -19
  94. data/lib/kuhsaft/partial_extractor.rb +1 -1
  95. data/lib/kuhsaft/searchable.rb +8 -11
  96. data/lib/kuhsaft/translatable.rb +35 -19
  97. data/lib/kuhsaft/version.rb +1 -1
  98. data/lib/tasks/kuhsaft_tasks.rake +12 -0
  99. data/lib/templates/kuhsaft/assets/ck-config.js.coffee +7 -0
  100. data/lib/templates/kuhsaft/translations/add_translation.html.erb +4 -10
  101. data/spec/controllers/kuhsaft/api/pages_controller_spec.rb +70 -0
  102. data/spec/controllers/kuhsaft/pages_controller_spec.rb +18 -14
  103. data/spec/controllers/kuhsaft/sitemaps_controller_spec.rb +13 -0
  104. data/spec/dummy/app/assets/javascripts/kuhsaft/cms/ck-config.js.coffee +7 -0
  105. data/spec/dummy/config/application.rb +2 -1
  106. data/spec/dummy/config/database.yml +1 -1
  107. data/spec/factories.rb +3 -3
  108. data/spec/features/cms_pages_spec.rb +13 -13
  109. data/spec/features/search_spec.rb +16 -18
  110. data/spec/helpers/kuhsaft/cms/pages_helper_spec.rb +2 -1
  111. data/spec/kuhsaft_spec.rb +1 -1
  112. data/spec/lib/brick_list_spec.rb +1 -1
  113. data/spec/lib/page_tree_spec.rb +10 -6
  114. data/spec/lib/searchable_spec.rb +4 -4
  115. data/spec/lib/translatable_spec.rb +114 -44
  116. data/spec/models/anchor_brick_spec.rb +1 -1
  117. data/spec/models/asset_spec.rb +1 -1
  118. data/spec/models/brick_spec.rb +1 -1
  119. data/spec/models/page_spec.rb +48 -37
  120. data/spec/models/publish_state_spec.rb +9 -9
  121. data/spec/spec_helper.rb +43 -21
  122. data/spec/support/kuhsaft_spec_helper.rb +2 -2
  123. data/spec/support/write_expectation.rb +57 -0
  124. data/spec/views/kuhsaft/sitemaps/index.xml.haml_spec.rb +67 -0
  125. metadata +119 -4
@@ -0,0 +1,282 @@
1
+ en:
2
+ date:
3
+ abbr_day_names:
4
+ - Sun
5
+ - Mon
6
+ - Tue
7
+ - Wed
8
+ - Thu
9
+ - Fri
10
+ - Sat
11
+ abbr_month_names:
12
+ -
13
+ - Jan
14
+ - Feb
15
+ - Mar
16
+ - Apr
17
+ - May
18
+ - Jun
19
+ - Jul
20
+ - Aug
21
+ - Sep
22
+ - Oct
23
+ - Nov
24
+ - Dec
25
+ day_names:
26
+ - Sunday
27
+ - Monday
28
+ - Tuesday
29
+ - Wednesday
30
+ - Thursday
31
+ - Friday
32
+ - Saturday
33
+ formats:
34
+ default: ! '%Y-%m-%d'
35
+ long: ! '%B %d, %Y'
36
+ short: ! '%b %d'
37
+ month_names:
38
+ -
39
+ - January
40
+ - February
41
+ - March
42
+ - April
43
+ - May
44
+ - June
45
+ - July
46
+ - August
47
+ - September
48
+ - October
49
+ - November
50
+ - December
51
+ order:
52
+ - :year
53
+ - :month
54
+ - :day
55
+ datetime:
56
+ distance_in_words:
57
+ about_x_hours:
58
+ one: about 1 hour
59
+ other: about %{count} hours
60
+ about_x_months:
61
+ one: about 1 month
62
+ other: about %{count} months
63
+ about_x_years:
64
+ one: about 1 year
65
+ other: about %{count} years
66
+ almost_x_years:
67
+ one: almost 1 year
68
+ other: almost %{count} years
69
+ half_a_minute: half a minute
70
+ less_than_x_minutes:
71
+ one: less than a minute
72
+ other: less than %{count} minutes
73
+ less_than_x_seconds:
74
+ one: less than 1 second
75
+ other: less than %{count} seconds
76
+ over_x_years:
77
+ one: over 1 year
78
+ other: over %{count} years
79
+ x_days:
80
+ one: 1 day
81
+ other: ! '%{count} days'
82
+ x_minutes:
83
+ one: 1 minute
84
+ other: ! '%{count} minutes'
85
+ x_months:
86
+ one: 1 month
87
+ other: ! '%{count} months'
88
+ x_seconds:
89
+ one: 1 second
90
+ other: ! '%{count} seconds'
91
+ prompts:
92
+ day: Day
93
+ hour: Hour
94
+ minute: Minute
95
+ month: Month
96
+ second: Seconds
97
+ year: Year
98
+ errors: &errors
99
+ format: ! '%{attribute} %{message}'
100
+ messages:
101
+ accepted: must be accepted
102
+ blank: can't be blank
103
+ present: must be blank
104
+ confirmation: ! "doesn't match %{attribute}"
105
+ empty: can't be empty
106
+ equal_to: must be equal to %{count}
107
+ even: must be even
108
+ exclusion: is reserved
109
+ greater_than: must be greater than %{count}
110
+ greater_than_or_equal_to: must be greater than or equal to %{count}
111
+ inclusion: is not included in the list
112
+ invalid: is invalid
113
+ less_than: must be less than %{count}
114
+ less_than_or_equal_to: must be less than or equal to %{count}
115
+ not_a_number: is not a number
116
+ not_an_integer: must be an integer
117
+ odd: must be odd
118
+ record_invalid: ! 'Validation failed: %{errors}'
119
+ restrict_dependent_destroy:
120
+ one: "Cannot delete record because a dependent %{record} exists"
121
+ many: "Cannot delete record because dependent %{record} exist"
122
+ taken: has already been taken
123
+ too_long:
124
+ one: is too long (maximum is 1 character)
125
+ other: is too long (maximum is %{count} characters)
126
+ too_short:
127
+ one: is too short (minimum is 1 character)
128
+ other: is too short (minimum is %{count} characters)
129
+ wrong_length:
130
+ one: is the wrong length (should be 1 character)
131
+ other: is the wrong length (should be %{count} characters)
132
+ other_than: "must be other than %{count}"
133
+ template:
134
+ body: ! 'There were problems with the following fields:'
135
+ header:
136
+ one: 1 error prohibited this %{model} from being saved
137
+ other: ! '%{count} errors prohibited this %{model} from being saved'
138
+ helpers:
139
+ select:
140
+ prompt: Please select
141
+ submit:
142
+ create: Create %{model}
143
+ submit: Save %{model}
144
+ update: Update %{model}
145
+ number:
146
+ currency:
147
+ format:
148
+ delimiter: ! ','
149
+ format: ! '%u%n'
150
+ precision: 2
151
+ separator: .
152
+ significant: false
153
+ strip_insignificant_zeros: false
154
+ unit: $
155
+ format:
156
+ delimiter: ! ','
157
+ precision: 3
158
+ separator: .
159
+ significant: false
160
+ strip_insignificant_zeros: false
161
+ human:
162
+ decimal_units:
163
+ format: ! '%n %u'
164
+ units:
165
+ billion: Billion
166
+ million: Million
167
+ quadrillion: Quadrillion
168
+ thousand: Thousand
169
+ trillion: Trillion
170
+ unit: ''
171
+ format:
172
+ delimiter: ''
173
+ precision: 3
174
+ significant: true
175
+ strip_insignificant_zeros: true
176
+ storage_units:
177
+ format: ! '%n %u'
178
+ units:
179
+ byte:
180
+ one: Byte
181
+ other: Bytes
182
+ gb: GB
183
+ kb: KB
184
+ mb: MB
185
+ tb: TB
186
+ percentage:
187
+ format:
188
+ delimiter: ''
189
+ format: "%n%"
190
+ precision:
191
+ format:
192
+ delimiter: ''
193
+ support:
194
+ array:
195
+ last_word_connector: ! ', and '
196
+ two_words_connector: ! ' and '
197
+ words_connector: ! ', '
198
+ time:
199
+ am: am
200
+ formats:
201
+ default: ! '%a, %d %b %Y %H:%M:%S %z'
202
+ long: ! '%B %d, %Y %H:%M'
203
+ short: ! '%d %b %H:%M'
204
+ pm: pm
205
+ # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
206
+ activemodel:
207
+ errors:
208
+ <<: *errors
209
+ activerecord:
210
+ errors:
211
+ <<: *errors
212
+ kuhsaft:
213
+ cms:
214
+ admin:
215
+ brick_type_dropdown:
216
+ add_element: Add element
217
+ add_specific_element: Add specific element
218
+ confirm_delete: Confirm delete
219
+ empty_state:
220
+ empty: Empty
221
+ main_navigation:
222
+ logout: Logout
223
+ assets:
224
+ edit:
225
+ edit: Edit
226
+ index:
227
+ create: Create
228
+ list:
229
+ confirm: Confirm
230
+ delete: Delete
231
+ new:
232
+ new: New
233
+ bricks:
234
+ brick_item:
235
+ confirm: Confirm
236
+ save: Save
237
+ saved: Saved
238
+ new:
239
+ create_new: Create new
240
+ no_content: No content
241
+ save: Save
242
+ pages:
243
+ edit:
244
+ edit_html: Edit html
245
+ form:
246
+ collapse_all: Collapse all
247
+ expand_all: Expand all
248
+ hint_description: Hint description
249
+ hint_keywords: Hint keywords
250
+ tab_content: Tab content
251
+ tab_metadata: Tab metadata
252
+ index:
253
+ add_page: Add page
254
+ new:
255
+ new: New
256
+ new_page: New page
257
+ pages: Pages
258
+ image_bricks:
259
+ image_brick:
260
+ edit:
261
+ image_preview: Image preview
262
+ search:
263
+ form:
264
+ placeholder: Placeholder
265
+ search: Search
266
+ results:
267
+ title: Title
268
+ text_bricks:
269
+ text_brick:
270
+ read_less: Read less
271
+ read_more: Read more
272
+ video_bricks:
273
+ video_brick:
274
+ edit:
275
+ any_source_error: Any source error
276
+ embed_src_optional: Embed src optional
277
+ layouts:
278
+ kuhsaft:
279
+ cms:
280
+ flash:
281
+ success: Success
282
+ title: Title
@@ -12,6 +12,13 @@ de:
12
12
  page_part:
13
13
  markdown: 'Formatierter Text'
14
14
  cms:
15
+ bricks:
16
+ brick_item:
17
+ confirm: 'Sind Sie sicher?'
18
+ new:
19
+ create_new: '%{brick} erstellen'
20
+ save: Speichern
21
+ no_content: 'Dieser Brick hat keinen eigenen Inhalt. Nach dem Speichern können darin weitere Bricks erstellt werden.'
15
22
  pages:
16
23
  index:
17
24
  create: 'Neue Seite erstellen'
@@ -42,6 +49,13 @@ de:
42
49
  list:
43
50
  confirm: 'Soll das Asset "%{filename}" entgültig entfernt werden?'
44
51
  delete: 'Asset löschen'
52
+ helpers:
53
+ select:
54
+ prompt: Bitte wählen
55
+ submit:
56
+ create: '%{model} erstellen'
57
+ submit: '%{model} speichern'
58
+ update: '%{model} aktualisieren'
45
59
  simple_form:
46
60
  labels:
47
61
  title: 'Seiten Titel'
@@ -15,6 +15,10 @@ en:
15
15
  bricks:
16
16
  brick_item:
17
17
  confirm: 'Are you sure?'
18
+ new:
19
+ create_new: 'Create %{brick}'
20
+ save: Save
21
+ no_content: 'This Brick has no own content. You can create more bricks within after saving.'
18
22
  pages:
19
23
  index:
20
24
  create: 'Create new page'
@@ -45,6 +49,62 @@ en:
45
49
  list:
46
50
  confirm: 'Are you sure you want to delete the asset "%{filename}"?'
47
51
  delete: 'Delete asset'
52
+ admin:
53
+ brick_type_dropdown:
54
+ add_element: Add element
55
+ add_specific_element: Add specific element
56
+ confirm_delete: Confirm delete
57
+ empty_state:
58
+ empty: Empty
59
+ main_navigation:
60
+ logout: Logout
61
+ assets:
62
+ edit:
63
+ edit: Edit
64
+ index:
65
+ create: Create
66
+ list:
67
+ confirm: Confirm
68
+ delete: Delete
69
+ new:
70
+ new: New
71
+ bricks:
72
+ brick_item:
73
+ confirm: Confirm
74
+ save: Save
75
+ saved: Saved
76
+ new:
77
+ create_new: Create new
78
+ no_content: No content
79
+ save: Save
80
+ pages:
81
+ edit:
82
+ edit_html: Edit html
83
+ form:
84
+ collapse_all: Collapse all
85
+ expand_all: Expand all
86
+ hint_description: Hint description
87
+ hint_keywords: Hint keywords
88
+ tab_content: Tab content
89
+ tab_metadata: Tab metadata
90
+ index:
91
+ add_page: Add page
92
+ new:
93
+ new: New
94
+ new_page: New page
95
+ pages: Pages
96
+ search:
97
+ form:
98
+ placeholder: Placeholder
99
+ search: Search
100
+ results:
101
+ title: Title
102
+ layouts:
103
+ kuhsaft:
104
+ cms:
105
+ flash:
106
+ success: Success
107
+ title: Title
48
108
  simple_form:
49
109
  labels:
50
110
  title: 'Page title'
@@ -6,5 +6,6 @@ de:
6
6
  kuhsaft/image_brick:
7
7
  image: 'Bild'
8
8
  caption: 'Beschreibung'
9
+ alt_text: 'Alt-Text'
9
10
  href: 'Link'
10
11
  image_size: 'Grösse'
@@ -0,0 +1,16 @@
1
+ en:
2
+ activerecord:
3
+ models:
4
+ kuhsaft/image_brick: 'Image'
5
+ attributes:
6
+ kuhsaft/image_brick:
7
+ image: 'Image'
8
+ caption: 'Caption'
9
+ alt_text: 'Alt text'
10
+ href: 'Link'
11
+ image_size: 'Filesize'
12
+ kuhsaft:
13
+ image_bricks:
14
+ image_brick:
15
+ edit:
16
+ image_preview: 'Image preview'
@@ -6,3 +6,6 @@ de:
6
6
  kuhsaft/text_brick:
7
7
  text: 'Text'
8
8
  read_more_text: 'Mehr lesen'
9
+ errors:
10
+ messages:
11
+ blank: "%{attribute} darf nicht leer sein!"
@@ -0,0 +1,16 @@
1
+ en:
2
+ activerecord:
3
+ models:
4
+ kuhsaft/text_brick: 'Text'
5
+ attributes:
6
+ kuhsaft/text_brick:
7
+ text: 'Text'
8
+ read_more_text: 'Read more'
9
+ errors:
10
+ messages:
11
+ blank: "%{attribute} can't be blank"
12
+ kuhsaft:
13
+ text_bricks:
14
+ text_brick:
15
+ read_less: 'Read less'
16
+ read_more: 'Read more'
@@ -0,0 +1,15 @@
1
+ en:
2
+ activerecord:
3
+ models:
4
+ kuhsaft/video_brick: 'Video'
5
+ attributes:
6
+ kuhsaft/video_brick:
7
+ video: 'Source'
8
+ embed_src: 'Embed Code'
9
+ href: 'Video'
10
+ kuhsaft:
11
+ video_bricks:
12
+ video_brick:
13
+ edit:
14
+ any_source_error: 'Any source error'
15
+ embed_src_optional: 'Embed src optional'