drg_cms 0.6.1.0 → 0.6.1.6

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/README.md +25 -10
  3. data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
  4. data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
  5. data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
  6. data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
  7. data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
  8. data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
  9. data/app/assets/javascripts/drg_cms/drg_cms.js +178 -55
  10. data/app/assets/stylesheets/drg_cms/drg_cms.css +218 -94
  11. data/app/assets/stylesheets/drg_cms/select-multiple.css +1 -1
  12. data/app/controllers/cmsedit_controller.rb +29 -24
  13. data/app/controllers/dc_application_controller.rb +78 -166
  14. data/app/controllers/dc_common_controller.rb +56 -47
  15. data/app/controls/dc_help_control.rb +12 -0
  16. data/app/controls/dc_report.rb +7 -9
  17. data/app/controls/design_element_settings_control.rb +1 -1
  18. data/app/forms/all_options.yml +25 -6
  19. data/app/forms/dc_big_table.yml +0 -2
  20. data/app/forms/dc_big_table_value.yml +0 -2
  21. data/app/forms/dc_design.yml +1 -2
  22. data/app/forms/dc_folder_permission.yml +0 -2
  23. data/app/forms/dc_help_1.yml +2 -1
  24. data/app/forms/dc_json_ld.yml +0 -3
  25. data/app/forms/dc_menu.yml +6 -12
  26. data/app/forms/dc_menu_item.yml +1 -3
  27. data/app/forms/dc_page.yml +5 -2
  28. data/app/forms/dc_policy.yml +2 -5
  29. data/app/forms/dc_poll.yml +10 -16
  30. data/app/forms/dc_seo.yml +1 -2
  31. data/app/forms/dc_simple_menu.yml +1 -2
  32. data/app/forms/dc_site.yml +5 -7
  33. data/app/helpers/cms_common_helper.rb +2 -3
  34. data/app/helpers/cms_edit_helper.rb +41 -31
  35. data/app/helpers/cms_helper.rb +6 -6
  36. data/app/helpers/cms_index_helper.rb +79 -34
  37. data/app/helpers/dc_application_helper.rb +99 -85
  38. data/app/models/concerns/dc_page_concern.rb +3 -2
  39. data/app/models/concerns/dc_piece_concern.rb +1 -1
  40. data/app/models/concerns/dc_site_concern.rb +10 -4
  41. data/app/models/concerns/dc_user_concern.rb +3 -3
  42. data/app/models/dc_big_table.rb +2 -2
  43. data/app/models/dc_filter.rb +28 -22
  44. data/app/models/dc_site.rb +0 -1
  45. data/app/models/dc_temp.rb +7 -0
  46. data/app/models/drgcms_form_fields/comment.rb +11 -2
  47. data/app/models/drgcms_form_fields/date_picker.rb +2 -0
  48. data/app/models/drgcms_form_fields/drgcms_field.rb +2 -1
  49. data/app/models/drgcms_form_fields/embedded.rb +4 -2
  50. data/app/models/drgcms_form_fields/number_field.rb +4 -3
  51. data/app/models/drgcms_form_fields/readonly.rb +13 -17
  52. data/app/models/drgcms_form_fields/select.rb +16 -18
  53. data/app/models/drgcms_form_fields/text_autocomplete.rb +39 -23
  54. data/app/renderers/dc_page_renderer.rb +7 -6
  55. data/app/renderers/dc_poll_renderer.rb +16 -20
  56. data/app/views/cmsedit/_edit_stuff.html.erb +5 -2
  57. data/app/views/cmsedit/_form.html.erb +3 -2
  58. data/app/views/cmsedit/_result.html.erb +21 -18
  59. data/app/views/cmsedit/edit.html.erb +2 -1
  60. data/app/views/cmsedit/index.html.erb +1 -1
  61. data/app/views/cmsedit/new.html.erb +3 -2
  62. data/app/views/dc_common/_help.html.erb +12 -3
  63. data/app/views/layouts/cms.html.erb +3 -5
  64. data/config/locales/drgcms_en.yml +5 -2
  65. data/config/locales/drgcms_sl.yml +5 -2
  66. data/config/locales/models_en.yml +2 -0
  67. data/config/locales/models_sl.yml +5 -3
  68. data/drg_cms.gemspec +16 -16
  69. data/lib/drg_cms/version.rb +1 -1
  70. data/lib/drg_cms.rb +46 -12
  71. metadata +35 -29
@@ -60,9 +60,10 @@ en:
60
60
  login: Login into CMS
61
61
  username: User name
62
62
  password: Password
63
- form_error: Error loading form #{form_name}
63
+ form_error: Error loading form %{form_name}
64
64
  img_large: Click for larger image
65
- no_class: Class %{class} not defined!
65
+ no_class: Class [%{class}] not defined!
66
+ no_method: Method (helper) [%{method}] not defined!
66
67
  img_alt_not_present: All images in body must have alternative text entered
67
68
 
68
69
  toggle_cms: Toggle CMS edit/view mode
@@ -120,6 +121,8 @@ en:
120
121
 
121
122
  dc_help:
122
123
  help: HELP
124
+ fields_button: Data description
125
+ comments_button: Comments
123
126
  title: Manage help documents
124
127
  project: Project
125
128
  lang: Locale
@@ -60,9 +60,10 @@ sl:
60
60
  login: Prijava v CMS
61
61
  username: Uporabnik
62
62
  password: Geslo
63
- form_error: Napaka pri branju forme #{form_name}
63
+ form_error: Napaka pri branju forme %{form_name}
64
64
  img_large: Klik za večjo sliko
65
- no_class: Class %{class} ni definiran!
65
+ no_class: Razred (class) [%{class}] ni definiran!
66
+ no_method: Metoda (helper) [%{method}] ne obstaja!
66
67
  img_alt_not_present: Vse slike v vsebini morajo imeti vpisano nadomestno besedilo
67
68
 
68
69
  toggle_cms: Preklopi med CMS urejanjem in prikazom
@@ -117,6 +118,8 @@ sl:
117
118
 
118
119
  dc_help:
119
120
  help: POMOČ
121
+ fields_button: Opis podatkov
122
+ comments_button: Opombe
120
123
  title: Urejanje dokumentov pomoči
121
124
  project: Projekt
122
125
  lang: Jezik
@@ -302,6 +302,7 @@ en:
302
302
  if_id: CSS id
303
303
  if_class: CSS class
304
304
  _update_menu: Update menu
305
+ div_class: DIV class
305
306
 
306
307
  dc_seo:
307
308
  seo: SEO
@@ -780,6 +781,7 @@ en:
780
781
  if_id: CSS id of IFrame object
781
782
  if_class: CSS class of IFrame object
782
783
  _update_menu: Update link in selected menu to point to this document
784
+ div_class: Class name given to top level div
783
785
 
784
786
  dc_seo:
785
787
  title: SEO optimised page title
@@ -333,7 +333,8 @@ sl:
333
333
  if_id: CSS id
334
334
  if_class: CSS class
335
335
  _update_menu: Spremeni meni
336
-
336
+ div_class: DIV class
337
+
337
338
  dc_seo:
338
339
  seo: SEO
339
340
  title: Naslov za brskalnik
@@ -779,7 +780,6 @@ sl:
779
780
  subject_link: Povezava (link) do sestavka
780
781
  sub_subject: Povzetek, kratek opis vsebine
781
782
  alt_link: Alternativna povezava do sestavka
782
- picture: Slika v povezavi s stranjo
783
783
  gallery: Dokument vsebuje slikovno galerijo.
784
784
  css: CSS
785
785
  script: Skript
@@ -800,7 +800,7 @@ sl:
800
800
  dc_design_id: Dizajn, mu pripada sestavek
801
801
  dc_site_id: Spletišče. ki mu pripada stran
802
802
  kats: Kategorije, ki jim pripada članek
803
- picture: Slika uporabljena za prikaz sestavka
803
+ picture: Slika uporabljena v zvezi s sestavkom
804
804
  dc_poll_id: Anketa, če sestavek vsebuje tudi anketo
805
805
  if_url: URL naslov od koder bo naložena vsebina IFrame-a
806
806
  if_width: Širina IFrame področja
@@ -811,6 +811,7 @@ sl:
811
811
  if_id: CSS id IFrame objekta
812
812
  if_class: CSS class IFrame objekta
813
813
  _update_menu: Popravi tudi povezavo do dokumenta v menuju
814
+ div_class: Class, ki bo določen na vrhnem razdelku (DIV)
814
815
 
815
816
  dc_seo:
816
817
  title: Naslov, ki se izpiše v gornji vrstici brskalnika. Optimiziraj za SEO.
@@ -983,3 +984,4 @@ sl:
983
984
  active: Podatki so aktivni
984
985
  add_schema: Dodaj strukturo
985
986
  add_error: Element %{schema} že obstaja!
987
+
data/drg_cms.gemspec CHANGED
@@ -1,26 +1,26 @@
1
- # Copyright 2012-2016 Damjan Rems
1
+ # Copyright 2012-2021 Damjan Rems
2
2
 
3
- $:.push File.expand_path("../lib", __FILE__)
3
+ $:.push File.expand_path('../lib', __FILE__)
4
4
 
5
- # Maintain your gem's version:
6
- require "drg_cms/version"
5
+ # Maintain gem's version:
6
+ require 'drg_cms/version'
7
7
 
8
- # Describe your gem and declare its dependencies:
8
+ # Describe gem and declare its dependencies:
9
9
  Gem::Specification.new do |s|
10
- s.name = "drg_cms"
10
+ s.name = 'drg_cms'
11
11
  s.version = DrgCms::VERSION
12
- s.authors = ["Damjan Rems"]
13
- s.email = ["damjan.rems@gmail.com"]
14
- s.homepage = "http://www.drgcms.org"
15
- s.summary = "DRG: Rapid web application development tool and CMS for Ruby, Rails and MongoDB"
16
- s.description = "DRG, development tool for rapid building of in-house (Intranet, private cloud) applications as well as CMS for creating complex, data-entry intensive web sites."
17
- s.license = "MIT"
18
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md", "History.log", "drg_cms.gemspec"]
19
- s.test_files = Dir["test/**/*"]
12
+ s.authors = ['Damjan Rems']
13
+ s.email = ['damjan.rems@gmail.com']
14
+ s.homepage = 'https://www.drgcms.org'
15
+ s.summary = 'DRG: Rapid web application development tool and CMS for Ruby, Rails and MongoDB'
16
+ s.description = 'DRG, development tool for rapid building of in-house (Intranet, private cloud) applications as well as CMS for creating complex, data-entry intensive web sites.'
17
+ s.license = 'MIT'
18
+ s.files = Dir['{app,config,db,lib}/**/*'] + %w[MIT-LICENSE Rakefile README.md History.log drg_cms.gemspec]
19
+ s.test_files = Dir['test/**/*']
20
20
 
21
- s.required_ruby_version = '>= 2.5'
21
+ s.required_ruby_version = '>= 2.7'
22
22
 
23
- s.add_dependency 'rails', '~> 6'
23
+ s.add_dependency 'rails', '~> 6.1'
24
24
  s.add_dependency 'jquery-rails'
25
25
  s.add_dependency 'jquery-ui-rails'
26
26
  s.add_dependency 'non-stupid-digest-assets'
@@ -23,5 +23,5 @@
23
23
 
24
24
  # drg_cms gem version
25
25
  module DrgCms #:nodoc:
26
- VERSION = '0.6.1.0'.freeze
26
+ VERSION = '0.6.1.6'.freeze
27
27
  end
data/lib/drg_cms.rb CHANGED
@@ -140,12 +140,8 @@ end
140
140
  def self.model_check(document, crash = false)
141
141
  return nil unless document.errors.any?
142
142
 
143
- msg = ""
144
- document.errors.each do |attribute, errors_array|
145
- msg << "#{attribute}: #{errors_array}\n"
146
- end
147
- #
148
- if crash and msg.size > 0
143
+ msg = document.errors.inject('') { |r, error| r << "#{error.attribute}: #{error.message}\n" }
144
+ if crash && msg.size > 0
149
145
  msg = "Validation errors in #{document.class}:\n" + msg
150
146
  pp msg
151
147
  Rails.logger.error(msg)
@@ -154,6 +150,15 @@ def self.model_check(document, crash = false)
154
150
  msg
155
151
  end
156
152
 
153
+ ########################################################################
154
+ # Determines if redis cache store is active
155
+ #
156
+ # @return [Boolean] : True if redis cache store is active
157
+ ########################################################################
158
+ def self.redis_cache_store?
159
+ (Rails.application.config.cache_store.first == :redis_cache_store) rescue false
160
+ end
161
+
157
162
  ####################################################################
158
163
  # Clear cache. If key is specified only this key will be deleted.
159
164
  #
@@ -162,17 +167,48 @@ end
162
167
  def self.cache_clear(key = nil)
163
168
  return Rails.cache.clear if key.nil?
164
169
 
165
- if ((Rails.application.config.cache_store.first == :redis_cache_store) rescue false)
170
+ if redis_cache_store?
166
171
  Rails.cache.redis.del(key)
167
172
  else
168
173
  Rails.cache.delete_matched("#{key}*")
169
174
  end
170
175
  end
171
176
 
172
- def self.__cache_clear(key = nil)
173
- return Rails.cache.clear if key.nil?
177
+ ####################################################################
178
+ # Read from cache
179
+ #
180
+ # @keys [Array] Array of keys
181
+ #
182
+ # @return [Object] Data returned from cache
183
+ ####################################################################
184
+ def self.cache_read(keys)
185
+ if redis_cache_store?
186
+ keys = keys.dup
187
+ first = keys.shift
188
+ data = Rails.cache.redis.hget(first, keys.join(''))
189
+ data ? Marshal.load(data) : nil
190
+ else
191
+ Rails.cache.read(keys.join(''))
192
+ end
193
+ end
174
194
 
175
- Rails.cache.delete_matched("#{key}*")
195
+ ####################################################################
196
+ # Write data to cache
197
+ #
198
+ # @param [Array] keys : array of keys
199
+ # @param [Object] data : Document object
200
+ #
201
+ # @return [Object] data so dc_cache_write can be used as last statement in method.
202
+ ####################################################################
203
+ def self.cache_write(keys, data)
204
+ if redis_cache_store?
205
+ keys = keys.dup
206
+ first = keys.shift
207
+ Rails.cache.redis.hset(first, keys.join(''), Marshal.dump(data))
208
+ else
209
+ Rails.cache.write(keys.join(''), data)
210
+ end
211
+ data
176
212
  end
177
213
 
178
214
  ###############################################################################
@@ -205,5 +241,3 @@ def self.routes
205
241
  end
206
242
 
207
243
  end
208
-
209
- DrgCms.add_patches_path(File.dirname(__FILE__) + '../app/models/drgcms_form_fields/patches')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drg_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.0
4
+ version: 0.6.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damjan Rems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-20 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '6'
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '6'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jquery-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +163,12 @@ files:
163
163
  - MIT-LICENSE
164
164
  - README.md
165
165
  - Rakefile
166
+ - app/assets/fonts/ibm-plex-sans-300.woff2
167
+ - app/assets/fonts/ibm-plex-sans-400.woff2
168
+ - app/assets/fonts/ibm-plex-sans-500.woff2
169
+ - app/assets/fonts/ibm-plex-sans-600.woff2
170
+ - app/assets/fonts/ibm-plex-sans-700.woff2
171
+ - app/assets/fonts/ibm-plex-sans-italic.woff2
166
172
  - app/assets/images/32px.png
167
173
  - app/assets/images/drg_cms/32px.png
168
174
  - app/assets/images/drg_cms/40px.png
@@ -425,7 +431,7 @@ files:
425
431
  - test/dummy/script/rails
426
432
  - test/integration/navigation_test.rb
427
433
  - test/lib/generators/new_drg_form_generator_test.rb
428
- homepage: http://www.drgcms.org
434
+ homepage: https://www.drgcms.org
429
435
  licenses:
430
436
  - MIT
431
437
  metadata: {}
@@ -437,47 +443,47 @@ required_ruby_version: !ruby/object:Gem::Requirement
437
443
  requirements:
438
444
  - - ">="
439
445
  - !ruby/object:Gem::Version
440
- version: '2.5'
446
+ version: '2.7'
441
447
  required_rubygems_version: !ruby/object:Gem::Requirement
442
448
  requirements:
443
449
  - - ">="
444
450
  - !ruby/object:Gem::Version
445
451
  version: '0'
446
452
  requirements: []
447
- rubygems_version: 3.1.2
453
+ rubygems_version: 3.2.22
448
454
  signing_key:
449
455
  specification_version: 4
450
456
  summary: 'DRG: Rapid web application development tool and CMS for Ruby, Rails and
451
457
  MongoDB'
452
458
  test_files:
453
459
  - test/drg_cms_test.rb
454
- - test/integration/navigation_test.rb
455
- - test/lib/generators/new_drg_form_generator_test.rb
456
- - test/dummy/script/rails
457
460
  - test/dummy/README.rdoc
458
- - test/dummy/app/views/layouts/application.html.erb
459
- - test/dummy/app/helpers/application_helper.rb
460
- - test/dummy/app/controllers/application_controller.rb
461
- - test/dummy/app/assets/stylesheets/application.css
462
- - test/dummy/app/assets/javascripts/application.js
463
- - test/dummy/public/422.html
464
- - test/dummy/public/404.html
465
- - test/dummy/public/favicon.ico
466
- - test/dummy/public/500.html
467
461
  - test/dummy/Rakefile
468
- - test/dummy/config.ru
469
- - test/dummy/config/environment.rb
470
- - test/dummy/config/boot.rb
471
- - test/dummy/config/routes.rb
462
+ - test/dummy/app/assets/javascripts/application.js
463
+ - test/dummy/app/assets/stylesheets/application.css
464
+ - test/dummy/app/controllers/application_controller.rb
465
+ - test/dummy/app/helpers/application_helper.rb
466
+ - test/dummy/app/views/layouts/application.html.erb
472
467
  - test/dummy/config/application.rb
468
+ - test/dummy/config/boot.rb
473
469
  - test/dummy/config/database.yml
474
- - test/dummy/config/environments/test.rb
475
- - test/dummy/config/environments/production.rb
470
+ - test/dummy/config/environment.rb
476
471
  - test/dummy/config/environments/development.rb
477
- - test/dummy/config/locales/en.yml
478
- - test/dummy/config/initializers/secret_token.rb
472
+ - test/dummy/config/environments/production.rb
473
+ - test/dummy/config/environments/test.rb
474
+ - test/dummy/config/initializers/backtrace_silencers.rb
479
475
  - test/dummy/config/initializers/inflections.rb
480
476
  - test/dummy/config/initializers/mime_types.rb
481
- - test/dummy/config/initializers/backtrace_silencers.rb
482
- - test/dummy/config/initializers/wrap_parameters.rb
477
+ - test/dummy/config/initializers/secret_token.rb
483
478
  - test/dummy/config/initializers/session_store.rb
479
+ - test/dummy/config/initializers/wrap_parameters.rb
480
+ - test/dummy/config/locales/en.yml
481
+ - test/dummy/config/routes.rb
482
+ - test/dummy/config.ru
483
+ - test/dummy/public/404.html
484
+ - test/dummy/public/422.html
485
+ - test/dummy/public/500.html
486
+ - test/dummy/public/favicon.ico
487
+ - test/dummy/script/rails
488
+ - test/integration/navigation_test.rb
489
+ - test/lib/generators/new_drg_form_generator_test.rb