drg_cms 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f15153abc4771ed08a6ffbe80f70b4922b55f05e
4
- data.tar.gz: 0eb5f0a39892fac760bf75460821d9bc9deef1e7
3
+ metadata.gz: 3281dd3aef7554c89150fcf948a4ffdbd253da8d
4
+ data.tar.gz: dc53e3cd616e1baf33b15d8b60a30251fa4ecc8d
5
5
  SHA512:
6
- metadata.gz: 2c9080f136311b94f6eae470ff7c0e09712b621875cd616bdf48a1d8563faec4cc9fab67b79bec8b6197032c971f3b0afae1e21c67aa1256686e211df880ace4
7
- data.tar.gz: e1bca3a5c70f23342f58e1c6be16be0b2eee186dc223ccdd02efa8161155e3bfcfb8d566b433012213aaed16f03fde738ae602421f7b6f989eb34e38111b488a
6
+ metadata.gz: e19a6cfa74140520e97be7a23b2e2c3091514f72b7c404c4b1b5af75dffa0f7f1a42fefd6c93998c326456d9730d3d80c74d875c40429d454ee6386494fe72e8
7
+ data.tar.gz: 489cc0194a151b6f3f13cea9d3841ae3b4b833f19440e9ca8577f6c95128c0463f1d1ddca2e6fbe1d6ab679e7956a6323ef60e31184a57f741ff9636b15d550a
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # DrgCms
2
2
 
3
- DRG CMS is content management system build on strong foundations of Ruby on Rails and Mongo DB. It uses single (cmsedit) controller together with specialy crafted forms system for data entry. It has built-in user friendly role based access system and it can be easly extended with help of Ruby on Rails plugin system.
3
+ DRG CMS is alternative way of programming application for Ruby on Rails. Instead of creating controllers and views for each collection (table) model, DRG CMS introduces single Cmsedit controller which uses DRG Forms to control CRUD database operations.
4
+
5
+ DRG CMS uses Mongo DB, leading NO-SQL document database, as database back-end with a help of mongoid gem. Mongoid's flexible document model defines all document fields, indexes, dependencies, validations in single model file with no Rails migrations required.
4
6
 
5
- DRG CMS can be used for rapid building of complex, data-entry intensive web sites as well as building your private Intranet applications.
7
+ It has built-in user friendly role based access system and it can be easly extended with help of Ruby on Rails plugin system.
8
+
9
+ DRG CMS can be used for rapid development of complex, data-entry intensive web sites as well as building your private, in-house, Intranet applications.
6
10
 
7
11
  Project Tracking
8
12
  ----------------
@@ -12,7 +16,7 @@ Project Tracking
12
16
  Compatibility
13
17
  -------------
14
18
 
15
- DRG CMS is tested against Ruby 1.9.3, 2.0, 2.1 and 2.2, MongoDB 2.4 and 2.6
19
+ DRG CMS is tested against Ruby 2.0, 2.1 and 2.2, Rails 4.2, Mongoid 4 and 5, MongoDB 2.4 and 2.6
16
20
 
17
21
  Documentation
18
22
  -------------
@@ -477,14 +477,31 @@ element = $(this).find(':first').attr('id');
477
477
  });
478
478
 
479
479
  /*******************************************************************
480
- * Fire show document when doubleclicked on result row
480
+ * Fire action (by default show document) when doubleclicked on result row
481
481
  *******************************************************************/
482
482
  $('.dc-result tr').on('dblclick', function(e) {
483
- e.preventDefault();
484
- url = this.getAttribute("data");
485
- if (url !== null & url.length > 5) { location.href = url; } // prevent when url not set
483
+ url = String( this.getAttribute("data-dblclick") );
484
+ // prevent when data-dblclick not set
485
+ if (url.length > 5) {
486
+ e.preventDefault();
487
+ location.href = url;
488
+ }
489
+ });
490
+
491
+ /*******************************************************************
492
+ * Fire action clicked on result row.
493
+ * TODO: Find out how to prevent event when clicked on action icon.
494
+ *******************************************************************/
495
+ $('.dc-result tr').on('click', function(e) {
496
+ url = String( this.getAttribute("data-click") );
497
+ // prevent when data-click not set
498
+ if (url.length > 5) {
499
+ e.preventDefault();
500
+ location.href = url;
501
+ }
486
502
  });
487
503
 
504
+
488
505
  });
489
506
 
490
507
  /*******************************************************************
@@ -79,17 +79,14 @@ font-family: helvetica;
79
79
  font-size: 12px;
80
80
  margin: 0px;
81
81
  vertical-align: middle;
82
+ color: #222;
82
83
  }
83
84
 
84
85
  textarea, input, select {
85
86
  color: #222;
86
- padding: 3px;
87
+ padding: 4px;
87
88
  border: solid 1px #aaa;
88
89
  border-radius: 2px;
89
- /*background: linear-gradient(#ffd 4%, #fff 100%); */
90
- /*
91
- box-shadow: rgba(0,0,0, 0.1) 0px 0px 4px;
92
- */
93
90
  }
94
91
 
95
92
  /*
@@ -101,6 +98,11 @@ background: #fff;
101
98
  }
102
99
  */
103
100
 
101
+ select {
102
+ padding: 4px 0px;
103
+ background: #fff;
104
+ }
105
+
104
106
  hr {
105
107
  background-color: #ccc;
106
108
  border: none;
@@ -120,10 +122,13 @@ height: 2px;
120
122
  td { vertical-align: middle; }
121
123
 
122
124
  th {
123
- padding: 5px 1px;
125
+ padding: 4px;
124
126
  text-align: left;
125
- border-bottom:2px solid #ccc;
126
- background: #fff;
127
+ border-bottom:1px solid #e8e8e8;
128
+ border-right:1px solid #e8e8e8;
129
+ background: #e8e8e8;
130
+ color:#888;
131
+ font-weight: bold;
127
132
  }
128
133
 
129
134
  th a:hover { color: #000;}
@@ -137,7 +142,7 @@ text-decoration: none;
137
142
  background: transparent;
138
143
  }
139
144
 
140
- a:hover { text-decoration: none; color: #fff; }
145
+ a:hover { text-decoration: none; color: #000; }
141
146
  a img { border: none; }
142
147
 
143
148
 
@@ -157,18 +162,22 @@ width: 24px;
157
162
  }
158
163
 
159
164
  .dc-result {
160
- width: 100%;
161
- padding: 0px;
162
- border-spacing: 0px;
163
- border-radius: 1px;
164
- background-color: #f8f8f8;
165
+ width: 100%;
166
+ padding: 0px;
167
+ border-spacing: 0px;
168
+ border-radius: 1px;
169
+ background-color: #fafafa;
170
+ border-top: 1px solid #e8e8e8;
171
+ border-left: 1px solid #e8e8e8;
165
172
  }
166
173
 
167
- .dc-result tr:hover { background-color: #ddd; }
174
+ .dc-result tr:hover { background-color: #eee; }
168
175
 
169
176
  .dc-result td {
170
- padding: 2px 0px;
177
+ padding: 3px 4px;
171
178
  line-height: 1.5em;
179
+ border-right: 1px solid #e8e8e8;
180
+ border-bottom: 1px solid #e8e8e8;
172
181
  }
173
182
 
174
183
  .dc-result i {
@@ -183,17 +192,24 @@ padding: 0px;
183
192
  #data-fields {margin: 5px;}
184
193
 
185
194
  .dc-link {
186
- padding: 4px 8px;
195
+ padding: 3px 8px;
187
196
  text-align: center;
188
197
  border-radius: 5px;
189
198
  background-color: #eee;
199
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
200
+ border: 1px solid #ddd;
190
201
  }
191
202
 
192
203
  .dc-link:hover {
193
204
  background-color: #888;
205
+ border: 1px solid #aaa;
206
+ transition: 0.3s;
194
207
  }
195
208
 
196
- .dc-link:hover a { color: #fff; }
209
+ .dc-link:hover a {
210
+ color: #222;
211
+ transition: 0.3s;
212
+ }
197
213
 
198
214
  .dc-link-ajax {
199
215
  text-align: left;
@@ -201,16 +217,23 @@ background-color: #eee;
201
217
  padding: 5px 8px;
202
218
  border-radius: 5px;
203
219
  color: #888;
204
- background-color: #eee;
220
+ background-color: #eee;
221
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
222
+ border: 1px solid #ddd;
205
223
  }
206
224
 
207
225
  .dc-link-ajax:hover {
208
- cursor: pointer;
209
- color: #fff;
210
- background-color: #888;
226
+ cursor: pointer;
227
+ /*background-color: #888; */
228
+ border: 1px solid #aaa;
229
+ transition: 0.3s;
211
230
  }
212
231
 
213
- .dc-link-ajax:hover a { color: #fff; cursor: pointer }
232
+ .dc-link-ajax:hover a {
233
+ color: #222;
234
+ cursor: pointer;
235
+ transition: 0.3s;
236
+ }
214
237
 
215
238
  .dc-link-img {
216
239
  padding: 3px;
@@ -265,31 +288,37 @@ background-color: #eee;
265
288
  .skip-next a:hover { text-decoration: none; color: #c43; }
266
289
 
267
290
  .dc-animate-button {
268
- box-shadow: inset 0 0 10px #fff;
269
291
  background-color: #888;
292
+ background: transparent linear-gradient(to bottom, #ddd 0%, #FFF 100%) repeat scroll 0% 0% !important;
293
+ /*border: 1px solid #ddd;*/
270
294
  }
271
295
 
272
296
  .dc-link-submit {
273
297
  text-align: left;
274
- padding: 5px 6px;
298
+ padding: 4px 6px;
275
299
  margin-right: 4px;
276
300
 
277
301
  border-radius: 5px;
278
- background-color: #eee;
302
+ background-color: #eee;
303
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
304
+ border: 1px solid #ddd;
279
305
  }
280
306
 
281
307
  .dc-link-submit .fa {
282
308
  color: #888;
283
309
  }
284
310
  .dc-link-submit:hover .fa {
285
- color: #fff;
311
+ color: #222;
312
+ transition: 0.3s;
286
313
  }
287
314
  .dc-link-submit:hover {
288
315
  color: #000;
289
- background-color: #888;
316
+ border: 1px solid #aaa;
317
+ transition: 0.3s;
290
318
  }
291
319
  .dc-link-submit:hover .dc-submit {
292
- color: #fff;
320
+ color: #222;
321
+ transition: 0.3s;
293
322
  }
294
323
  .dc-submit {
295
324
  text-decoration: none;
@@ -297,9 +326,10 @@ background-color: #888;
297
326
  color: #888;
298
327
  font-weight: bold;
299
328
  box-shadow: none;
300
- background: none;
329
+ /* background: none;*/
301
330
  padding: 0px 2px;
302
331
  border-radius: 0px;
332
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
303
333
  }
304
334
 
305
335
  .dc-submit:hover {
@@ -335,16 +365,20 @@ background-color: #888;
335
365
  width: 99.9%;
336
366
  margin: 0px;
337
367
  background-color: #fff;
368
+ /*
369
+
338
370
  border-radius: 1px;
339
371
  border-top:1px solid #fff;
340
372
  border-left:1px solid #fff;
341
- border-bottom:1px solid #ccc;
373
+ border-bottom:1px solid #ccc;*/
342
374
  }
343
375
 
344
376
  .dc-form-table {
345
377
  width: 100%;
346
378
  border-spacing: 0px;
347
379
  padding: 0px;
380
+ border: 1px solid #ddd;
381
+ border-top: 0px;
348
382
  }
349
383
 
350
384
  .dc-form-info {
@@ -423,10 +457,11 @@ background-color: #888;
423
457
  }
424
458
 
425
459
  .dc-color-odd {
426
- background-color: #f4f4f4;
460
+ background-color: #f8f8f8;
427
461
  /* border-bottom: solid 1px #eee; */
428
462
  }
429
463
  .dc-color-even {
464
+ background-color: #f8f8f8;
430
465
  /* border-bottom: solid 1px #eee; */
431
466
  }
432
467
 
@@ -462,7 +497,7 @@ border-bottom: 1px solid #eee;
462
497
  }
463
498
 
464
499
  .dc-odd {
465
- background-color: #fff;
500
+ background-color: #fcfcfc;
466
501
  }
467
502
 
468
503
  .dc-separator {
@@ -502,10 +537,15 @@ background: transparent;
502
537
  .cmsedit-table {
503
538
  width: 100%;
504
539
  background-color: #fff;
505
- border-spacing: 0px;
506
540
  border-collapse: collapse;
541
+ border: 4px solid #fff;
507
542
  }
508
543
 
544
+ .cmsedit-table tr {
545
+ background-color: #fff;
546
+ background: #fff;
547
+ }
548
+
509
549
  .cmsedit-menu {
510
550
  background-color: #fff;
511
551
  padding: 4px;
@@ -695,10 +735,11 @@ background-color: #eee;
695
735
  }
696
736
 
697
737
  .iframe_embedded {
698
- border: 1px solid #6cf;
738
+ padding: 4px;
699
739
  background-image: none;
700
- border-radius: 1px;
701
- box-shadow: 1px 1px 1px #6cf;
740
+ border-radius: 2px;
741
+ border: 2px solid #669;
742
+ background-color: #fff;
702
743
  }
703
744
 
704
745
  #iframe_edit, #iframe_cms {
@@ -721,7 +762,7 @@ color: #888;
721
762
  #dc-action-menu ul {
722
763
  list-style:none;
723
764
  padding: 0px;
724
- margin: 5px 2px 4px 0px;
765
+ margin: 6px 2px 4px 2px;
725
766
  }
726
767
 
727
768
  .dc-action-menu {
@@ -739,25 +780,30 @@ max-width: 200px;
739
780
  background: #eee;
740
781
  border-radius:5px;
741
782
  z-index: 1;
742
- /*background: linear-gradient(#eee 5%, #fff 100%); */
783
+
784
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
785
+ border: 1px solid #ddd;
743
786
  }
744
787
 
745
788
  .dc-action-menu li:hover {
746
- background: #888;
747
- color: #fff;
789
+ border: 1px solid #aaa;
790
+ color: #222;
791
+ transition: 0.3s;
748
792
  /*background: linear-gradient(#fff 5%, #eee 100%); */
749
793
  }
750
794
 
751
795
  .dc-action-menu li:hover a {
752
- color: #fff;
796
+ color: #222;
753
797
  }
754
798
 
755
799
  .dc-action-menu ul {
800
+ margin-top: 1px;
756
801
  background:#fff;
757
802
  position:absolute;
758
803
  left:-9999px;
759
- border: 0px;
760
- box-shadow: 2px 2px 2px -1px #aaa;
804
+
805
+ /*box-shadow: 2px 2px 4px #aaa;*/
806
+
761
807
  }
762
808
 
763
809
  .dc-action-menu ul li {
@@ -765,10 +811,9 @@ display:block;
765
811
  float:none;
766
812
  padding: 4px 10px;
767
813
  border-radius: 0px;
768
- background: none;
769
- background-color: #f8f8f8;
770
814
  margin-right: 0px;
771
815
  white-space:nowrap;
816
+ background: transparent linear-gradient(to bottom, #FFF 0%, #F2F2F2 100%) repeat scroll 0% 0%;
772
817
  }
773
818
 
774
819
  .dc-action-menu ul a {
@@ -786,7 +831,7 @@ color: #888;
786
831
  }
787
832
 
788
833
  .dc-action-menu li:hover ul li a:hover {
789
- color: #fff;
834
+ color: #222;
790
835
  }
791
836
 
792
837
  /************************** info popup *************************/
@@ -206,9 +206,11 @@ def index
206
206
  @records = []
207
207
  return render(action: :index)
208
208
  end
209
- # pagination
210
- per_page = (@form['result_set']['per_page'] || 30).to_i
211
- @records = @records.page(params[:page]).per(per_page) if per_page > 0
209
+ # pagination
210
+ unless @form['table'] == 'dc_dummy'
211
+ per_page = (@form['result_set']['per_page'] || 30).to_i
212
+ @records = @records.page(params[:page]).per(per_page) if per_page > 0
213
+ end
212
214
  else
213
215
  p "Error: result_set:filter: #{@form['result_set']['filter']} not found in controls!"
214
216
  end
@@ -314,18 +316,18 @@ end
314
316
  def duplicate_embedded(source) #:nodoc:
315
317
  # TODO Works for two embedded levels. Dies with third and more levels.
316
318
  dest = {}
317
- source.each do |attr_name, value|
318
- next if attr_name == '_id' # don't duplicate _id
319
+ source.each do |attribute_name, value|
320
+ next if attribute_name == '_id' # don't duplicate _id
319
321
  if value.class == Array
320
- dest[attr_name] = []
322
+ dest[attribute_name] = []
321
323
  value.each do |ar|
322
- dest[attr_name] << duplicate_embedded(ar)
324
+ dest[attribute_name] << duplicate_embedded(ar)
323
325
  end
324
326
  else
325
327
  # if duplicate string must be added. Useful for unique attributes
326
- add_duplicate = params['dup_fields'].to_s.match(attr_name + ',')
327
- dest[attr_name] = value
328
- dest[attr_name] << ' dup' if add_duplicate
328
+ add_duplicate = params['dup_fields'].to_s.match(attribute_name + ',')
329
+ dest[attribute_name] = value
330
+ dest[attribute_name] << ' dup' if add_duplicate
329
331
  end
330
332
  end
331
333
  dest
@@ -337,19 +339,19 @@ end
337
339
  ########################################################################
338
340
  def duplicate_document(source)
339
341
  dest = {}
340
- source.attribute_names.each do |attr_name|
341
- next if attr_name == '_id' # don't duplicate _id
342
- # if duplicate string must be added. Useful for unique attributes
343
- add_duplicate = params['dup_fields'].to_s.match(attr_name + ',')
344
- dest[attr_name] = source[attr_name]
345
- dest[attr_name] << ' dup' if add_duplicate
346
- end
347
- #
342
+ source.attribute_names.each do |attribute_name|
343
+ next if attribute_name == '_id' # don't duplicate _id
344
+ # if duplicate, string must be added. Useful for unique attributes
345
+ add_duplicate = params['dup_fields'].to_s.match(attribute_name + ',')
346
+ dest[attribute_name] = source[attribute_name]
347
+ dest[attribute_name] << ' dup' if add_duplicate
348
+ end
349
+ # embedded documents
348
350
  source.embedded_relations.keys.each do |embedded_name|
349
351
  next if source[embedded_name].nil? # it happens
350
352
  dest[embedded_name] = []
351
- source[embedded_name].each do |ar|
352
- dest[embedded_name] << duplicate_embedded(ar)
353
+ source[embedded_name].each do |embedded|
354
+ dest[embedded_name] << duplicate_embedded(embedded)
353
355
  end
354
356
  end
355
357
  dest