drg_cms 0.6.1.6 → 0.6.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +203 -24
  3. data/app/assets/javascripts/drg_cms/drg_cms.js +183 -95
  4. data/app/assets/stylesheets/drg_cms/drg_cms.css +542 -509
  5. data/app/assets/stylesheets/drg_cms_application.css +1 -1
  6. data/app/assets/stylesheets/drg_cms_cms.css +1 -4
  7. data/app/controllers/cmsedit_controller.rb +25 -103
  8. data/app/controllers/dc_common_controller.rb +6 -5
  9. data/app/controls/browse_models_control.rb +15 -26
  10. data/app/controls/cmsedit_control.rb +125 -0
  11. data/app/controls/dc_help_control.rb +1 -1
  12. data/app/controls/dc_page_control.rb +0 -1
  13. data/app/controls/dc_poll_result_control.rb +1 -1
  14. data/app/controls/dc_report.rb +1 -1
  15. data/app/forms/all_options.yml +1 -1
  16. data/app/forms/cms_menu.yml +24 -24
  17. data/app/forms/dc_browse_fields.yml +13 -9
  18. data/app/forms/dc_poll_result_export.yml +1 -1
  19. data/app/helpers/cms_common_helper.rb +7 -5
  20. data/app/helpers/cms_edit_helper.rb +52 -45
  21. data/app/helpers/cms_helper.rb +76 -40
  22. data/app/helpers/cms_index_helper.rb +180 -139
  23. data/app/helpers/dc_application_helper.rb +37 -43
  24. data/app/models/concerns/dc_page_concern.rb +1 -1
  25. data/app/models/dc_filter.rb +30 -22
  26. data/app/models/dc_json_ld.rb +1 -1
  27. data/app/models/dc_part.rb +19 -9
  28. data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
  29. data/app/models/drgcms_form_fields/link_to.rb +1 -1
  30. data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
  31. data/app/models/drgcms_form_fields/readonly.rb +3 -0
  32. data/app/models/drgcms_form_fields/select.rb +8 -7
  33. data/app/models/drgcms_form_fields/text_autocomplete.rb +2 -2
  34. data/app/renderers/dc_part_renderer.rb +1 -1
  35. data/app/renderers/dc_poll_renderer.rb +1 -1
  36. data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
  37. data/app/views/cmsedit/login.html.erb +1 -1
  38. data/app/views/dc_common/paste_clipboard.html.erb +1 -1
  39. data/config/locales/drgcms_en.yml +2 -1
  40. data/config/locales/drgcms_sl.yml +2 -1
  41. data/config/locales/kaminari.yml +1 -1
  42. data/drg_cms.gemspec +1 -1
  43. data/lib/drg_cms/version.rb +1 -1
  44. data/lib/drg_cms.rb +4 -4
  45. metadata +4 -5
  46. data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
  47. data/app/views/cmsedit/__show.html.erb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ffde8dc003d78a30e69a2a1f45530841829c5b66d247e7bcece0d3c94a1a15
4
- data.tar.gz: 3e1c6a0762f22cce3500de3c4ee0e2258c25f6f39a2aa3dc82f3febd15535449
3
+ metadata.gz: 83e7b1464f53b988b2bbfb9b9b4069bea725c33bcbe5d8a107293696059742f8
4
+ data.tar.gz: e969b7a61d4b837fecc35f476d72c1f421a54dd86cee95e646a299c320f9298e
5
5
  SHA512:
6
- metadata.gz: 562e2196260eefc0999249e1c0e871cda94b7fd2d303482d39314ec2eb6ae5ae4b32545b8a85c4434a28042d9c2c8b9f2c9dc0a1b1be3a0ec49d20cddece7aef
7
- data.tar.gz: 03d0849a4040d4b99cf4b8c3b682e77b6c333ad562453700703b49a18d408d2e88555777051cf0b8f61d059ce4bf7e9f1670104f3e3ad786ea226c69c7217c08
6
+ metadata.gz: c2d0ecc9d8ec2a18a03f14dee87e62f4b51d12a653de943c67a3ddfa6ad578679e3511b3f89b86a9c2c75509e59f230dde4e0946049c3567e087a193d59e02c3
7
+ data.tar.gz: 444d5c7f43362cf4466979d47ce3bbb9cd2afa74702a94d10d08947b34d8cf6a533e0f555cc3d734f38a7060b544cd899ad4cffce235957623e2bcc680e07b65
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