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.
- checksums.yaml +4 -4
- data/README.md +203 -24
- data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
- data/app/assets/javascripts/drg_cms/drg_cms.js +253 -106
- data/app/assets/stylesheets/drg_cms/drg_cms.css +670 -521
- data/app/assets/stylesheets/drg_cms_application.css +1 -1
- data/app/assets/stylesheets/drg_cms_cms.css +1 -4
- data/app/controllers/cmsedit_controller.rb +33 -211
- data/app/controllers/dc_application_controller.rb +98 -22
- data/app/controllers/dc_common_controller.rb +9 -22
- data/app/controls/browse_models_control.rb +18 -27
- data/app/controls/cmsedit_control.rb +129 -0
- data/app/controls/dc_help_control.rb +1 -1
- data/app/controls/dc_page_control.rb +0 -1
- data/app/controls/dc_poll_result_control.rb +1 -1
- data/app/controls/dc_report.rb +2 -2
- data/app/controls/design_element_settings_control.rb +1 -1
- data/app/forms/all_options.yml +25 -7
- data/app/forms/cms_menu.yml +24 -24
- data/app/forms/dc_browse_fields.yml +13 -9
- data/app/forms/dc_browse_models.yml +24 -2
- data/app/forms/dc_poll_result_export.yml +1 -1
- data/app/forms/dc_site.yml +2 -5
- data/app/forms/dc_steps_template.yml +51 -0
- data/app/helpers/cms_common_helper.rb +73 -6
- data/app/helpers/cms_edit_helper.rb +275 -159
- data/app/helpers/cms_helper.rb +152 -59
- data/app/helpers/cms_index_helper.rb +220 -172
- data/app/helpers/dc_application_helper.rb +40 -67
- data/app/models/concerns/dc_page_concern.rb +1 -1
- data/app/models/concerns/dc_site_concern.rb +9 -3
- data/app/models/dc_filter.rb +30 -22
- data/app/models/dc_journal.rb +2 -2
- data/app/models/dc_json_ld.rb +19 -42
- data/app/models/dc_part.rb +19 -9
- data/app/models/dc_site.rb +0 -1
- data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
- data/app/models/drgcms_form_fields/link_to.rb +1 -1
- data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
- data/app/models/drgcms_form_fields/readonly.rb +4 -1
- data/app/models/drgcms_form_fields/select.rb +10 -9
- data/app/models/drgcms_form_fields/text_autocomplete.rb +20 -12
- data/app/models/drgcms_form_fields/text_with_select.rb +1 -0
- data/app/renderers/dc_common_renderer.rb +20 -3
- data/app/renderers/dc_part_renderer.rb +1 -1
- data/app/renderers/dc_poll_renderer.rb +1 -1
- data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
- data/app/views/cmsedit/_form.html.erb +19 -12
- data/app/views/cmsedit/edit.html.erb +10 -6
- data/app/views/cmsedit/index.html.erb +5 -3
- data/app/views/cmsedit/login.html.erb +1 -1
- data/app/views/cmsedit/new.html.erb +9 -5
- data/app/views/dc_common/_help.html.erb +1 -0
- data/app/views/dc_common/paste_clipboard.html.erb +1 -1
- data/app/views/layouts/cms.html.erb +3 -5
- data/config/locales/drgcms_en.yml +7 -1
- data/config/locales/drgcms_sl.yml +7 -1
- data/config/locales/kaminari.yml +1 -1
- data/drg_cms.gemspec +2 -2
- data/lib/drg_cms/version.rb +1 -1
- data/lib/drg_cms.rb +4 -4
- metadata +16 -10
- data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
- data/app/views/cmsedit/__show.html.erb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc5db773399698216bce4e41936d84f3e4780c1ac1a23497b755d9ddfce1102
|
4
|
+
data.tar.gz: aba467dab232ba47b20b1e00dcdc746aa9568521b8d756137c4dab40b255f795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00c2289971583654147c8d7df3e2c1fcac20845f40381a631f290c888867db86b160910bb7643c5c54c749c671b7751de010cf53c16154a40d9be32c549eb761
|
7
|
+
data.tar.gz: c79254feaa595bb5fad752aaf943d327fa475d64b9e832bc5555d76388b4c25a286ac6f4ef1fa3acc65e122fc532ed09291a15e6623d96c80420282fca5480b5
|
data/README.md
CHANGED
@@ -1,38 +1,217 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
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
|
-
* [
|
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 (
|
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-
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|