drg_cms 0.6.1.11 → 0.7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +260 -0
- data/MIT-LICENSE +1 -1
- data/README.md +9 -5
- data/app/assets/javascripts/drg_cms/drg_cms.js +35 -19
- data/app/assets/javascripts/drg_cms_application.js +0 -2
- data/app/assets/javascripts/drg_cms_cms.js +2 -3
- data/app/assets/stylesheets/drg_cms/jstree.css +32 -27
- data/app/assets/stylesheets/drg_cms/select-multiple.css +4 -2
- data/app/controllers/dc_application_controller.rb +3 -2
- data/app/controllers/dc_common_controller.rb +7 -7
- data/app/controls/dc_category_control.rb +61 -0
- data/app/forms/cms_menu.yml +3 -2
- data/app/forms/dc_category.yml +17 -8
- data/app/forms/dc_category_as_tree.yml +31 -0
- data/app/forms/help/dc_category_as_tree.en +4 -0
- data/app/forms/help/dc_category_as_tree.sl +5 -0
- data/app/helpers/cms_edit_helper.rb +2 -2
- data/app/helpers/dc_application_helper.rb +31 -49
- data/app/helpers/dc_category_helper.rb +129 -0
- data/app/models/dc_category.rb +50 -24
- data/app/models/drgcms_form_fields/date_picker.rb +10 -12
- data/app/models/drgcms_form_fields/datetime_picker.rb +10 -11
- data/app/models/drgcms_form_fields/drgcms_field.rb +46 -4
- data/app/models/drgcms_form_fields/tree_select.rb +20 -19
- data/app/views/layouts/content.html.erb +1 -1
- data/config/locales/drgcms_en.yml +2 -0
- data/config/locales/drgcms_sl.yml +2 -0
- data/drg_cms.gemspec +2 -2
- data/lib/drg_cms/version.rb +1 -1
- data/lib/tasks/dc_cleanup.rake +20 -42
- metadata +12 -7
- data/History.log +0 -109
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02d39a65170a68812cc184efecaa6e53f0b0360c4133311e463a1e213005bda1
|
4
|
+
data.tar.gz: 334d0446b894f7063a503fbb1dcb8fb69b54c128ea7ac8f21da941205a808da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 613591551d270da4a2ac32e6b9215d1985b50f209231a9c6d00ddedae95775a08386c7d89fffe5fd536d440b58e69d53659a653925c486e5e5c0c273902e3644
|
7
|
+
data.tar.gz: 979c3b634d3a1ed71e7e0dab7f1aff20bc4ccd34df5f2695f05855beb833c3f716b342893ac638096d2fb5419dc87649751ebb85b8ca1905fe53c053af104284
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,260 @@
|
|
1
|
+
See [GitHub Releases](https://github.com/drgcms/drg-cms/releases) for all future releases
|
2
|
+
|
3
|
+
## Changes
|
4
|
+
|
5
|
+
## [0.7.0.2] - october 2022
|
6
|
+
### New features
|
7
|
+
- mongoid 8 gem and MongoDB 6.0 are tested and used in production
|
8
|
+
- jquery 3 enabled in cms editor window
|
9
|
+
- local caching results of dc_user_can_view method gains huge speedups. Especially on huge menus
|
10
|
+
- categories can now be edited in a tree view. Example of usage of type: method option in result_set
|
11
|
+
|
12
|
+
## Bugs resolved:
|
13
|
+
- redirect_to method requires **allow_other_host: true** option when redirecting to other host. Requirement of Rails 7
|
14
|
+
- options option for configuring form elements, which are created from javascript objects, are now properly parsed when set as json or yaml parameters
|
15
|
+
|
16
|
+
## [0.6.1.11] - june 2022
|
17
|
+
### New features
|
18
|
+
- DRG CMS is tested and running against Ruby 3.1 and Rails 7 in production
|
19
|
+
- enable wizard like form. Wizard forms extend other forms and select fields to be processed step by step. It paints steps panel on the left side of the form and add next and previous action buttons to top of form. Document processing and saving must be done in control file
|
20
|
+
- ensure help button is displayed on the form only when there is a help text available
|
21
|
+
- attribute data-validate html option added. When set to true HTML5 form validations will be ignored on action button clicked. When you have close button on dialog, and you can not close it, because form validations must be met
|
22
|
+
- when check is used to select documents for processing only document ids are send as parameters. Before that they were send as 'check-id'
|
23
|
+
- standard fields like created_by, created_at, active, updated_at, updated_by no longer need to be localized for each model
|
24
|
+
- google analytics GA4 support added
|
25
|
+
- text_with_select and hidden_field DRG Form fields now trigger change event, when the value is changed
|
26
|
+
- simplify display of footer record in documents browser. It can now be of Array type. Array columns are in same order as fields defined on form
|
27
|
+
- model may now define set_history method, which will be called on standard CRUD operations. The idea is to save some extra data in the set history method, which can be later used for revision.
|
28
|
+
- html_field (ck_editor) value is now saved to parameters on ajax action.
|
29
|
+
|
30
|
+
## Bugs resolved:
|
31
|
+
- in some cases journal of current document was not displayed properly
|
32
|
+
|
33
|
+
## [0.6.1.9] - march 2022
|
34
|
+
### New features
|
35
|
+
The biggest new feature in this version is trying to match application design to Material design recommendations and replacing the FontAwesome icon fonts with Material design icon set.
|
36
|
+
|
37
|
+
Other features:
|
38
|
+
- form_name and table parameters can be replaced by f and t parameter. This will shorten URL's in menus.
|
39
|
+
- new action **type: popup** is added to available actions. This action will load the form into a popup window. Other options are the same as for window or link type.
|
40
|
+
- column (field) in result set can now be painted from Rails helper method and not only from method defined in model
|
41
|
+
|
42
|
+
## [0.6.1.5] - december 2021
|
43
|
+
### New features
|
44
|
+
- process_ajax_result function has two new options. **parenturl** will change URL on parent dialog and **popup_url** which will popup window and load url address into it
|
45
|
+
- application locale setting can finally be set by url. Put **&locale=en** into url and all subsequently calls to application will be english localized. To reset to default locale just pass empty **&locale=** parameter
|
46
|
+
- comment DRG Form field type has now html option which will add html attributes to comment text
|
47
|
+
- result_set data can now be drawn by custom method with new option **type:**. Option defines type of element which will be used for painting result_set data.<br>
|
48
|
+
**type: default** or omitted. The default (cms_edit/index) painting is used.<br>
|
49
|
+
**type: method**; supports one additional option<br>
|
50
|
+
**eval: my_method_name**; will call (helper) method my_method_name and use its return to paint result_set dialog
|
51
|
+
|
52
|
+
## [0.6.1.4] - september 2021
|
53
|
+
### New features
|
54
|
+
- requirements updated to Rails 6.1 and Ruby 2.7
|
55
|
+
- enable Redis caching for fundamental collections. Permissions, site, page and design collections documents. Documents from these collections are usually read on every page load
|
56
|
+
- document history (journal) shortcut is added to document info icon
|
57
|
+
- embedded documents are now automatically resized to content height
|
58
|
+
- help system manager is ready and is located CMS advanced menu. Every DRG Form can have it's help file in help directory. Help dialog can be called from icon in form dialog title
|
59
|
+
- form name added as id to form dialog, so fields on a form can be selected according to form name
|
60
|
+
- process_json_request has new focus option, which will transfer focus to defined field on ajax call return
|
61
|
+
- readonly form can have embedded form which are not readonly. By default readonly embedded forms are also readonly. Readonly form can also have specific actions available. Again by default actions (except back) are not available on readonly forms
|
62
|
+
- check option is added to result set actions. This enables selection of documents and processing selected documents with ajax index action
|
63
|
+
- more user friendly mobile experience
|
64
|
+
|
65
|
+
## [0.6.0.8] - december 2020
|
66
|
+
### New features
|
67
|
+
- form field can also be defined as mongoid model method, not just fields defined in mongoid model (which is basically equal)
|
68
|
+
- result column value can be obtained by method defined in a mongoid model
|
69
|
+
- permissions can now be namespaced. In your application you may start all collection names with same first 3 characters and define eg. dc_* permission, which will set permissions for all collections with name starting with dc_.
|
70
|
+
- dc_temp collection has new order field so result can be ordered
|
71
|
+
- embedded DRG Form field has now three options for load. default loads embedded form on form load, always loads (refreshes) embedded form each time parent tab is clicked and delay which loads embedded form when parent tab is selected for the first time
|
72
|
+
- close action added to form edit options. It will call window.close() javascript code. Can be used when window was opened with window action type
|
73
|
+
- new DRG Forms field type method defined. Will call any method and display returned HTML code
|
74
|
+
- form dialog name can now be set dynamically
|
75
|
+
- dc_format_value won't output 0 if 'z' is present in format parameter.
|
76
|
+
- line: top and line: bottom parameters will paint horizontal line on a form
|
77
|
+
- reports made easy with help of prawn gem. Reports are treated like controls and consist of form for selecting data and displaying result, printing report and exporting to spreadsheet
|
78
|
+
- form fields have got default option which can also be evaluated (eg. Time.now)
|
79
|
+
- polls can now have javascript code defined. Radio buttons added to polls.
|
80
|
+
- by default result browser can be sorted by any column (field) defined in result_set options. Default can be disabled by adding sort: n option to field
|
81
|
+
- result set width option can be set as none or hidden. Used for report which doesn't display field and only exports it to Excel
|
82
|
+
- run action now checks if user has permissions to run
|
83
|
+
- result set column sorting can be disabled by defining sort: n option
|
84
|
+
- poll results may (must) now be confirmed
|
85
|
+
- Exo variable font is now being used as default font
|
86
|
+
|
87
|
+
## [0.6.0.6] - june 2020
|
88
|
+
### New features
|
89
|
+
- index section has got select_field and deny_field option, for granular selection of fields displayed on result set browser
|
90
|
+
- new DcTemp model is available for browsing temporary data. Unlike DcMemory model, data is saved to database and can persist until clear is requested
|
91
|
+
- CSS code can now be added to DRG Form on top level or on field level with css option
|
92
|
+
- javascript code can now be part of DRG Form definition or can be loaded from external js file
|
93
|
+
- readonly number field is now displayed formatted when format is specified
|
94
|
+
- date_picker and datetime_picker have autocomplete code turned to off by default
|
95
|
+
- ajax action in embedded form field can now update form field on parent form
|
96
|
+
- embedded DRG Form field can now be used for browsing foreign collection with has_many relation
|
97
|
+
- embedded DRG Form field can now pass additional parameters to called Form
|
98
|
+
- recommended control files location is now app/controls folder. app/controllers/drgcms_controls locations will be deprecated
|
99
|
+
- dc_poll_result model created to save polls result by calling dc_poll.save_results
|
100
|
+
- all action buttons (on index, result and edit form) can now be of type link,ajax,submit and window. They can all be called with additional parameters and be either enabled or disabled
|
101
|
+
- index actions can now hold additional input fields (ex. for additional filter fields)
|
102
|
+
- cmsedit controller has got additional run action, which can be used with ajax actions to directly call any method in controls or any class file.
|
103
|
+
- checkbox and select fields can now be properly set from ajax call. When return of set select field is array select field choices are set
|
104
|
+
- choices of select field can now depend on value of another field. <b>depend: other_field_name_on_form</b> option forces select field to dynamically update its choices when depend field changes it's value
|
105
|
+
- head option added to form. Head is drawn at the top of the form and may display values from fields (methods) from current document, comment or evaluated text data. Definition of head fields is similar to entry fields.
|
106
|
+
- new delayed option added to embedded DRG Form field. If set to true embedded form is loaded delayed when tab holding embedded field is selected. This minimizes database access when lots of embedded forms is located on tabs
|
107
|
+
- DRG Form can now be dynamically updated by defining dc_update_form method in control file
|
108
|
+
- dc_update_method is called after form file has been read and before form processing. Thus whole form can be changed or programmatically created
|
109
|
+
- display of readonly fields is mostly improved by using readonly HTML5 keyword
|
110
|
+
- new radio DRG Form field for implementing radio button fields entry fields
|
111
|
+
- new file_field DRG Form field for classic file upload
|
112
|
+
- new action DRG Form field can be used to put action anywhere between for entry fields
|
113
|
+
|
114
|
+
## [0.6.0.3] - january 2020
|
115
|
+
### New features
|
116
|
+
- Rails 6 compatible
|
117
|
+
- jQuery 3 used as jquery javascript library in production
|
118
|
+
- SEO optimizations added to dc_page and can be easily added to any document model
|
119
|
+
- json_ld_structure skeleton can be easily added to any document model
|
120
|
+
- DRGCMS form can be used to browse any array not only mongodb collections
|
121
|
+
- form actions can be disabled when editing data. For now only on new document
|
122
|
+
- gallery can be added to document by adding boolean field to model and adding dc _render(:dc_gallery) to document renderer
|
123
|
+
- parent_disabled and parent_opened options added to tree_view DRG CMS form field.
|
124
|
+
- fa-icons can now be rendered as menu item caption
|
125
|
+
- renderers moved to app/renderers directory
|
126
|
+
- all pictures embedded in document body must have alt data set
|
127
|
+
- DRG CMS form can now include other form
|
128
|
+
- ajax call result can now be evaluated as javascript code
|
129
|
+
- autocomplete field can now return field value which is not an id field
|
130
|
+
- CMS toggle polished. When clicked on left half of toggle current position on display is preserved
|
131
|
+
- filter condition can now be set, by clicking on column sort icon.
|
132
|
+
|
133
|
+
## [0.5.52.14] - may 2019
|
134
|
+
### New features
|
135
|
+
- rows an columns on DRG Forms are now created as divs instead of tables
|
136
|
+
- file_select DRG Forms field has picture preview on the side
|
137
|
+
- DRG Forms table displaying result set can detect @record_footer variable and if set, draws additional row at the end of result set. This can be used for displaying total row data
|
138
|
+
- icon position on action button created by dc_link_to method, can now be positioned first or after button caption
|
139
|
+
- DRG Form embedded field can now be used to browse any collection, not only embedded collections
|
140
|
+
- menu items can be created dynamically. For example login/logout can be embedded in menu. Menu item can also contain just horizontal line as separator
|
141
|
+
- DRG Form fields can have HTML5 style validation defined in HTML section. Validations are performed not only on form submit but also on ajax calls
|
142
|
+
- number_field added to DRG Forms. Number fields can have fixed decimal places, thousands delimiters and are aligned to right
|
143
|
+
- routes needed by DrgCms are now defined by DrgCms.routes method which can be used in routes.rb
|
144
|
+
- new forms field <b>tree_select</b>
|
145
|
+
- new forms field <b>numeric_field</b>
|
146
|
+
- base DRG_CRM models (dc_site, dc_page, dc_piece, dc_user, dc_olicy_rule) are now defined as concerns.
|
147
|
+
- dc_site can now inherit policy from other site and thus simplify policy definitions when multiple sites with same users are used on single Rails instance.
|
148
|
+
- dc_memory model replaces dc_dummy model for editing non DB data
|
149
|
+
- cms_edit controller is aliased as cms
|
150
|
+
- menu item may now be calculated when picture values is preceded with @
|
151
|
+
- horizontal menu can be added to menu by defining < hr > in caption
|
152
|
+
- iframe options added to dc_page model
|
153
|
+
- default data for testing created
|
154
|
+
- formname keyword change to form_name
|
155
|
+
- table elements replaced by div elements for form. Thus editing data is more flexible on tablets or even mobiles,
|
156
|
+
- image preview added to file_select field. Can be omitted with preview: no option
|
157
|
+
- result table can now have @record_footer record which defines values for footer displayed on the bottom of result table
|
158
|
+
- embedded field can embed other forms not just field embedded in model. Name option must match table option.
|
159
|
+
- html 5 validations can be added to form fields in html option
|
160
|
+
- popup message can be displayed as result of ajax call from form
|
161
|
+
- dc_name4_id can return value of any method defined in model
|
162
|
+
- removed url collection created for adding removed url-s to sitemap
|
163
|
+
- dc_check_user_still_valid method added to check if user data saved to session is still valid every defined period of time,
|
164
|
+
- DRG CMS form fields source code refactored. Code for every field is now defined in its own file
|
165
|
+
|
166
|
+
### Bugs resolved
|
167
|
+
- dc_before_edit callback was not working as expected
|
168
|
+
- lots of small bugs resolved
|
169
|
+
|
170
|
+
## [0.5.52.4] - march 2018
|
171
|
+
### New features
|
172
|
+
- Ruby 2.4 is required
|
173
|
+
- Rails 5.2 compatibility requirements met
|
174
|
+
- dc_page document has new fields for defining and displaying iframe
|
175
|
+
- CMS menu has link option which defines direct url link
|
176
|
+
- DRG Form data entry fields are now built of div elements instead of table elements
|
177
|
+
- text_with_autocomplete can now return value which is not dependent on relation in another collection
|
178
|
+
- data entry form is automatically resized to full size when tab is selected.
|
179
|
+
|
180
|
+
### Bugs resolved
|
181
|
+
- tree_select field returns BSON objects when BSON object is selected and array when multiple options are selected. It was returning strings before.
|
182
|
+
- refactoring formname DRG Forms option to form_name
|
183
|
+
|
184
|
+
## [0.5.51] - september 2017
|
185
|
+
### New features
|
186
|
+
- Rails version 5.1 compatibility
|
187
|
+
- Ruby version 2.3 is now required
|
188
|
+
- select field with multiple can now properly process non BSON array values
|
189
|
+
- DRG CMS Form readonly field with readonly : yes option will not be saved to database on save
|
190
|
+
- dc_dummy collection will be deprecated and replaced with dc_memory collection. Name was chosen unfortunately
|
191
|
+
- DrgForms can now be used for editing YAML settings saved in dc_page document. This enables editing dynamic settings of elements embedded in design
|
192
|
+
|
193
|
+
## [0.5.50] - may 2017
|
194
|
+
### New features
|
195
|
+
- Rails 5.0 compatibility
|
196
|
+
- category types can now be defined in dc_big_table under dc_category_type key
|
197
|
+
- DrgCms gem routes can now be defined as DrgCms.routes
|
198
|
+
- new field tree_select added to DRG CMS Forms. Tree select will be used as data entry field for categories instead of select field with multiple option
|
199
|
+
- switch to Rails concern for main model definitions which may be reused
|
200
|
+
- site policy can be inherited from other site
|
201
|
+
- menus can now belong to site
|
202
|
+
- clear_link method is now a class method of DcPage model and can thus be called directly from other parts of application
|
203
|
+
|
204
|
+
### Bugs resolved
|
205
|
+
- documents can now be undeleted from journal
|
206
|
+
|
207
|
+
## [0.5.10] - february 2017
|
208
|
+
### New features
|
209
|
+
- browsing array of hashes is now possible with DRG Forms
|
210
|
+
- simple browsing of all defined models and field definitions added to CMS System menu
|
211
|
+
- new result_set options table_style, table_class, tr_style, tr_class, td_style, td_class. Welcome colors to result_set browser
|
212
|
+
- result_set has been renewed for more modern design. Header elements have now sorting icons
|
213
|
+
- dblclick and click actions can now be defined on result set and can fire any action when clicked or double clicked on result set row
|
214
|
+
- main CMS menu was becoming to large and was divided into two menus
|
215
|
+
- result set browse filter data entry redesigned. Values can now be entered directly on actions area. Value of entered fied is also retained beetwen calls
|
216
|
+
- new DcInternals model introduced. It will be used for accessing internal variables
|
217
|
+
- DRG Forms has new option columns. Option defines number of columns per tab or fields. Field option also got colspan option indicating over how many columns field spans
|
218
|
+
- DRG Forms field size can now also be defined on same level as field type. Before it was defined in html sublevel
|
219
|
+
- jQuery javascript library forced to jQuery2
|
220
|
+
- choices for select fields are now UTF-8 sorted since MongoDB does not provide utf sorting
|
221
|
+
- placeholder text added for text_autocomplete field. It can also be defined in form field html options
|
222
|
+
- filters option can now have "like" keyword for fields that are not defined on form. For example created_by like user_id
|
223
|
+
- table_style added to result_set DRGCMS Forms option. This allows CSS style like width: 150% which will result in horizontal scroler on table and view more columns on result set.
|
224
|
+
- result_set filter now has is empty option allowing to filter fields with null value.
|
225
|
+
- filter OFF icon now displays currently active filter when hovered.
|
226
|
+
- request_process field added to dc_site collection. It allowis for site to have different requests processing as defined in rails routes file. Single rails instance can now mix single document sites with complex sites.
|
227
|
+
- multiple option is added to DRGCMS Forms select_field.
|
228
|
+
- is_email? class method added to dc_user model.
|
229
|
+
- form generator has now list of all model fields added at the end of generated form. Field names can be used as template in YAML translation file.
|
230
|
+
- dc_choices4_field method implemented. It returns choices that are defined in localization files.
|
231
|
+
- categories field changed from multitext_autocomplete to select field with multiple options.
|
232
|
+
- a poll form can now be surrounded by div tag thus allowing for additional styling of polls
|
233
|
+
- drgcms_controlls files can now also be defined only as control files.
|
234
|
+
- journal documents can now be filtered by document id
|
235
|
+
- CMS menu redesigned. Instead of pulldown menus are now displayed fixed on the left side of edit area
|
236
|
+
|
237
|
+
### Bugs resolved
|
238
|
+
- associated menu can now be selected on dc_page form also for non dc_simple_menu menus
|
239
|
+
- improved readonly display of select and text_autocomplete DRG Forms fields.
|
240
|
+
- text_autocomplete field is set to nil when content of field is deleted.
|
241
|
+
- jQuery migrate udated to version 1.3. This was required by jquery-rails gem which included latest version of jQuery which resulted in an runtime error.
|
242
|
+
- call before_new callback only when new empty record has been created.
|
243
|
+
- prevent double form submit when browser is restarted.
|
244
|
+
- when user has no role defined guest role is automatically applied
|
245
|
+
- dc_cleanup rake task deletes 1000 session documents created by robots at once instead of all which ended in error if number of documents was higher then 100.000
|
246
|
+
|
247
|
+
|
248
|
+
## [0.5.7] - november 2015
|
249
|
+
### New features
|
250
|
+
- single site document. All data for the site can be saved to single dc_site document and processed by dc_single_sitedoc_request
|
251
|
+
- site parts can now also be saved and collected from dc_site document
|
252
|
+
- CMS menu done right
|
253
|
+
- Page title is now set from dc_page_renderer default method
|
254
|
+
|
255
|
+
### Bugs resolved
|
256
|
+
- Corrected bug when multitext_autocomplete field was not displaying right values when displayed readonly
|
257
|
+
- dc_choices4 now checks if model has active field defined and returns only choices of documents that have active field value set to true
|
258
|
+
- design and page edit icons are now displayed only when design or page documents are available
|
259
|
+
- return_to from drgcms_control was not properly handled
|
260
|
+
- mouse cursor now changes to pointer when moved over ajax link
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Minimal database experience and only basic programming skills are needed
|
|
9
9
|
to create a data entry program. You can do it in 6 simple steps.
|
10
10
|
|
11
11
|
Step 1: Create Model<br>
|
12
|
-
Step 2: Generate Form<br>
|
12
|
+
Step 2: Generate DRG Form<br>
|
13
13
|
Step 3: Edit Form<br>
|
14
14
|
Step 4: Define Labels and Help Text<br>
|
15
15
|
Step 5: Create Controls File (if required)<br>
|
@@ -46,14 +46,14 @@ validates :duration, presence: true
|
|
46
46
|
end
|
47
47
|
```
|
48
48
|
|
49
|
-
<b>Form:</b> Form file is a text file, written in the YAML markup language. It consists
|
49
|
+
<b>Form:</b> DRG Form file is a text file, written in the YAML markup language. It consists
|
50
50
|
of three main parts.<br>
|
51
51
|
|
52
|
-
<b>index:</b> Which defines actions
|
52
|
+
<b>index:</b> Which defines actions performed on database documents or
|
53
53
|
set of document.<br>
|
54
54
|
<b>result_set:</b> Defines set of documents, document fields and actions
|
55
55
|
which can be performed on a document.<br>
|
56
|
-
<b>form:</b> Defines data entry fields for editing and viewing
|
56
|
+
<b>form:</b> Defines data entry fields for editing and viewing a single document.<br>
|
57
57
|
|
58
58
|
Example of form file for Note model app/forms/note.yaml
|
59
59
|
|
@@ -171,6 +171,10 @@ end
|
|
171
171
|
|
172
172
|
end
|
173
173
|
```
|
174
|
+
<br>
|
175
|
+
|
176
|
+
Visit [gallery](https://www.drgcms.org/gallery) of DRG Forms
|
177
|
+
usage in production.
|
174
178
|
|
175
179
|
## Features
|
176
180
|
DRG CMS uses Ruby on Rails, one of the most popular frameworks for
|
@@ -210,7 +214,7 @@ Compatibility
|
|
210
214
|
-------------
|
211
215
|
|
212
216
|
DRG CMS is being actively developed since 2012 and has been live tested in production
|
213
|
-
since beginning. It runs against latest technology Ruby (3.
|
217
|
+
since beginning. It runs against latest technology Ruby (3.1), Rails (7.0)
|
214
218
|
and MongoDB (5.0) and had so far little or no problems advancing to latest versions
|
215
219
|
of required programs.
|
216
220
|
|
@@ -67,7 +67,12 @@ update_embedded_on_tab_select = function(div_name) {
|
|
67
67
|
* Return false when confirmation is not required
|
68
68
|
*******************************************************************/
|
69
69
|
confirmation_is_cancled = function(object) {
|
70
|
-
let confirmation =
|
70
|
+
let confirmation = '';
|
71
|
+
if ($.type(object) === "string") {
|
72
|
+
confirmation = object;
|
73
|
+
} else {
|
74
|
+
confirmation = object.getAttribute("data-confirm");
|
75
|
+
}
|
71
76
|
// if confirmation required
|
72
77
|
if (confirmation !== null) {
|
73
78
|
if (!confirm(confirmation)) {return true;}
|
@@ -133,7 +138,20 @@ format_number_field = function(e) {
|
|
133
138
|
if (delimiter !== '') whole = ar.join(delimiter);
|
134
139
|
e.val(whole + separator + dec + currency);
|
135
140
|
};
|
136
|
-
|
141
|
+
|
142
|
+
/*******************************************************************
|
143
|
+
* Dynamically loads javascript file from filesystem
|
144
|
+
*******************************************************************/
|
145
|
+
function load_script( url, callback ) {
|
146
|
+
let script = document.createElement( "script" )
|
147
|
+
script.type = "text/javascript";
|
148
|
+
script.src = url;
|
149
|
+
script.onload = function() {
|
150
|
+
callback()
|
151
|
+
};
|
152
|
+
document.head.appendChild(script);
|
153
|
+
}
|
154
|
+
|
137
155
|
/*******************************************************************
|
138
156
|
* Activate jquery UI tooltip. This needs jquery.ui >= 1.9
|
139
157
|
*******************************************************************/
|
@@ -990,35 +1008,31 @@ $(document).ready( function() {
|
|
990
1008
|
});
|
991
1009
|
|
992
1010
|
$('#1menu-filter').on('click', function(e) {
|
993
|
-
|
994
|
-
// if (e.target.src !== undefined) {
|
995
|
-
// target = e.target.parent(); // picture
|
996
|
-
// };
|
997
|
-
// dumpAttributes(target);
|
1011
|
+
let target = e.target;
|
998
1012
|
req = target.getAttribute("data-request");
|
999
1013
|
$('.menu-filter').toggle(300);
|
1000
|
-
|
1001
1014
|
});
|
1002
1015
|
|
1003
1016
|
/*******************************************************************
|
1004
|
-
*
|
1005
|
-
*
|
1017
|
+
* Pressing Enter in search field will trigger click event on search icon
|
1018
|
+
* and thus force search event.
|
1006
1019
|
*******************************************************************/
|
1007
1020
|
$('#_record__filter_field').keydown( function(e) {
|
1008
1021
|
if (e.which == '13' || e.which == '9') {
|
1009
|
-
let url = $(this).parents('span').attr("data-url");
|
1010
|
-
url = url + "&filter_value=" + this.value;
|
1011
|
-
simple_ajax_call(url);
|
1022
|
+
// let url = $(this).parents('span').attr("data-url");
|
1023
|
+
// url = url + "&filter_value=" + this.value;
|
1024
|
+
// simple_ajax_call(url);
|
1025
|
+
$('.record_filter_field_icon').trigger("click")
|
1012
1026
|
};
|
1013
1027
|
});
|
1014
1028
|
|
1015
1029
|
/*******************************************************************
|
1016
|
-
*
|
1017
|
-
*
|
1030
|
+
* Will set internal filter value and fire reload event to enable
|
1031
|
+
* filtering documents of browsed collection.
|
1018
1032
|
*******************************************************************/
|
1019
1033
|
$('.record_filter_field_icon').on('click', function(e) {
|
1020
1034
|
let field = $('#_record__filter_field');
|
1021
|
-
let url
|
1035
|
+
let url = $(this).parents('span').attr("data-url");
|
1022
1036
|
let value = null;
|
1023
1037
|
|
1024
1038
|
if (field.is(':checkbox')) {
|
@@ -1035,8 +1049,11 @@ $(document).ready( function() {
|
|
1035
1049
|
*******************************************************************/
|
1036
1050
|
$('#open_drgcms_filter').on('click', function(e) {
|
1037
1051
|
$('#drgcms_filter').bPopup({
|
1038
|
-
transition: 'slideDown',
|
1039
|
-
|
1052
|
+
transition: 'slideDown',
|
1053
|
+
transitionClose: 'slideDown',
|
1054
|
+
speed: 300,
|
1055
|
+
opacity: 0,
|
1056
|
+
position: ['auto', 20],
|
1040
1057
|
closeClass: 'dc-link' });
|
1041
1058
|
});
|
1042
1059
|
|
@@ -1102,7 +1119,6 @@ $(document).ready( function() {
|
|
1102
1119
|
* Result set record menu is left open if action is canceled. Ex. delete confirm. This will hide menu.
|
1103
1120
|
*******************************************************************/
|
1104
1121
|
$('.dc-result-submenu ul li').on('click', function(e) {
|
1105
|
-
console.log('ups');
|
1106
1122
|
if (typeof dc_last_menu_selected !== 'undefined') dc_last_menu_selected.hide();
|
1107
1123
|
});
|
1108
1124
|
|
@@ -4,9 +4,8 @@
|
|
4
4
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
5
|
// the compiled file.
|
6
6
|
|
7
|
-
//=
|
8
|
-
//= require
|
9
|
-
//= require drg_cms/jquery-migrate.js
|
7
|
+
//= require_self
|
8
|
+
//= require jquery3
|
10
9
|
//= require jquery_ujs
|
11
10
|
|
12
11
|
//= require jquery-ui/widgets/tooltip
|
@@ -117,11 +117,9 @@
|
|
117
117
|
.vakata-context,
|
118
118
|
.vakata-context ul {
|
119
119
|
margin: 0;
|
120
|
-
padding: 2px;
|
121
120
|
position: absolute;
|
122
|
-
background: #
|
123
|
-
|
124
|
-
box-shadow: 2px 2px 2px #999999;
|
121
|
+
background: #fff;
|
122
|
+
filter: drop-shadow(1px 1px 6px #ddd);
|
125
123
|
}
|
126
124
|
.vakata-context ul {
|
127
125
|
list-style: none;
|
@@ -140,19 +138,20 @@
|
|
140
138
|
}
|
141
139
|
.vakata-context li > a {
|
142
140
|
display: block;
|
143
|
-
padding:
|
141
|
+
padding: 4px;
|
144
142
|
text-decoration: none;
|
145
143
|
width: auto;
|
146
144
|
color: black;
|
147
145
|
white-space: nowrap;
|
148
|
-
line-height: 2.4em;
|
149
|
-
text-shadow: 1px 1px 0 white;
|
150
146
|
border-radius: 1px;
|
151
147
|
}
|
152
148
|
.vakata-context li > a:hover {
|
153
149
|
position: relative;
|
154
|
-
background-color:
|
155
|
-
|
150
|
+
background-color: rgba(44, 142, 255, 1);
|
151
|
+
color: #fff;
|
152
|
+
}
|
153
|
+
.vakata-context li > a:hover > i {
|
154
|
+
color: #fff;
|
156
155
|
}
|
157
156
|
.vakata-context li > a.vakata-context-parent {
|
158
157
|
background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==");
|
@@ -164,8 +163,6 @@
|
|
164
163
|
}
|
165
164
|
.vakata-context .vakata-context-hover > a {
|
166
165
|
position: relative;
|
167
|
-
background-color: #e8eff7;
|
168
|
-
box-shadow: 0 0 2px #0a6aa1;
|
169
166
|
}
|
170
167
|
.vakata-context .vakata-context-separator > a,
|
171
168
|
.vakata-context .vakata-context-separator > a:hover {
|
@@ -177,7 +174,6 @@
|
|
177
174
|
max-height: 1px;
|
178
175
|
padding: 0;
|
179
176
|
margin: 0 0 0 2.4em;
|
180
|
-
border-left: 1px solid #e0e0e0;
|
181
177
|
text-shadow: 0 0 0 transparent;
|
182
178
|
box-shadow: 0 0 0 transparent;
|
183
179
|
border-radius: 0;
|
@@ -195,25 +191,15 @@
|
|
195
191
|
.vakata-context li > a > i {
|
196
192
|
text-decoration: none;
|
197
193
|
display: inline-block;
|
198
|
-
width: 2.4em;
|
199
|
-
height: 2.4em;
|
200
194
|
background: transparent;
|
201
|
-
|
202
|
-
vertical-align: top;
|
195
|
+
vertical-align: bottom;
|
203
196
|
text-align: center;
|
204
|
-
|
197
|
+
color: rgba(44, 142, 255, 1);
|
205
198
|
}
|
206
199
|
.vakata-context li > a > i:empty {
|
207
|
-
width: 2.4em;
|
208
|
-
line-height: 2.4em;
|
209
200
|
}
|
210
201
|
.vakata-context li > a .vakata-contextmenu-sep {
|
211
202
|
display: inline-block;
|
212
|
-
width: 1px;
|
213
|
-
height: 2.4em;
|
214
|
-
background: white;
|
215
|
-
margin: 0 0.5em 0 0;
|
216
|
-
border-left: 1px solid #e2e3e3;
|
217
203
|
}
|
218
204
|
.vakata-context .vakata-contextmenu-shortcut {
|
219
205
|
font-size: 0.8em;
|
@@ -233,9 +219,7 @@
|
|
233
219
|
background-repeat: no-repeat;
|
234
220
|
}
|
235
221
|
.vakata-context-rtl .vakata-context-separator > a {
|
236
|
-
margin: 0 2.4em 0 0;
|
237
222
|
border-left: 0;
|
238
|
-
border-right: 1px solid #e2e3e3;
|
239
223
|
}
|
240
224
|
.vakata-context-rtl .vakata-context-left ul {
|
241
225
|
right: auto;
|
@@ -954,7 +938,8 @@
|
|
954
938
|
margin-top: -10px;
|
955
939
|
}
|
956
940
|
}
|
957
|
-
|
941
|
+
|
942
|
+
@media (max-width: 600px) {
|
958
943
|
.jstree-default-responsive {
|
959
944
|
/*
|
960
945
|
.jstree-open > .jstree-ocl,
|
@@ -1099,4 +1084,24 @@
|
|
1099
1084
|
margin-left: 0;
|
1100
1085
|
margin-right: 0;
|
1101
1086
|
}
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
/* edit categorise as tree */
|
1090
|
+
#catagories-as-tree {
|
1091
|
+
margin: 8px 4px;
|
1092
|
+
border-top: 2px solid #bbb;
|
1093
|
+
padding: 8px;
|
1094
|
+
background-color: #f8f8f8;
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
#catagories-as-tree .jstree-anchor {
|
1098
|
+
padding: 2px 4px;
|
1099
|
+
font-weight: 400;
|
1100
|
+
}
|
1101
|
+
|
1102
|
+
#catagories-as-tree .mi-o {
|
1103
|
+
font-size: 22px;
|
1104
|
+
color: #666;
|
1105
|
+
padding-right: 4px;
|
1106
|
+
vertical-align: top;
|
1102
1107
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
.ms-container{
|
2
|
-
|
2
|
+
width: fit-content;
|
3
|
+
max-width: 600px;
|
3
4
|
}
|
4
5
|
|
5
6
|
.ms-container:after{
|
@@ -62,7 +63,7 @@
|
|
62
63
|
}
|
63
64
|
|
64
65
|
.ms-container .ms-selectable li.ms-elem-selectable{
|
65
|
-
padding:
|
66
|
+
padding: 3px 10px;
|
66
67
|
color: #444;
|
67
68
|
font-size: 14px;
|
68
69
|
}
|
@@ -96,4 +97,5 @@
|
|
96
97
|
.pull-right.ms-elem-selected{
|
97
98
|
float: right;
|
98
99
|
font-size: smaller;
|
100
|
+
padding-left: 4px;
|
99
101
|
}
|
@@ -424,7 +424,7 @@ end
|
|
424
424
|
# decamelize_type(ModelName) # 'ModelName' => 'model_name'
|
425
425
|
########################################################################
|
426
426
|
def decamelize_type(model_string)
|
427
|
-
model_string ? model_string.underscore : nil
|
427
|
+
model_string ? model_string.to_s.underscore : nil
|
428
428
|
end
|
429
429
|
|
430
430
|
####################################################################
|
@@ -439,7 +439,8 @@ def dc_error_messages_for(document)
|
|
439
439
|
|
440
440
|
msg = ''
|
441
441
|
document.errors.each do |error|
|
442
|
-
label = t("helpers.label.#{decamelize_type(document.class)}.#{error.attribute}"
|
442
|
+
label = t("helpers.label.#{decamelize_type(document.class)}.#{error.attribute}")
|
443
|
+
label = error.attribute if label.match( 'translation missing' )
|
443
444
|
msg << "<li>#{label} : #{error.message}</li>"
|
444
445
|
end
|
445
446
|
|