drg_cms 0.7.0.2 → 0.7.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/drg_cms/drg_cms.js +110 -35
- data/app/assets/javascripts/drg_cms/jquery.bpopup.js +372 -0
- data/app/assets/javascripts/drg_cms_application.js +1 -1
- data/app/assets/javascripts/drg_cms_cms.js +1 -1
- data/app/assets/stylesheets/drg_cms/drg_cms.css +126 -36
- data/app/assets/stylesheets/drg_cms/select-multiple.css +6 -7
- data/app/controllers/cmsedit_controller.rb +78 -47
- data/app/controllers/dc_application_controller.rb +22 -25
- data/app/controllers/dc_common_controller.rb +9 -6
- data/app/controllers/dc_main_controller.rb +0 -1
- data/app/controls/{dc_category_control.rb → dc_gallery_control.rb} +15 -30
- data/app/controls/dc_image_control.rb +180 -0
- data/app/controls/dc_page_control.rb +3 -3
- data/app/controls/dc_poll_result_control.rb +38 -39
- data/app/controls/dc_report.rb +9 -4
- data/app/controls/dc_setup_control.rb +53 -0
- data/app/controls/design_element_settings_control.rb +88 -37
- data/app/forms/all_options.yml +20 -9
- data/app/forms/cms_menu.yml +14 -2
- data/app/forms/dc_gallery.yml +1 -1
- data/app/forms/dc_image.yml +122 -0
- data/app/forms/dc_image_search.yml +72 -0
- data/app/forms/dc_page.yml +11 -8
- data/app/forms/dc_poll.yml +2 -1
- data/app/forms/dc_poll_result.yml +10 -7
- data/app/forms/dc_setup.yml +45 -0
- data/app/forms/dc_steps_template.yml +6 -2
- data/app/helpers/cms_common_helper.rb +36 -24
- data/app/helpers/cms_edit_helper.rb +26 -33
- data/app/helpers/cms_helper.rb +29 -12
- data/app/helpers/cms_index_helper.rb +109 -80
- data/app/helpers/dc_application_helper.rb +108 -86
- data/app/helpers/dc_image_helper.rb +127 -0
- data/app/models/concerns/dc_policy_rule_concern.rb +1 -1
- data/app/models/concerns/dc_user_concern.rb +13 -5
- data/app/models/dc_big_table.rb +1 -1
- data/app/models/dc_category.rb +12 -0
- data/app/models/dc_design.rb +5 -4
- data/app/models/dc_filter.rb +24 -27
- data/app/models/dc_image.rb +237 -0
- data/app/models/dc_internals.rb +5 -9
- data/app/models/dc_memory.rb +2 -2
- data/app/models/dc_policy_role.rb +8 -8
- data/app/models/dc_setup.rb +111 -0
- data/app/models/drgcms_form_fields/datetime_picker.rb +1 -1
- data/app/models/drgcms_form_fields/drgcms_field.rb +9 -26
- data/app/models/drgcms_form_fields/embedded.rb +28 -17
- data/app/models/drgcms_form_fields/journal_diff.rb +2 -2
- data/app/models/drgcms_form_fields/multitext_autocomplete.rb +88 -76
- data/app/models/drgcms_form_fields/select.rb +41 -19
- data/app/models/drgcms_form_fields/text_with_select.rb +5 -9
- data/app/renderers/dc_big_menu_renderer.rb +18 -20
- data/app/renderers/dc_gallery_renderer.rb +10 -4
- data/app/renderers/dc_menu_renderer.rb +21 -58
- data/app/renderers/dc_page_renderer.rb +7 -7
- data/app/renderers/dc_poll_renderer.rb +13 -12
- data/app/renderers/dc_simple_menu_renderer.rb +1 -1
- data/app/views/cmsedit/_edit_stuff.html.erb +4 -1
- data/app/views/cmsedit/edit.html.erb +1 -1
- data/app/views/cmsedit/index.html.erb +1 -1
- data/app/views/cmsedit/new.html.erb +1 -0
- data/config/locales/drgcms_en.yml +22 -2
- data/config/locales/drgcms_sl.yml +25 -6
- data/config/locales/models_en.yml +50 -1
- data/config/locales/models_sl.yml +60 -1
- data/drg_cms.gemspec +1 -1
- data/lib/drg_cms/version.rb +1 -1
- data/lib/drg_cms.rb +40 -27
- data/lib/generators/convert_to_ar/USAGE +8 -0
- data/lib/generators/convert_to_ar/convert_to_ar_generator.rb +158 -0
- data/lib/generators/new_drg_form/new_drg_form_generator.rb +32 -14
- metadata +19 -10
- data/app/assets/javascripts/drg_cms/jquery.bpopup.min.js +0 -7
- data/app/views/layouts/__cmsedit.html.erb +0 -16
data/lib/drg_cms.rb
CHANGED
@@ -27,9 +27,9 @@ end
|
|
27
27
|
|
28
28
|
###############################################################################
|
29
29
|
# When new plugin with its own DRG forms is added to application, path to
|
30
|
-
# forms directory must be send to DrgCms module. Paths are saved into @@paths
|
30
|
+
# forms directory must be send to DrgCms module. Paths are saved into internal @@paths variable.
|
31
31
|
#
|
32
|
-
# Adding path is best done in plugin
|
32
|
+
# Adding path is best done in plugin module initialization code.
|
33
33
|
#
|
34
34
|
# Parameters:
|
35
35
|
# [path] String. Path to forms directory
|
@@ -40,21 +40,18 @@ end
|
|
40
40
|
# module MyPlugin
|
41
41
|
# end
|
42
42
|
#
|
43
|
-
# DrgCms.add_forms_path
|
43
|
+
# DrgCms.add_forms_path(Rails.root.join('app/forms'), Rails.root.join('app/reports/forms'))
|
44
44
|
###############################################################################
|
45
|
-
def self.add_forms_path(
|
45
|
+
def self.add_forms_path(*paths)
|
46
46
|
if @@paths[:forms].nil?
|
47
|
-
|
48
|
-
|
49
|
-
# @@paths[:forms] << Rails.root.join('app/forms')
|
50
|
-
# DrgCms forms path
|
51
|
-
@@paths[:forms] << File.expand_path("../../app/forms", __FILE__)
|
47
|
+
# DrgCms own forms path by default
|
48
|
+
@@paths[:forms] = [File.expand_path("../../app/forms", __FILE__)]
|
52
49
|
end
|
53
|
-
@@paths[:forms]
|
50
|
+
@@paths[:forms] += paths
|
54
51
|
end
|
55
52
|
|
56
53
|
###############################################################################
|
57
|
-
# Patching is one of the rubies best
|
54
|
+
# Patching is one of the rubies best strengths and also its curse. Loading
|
58
55
|
# patches in development has become real problem for developers. This is my
|
59
56
|
# way of patch loading.
|
60
57
|
#
|
@@ -77,15 +74,13 @@ end
|
|
77
74
|
###############################################################################
|
78
75
|
def self.add_patches_path(path)
|
79
76
|
self.add_path(:patches, path)
|
80
|
-
# Dir["#{path}/**/*.rb"].each { |path| p path; require_dependency path }
|
81
|
-
# Dir["#{path}/**/*.rb"].each { |file| p file; require file }
|
82
77
|
end
|
83
78
|
|
84
79
|
###############################################################################
|
85
80
|
# General add path method. Paths are saved into @@paths hash variable. Paths can
|
86
81
|
# then be reused in different parts of application.
|
87
82
|
#
|
88
|
-
# Adding paths is best done in plugin
|
83
|
+
# Adding paths is best done in plugin module initialization code.
|
89
84
|
#
|
90
85
|
# Parameters:
|
91
86
|
# [type] Symbol. Defines type of data. Current used values are :forms, :patches
|
@@ -120,9 +115,9 @@ end
|
|
120
115
|
|
121
116
|
####################################################################
|
122
117
|
# Checks if any errors exist on document and writes error log. It can also
|
123
|
-
# crash if requested. This is mostly
|
118
|
+
# crash if requested. This is mostly useful in development for debugging
|
124
119
|
# model errors or when updating multiple collections and each save must be
|
125
|
-
# checked if
|
120
|
+
# checked if successful.
|
126
121
|
#
|
127
122
|
# @param [Document] Document object which will be checked
|
128
123
|
# @param [Boolean] If true method should end in runtime error. Default = false.
|
@@ -165,6 +160,7 @@ end
|
|
165
160
|
# @param [String] Optional key to be deleted
|
166
161
|
####################################################################
|
167
162
|
def self.cache_clear(key = nil)
|
163
|
+
return unless Rails.cache
|
168
164
|
return Rails.cache.clear if key.nil?
|
169
165
|
|
170
166
|
if redis_cache_store?
|
@@ -182,14 +178,18 @@ end
|
|
182
178
|
# @return [Object] Data returned from cache
|
183
179
|
####################################################################
|
184
180
|
def self.cache_read(keys)
|
185
|
-
if redis_cache_store?
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
181
|
+
data = if redis_cache_store?
|
182
|
+
tmp_keys = keys.dup
|
183
|
+
first_key = tmp_keys.shift
|
184
|
+
cached = Rails.cache.redis.hget(first_key, tmp_keys.join(''))
|
185
|
+
cached ? Marshal.load(cached) : nil
|
186
|
+
else
|
187
|
+
Rails.cache.read(keys.join(''))
|
188
|
+
end
|
189
|
+
return data if data
|
190
|
+
return nil unless block_given?
|
191
|
+
|
192
|
+
self.cache_write(keys, yield)
|
193
193
|
end
|
194
194
|
|
195
195
|
####################################################################
|
@@ -202,15 +202,28 @@ end
|
|
202
202
|
####################################################################
|
203
203
|
def self.cache_write(keys, data)
|
204
204
|
if redis_cache_store?
|
205
|
-
|
206
|
-
|
207
|
-
Rails.cache.redis.hset(
|
205
|
+
tmp_keys = keys.dup
|
206
|
+
first_key = tmp_keys.shift
|
207
|
+
Rails.cache.redis.hset(first_key, tmp_keys.join(''), Marshal.dump(data))
|
208
208
|
else
|
209
209
|
Rails.cache.write(keys.join(''), data)
|
210
210
|
end
|
211
211
|
data
|
212
212
|
end
|
213
213
|
|
214
|
+
####################################################################
|
215
|
+
# Reads data from mongoid cache. Mongoid has it's own cache, which can be
|
216
|
+
# used to cache results on single request.
|
217
|
+
#
|
218
|
+
# @param [model] class: Model name
|
219
|
+
# @param [id] String || BSON::ObjectId : Id
|
220
|
+
#
|
221
|
+
# @return [Object] data document.
|
222
|
+
####################################################################
|
223
|
+
def self.cached(model, id)
|
224
|
+
id ? Mongo::QueryCache.cache { model.find(id) } : nil
|
225
|
+
end
|
226
|
+
|
214
227
|
###############################################################################
|
215
228
|
# All Routes required by DrgCms.
|
216
229
|
#
|
@@ -0,0 +1,158 @@
|
|
1
|
+
class ConvertToArGenerator < Rails::Generators::NamedBase
|
2
|
+
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
desc "This generator converts mongoid model to active_record migration"
|
5
|
+
argument :model_name, :type => :string, :default => 'dc_*'
|
6
|
+
argument :migration_name, :type => :string, :default => 'initial_migration'
|
7
|
+
|
8
|
+
TYPES = {
|
9
|
+
String => :string,
|
10
|
+
Time => :datetime,
|
11
|
+
DateTime => :datetime,
|
12
|
+
Object => :integer,
|
13
|
+
Integer => :integer,
|
14
|
+
BSON::ObjectId => :integer,
|
15
|
+
Mongoid::Boolean => :boolean,
|
16
|
+
BigDecimal => [:decimal, :precision => 8, :scale => 2, :default => 0.00],
|
17
|
+
Date => :date,
|
18
|
+
Hash => :text,
|
19
|
+
Array => :text
|
20
|
+
}
|
21
|
+
|
22
|
+
###########################################################################
|
23
|
+
#
|
24
|
+
###########################################################################
|
25
|
+
def create_migration
|
26
|
+
p model_name, migration_name
|
27
|
+
|
28
|
+
code = model_name.match(/\*/) ? migrate_many(model_name) : migrate_one(model_name)
|
29
|
+
code = top(migration_name) + code + bottom
|
30
|
+
create_file "db/#{source_file_name(migration_name).underscore}.rb", code
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
###########################################################################
|
36
|
+
#
|
37
|
+
###########################################################################
|
38
|
+
def source_file_name(migration)
|
39
|
+
"#{Time.now.strftime("%Y%m%d%H%M%S")}_#{migration}"
|
40
|
+
end
|
41
|
+
|
42
|
+
###########################################################################
|
43
|
+
#
|
44
|
+
###########################################################################
|
45
|
+
def migrate_one(model_name)
|
46
|
+
mongo_model = model_name.classify.constantize
|
47
|
+
new_model_name = model_name.start_with?('dc_') ? model_name.sub('dc_', 'ar_') : model_name
|
48
|
+
code = %( create_table :#{new_model_name.pluralize} do |t|\n)
|
49
|
+
left = ' t.'
|
50
|
+
timestamps = false
|
51
|
+
# fields
|
52
|
+
document = mongo_model.new
|
53
|
+
document.attribute_names.each do |attribute_name|
|
54
|
+
next if attribute_name == '_id'
|
55
|
+
if %w[created_at updated_at].include?(attribute_name)
|
56
|
+
timestamps = true
|
57
|
+
next
|
58
|
+
end
|
59
|
+
|
60
|
+
options = mongo_model.fields[attribute_name].options
|
61
|
+
pp "Undefined type #{options[:type]} for #{mongo_model}.#{attribute_name}" unless TYPES[options[:type]]
|
62
|
+
att_name = attribute_name.sub(/^dc_/,'ar_')
|
63
|
+
code << %(#{left}#{TYPES[options[:type]]} :#{att_name})
|
64
|
+
code << %(, default: #{get_default(options[:default], options[:type])}) if options[:default]
|
65
|
+
code << "\n"
|
66
|
+
end
|
67
|
+
code << %(\n#{left}timestamps\n) if timestamps
|
68
|
+
|
69
|
+
# indexes
|
70
|
+
if document.index_specifications.any?
|
71
|
+
code << "\n"
|
72
|
+
document.index_specifications.each do |index|
|
73
|
+
code << "#{left}index "
|
74
|
+
code << (index.fields.size > 1 ? "[:#{index.fields.join(', :')}]" : ":#{index.fields.first}")
|
75
|
+
code << ", #{index.options.to_s.gsub(/\{|\}/, '')}" if index.options.size > 0
|
76
|
+
code << "\n"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# export some test data
|
81
|
+
data = []
|
82
|
+
mongo_model.all.limit(5).each do |doc|
|
83
|
+
#data << doc.as_document.inject([]) { |r, e| [e.first.sub(/^dc_/,'ar_'), e.last] }
|
84
|
+
data << doc.as_document.map { |e| [e.first.sub(/^dc_/,'ar_'), e.last] }
|
85
|
+
end
|
86
|
+
File.write("db/#{new_model_name}.json", data.to_json)
|
87
|
+
|
88
|
+
code << " end\n\n"
|
89
|
+
end
|
90
|
+
|
91
|
+
###########################################################################
|
92
|
+
#
|
93
|
+
###########################################################################
|
94
|
+
def get_default(default, type)
|
95
|
+
case type.to_s
|
96
|
+
when 'String' then "'#{default}'"
|
97
|
+
else default
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
#########################################################################
|
102
|
+
# Return array of all models found in application.
|
103
|
+
#########################################################################
|
104
|
+
def all_collections
|
105
|
+
collections = []
|
106
|
+
DrgCms.paths(:forms).each do |path|
|
107
|
+
models_dir = File.expand_path("../models", path)
|
108
|
+
Dir["#{models_dir}/*.rb"].each do |model_file|
|
109
|
+
model_file =~ /(.*)\/(.*).rb/
|
110
|
+
# check if model exists
|
111
|
+
collection = $2.camelize.constantize.new rescue nil
|
112
|
+
collections << collection.class.to_s.underscore if collection&.respond_to?(:_id)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
collections.sort
|
116
|
+
end
|
117
|
+
|
118
|
+
###########################################################################
|
119
|
+
#
|
120
|
+
###########################################################################
|
121
|
+
def migrate_many(model_name)
|
122
|
+
selector = model_name[0, model_name.index('*') - 1].downcase
|
123
|
+
p selector
|
124
|
+
|
125
|
+
list = all_collections.select { |name| name.starts_with?(selector) }
|
126
|
+
list.inject('') { |r, e| r << migrate_one(e) }
|
127
|
+
end
|
128
|
+
|
129
|
+
###########################################################################
|
130
|
+
#class #{migration_name} < ActiveRecord::Migration[7.0]
|
131
|
+
# def change
|
132
|
+
# create_table :products do |t|
|
133
|
+
# t.string :name
|
134
|
+
# t.text :description
|
135
|
+
#
|
136
|
+
# t.timestamps = true
|
137
|
+
# end
|
138
|
+
# end
|
139
|
+
# end
|
140
|
+
###########################################################################
|
141
|
+
def top(migration_name)
|
142
|
+
<<EOT
|
143
|
+
class #{migration_name.classify} < ActiveRecord::Migration[7.0]
|
144
|
+
def change
|
145
|
+
EOT
|
146
|
+
end
|
147
|
+
|
148
|
+
###########################################################################
|
149
|
+
#
|
150
|
+
###########################################################################
|
151
|
+
def bottom
|
152
|
+
<<EOT
|
153
|
+
end
|
154
|
+
end
|
155
|
+
EOT
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
@@ -147,22 +147,24 @@ end
|
|
147
147
|
###########################################################################
|
148
148
|
#
|
149
149
|
###########################################################################
|
150
|
-
def form_field(
|
151
|
-
helper = I18n.t("helpers.label.#{@file_name}.choices4_#{
|
150
|
+
def form_field(field_name, index, offset, field_type)
|
151
|
+
helper = I18n.t("helpers.label.#{@file_name}.choices4_#{field_name}")
|
152
152
|
type, eval = 'select',''
|
153
|
-
if helper.class == Hash
|
154
|
-
if
|
155
|
-
eval = "eval: dc_choices4('#{
|
153
|
+
if helper.class == Hash || helper.match( 'Translation missing' )
|
154
|
+
if field_name[-3, 3] == '_id'
|
155
|
+
eval = "eval: dc_choices4('#{field_name[0, field_name.size - 3]}', 'description_field_name', 'id')\n"
|
156
|
+
elsif field_type.match('Boolean')
|
157
|
+
type = 'check_box'
|
156
158
|
else
|
157
159
|
type = 'text_field'
|
158
160
|
end
|
159
161
|
end
|
160
|
-
|
162
|
+
|
161
163
|
yml = ' '*offset
|
162
164
|
yml << "#{index}:\n"
|
163
165
|
offset += 2
|
164
|
-
|
165
|
-
yml << ' '*offset + "name: #{
|
166
|
+
|
167
|
+
yml << ' '*offset + "name: #{field_name}\n"
|
166
168
|
yml << ' '*offset + "type: #{type}\n"
|
167
169
|
yml << ' '*offset + eval if eval.size > 0
|
168
170
|
yml << ' '*offset + "size: 50\n" if type == 'text_field'
|
@@ -196,40 +198,56 @@ end
|
|
196
198
|
#
|
197
199
|
###########################################################################
|
198
200
|
def form_fields_options
|
199
|
-
forbidden = [
|
201
|
+
forbidden = %w[_id created_by updated_by created_at updated_at]
|
200
202
|
tab_index = 1
|
201
203
|
field_index = 0
|
202
204
|
if options.tabs?
|
203
205
|
yml = " tabs:\n"
|
204
|
-
@model.
|
206
|
+
@model.fields.each do |attr_name, field|
|
205
207
|
next if forbidden.include?(attr_name)
|
208
|
+
|
206
209
|
if field_index%100 == 0
|
207
210
|
yml << " tab#{tab_index}:\n"
|
208
211
|
field_index = 0
|
209
212
|
tab_index += 1
|
210
213
|
end
|
211
214
|
field_index += 10
|
212
|
-
yml << form_field(attr_name, field_index, 6)
|
215
|
+
yml << form_field(attr_name, field_index, 6, field.options[:type].to_s)
|
213
216
|
end
|
214
217
|
yml << " tab#{tab_index}:\n"
|
215
218
|
yml << embedded_form_field(6)
|
219
|
+
|
216
220
|
else
|
217
221
|
yml = " fields:\n"
|
218
|
-
@model.
|
222
|
+
@model.fields.each do |attr_name, field|
|
219
223
|
next if forbidden.include?(attr_name)
|
224
|
+
|
220
225
|
field_index += 10
|
221
|
-
yml << form_field(attr_name, field_index, 4)
|
226
|
+
yml << form_field(attr_name, field_index, 4, field.options[:type].to_s)
|
222
227
|
end
|
223
228
|
yml << embedded_form_field(4)
|
224
229
|
end
|
225
230
|
yml
|
226
231
|
end
|
227
232
|
|
233
|
+
###########################################################################
|
234
|
+
#
|
235
|
+
###########################################################################
|
236
|
+
def xform_fields_options
|
237
|
+
forbidden = %w[_id created_by updated_by created_at updated_at]
|
238
|
+
tab_index = 1
|
239
|
+
field_index = 0
|
240
|
+
@model.fields.each do |name, field|
|
241
|
+
pp [name, field.options[:type].to_s]
|
242
|
+
#pp [name, type]
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
228
246
|
###########################################################################
|
229
247
|
#
|
230
248
|
###########################################################################
|
231
249
|
def localize_options
|
232
|
-
forbidden = [
|
250
|
+
forbidden = %w[_id created_by updated_by created_at updated_at]
|
233
251
|
yml =<<EOT
|
234
252
|
|
235
253
|
#################################################################
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drg_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damjan Rems
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: non-
|
56
|
+
name: non-digest-assets
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -196,7 +196,7 @@ files:
|
|
196
196
|
- app/assets/images/throbber.gif
|
197
197
|
- app/assets/javascripts/drg_cms/drg_cms.js
|
198
198
|
- app/assets/javascripts/drg_cms/jquery-migrate.js
|
199
|
-
- app/assets/javascripts/drg_cms/jquery.bpopup.
|
199
|
+
- app/assets/javascripts/drg_cms/jquery.bpopup.js
|
200
200
|
- app/assets/javascripts/drg_cms/jquery.datetimepicker.js
|
201
201
|
- app/assets/javascripts/drg_cms/jstree.min.js
|
202
202
|
- app/assets/javascripts/drg_cms/select-multiple.js
|
@@ -217,11 +217,13 @@ files:
|
|
217
217
|
- app/controllers/dc_main_controller.rb
|
218
218
|
- app/controls/browse_models_control.rb
|
219
219
|
- app/controls/cmsedit_control.rb
|
220
|
-
- app/controls/
|
220
|
+
- app/controls/dc_gallery_control.rb
|
221
221
|
- app/controls/dc_help_control.rb
|
222
|
+
- app/controls/dc_image_control.rb
|
222
223
|
- app/controls/dc_page_control.rb
|
223
224
|
- app/controls/dc_poll_result_control.rb
|
224
225
|
- app/controls/dc_report.rb
|
226
|
+
- app/controls/dc_setup_control.rb
|
225
227
|
- app/controls/design_element_settings_control.rb
|
226
228
|
- app/forms/all_options.yml
|
227
229
|
- app/forms/cms_forms.yml
|
@@ -240,6 +242,8 @@ files:
|
|
240
242
|
- app/forms/dc_gallery.yml
|
241
243
|
- app/forms/dc_help_1.yml
|
242
244
|
- app/forms/dc_ident.yml
|
245
|
+
- app/forms/dc_image.yml
|
246
|
+
- app/forms/dc_image_search.yml
|
243
247
|
- app/forms/dc_journal.yml
|
244
248
|
- app/forms/dc_json_ld.yml
|
245
249
|
- app/forms/dc_key_value.yml
|
@@ -261,6 +265,7 @@ files:
|
|
261
265
|
- app/forms/dc_poll_result_export.yml
|
262
266
|
- app/forms/dc_removed_url.yml
|
263
267
|
- app/forms/dc_seo.yml
|
268
|
+
- app/forms/dc_setup.yml
|
264
269
|
- app/forms/dc_simple_menu.yml
|
265
270
|
- app/forms/dc_simple_menu_item.yml
|
266
271
|
- app/forms/dc_site.yml
|
@@ -277,6 +282,7 @@ files:
|
|
277
282
|
- app/helpers/cms_index_helper.rb
|
278
283
|
- app/helpers/dc_application_helper.rb
|
279
284
|
- app/helpers/dc_category_helper.rb
|
285
|
+
- app/helpers/dc_image_helper.rb
|
280
286
|
- app/models/concerns/dc_page_concern.rb
|
281
287
|
- app/models/concerns/dc_piece_concern.rb
|
282
288
|
- app/models/concerns/dc_policy_rule_concern.rb
|
@@ -295,6 +301,7 @@ files:
|
|
295
301
|
- app/models/dc_folder_permission.rb
|
296
302
|
- app/models/dc_gallery.rb
|
297
303
|
- app/models/dc_ident.rb
|
304
|
+
- app/models/dc_image.rb
|
298
305
|
- app/models/dc_internals.rb
|
299
306
|
- app/models/dc_journal.rb
|
300
307
|
- app/models/dc_json_ld.rb
|
@@ -315,6 +322,7 @@ files:
|
|
315
322
|
- app/models/dc_poll_item.rb
|
316
323
|
- app/models/dc_poll_result.rb
|
317
324
|
- app/models/dc_removed_url.rb
|
325
|
+
- app/models/dc_setup.rb
|
318
326
|
- app/models/dc_simple_menu.rb
|
319
327
|
- app/models/dc_simple_menu_item.rb
|
320
328
|
- app/models/dc_site.rb
|
@@ -376,7 +384,6 @@ files:
|
|
376
384
|
- app/views/dc_common/_help.html.erb
|
377
385
|
- app/views/dc_common/_iframe_edit.html.erb
|
378
386
|
- app/views/dc_common/paste_clipboard.html.erb
|
379
|
-
- app/views/layouts/__cmsedit.html.erb
|
380
387
|
- app/views/layouts/cms.html.erb
|
381
388
|
- app/views/layouts/content.html.erb
|
382
389
|
- app/views/layouts/models.html.erb
|
@@ -396,6 +403,8 @@ files:
|
|
396
403
|
- lib/drg_cms.rb
|
397
404
|
- lib/drg_cms/engine.rb
|
398
405
|
- lib/drg_cms/version.rb
|
406
|
+
- lib/generators/convert_to_ar/USAGE
|
407
|
+
- lib/generators/convert_to_ar/convert_to_ar_generator.rb
|
399
408
|
- lib/generators/new_drg_form/USAGE
|
400
409
|
- lib/generators/new_drg_form/new_drg_form_generator.rb
|
401
410
|
- lib/tasks/browse_models.rake
|
@@ -440,7 +449,7 @@ homepage: https://www.drgcms.org
|
|
440
449
|
licenses:
|
441
450
|
- MIT
|
442
451
|
metadata: {}
|
443
|
-
post_install_message:
|
452
|
+
post_install_message:
|
444
453
|
rdoc_options: []
|
445
454
|
require_paths:
|
446
455
|
- lib
|
@@ -455,8 +464,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
455
464
|
- !ruby/object:Gem::Version
|
456
465
|
version: '0'
|
457
466
|
requirements: []
|
458
|
-
rubygems_version: 3.
|
459
|
-
signing_key:
|
467
|
+
rubygems_version: 3.4.10
|
468
|
+
signing_key:
|
460
469
|
specification_version: 4
|
461
470
|
summary: 'DRG: Rapid web application development tool and CMS for Ruby, Rails and
|
462
471
|
MongoDB'
|
@@ -1,7 +0,0 @@
|
|
1
|
-
/*================================================================================
|
2
|
-
* @name: bPopup - if you can't get it up, use bPopup
|
3
|
-
* @author: (c)Bjoern Klinggaard (twitter@bklinggaard)
|
4
|
-
* @demo: http://dinbror.dk/bpopup
|
5
|
-
* @version: 0.11.0.min
|
6
|
-
================================================================================*/
|
7
|
-
(function(c){c.fn.bPopup=function(A,E){function L(){a.contentContainer=c(a.contentContainer||b);switch(a.content){case "iframe":var d=c('<iframe class="b-iframe" '+a.iframeAttr+"></iframe>");d.appendTo(a.contentContainer);t=b.outerHeight(!0);u=b.outerWidth(!0);B();d.attr("src",a.loadUrl);l(a.loadCallback);break;case "image":B();c("<img />").load(function(){l(a.loadCallback);F(c(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:B(),c('<div class="b-ajax-wrapper"></div>').load(a.loadUrl,a.loadData,function(d,b,e){l(a.loadCallback,b);F(c(this))}).hide().appendTo(a.contentContainer)}}function B(){a.modal&&c('<div class="b-modal '+e+'"></div>').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+v}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);C();b.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?f.scrollLeft()+w:-1*(x+u):m(!(!a.follow[0]&&n||g)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?f.scrollTop()+y:z+-1*t:p(!(!a.follow[1]&&q||g)),"z-index":a.zIndex+v+1}).each(function(){a.appending&&c(this).appendTo(a.appendTo)});G(!0)}function r(){a.modal&&c(".b-modal."+b.data("id")).fadeTo(a.speed,0,function(){c(this).remove()});a.scrollBar||c("html").css("overflow","auto");c(".b-modal."+e).unbind("click");f.unbind("keydown."+e);k.unbind("."+e).data("bPopup",0<k.data("bPopup")-1?k.data("bPopup")-1:null);b.undelegate(".bClose, ."+a.closeClass,"click."+e,r).data("bPopup",null);clearTimeout(H);G();return!1}function I(d){y=k.height();w=k.width();h=D();if(h.x||h.y)clearTimeout(J),J=setTimeout(function(){C();d=d||a.followSpeed;var e={};h.x&&(e.left=a.follow[0]?m(!0):"auto");h.y&&(e.top=a.follow[1]?p(!0):"auto");b.dequeue().each(function(){g?c(this).css({left:x,top:z}):c(this).animate(e,d,a.followEasing)})},50)}function F(d){var c=d.width(),e=d.height(),f={};a.contentContainer.css({height:e,width:c});e>=b.height()&&(f.height=b.height());c>=b.width()&&(f.width=b.width());t=b.outerHeight(!0);u=b.outerWidth(!0);C();a.contentContainer.css({height:"auto",width:"auto"});f.left=m(!(!a.follow[0]&&n||g));f.top=p(!(!a.follow[1]&&q||g));b.animate(f,250,function(){d.show();h=D()})}function M(){k.data("bPopup",v);b.delegate(".bClose, ."+a.closeClass,"click."+e,r);a.modalClose&&c(".b-modal."+e).css("cursor","pointer").bind("click",r);N||!a.follow[0]&&!a.follow[1]||k.bind("scroll."+e,function(){if(h.x||h.y){var d={};h.x&&(d.left=a.follow[0]?m(!g):"auto");h.y&&(d.top=a.follow[1]?p(!g):"auto");b.dequeue().animate(d,a.followSpeed,a.followEasing)}}).bind("resize."+e,function(){I()});a.escClose&&f.bind("keydown."+e,function(a){27==a.which&&r()})}function G(d){function c(e){b.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){K(d)})}switch(d?a.transition:a.transitionClose||a.transition){case "slideIn":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()-(u||b.outerWidth(!0))-200});break;case "slideBack":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()+w+200});break;case "slideDown":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()-(t||b.outerHeight(!0))-200});break;case "slideUp":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()+y+200});break;default:b.stop().fadeTo(a.speed,d?1:0,function(){K(d)})}}function K(d){d?(M(),l(E),a.autoClose&&(H=setTimeout(r,a.autoClose))):(b.hide(),l(a.onClose),a.loadUrl&&(a.contentContainer.empty(),b.css({height:"auto",width:"auto"})))}function m(a){return a?x+f.scrollLeft():x}function p(a){return a?z+f.scrollTop():z}function l(a,e){c.isFunction(a)&&a.call(b,e)}function C(){z=q?a.position[1]:Math.max(0,(y-b.outerHeight(!0))/2-a.amsl);x=n?a.position[0]:(w-b.outerWidth(!0))/2;h=D()}function D(){return{x:w>b.outerWidth(!0),y:y>b.outerHeight(!0)}}c.isFunction(A)&&(E=A,A=null);var a=c.extend({},c.fn.bPopup.defaults,A);a.scrollBar||c("html").css("overflow","hidden");var b=this,f=c(document),k=c(window),y=k.height(),w=k.width(),N=/OS 6(_\d)+/i.test(navigator.userAgent),v=0,e,h,q,n,g,z,x,t,u,J,H;b.close=function(){r()};b.reposition=function(a){I(a)};return b.each(function(){c(this).data("bPopup")||(l(a.onOpen),v=(k.data("bPopup")||0)+1,e="__b-popup"+v+"__",q="auto"!==a.position[1],n="auto"!==a.position[0],g="fixed"===a.positionStyle,t=b.outerHeight(!0),u=b.outerWidth(!0),a.loadUrl?L():B())})};c.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery);
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title><%= @page_title %></title>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<%= stylesheet_link_tag "cms", media: 'all' %>
|
7
|
-
<style type="text/css" media="all"><%= "#{@site.css}#{@design.css}\n#{@page.css}".html_safe if @page %></style>
|
8
|
-
<%= @site.header.html_safe if @site %>
|
9
|
-
<%= javascript_include_tag "cms" %>
|
10
|
-
<%= csrf_meta_tags %>
|
11
|
-
</head>
|
12
|
-
|
13
|
-
<body>
|
14
|
-
<%= yield %>
|
15
|
-
</body>
|
16
|
-
</html>
|