etabliocms_core 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/admin-core.js +1 -1
- data/app/assets/javascripts/core.js +33 -0
- data/app/assets/stylesheets/admin-core.css +1 -1
- data/app/assets/stylesheets/{admin.css.scss → core.css.scss} +20 -1
- data/app/assets/stylesheets/shared.css.scss +1 -0
- data/app/controllers/etabliocms_core/admin/base_controller.rb +1 -0
- data/app/helpers/etabliocms_core/admin/nested_fields_helper.rb +21 -0
- data/app/models/etabliocms_core/user.rb +2 -0
- data/app/views/etabliocms_core/admin/users/_form.html.erb +1 -1
- data/app/views/layouts/admin.html.erb +6 -0
- data/config/locales/core.cs.yml +2 -0
- data/db/migrate/20120314110048_create_versions.etabliocms_core_engine.rb +13 -0
- data/lib/etabliocms_core/engine.rb +1 -0
- data/lib/etabliocms_core/version.rb +1 -1
- metadata +37 -24
- data/app/assets/javascripts/admin.js +0 -11
@@ -0,0 +1,33 @@
|
|
1
|
+
var Admin = function() {
|
2
|
+
|
3
|
+
return {
|
4
|
+
initPopUp : function() {
|
5
|
+
$('a[data-popup=true]').click(function(e) {
|
6
|
+
e.preventDefault();
|
7
|
+
window.open($(this).attr('href'));
|
8
|
+
})
|
9
|
+
},
|
10
|
+
|
11
|
+
hideAndDestroyFields : function(self) {
|
12
|
+
var $self = $(self);
|
13
|
+
$self.closest(".fields").hide().
|
14
|
+
find("input[type=hidden]").val("1");
|
15
|
+
},
|
16
|
+
|
17
|
+
addFields : function(selector, content, association) {
|
18
|
+
var object_id = new Date().getTime().toString().substring(5);
|
19
|
+
var regexp = new RegExp("new_" + association, "g");
|
20
|
+
content = content.replace(regexp, object_id);
|
21
|
+
|
22
|
+
content = $(content);
|
23
|
+
content.find("input[data-kind=position]").val(object_id);
|
24
|
+
$('label', content).each(function(i) {
|
25
|
+
var id = 'id-' + new Date().getTime() + i;
|
26
|
+
$(this).attr('for', id).next().find('select:enabled, input:enabled').attr('id', id);
|
27
|
+
$(this).next('input, textarea, select').attr('id', id);
|
28
|
+
});
|
29
|
+
|
30
|
+
$(selector).append(content);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}();
|
@@ -127,6 +127,10 @@ fieldset { border:0; clear:both;
|
|
127
127
|
&.small-text-area { height:50px; }
|
128
128
|
}
|
129
129
|
.submit { float:right; margin-right:3px; }
|
130
|
+
.submit-box { width: 750px; text-align: right; margin-top: 15px;
|
131
|
+
.submit { float: none;}
|
132
|
+
span.or { padding: 0 10px; font-style: italic; }
|
133
|
+
}
|
130
134
|
.checkbox label {width:160px; }
|
131
135
|
.multiple-select { height:5em; }
|
132
136
|
input {
|
@@ -159,7 +163,7 @@ table {
|
|
159
163
|
&.admin-table { border-collapse: collapse;
|
160
164
|
td { padding: 3px; border: 1px solid $grey_dark; }
|
161
165
|
}
|
162
|
-
.centered { text-align: center;
|
166
|
+
.centered { text-align: center; }
|
163
167
|
.thumbnail { max-width: 250px; overflow: hidden;
|
164
168
|
img { max-width: 240px; }
|
165
169
|
}
|
@@ -169,6 +173,9 @@ table {
|
|
169
173
|
|
170
174
|
/* OTHER */
|
171
175
|
.submit { border: 4px solid $background_dark; background: $background_dark; font-weight: bold; color: white; font-size: 1.1em; @include round(); }
|
176
|
+
.handle { text-align: center;
|
177
|
+
img:hover { cursor: pointer }
|
178
|
+
}
|
172
179
|
|
173
180
|
#flash { text-align:center; margin: 10px 100px;
|
174
181
|
p { margin:0; border:0; padding: 10px; background: none;
|
@@ -190,3 +197,15 @@ table {
|
|
190
197
|
}
|
191
198
|
|
192
199
|
#errorExplanation { margin: 0 0 20px 0;}
|
200
|
+
|
201
|
+
.nested-fields-table { border-collapse: collapse; margin: 10px 0 20px 0;
|
202
|
+
th { font-weight: bold; text-align:center; }
|
203
|
+
tbody td { padding:4px 2px; border:0;
|
204
|
+
&.thumbnail{ text-align: center;
|
205
|
+
img { max-height: 35px; }
|
206
|
+
}
|
207
|
+
}
|
208
|
+
tr.fields { line-height: 15px;
|
209
|
+
td { vertical-align: middle; }
|
210
|
+
}
|
211
|
+
}
|
@@ -24,5 +24,6 @@
|
|
24
24
|
.icon-refresh { background: image_url('icons/icon-refresh.gif'); }
|
25
25
|
.icon-pause { background: image_url('icons/icon-pause.gif'); }
|
26
26
|
.icon-stop { background: image_url('icons/icon-stop.gif'); }
|
27
|
+
.icon-copypaste { background: image_url('icons/icon-copypaste.png'); }
|
27
28
|
|
28
29
|
.public-icon-top { background-image: image_url('public/icon-top.png'); }
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module EtabliocmsCore
|
2
|
+
module Admin
|
3
|
+
module NestedFieldsHelper
|
4
|
+
|
5
|
+
def link_to_add_fields(name, f, association, target, options = {})
|
6
|
+
new_object = f.object.class.reflect_on_association(association).klass.new
|
7
|
+
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
|
8
|
+
render(association.to_s.singularize + "_fields", :builder => builder)
|
9
|
+
end
|
10
|
+
link_to_function(name,
|
11
|
+
"Admin.addFields('#{target}', '#{escape_javascript(fields)}', '#{association}')",
|
12
|
+
options).html_safe
|
13
|
+
end
|
14
|
+
|
15
|
+
def link_to_remove_fields(name, f)
|
16
|
+
f.hidden_field(:_destroy) + link_to_function(name, "Admin.hideAndDestroyFields(this)")
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -14,6 +14,12 @@
|
|
14
14
|
<title><%= yield :title %> | <%= t('admin.admin') %> </title>
|
15
15
|
<%= stylesheet_link_tag "admin-core" %>
|
16
16
|
<%= javascript_include_tag "admin-core" %>
|
17
|
+
|
18
|
+
<% if defined? EtabliocmsPages %>
|
19
|
+
<%= stylesheet_link_tag "admin-pages" %>
|
20
|
+
<%= javascript_include_tag "admin-pages" %>
|
21
|
+
<% end %>
|
22
|
+
|
17
23
|
<%= csrf_meta_tags %>
|
18
24
|
</head>
|
19
25
|
|
data/config/locales/core.cs.yml
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateVersions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :versions do |t|
|
4
|
+
t.string :item_type, :null => false
|
5
|
+
t.integer :item_id, :null => false
|
6
|
+
t.string :event, :null => false
|
7
|
+
t.string :whodunnit
|
8
|
+
t.text :object
|
9
|
+
t.datetime :created_at
|
10
|
+
end
|
11
|
+
add_index :versions, [:item_type, :item_id]
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etabliocms_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &12608440 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *12608440
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &12551400 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *12551400
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jquery-ui-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &12549840 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *12549840
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: devise
|
49
|
-
requirement: &
|
49
|
+
requirement: &12547980 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.0.4
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *12547980
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: configatron
|
60
|
-
requirement: &
|
60
|
+
requirement: &12546420 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *12546420
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: RedCloth
|
71
|
-
requirement: &
|
71
|
+
requirement: &12544560 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - =
|
@@ -76,10 +76,21 @@ dependencies:
|
|
76
76
|
version: 4.2.9
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *12544560
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: paper_trail
|
82
|
+
requirement: &12559760 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *12559760
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: acts_as_sluggy
|
82
|
-
requirement: &
|
93
|
+
requirement: &12558520 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,10 +98,10 @@ dependencies:
|
|
87
98
|
version: '0'
|
88
99
|
type: :runtime
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *12558520
|
91
102
|
- !ruby/object:Gem::Dependency
|
92
103
|
name: extended_nested_set
|
93
|
-
requirement: &
|
104
|
+
requirement: &12557600 !ruby/object:Gem::Requirement
|
94
105
|
none: false
|
95
106
|
requirements:
|
96
107
|
- - ! '>='
|
@@ -98,10 +109,10 @@ dependencies:
|
|
98
109
|
version: '0'
|
99
110
|
type: :runtime
|
100
111
|
prerelease: false
|
101
|
-
version_requirements: *
|
112
|
+
version_requirements: *12557600
|
102
113
|
- !ruby/object:Gem::Dependency
|
103
114
|
name: textile_extension_pack
|
104
|
-
requirement: &
|
115
|
+
requirement: &12556680 !ruby/object:Gem::Requirement
|
105
116
|
none: false
|
106
117
|
requirements:
|
107
118
|
- - ! '>='
|
@@ -109,10 +120,10 @@ dependencies:
|
|
109
120
|
version: '0'
|
110
121
|
type: :runtime
|
111
122
|
prerelease: false
|
112
|
-
version_requirements: *
|
123
|
+
version_requirements: *12556680
|
113
124
|
- !ruby/object:Gem::Dependency
|
114
125
|
name: sqlite3
|
115
|
-
requirement: &
|
126
|
+
requirement: &12555900 !ruby/object:Gem::Requirement
|
116
127
|
none: false
|
117
128
|
requirements:
|
118
129
|
- - ! '>='
|
@@ -120,7 +131,7 @@ dependencies:
|
|
120
131
|
version: '0'
|
121
132
|
type: :development
|
122
133
|
prerelease: false
|
123
|
-
version_requirements: *
|
134
|
+
version_requirements: *12555900
|
124
135
|
description: Small CMS
|
125
136
|
email:
|
126
137
|
- patrikjira@gmail.com
|
@@ -140,11 +151,11 @@ files:
|
|
140
151
|
- app/views/etabliocms_core/admin/users/new.html.erb
|
141
152
|
- app/views/etabliocms_core/admin/users/edit.html.erb
|
142
153
|
- app/views/etabliocms_core/admin/users/index.html.erb
|
154
|
+
- app/assets/javascripts/core.js
|
143
155
|
- app/assets/javascripts/shared.js
|
144
|
-
- app/assets/javascripts/admin.js
|
145
156
|
- app/assets/javascripts/admin-core.js
|
146
157
|
- app/assets/stylesheets/shared.css.scss
|
147
|
-
- app/assets/stylesheets/
|
158
|
+
- app/assets/stylesheets/core.css.scss
|
148
159
|
- app/assets/stylesheets/admin-core.css
|
149
160
|
- app/assets/images/admin/background-sidebar-top.png
|
150
161
|
- app/assets/images/admin/line-heading.gif
|
@@ -203,6 +214,7 @@ files:
|
|
203
214
|
- app/controllers/etabliocms_core/application_controller_extension.rb
|
204
215
|
- app/models/etabliocms_core/user.rb
|
205
216
|
- app/helpers/etabliocms_core/output_helper.rb
|
217
|
+
- app/helpers/etabliocms_core/admin/nested_fields_helper.rb
|
206
218
|
- app/helpers/etabliocms_core/admin/table_tree_helper.rb
|
207
219
|
- app/helpers/etabliocms_core/application_helper.rb
|
208
220
|
- config/routes.rb
|
@@ -211,6 +223,7 @@ files:
|
|
211
223
|
- config/locales/devise.cs.yml
|
212
224
|
- config/locales/core.cs.yml
|
213
225
|
- config/locales/cs.rb
|
226
|
+
- db/migrate/20120314110048_create_versions.etabliocms_core_engine.rb
|
214
227
|
- db/migrate/20120222142355_create_users.etabliocms_core_engine.rb
|
215
228
|
- lib/form_helper.rb
|
216
229
|
- lib/etabliocms_core/version.rb
|