drg_cms 0.6.1.5 → 0.6.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +203 -24
  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 +253 -106
  10. data/app/assets/stylesheets/drg_cms/drg_cms.css +670 -521
  11. data/app/assets/stylesheets/drg_cms_application.css +1 -1
  12. data/app/assets/stylesheets/drg_cms_cms.css +1 -4
  13. data/app/controllers/cmsedit_controller.rb +33 -211
  14. data/app/controllers/dc_application_controller.rb +98 -22
  15. data/app/controllers/dc_common_controller.rb +9 -22
  16. data/app/controls/browse_models_control.rb +18 -27
  17. data/app/controls/cmsedit_control.rb +129 -0
  18. data/app/controls/dc_help_control.rb +1 -1
  19. data/app/controls/dc_page_control.rb +0 -1
  20. data/app/controls/dc_poll_result_control.rb +1 -1
  21. data/app/controls/dc_report.rb +2 -2
  22. data/app/controls/design_element_settings_control.rb +1 -1
  23. data/app/forms/all_options.yml +25 -7
  24. data/app/forms/cms_menu.yml +24 -24
  25. data/app/forms/dc_browse_fields.yml +13 -9
  26. data/app/forms/dc_browse_models.yml +24 -2
  27. data/app/forms/dc_poll_result_export.yml +1 -1
  28. data/app/forms/dc_site.yml +2 -5
  29. data/app/forms/dc_steps_template.yml +51 -0
  30. data/app/helpers/cms_common_helper.rb +73 -6
  31. data/app/helpers/cms_edit_helper.rb +275 -159
  32. data/app/helpers/cms_helper.rb +152 -59
  33. data/app/helpers/cms_index_helper.rb +220 -172
  34. data/app/helpers/dc_application_helper.rb +40 -67
  35. data/app/models/concerns/dc_page_concern.rb +1 -1
  36. data/app/models/concerns/dc_site_concern.rb +9 -3
  37. data/app/models/dc_filter.rb +30 -22
  38. data/app/models/dc_journal.rb +2 -2
  39. data/app/models/dc_json_ld.rb +19 -42
  40. data/app/models/dc_part.rb +19 -9
  41. data/app/models/dc_site.rb +0 -1
  42. data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
  43. data/app/models/drgcms_form_fields/link_to.rb +1 -1
  44. data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
  45. data/app/models/drgcms_form_fields/readonly.rb +4 -1
  46. data/app/models/drgcms_form_fields/select.rb +10 -9
  47. data/app/models/drgcms_form_fields/text_autocomplete.rb +20 -12
  48. data/app/models/drgcms_form_fields/text_with_select.rb +1 -0
  49. data/app/renderers/dc_common_renderer.rb +20 -3
  50. data/app/renderers/dc_part_renderer.rb +1 -1
  51. data/app/renderers/dc_poll_renderer.rb +1 -1
  52. data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
  53. data/app/views/cmsedit/_form.html.erb +19 -12
  54. data/app/views/cmsedit/edit.html.erb +10 -6
  55. data/app/views/cmsedit/index.html.erb +5 -3
  56. data/app/views/cmsedit/login.html.erb +1 -1
  57. data/app/views/cmsedit/new.html.erb +9 -5
  58. data/app/views/dc_common/_help.html.erb +1 -0
  59. data/app/views/dc_common/paste_clipboard.html.erb +1 -1
  60. data/app/views/layouts/cms.html.erb +3 -5
  61. data/config/locales/drgcms_en.yml +7 -1
  62. data/config/locales/drgcms_sl.yml +7 -1
  63. data/config/locales/kaminari.yml +1 -1
  64. data/drg_cms.gemspec +2 -2
  65. data/lib/drg_cms/version.rb +1 -1
  66. data/lib/drg_cms.rb +4 -4
  67. metadata +16 -10
  68. data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
  69. data/app/views/cmsedit/__show.html.erb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be7dfed0ede6cbd81a93dbefbd517a2cb3d31151339a1bd3598ebde7e76993e9
4
- data.tar.gz: d028640f11c1877e4f6eb4efe44f8fdd9306047678b9d731daeab3e56fb32749
3
+ metadata.gz: 8dc5db773399698216bce4e41936d84f3e4780c1ac1a23497b755d9ddfce1102
4
+ data.tar.gz: aba467dab232ba47b20b1e00dcdc746aa9568521b8d756137c4dab40b255f795
5
5
  SHA512:
6
- metadata.gz: 2f5617503a1c85ce1b5bf2a9d3460a33525ba96e20a82a84b85e7adc6f370a576f97b2e76aa57ff424243958046b396e0c4c2a3529a8ba0f763ef43cbe92f450
7
- data.tar.gz: 9e716e8fca1ae6330bd74139512fb952d88600ca42d8cd4c5690e8271fb9a50b3e624e72fbcdc7df5ee820a4cd466fc8c6c2b1f5c58b5b9261afb1d076905237
6
+ metadata.gz: 00c2289971583654147c8d7df3e2c1fcac20845f40381a631f290c888867db86b160910bb7643c5c54c749c671b7751de010cf53c16154a40d9be32c549eb761
7
+ data.tar.gz: c79254feaa595bb5fad752aaf943d327fa475d64b9e832bc5555d76388b4c25a286ac6f4ef1fa3acc65e122fc532ed09291a15e6623d96c80420282fca5480b5
data/README.md CHANGED
@@ -1,38 +1,217 @@
1
- # DrgCms
2
-
3
- DRG CMS is advanced way of programming application for Ruby on Rails.
4
- Instead of creating controllers and views for each collection (table),
5
- DRG CMS introduces single Cmsedit controller. All CRUD database actions are
6
- controlled by DRG Forms file, which can have hundreds of data entry fields
7
- and still be easy to maintain and update.
8
-
9
- DRG CMS uses MongoDB, leading NO-SQL document database, as database back-end
10
- with a help of mongoid gem. Mongoid's flexible document model defines all
11
- document fields, indexes, dependencies, validations in single model source file with
12
- no Rails migrations required. When collection model is defined, data entry DRG Form
13
- can easily be generated with form generator.
14
-
15
- DRG CMS can be used for rapid development of complex, data-entry intensive web
16
- sites as well as building your private, in-house, Intranet applications. At
17
- the same time it can be used as CMS system with support for running
18
- multiple web sites on single Ruby on Rails instance.
19
-
1
+ # drg-cms
2
+
3
+ [![Gem Version](http://img.shields.io/gem/v/drg_cms.svg)](https://rubygems.org/gems/drg_cms)
4
+ [![Gem Downloads](https://img.shields.io/gem/dt/drg_cms.svg)](https://rubygems.org/gems/drg_cms)
5
+
6
+
7
+ DRG CMS simplifies the programming of business applications.
8
+ Minimal database experience and only basic programming skills are needed
9
+ to create a data entry program. You can do it in 6 simple steps.
10
+
11
+ Step 1: Create Model<br>
12
+ Step 2: Generate Form<br>
13
+ Step 3: Edit Form<br>
14
+ Step 4: Define Labels and Help Text<br>
15
+ Step 5: Create Controls File (if required)<br>
16
+ Step 6: Include in application menu<br>
17
+
18
+ Most of the time, you will end up with two source files.
19
+
20
+ <b>Model:</b> Model file is a database document definition file written in Ruby
21
+ language. Model file holds fields definitions,
22
+ index definitions, dependencies, validations, callbacks and transformations
23
+ for a database document (record).
24
+
25
+ An example of a typical model file app/models/note.rb
26
+
27
+ ```ruby
28
+ class Note
29
+ include Mongoid::Document
30
+ include Mongoid::Timestamps
31
+
32
+ field :title, type: String
33
+ field :body, type: String
34
+ field :time_begin, type: DateTime
35
+ field :duration, type: Integer
36
+ field :search, type: String
37
+
38
+ field :user_id, type: BSON::ObjectId
39
+
40
+ index user_id: 1
41
+
42
+ validates :title, presence: true
43
+ validates :time_begin, presence: true
44
+ validates :duration, presence: true
45
+
46
+ end
47
+ ```
48
+
49
+ <b>Form:</b> Form file is a text file, written in the YAML markup language. It consists
50
+ of three main parts.<br>
51
+
52
+ <b>index:</b> Which defines actions usually performed on database documents or
53
+ set of document.<br>
54
+ <b>result_set:</b> Defines set of documents, document fields and actions
55
+ which can be performed on a document.<br>
56
+ <b>form:</b> Defines data entry fields for editing and viewing the document.<br>
57
+
58
+ Example of form file for Note model app/forms/note.yaml
59
+
60
+ ```yaml
61
+ table: note
62
+
63
+ index:
64
+ filter: search as text_field
65
+ actions: standard
66
+
67
+ result_set:
68
+ filter: current_users_documents
69
+ actions:
70
+ 1: edit
71
+
72
+ columns:
73
+ 10:
74
+ name: title
75
+ width: 25%
76
+ 20:
77
+ name: time_started
78
+ width: 10%
79
+ format: '%d.%m.%Y'
80
+ 30:
81
+ name: duration
82
+
83
+ form:
84
+ fields:
85
+ 10:
86
+ name: user_id
87
+ type: readonly
88
+ eval: dc_name4_id,dc_user,name
89
+ default:
90
+ eval: 'session[:user_id]'
91
+ 20:
92
+ name: title
93
+ type: text_field
94
+ size: 50
95
+ 30:
96
+ name: time_started
97
+ type: datetime_picker
98
+ options:
99
+ step: 15
100
+ 40:
101
+ name: duration
102
+ type: select
103
+ 50:
104
+ name: body
105
+ type: html_field
106
+ options: "height: 500"
107
+ ```
108
+
109
+ Add labels and help text to your project locales files.
110
+ ```yaml
111
+ en:
112
+ helpers:
113
+ label:
114
+ diary:
115
+ tabletitle: Diary
116
+ choices4_duration: "10 min:10,15 min:15,20 min:20,30 min:30,45 min:45,1 hour:60,1 hour 30 min:90,2 hours:120,2 hours 30 min:150,3 hours:180,4 hours:240,5 hours:300,6 hours:360,7 hours:420,8 hours:480"
117
+
118
+ title: Title
119
+ body: Description
120
+ time_started: Start time
121
+ duration: Duration
122
+ search: Search
123
+ user_id: Owner
124
+
125
+ help:
126
+ diary:
127
+ title: Short title
128
+ body: Description of event or note
129
+ time_started: Time or date when note is created or event started
130
+ duration: Duration of event
131
+ search: Data used for searching data
132
+ user_id: Owner of the note
133
+ ```
134
+ Combination of two source files and localisation data makes application
135
+ data entry program. Application data entry program implements all data
136
+ entry operations on a database:<br>
137
+ <li>add new document<br>
138
+ <li>edit document<br>
139
+ <li>delete document<br>
140
+ <li>view document
141
+ <br><br>Add it into your application menu with this code:
142
+
143
+ ```ruby
144
+ dc_link_to('Notes', 'book', { table: 'note' }, target: 'iframe_edit')
145
+ ```
146
+
147
+ And when you need advanced program logic, you will implement it in
148
+ the control file. Control files code is injected into cmsedit
149
+ controller during form load, and provides additional program logic required
150
+ by data entry program.
151
+ ```ruby
152
+ ######################################################################
153
+ # Drgcms controls for Notes application
154
+ ######################################################################
155
+ module NoteControl
156
+
157
+ ######################################################################
158
+ # Fill in currently logged user on new record action.
159
+ ######################################################################
160
+ def dc_new_record
161
+ @record.user_id = session[:user_id]
162
+ @record.time_started = Time.now.localtime
163
+ end
164
+
165
+ ###########################################################################
166
+ # Allow only current user documents to be displayed
167
+ ###########################################################################
168
+ def current_user_documents
169
+ user_filter_options(Note).and(user_id: session[:user_id]).order_by(id: -1)
170
+ end
171
+
172
+ end
173
+ ```
174
+
175
+ ## Features
176
+ DRG CMS uses Ruby on Rails, one of the most popular frameworks for
177
+ building web sites. Ruby on Rails guarantees highest level of application security and huge base of extensions which will help you when your application grows.
178
+ <br><br>
179
+ DRG CMS uses MongoDB, leading NO-SQL document database, as database
180
+ back-end with a help of mongoid gem. Mongoid's flexible document model
181
+ defines all document fields, indexes, dependencies, validations in a
182
+ single model file with no database migrations required.
183
+ <br><br>
20
184
  DRG CMS has built-in user friendly role based database access system. Administrator
21
185
  defines roles and roles rights (no access, can read, can edit) as web site policies.
22
- Roles are then assigned to users and policies can be assigned to documents (web pages)
23
- or even parts of a document.
186
+ Roles are then assigned to users and policies can be assigned to documents (web pages)
187
+ or even parts of a documents.
188
+ <br><br>
189
+ DRG CMS can coexist with other frameworks which use MongoDB as database
190
+ back-end. Use your favorite framework for data presentation and
191
+ use DRG Forms for rapid development of data entry forms.
192
+ <br><br>
193
+ DRG CMS can coexist with other databases and Rails controllers. I can
194
+ highly recommend using DRG CMS in heterogeneous database Intranet
195
+ projects. For the last few years, DRG has been used for development of
196
+ an in-house Intranet portal which uses MongoDB as primary database and
197
+ connects frequently to Oracle and MS-SQL databases.
198
+
199
+ ## Installation
200
+
201
+ Go and [jumpstart](https://github.com/drgcms/drg-portal-jumpstart)
202
+ internal portal application with DRG CMS in just few minutes.
24
203
 
25
204
  Project Tracking
26
205
  ----------------
27
206
 
28
- * [DrgCms Website and Documentation](http://www.drgcms.org)
207
+ * [Visit DRG CMS web site](http://www.drgcms.org)
29
208
 
30
209
  Compatibility
31
210
  -------------
32
211
 
33
212
  DRG CMS is being actively developed since 2012 and has been live tested in production
34
213
  since beginning. It runs against latest technology Ruby (3.0), Rails (6.1)
35
- and MongoDB (4.4) and had so far little or no problems advancing to latest versions
214
+ and MongoDB (5.0) and had so far little or no problems advancing to latest versions
36
215
  of required programs.
37
216
 
38
217
  Documentation
@@ -44,7 +223,7 @@ Please see the DRG CMS website for up-to-date documentation:
44
223
  License (MIT LICENCE)
45
224
  ---------------------
46
225
 
47
- Copyright (c) 2012-2021 Damjan Rems
226
+ Copyright (c) 2012-2022 Damjan Rems
48
227
 
49
228
  Permission is hereby granted, free of charge, to any person obtaining
50
229
  a copy of this software and associated documentation files (the