drg_cms 0.6.1.11 → 0.7.0.8
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 +95 -34
- data/app/assets/javascripts/drg_cms/jquery.bpopup.js +372 -0
- data/app/assets/javascripts/drg_cms_application.js +1 -3
- data/app/assets/javascripts/drg_cms_cms.js +3 -4
- data/app/assets/stylesheets/drg_cms/drg_cms.css +37 -5
- data/app/assets/stylesheets/drg_cms/jstree.css +32 -27
- data/app/assets/stylesheets/drg_cms/select-multiple.css +6 -4
- data/app/controllers/cmsedit_controller.rb +22 -24
- data/app/controllers/dc_application_controller.rb +10 -9
- data/app/controllers/dc_common_controller.rb +14 -11
- data/app/controllers/dc_main_controller.rb +0 -1
- data/app/controls/dc_gallery_control.rb +46 -0
- 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 +7 -8
- data/app/controls/dc_report.rb +9 -4
- data/app/controls/design_element_settings_control.rb +88 -37
- data/app/forms/all_options.yml +18 -7
- data/app/forms/cms_menu.yml +10 -4
- data/app/forms/dc_category.yml +17 -8
- data/app/forms/dc_category_as_tree.yml +31 -0
- 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_steps_template.yml +2 -1
- 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_common_helper.rb +24 -16
- data/app/helpers/cms_edit_helper.rb +28 -35
- data/app/helpers/cms_helper.rb +21 -5
- data/app/helpers/cms_index_helper.rb +53 -38
- data/app/helpers/dc_application_helper.rb +95 -121
- data/app/helpers/dc_category_helper.rb +129 -0
- 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 +12 -4
- data/app/models/dc_category.rb +62 -24
- data/app/models/dc_design.rb +5 -4
- data/app/models/dc_filter.rb +19 -18
- data/app/models/dc_image.rb +237 -0
- data/app/models/dc_internals.rb +5 -9
- data/app/models/dc_policy_role.rb +8 -8
- 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 +55 -30
- data/app/models/drgcms_form_fields/embedded.rb +11 -8
- data/app/models/drgcms_form_fields/journal_diff.rb +2 -2
- data/app/models/drgcms_form_fields/multitext_autocomplete.rb +51 -47
- data/app/models/drgcms_form_fields/select.rb +20 -14
- data/app/models/drgcms_form_fields/text_with_select.rb +5 -9
- data/app/models/drgcms_form_fields/tree_select.rb +20 -19
- data/app/renderers/dc_gallery_renderer.rb +10 -4
- data/app/renderers/dc_page_renderer.rb +7 -7
- data/app/renderers/dc_poll_renderer.rb +13 -12
- data/app/views/cmsedit/_edit_stuff.html.erb +1 -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/app/views/layouts/content.html.erb +1 -1
- data/config/locales/drgcms_en.yml +16 -2
- data/config/locales/drgcms_sl.yml +15 -2
- data/config/locales/models_en.yml +33 -0
- data/config/locales/models_sl.yml +44 -1
- data/drg_cms.gemspec +3 -3
- data/lib/drg_cms/version.rb +1 -1
- data/lib/drg_cms.rb +19 -5
- data/lib/generators/convert_to_ar/USAGE +8 -0
- data/lib/generators/convert_to_ar/convert_to_ar_generator.rb +158 -0
- data/lib/tasks/dc_cleanup.rake +20 -42
- metadata +25 -14
- data/History.log +0 -109
- data/app/assets/javascripts/drg_cms/jquery.bpopup.min.js +0 -7
- data/app/views/layouts/__cmsedit.html.erb +0 -16
@@ -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
|
data/lib/tasks/dc_cleanup.rake
CHANGED
@@ -36,30 +36,29 @@ namespace :drg_cms do
|
|
36
36
|
task :clear_sessions, [:name] => :environment do |t, args|
|
37
37
|
p 'This is just an example how to clear sessions collection. It wont do anything because of next line.'
|
38
38
|
return if true
|
39
|
-
# This should remove all sessions documents created by robots
|
40
|
-
# It is quite a task to compare two dates in mongoid. This should not be problem if it is run daily
|
39
|
+
# This should remove all sessions documents created by robots
|
40
|
+
# It is quite a task to compare two dates in mongoid. This should not be problem if it is run daily
|
41
41
|
ActionDispatch::Session::MongoidStore::Session.all.each do |doc|
|
42
|
-
doc.delete if (doc.created_at == doc.updated_at
|
42
|
+
doc.delete if (doc.created_at == doc.updated_at || doc.updated_at < 100.days.ago)
|
43
43
|
end
|
44
|
-
# or if you want to clear everything older than 1 week
|
44
|
+
# or if you want to clear everything older than 1 week
|
45
45
|
ActionDispatch::Session::MongoidStore::Session.where(:updated_at.lt => 1.week.ago).delete
|
46
|
-
DcSite.collection.database.command(
|
46
|
+
DcSite.collection.database.command(compact: 'sessions')
|
47
47
|
end
|
48
48
|
|
49
49
|
###########################################################################
|
50
50
|
desc 'Clears mongodb session documents created by web robots'
|
51
51
|
task :clear_sessions_from_robots, [:name] => :environment do |t, args|
|
52
|
-
# This should remove all sessions documents created by web robots
|
53
|
-
# ActionDispatch::Session::MongoidStore::Session.where('$where' => 'this.created_at == this.updated_at').limit(1000).each do |doc|
|
52
|
+
# This should remove all sessions documents created by web robots
|
54
53
|
n = 0
|
55
54
|
ActionDispatch::Session::MongoidStore::Session.batch_size(1000).all.each do |doc|
|
56
|
-
if (doc.created_at + 2 > doc.updated_at
|
55
|
+
if (doc.created_at + 2 > doc.updated_at || doc.updated_at < 1.year.ago)
|
57
56
|
doc.delete
|
58
|
-
p "Deleted #{n}" if (n+=1)%1000 == 0
|
57
|
+
p "Deleted #{n}" if (n += 1) % 1000 == 0
|
59
58
|
end
|
60
59
|
end
|
61
60
|
p "Deleted #{n}"
|
62
|
-
DcSite.collection.database.command(
|
61
|
+
DcSite.collection.database.command(compact: 'sessions')
|
63
62
|
end
|
64
63
|
|
65
64
|
###########################################################################
|
@@ -72,16 +71,14 @@ namespace :drg_cms do
|
|
72
71
|
return (p "#{archive_file} exists") if File.exist?(archive_file)
|
73
72
|
|
74
73
|
date_to = Time.local(date[0,4].to_i, date[4,2].to_i, date[6,2].to_i).beginning_of_day
|
75
|
-
n = 0
|
76
|
-
save = ''
|
74
|
+
n, save = 0, ''
|
77
75
|
DcVisit.where(:time.lt => date_to).each do |visit|
|
78
76
|
save << visit.to_json + "\n"
|
79
|
-
#
|
80
|
-
p "Deleted #{n}" if (n+=1)%10000 == 0
|
77
|
+
p "Deleted #{n}" if (n += 1) % 10000 == 0
|
81
78
|
end
|
82
79
|
DcVisit.where(:time.lt => date_to).delete
|
83
|
-
File.
|
84
|
-
DcSite.collection.database.command(
|
80
|
+
File.write(archive_file, save)
|
81
|
+
DcSite.collection.database.command(compact: 'dc_visits')
|
85
82
|
end
|
86
83
|
|
87
84
|
###########################################################################
|
@@ -90,39 +87,20 @@ namespace :drg_cms do
|
|
90
87
|
input = read_input("Just press Enter to start. If you type in anything process won't start.")
|
91
88
|
return unless input.to_s.size == 0
|
92
89
|
today = Time.now.beginning_of_day
|
93
|
-
n = 0
|
94
|
-
save_stat, save_ads = '', ''
|
90
|
+
n, save_stat, save_ads = 0, '', ''
|
95
91
|
DcAd.all.each do |ad|
|
96
|
-
if !ad.active
|
92
|
+
if !ad.active || (ad.valid_to && ad.valid_to < today)
|
97
93
|
save_ads << ad.to_json + "\n"
|
98
94
|
DcAdStat.where(:dc_ad_id => ad._id).each do |stat|
|
99
95
|
save_stat << stat.to_json + "\n"
|
100
|
-
p "Deleted #{n}" if (n+=1)%10000 == 0
|
96
|
+
p "Deleted #{n}" if (n += 1) % 10000 == 0
|
101
97
|
end
|
102
98
|
DcAdStat.where(:dc_ad_id => ad._id).delete
|
103
99
|
end
|
104
100
|
end
|
105
|
-
File.
|
106
|
-
File.
|
107
|
-
DcSite.collection.database.command(
|
101
|
+
File.write("ads_stat_#{Time.now.strftime('%Y%d%m')}.json", save_stat)
|
102
|
+
File.write("ads_#{Time.now.strftime('%Y%d%m')}.json", save_ads)
|
103
|
+
DcSite.collection.database.command(compact: 'dc_ad_stats')
|
108
104
|
end
|
109
|
-
|
110
|
-
=begin
|
111
|
-
###########################################################################
|
112
|
-
desc "Correct error when ad_id ield is used instead of dc_ad_id."
|
113
|
-
task :repair_ad_stats, [:name] => :environment do |t, args|
|
114
|
-
input = read_input("Just press Enter to start. If you type in anything process won't start.")
|
115
|
-
return unless input.to_s.size == 0
|
116
|
-
n = 0
|
117
|
-
p DcAdStat.only(:id).where(:dc_ad_id => nil).to_a.size
|
118
|
-
DcAdStat.where(:dc_ad_id => nil).each do |stat|
|
119
|
-
stat.dc_ad_id = stat.ad_id
|
120
|
-
stat.ad_id = nil
|
121
|
-
stat.save
|
122
|
-
|
123
|
-
p n if (n+=1)%1000 == 0
|
124
|
-
end
|
125
|
-
end
|
126
|
-
=end
|
127
|
-
|
105
|
+
|
128
106
|
end
|
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.
|
4
|
+
version: 0.7.0.8
|
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: 2023-07-02 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
|
- - ">="
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: mongoid
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: kaminari-mongoid
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,7 +159,7 @@ executables: []
|
|
159
159
|
extensions: []
|
160
160
|
extra_rdoc_files: []
|
161
161
|
files:
|
162
|
-
-
|
162
|
+
- CHANGELOG.md
|
163
163
|
- MIT-LICENSE
|
164
164
|
- README.md
|
165
165
|
- Rakefile
|
@@ -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,7 +217,9 @@ 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/dc_gallery_control.rb
|
220
221
|
- app/controls/dc_help_control.rb
|
222
|
+
- app/controls/dc_image_control.rb
|
221
223
|
- app/controls/dc_page_control.rb
|
222
224
|
- app/controls/dc_poll_result_control.rb
|
223
225
|
- app/controls/dc_report.rb
|
@@ -232,12 +234,15 @@ files:
|
|
232
234
|
- app/forms/dc_browse_fields.yml
|
233
235
|
- app/forms/dc_browse_models.yml
|
234
236
|
- app/forms/dc_category.yml
|
237
|
+
- app/forms/dc_category_as_tree.yml
|
235
238
|
- app/forms/dc_design.yml
|
236
239
|
- app/forms/dc_filter.yml
|
237
240
|
- app/forms/dc_folder_permission.yml
|
238
241
|
- app/forms/dc_gallery.yml
|
239
242
|
- app/forms/dc_help_1.yml
|
240
243
|
- app/forms/dc_ident.yml
|
244
|
+
- app/forms/dc_image.yml
|
245
|
+
- app/forms/dc_image_search.yml
|
241
246
|
- app/forms/dc_journal.yml
|
242
247
|
- app/forms/dc_json_ld.yml
|
243
248
|
- app/forms/dc_key_value.yml
|
@@ -266,12 +271,16 @@ files:
|
|
266
271
|
- app/forms/dc_user.yml
|
267
272
|
- app/forms/dc_user_role.yml
|
268
273
|
- app/forms/drgcms_cms.yml
|
274
|
+
- app/forms/help/dc_category_as_tree.en
|
275
|
+
- app/forms/help/dc_category_as_tree.sl
|
269
276
|
- app/forms/json_ld_schema.yml
|
270
277
|
- app/helpers/cms_common_helper.rb
|
271
278
|
- app/helpers/cms_edit_helper.rb
|
272
279
|
- app/helpers/cms_helper.rb
|
273
280
|
- app/helpers/cms_index_helper.rb
|
274
281
|
- app/helpers/dc_application_helper.rb
|
282
|
+
- app/helpers/dc_category_helper.rb
|
283
|
+
- app/helpers/dc_image_helper.rb
|
275
284
|
- app/models/concerns/dc_page_concern.rb
|
276
285
|
- app/models/concerns/dc_piece_concern.rb
|
277
286
|
- app/models/concerns/dc_policy_rule_concern.rb
|
@@ -290,6 +299,7 @@ files:
|
|
290
299
|
- app/models/dc_folder_permission.rb
|
291
300
|
- app/models/dc_gallery.rb
|
292
301
|
- app/models/dc_ident.rb
|
302
|
+
- app/models/dc_image.rb
|
293
303
|
- app/models/dc_internals.rb
|
294
304
|
- app/models/dc_journal.rb
|
295
305
|
- app/models/dc_json_ld.rb
|
@@ -371,7 +381,6 @@ files:
|
|
371
381
|
- app/views/dc_common/_help.html.erb
|
372
382
|
- app/views/dc_common/_iframe_edit.html.erb
|
373
383
|
- app/views/dc_common/paste_clipboard.html.erb
|
374
|
-
- app/views/layouts/__cmsedit.html.erb
|
375
384
|
- app/views/layouts/cms.html.erb
|
376
385
|
- app/views/layouts/content.html.erb
|
377
386
|
- app/views/layouts/models.html.erb
|
@@ -391,6 +400,8 @@ files:
|
|
391
400
|
- lib/drg_cms.rb
|
392
401
|
- lib/drg_cms/engine.rb
|
393
402
|
- lib/drg_cms/version.rb
|
403
|
+
- lib/generators/convert_to_ar/USAGE
|
404
|
+
- lib/generators/convert_to_ar/convert_to_ar_generator.rb
|
394
405
|
- lib/generators/new_drg_form/USAGE
|
395
406
|
- lib/generators/new_drg_form/new_drg_form_generator.rb
|
396
407
|
- lib/tasks/browse_models.rake
|
@@ -435,7 +446,7 @@ homepage: https://www.drgcms.org
|
|
435
446
|
licenses:
|
436
447
|
- MIT
|
437
448
|
metadata: {}
|
438
|
-
post_install_message:
|
449
|
+
post_install_message:
|
439
450
|
rdoc_options: []
|
440
451
|
require_paths:
|
441
452
|
- lib
|
@@ -450,8 +461,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
450
461
|
- !ruby/object:Gem::Version
|
451
462
|
version: '0'
|
452
463
|
requirements: []
|
453
|
-
rubygems_version: 3.
|
454
|
-
signing_key:
|
464
|
+
rubygems_version: 3.4.10
|
465
|
+
signing_key:
|
455
466
|
specification_version: 4
|
456
467
|
summary: 'DRG: Rapid web application development tool and CMS for Ruby, Rails and
|
457
468
|
MongoDB'
|
data/History.log
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
|
2
|
-
New features for DRG CMS version up to 0.5.51.1
|
3
|
-
Rails version 5.1 compatibility
|
4
|
-
Ruby version 2.3 is now required
|
5
|
-
select field with multiple can now properly process non BSON array values
|
6
|
-
DRG CMS Form readonly field with readonly : yes option will not be saved to database on save
|
7
|
-
dc_dummy collection will be deprecated and replaced with dc_memory collection. Name was chosen unfortunately
|
8
|
-
DrgForms can now be used for editing YAML settings saved in dc_page document. This enables editing dynamic settings of elements embedded in design
|
9
|
-
cms_edit url can now be used only as cms
|
10
|
-
|
11
|
-
Bugs resolved for DRG CMS version up to 0.5.51.1
|
12
|
-
journal is now able to undelete deleted document
|
13
|
-
|
14
|
-
New features for DRG CMS version up to 0.5.50.4
|
15
|
-
Rails 5.0 compatibility
|
16
|
-
category types can now be defined in dc_big_table under dc_category_type key
|
17
|
-
DrgCms gem routes can now be defined as DrgCms.routes
|
18
|
-
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
|
19
|
-
switch to Rails concern for main model definitions which may be reused.
|
20
|
-
site policy can be inherited from other site
|
21
|
-
menus can now belong to site
|
22
|
-
clear_link method is now a class method of DcPage model and can thus be called directly from other parts of application
|
23
|
-
|
24
|
-
Bugs resolved for DRG CMS version up to 0.5.50.4
|
25
|
-
journal is now able to undelete deleted document
|
26
|
-
|
27
|
-
|
28
|
-
New features for DRG CMS version 0.5.10.14
|
29
|
-
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.
|
30
|
-
result_set filter now has is empty option allowing to filter fields with null value.
|
31
|
-
filter OFF icon now displays currently active filter when hovered.
|
32
|
-
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.
|
33
|
-
multiple option is added to DRGCMS Forms select_field.
|
34
|
-
is_email? class method added to dc_user model.
|
35
|
-
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.
|
36
|
-
dc_choices4_field method implemented. It returns choices that are defined in localization files.
|
37
|
-
categories field changed from multitext_autocomplete to select field with multiple options.
|
38
|
-
a poll form can now be surrounded by div tag thus allowing for additional styling of polls
|
39
|
-
drgcms_controlls files can now also be defined only as control files.
|
40
|
-
journal documents can now be filtered by document id
|
41
|
-
CMS menu redesigned. Instead of pulldown menus are now displayed fixed on the left side of edit area
|
42
|
-
|
43
|
-
Bugs resolved for DRG CMS version 0.5.10.14
|
44
|
-
prevent double form submit when browser is restarted.
|
45
|
-
when user has no role defined guest role is automatically applied
|
46
|
-
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
|
47
|
-
|
48
|
-
|
49
|
-
New features for DRG CMS version 0.5.10
|
50
|
-
|
51
|
-
jQuery javascript library forced to jQuery2
|
52
|
-
Choices for select fields are now UTF-8 sorted since MongoDB does not provide utf sorting.
|
53
|
-
Placeholder text added for text_autocomplete field. It can also be defined in form field html options.
|
54
|
-
Filters option can now have "like" keyword for fields that are not defined on form. For example created_by like user_id.
|
55
|
-
|
56
|
-
Bugs resolved for DRG CMS version 0.5.10
|
57
|
-
|
58
|
-
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.
|
59
|
-
Call before_new callback only when new empty record has been created.
|
60
|
-
|
61
|
-
--
|
62
|
-
|
63
|
-
New features for DRG CMS version 0.5.9
|
64
|
-
|
65
|
-
Main CMS menu was becoming to large and was divided into two menus.
|
66
|
-
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.
|
67
|
-
New DcInternals model introduced. It will be used for accessing internal variables.
|
68
|
-
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.
|
69
|
-
DRG Forms field size can now also be defined on same level as field type. Before it was defined in html sublevel.
|
70
|
-
|
71
|
-
Bugs resolved for DRG CMS version 0.5.9
|
72
|
-
|
73
|
-
Improved readonly display of select and text_autocomplete DRG Forms fields.
|
74
|
-
Text_autocomplete field is set to nil when content of field is deleted.
|
75
|
-
|
76
|
-
--
|
77
|
-
|
78
|
-
New features for DRG CMS version 0.5.8
|
79
|
-
|
80
|
-
Browsing array of hashes is now possible with DRG Forms
|
81
|
-
Simple browsing of all defined models and field definitions added to CMS System menu
|
82
|
-
new result_set options table_style, table_class, tr_style, tr_class, td_style, td_class. Welcome colors to result_set browser
|
83
|
-
result_set has been renewed for more modern design. Header elements have now sorting icons
|
84
|
-
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.
|
85
|
-
|
86
|
-
Bugs resolved for DRG CMS version 0.5.8
|
87
|
-
|
88
|
-
associated menu can now be selected on dc_page form also for non dc_simple_menu menus
|
89
|
-
|
90
|
-
--
|
91
|
-
|
92
|
-
New features for DRG CMS version 0.5.7
|
93
|
-
|
94
|
-
single site document. All data for the site can be saved to single dc_site document and processed by dc_single_sitedoc_request
|
95
|
-
site parts can now also be saved and collected from dc_site document
|
96
|
-
CMS menu done right
|
97
|
-
Page title is now set from dc_page_renderer default method
|
98
|
-
|
99
|
-
Bugs resolved for DRG CMS version 0.5.7
|
100
|
-
|
101
|
-
Corrected bug when multitext_autocomplete field was not displaying right values when displayed readonly
|
102
|
-
|
103
|
-
dc_choices4 now checks if model has active field defined and returns only choices of documents that have active field value set to true
|
104
|
-
|
105
|
-
Design and page edit icons are now displayed only when design or page documents are available
|
106
|
-
|
107
|
-
return_to from drgcms_control was not properly handled
|
108
|
-
|
109
|
-
Mouse cursor now changes to pointer when moved over ajax link
|
@@ -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>
|