sunrise-cms 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/sunrise/main.css +31 -3
- data/app/controllers/sunrise/manager_controller.rb +2 -2
- data/app/views/sunrise/manager/structures/tree/_record.html.erb +10 -4
- data/config/locales/sunrise/uk.yml +62 -63
- data/lib/sunrise/models/ability.rb +3 -0
- data/lib/sunrise/version.rb +1 -1
- data/spec/controllers/sunrise/manager_controller_spec.rb +7 -0
- data/spec/dummy/log/test.log +11655 -0
- data/vendor/assets/images/sunrise/top_logo_black.png +0 -0
- metadata +3 -2
@@ -360,7 +360,6 @@ input[disabled].button.gray {
|
|
360
360
|
}
|
361
361
|
/* new css code */
|
362
362
|
.sub-wrapper .main-list li {
|
363
|
-
padding:10px 0 10px 30px;
|
364
363
|
font-weight:bold;
|
365
364
|
text-shadow:#000 1px 2px 0;
|
366
365
|
}
|
@@ -368,7 +367,6 @@ input[disabled].button.gray {
|
|
368
367
|
display: block;
|
369
368
|
height:27px;
|
370
369
|
padding: 10px 30px 0 65px;
|
371
|
-
margin:-10px 0 -10px -30px;
|
372
370
|
color: #fff;
|
373
371
|
text-decoration: none;
|
374
372
|
font-size: 15px;
|
@@ -383,7 +381,7 @@ input[disabled].button.gray {
|
|
383
381
|
padding: 9px 30px 9px 65px;
|
384
382
|
font-size: 15px;
|
385
383
|
display: block;
|
386
|
-
color: #952c9e
|
384
|
+
/* color: #952c9e;*/
|
387
385
|
}
|
388
386
|
.sub-wrapper .main-list li a:hover, .sub-wrapper .inner-list li a:hover {
|
389
387
|
background-color: #000 !important;
|
@@ -408,6 +406,12 @@ input[disabled].button.gray {
|
|
408
406
|
.sub-wrapper .main-list li span.icon5 {
|
409
407
|
background: url(/assets/sunrise/top_logo.png) no-repeat 30px center;
|
410
408
|
}
|
409
|
+
.sub-wrapper .main-list li span.icon1,
|
410
|
+
.sub-wrapper .main-list li span.icon2,
|
411
|
+
.sub-wrapper .main-list li span.icon3,
|
412
|
+
.sub-wrapper .main-list li span.icon4 {
|
413
|
+
background: url(/assets/sunrise/top_logo_black.png) no-repeat 30px center;
|
414
|
+
}
|
411
415
|
.sub-wrapper .inner-list {
|
412
416
|
display: block;
|
413
417
|
float: left;
|
@@ -1699,3 +1703,27 @@ div.input.date .calend-holder {
|
|
1699
1703
|
} */
|
1700
1704
|
|
1701
1705
|
/* \\\\tree stuff */
|
1706
|
+
|
1707
|
+
|
1708
|
+
/* first_structure_icons */
|
1709
|
+
.treeHolder ul li div {
|
1710
|
+
padding-right: 50px;
|
1711
|
+
}
|
1712
|
+
.treeHolder ul li div.first_structure_icons {
|
1713
|
+
position: absolute;
|
1714
|
+
top: 0;
|
1715
|
+
right: 0;
|
1716
|
+
z-index: 10;
|
1717
|
+
padding: 0;
|
1718
|
+
height: 36px;
|
1719
|
+
}
|
1720
|
+
.treeHolder ul li div.first_structure_icons a {
|
1721
|
+
right: 0;
|
1722
|
+
}
|
1723
|
+
.treeHolder ul li div.first_structure_icons a.btn_edit {
|
1724
|
+
right: 10px;
|
1725
|
+
}
|
1726
|
+
.treeHolder ul li div.first_structure_icons a.btn_del {
|
1727
|
+
right: 10px;
|
1728
|
+
}
|
1729
|
+
/* end first_structure_icons */
|
@@ -80,7 +80,7 @@ module Sunrise
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def mass_destroy
|
83
|
-
abstract_model.model.destroy_all(
|
83
|
+
abstract_model.model.destroy_all(:id => params[:ids]) unless params[:ids].blank?
|
84
84
|
|
85
85
|
respond_to do |format|
|
86
86
|
format.html { redirect_to redirect_after_update }
|
@@ -144,7 +144,7 @@ module Sunrise
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def authorize_resource
|
147
|
-
authorize!(action_name, @record || abstract_model.model, :context => :sunrise)
|
147
|
+
authorize!(action_name.to_sym, @record || abstract_model.model, :context => :sunrise)
|
148
148
|
end
|
149
149
|
|
150
150
|
def scoped_index_path(options = {})
|
@@ -1,10 +1,16 @@
|
|
1
1
|
<%= content_tag :li, :id => dom_id(record) do -%>
|
2
2
|
<div>
|
3
3
|
<%= link_to record.send(abstract_model.config.object_label_method), manage_structure_path(record) %>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
|
5
|
+
<% if record.root? %>
|
6
|
+
<div class="first_structure_icons">
|
7
|
+
<%= link_to '', edit_path(abstract_model.parent_hash.merge(:id => record.id)), :class => "btn_edit", :id => dom_id(record, :edit) if can?(:edit, record) %>
|
8
|
+
</div>
|
9
|
+
<% else %>
|
10
|
+
<%= link_to '', edit_path(abstract_model.parent_hash.merge(:id => record.id)), :class => "btn_edit", :id => dom_id(record, :edit) if can?(:edit, record) %>
|
11
|
+
|
12
|
+
<%= link_to '', delete_path(abstract_model.parent_hash.merge(:id => record.id)), :method => :delete, :confirm => t("manage.confirm_delete"), :class => "btn_del", :id => dom_id(record, :delete) if can?(:delete, record) %>
|
13
|
+
<% end %>
|
8
14
|
|
9
15
|
<a href="#" class="dnd_link"></a>
|
10
16
|
</div>
|
@@ -87,25 +87,25 @@ uk:
|
|
87
87
|
new_structure: "Створити розділ"
|
88
88
|
user_actions: "Дії"
|
89
89
|
posts: "Блог"
|
90
|
-
new_post: "
|
91
|
-
confirm_delete: "
|
92
|
-
confirm_mass_delete: "
|
93
|
-
prev: "
|
94
|
-
next: "
|
95
|
-
max_size: "Макс
|
96
|
-
keywords: "
|
97
|
-
edit: "
|
98
|
-
delete: "
|
99
|
-
add: "
|
100
|
-
create: "
|
101
|
-
cancel: "
|
102
|
-
update: "
|
103
|
-
sort: "
|
104
|
-
pictures: "
|
105
|
-
download: "
|
106
|
-
close: "
|
107
|
-
search: "
|
108
|
-
filter: "
|
90
|
+
new_post: "Додати пост"
|
91
|
+
confirm_delete: "Ви дійсно хочете видалити запис?"
|
92
|
+
confirm_mass_delete: "Ви дійсно хочете видалити запис (и)?"
|
93
|
+
prev: "Попередня"
|
94
|
+
next: "Наступна"
|
95
|
+
max_size: "Макс розм."
|
96
|
+
keywords: "Ключові слова"
|
97
|
+
edit: "Редагувати"
|
98
|
+
delete: "Видалити"
|
99
|
+
add: "Додати"
|
100
|
+
create: "Створити"
|
101
|
+
cancel: "Скасувати"
|
102
|
+
update: "Оновити"
|
103
|
+
sort: "Сортувати"
|
104
|
+
pictures: "Фотографії"
|
105
|
+
download: "Завантажити"
|
106
|
+
close: "Закрити"
|
107
|
+
search: "Пошук"
|
108
|
+
filter: "Фільтр"
|
109
109
|
|
110
110
|
menu:
|
111
111
|
title: "Розділи та модулі"
|
@@ -131,10 +131,10 @@ uk:
|
|
131
131
|
users: "Користувача"
|
132
132
|
|
133
133
|
settings:
|
134
|
-
title: "
|
135
|
-
mailer: "
|
134
|
+
title: "Налаштування"
|
135
|
+
mailer: "Пошта"
|
136
136
|
route: "Домен"
|
137
|
-
contacts: "
|
137
|
+
contacts: "Контакти"
|
138
138
|
|
139
139
|
locale:
|
140
140
|
ru: "русский"
|
@@ -142,41 +142,41 @@ uk:
|
|
142
142
|
uk: "украинский"
|
143
143
|
|
144
144
|
model_filter:
|
145
|
-
title: "
|
146
|
-
filter: "
|
147
|
-
search: "
|
148
|
-
clear: "
|
149
|
-
total_count: "
|
145
|
+
title: "Фільтр даних"
|
146
|
+
filter: "Фільтр"
|
147
|
+
search: "Пошук"
|
148
|
+
clear: "Очистити"
|
149
|
+
total_count: "Всього"
|
150
150
|
|
151
151
|
position:
|
152
|
-
down: "
|
153
|
-
up: "
|
152
|
+
down: "Опустити вниз"
|
153
|
+
up: "Підняти вверх"
|
154
154
|
|
155
155
|
buttons:
|
156
|
-
create_structure: "
|
157
|
-
table: "
|
156
|
+
create_structure: "Створити розділ"
|
157
|
+
table: "Таблиця"
|
158
158
|
thumbs: "Список"
|
159
|
-
edit_profile: "
|
160
|
-
exit: "
|
159
|
+
edit_profile: "Мій профайл"
|
160
|
+
exit: "Вихід"
|
161
161
|
|
162
162
|
user:
|
163
|
-
actions: "
|
163
|
+
actions: "дії"
|
164
164
|
events:
|
165
|
-
register: "
|
166
|
-
suspend: "
|
167
|
-
delete: "
|
168
|
-
unsuspend: "
|
169
|
-
activate: "
|
170
|
-
unlock: "
|
171
|
-
roles: "
|
165
|
+
register: "Реєстрація"
|
166
|
+
suspend: "Заморозити"
|
167
|
+
delete: "Видалити"
|
168
|
+
unsuspend: "Розморозити"
|
169
|
+
activate: "Активувати"
|
170
|
+
unlock: "Розблокувати"
|
171
|
+
roles: "Ролі"
|
172
172
|
|
173
173
|
users:
|
174
|
-
activated_at: "
|
174
|
+
activated_at: "активація"
|
175
175
|
last_login_ip: "ip"
|
176
176
|
email: "email"
|
177
|
-
category: "
|
178
|
-
name: "
|
179
|
-
export: "
|
177
|
+
category: "категорія"
|
178
|
+
name: "Ім'я"
|
179
|
+
export: "Експортувати"
|
180
180
|
|
181
181
|
sort:
|
182
182
|
_: "-"
|
@@ -187,30 +187,29 @@ uk:
|
|
187
187
|
|
188
188
|
structure:
|
189
189
|
kind:
|
190
|
-
page: "
|
190
|
+
page: "Текстова сторінка"
|
191
191
|
posts: "Блоги"
|
192
|
-
main: "
|
192
|
+
main: "Головна сторінка"
|
193
193
|
promo: "Конкурс"
|
194
|
-
lessons: "
|
195
|
-
faq: "
|
196
|
-
shake: "Shake в банке"
|
194
|
+
lessons: "Приватні уроки"
|
195
|
+
faq: "Питання та відповіді"
|
197
196
|
downloads: "Downloads"
|
198
197
|
redirect: "Redirect"
|
199
|
-
tracks: "
|
200
|
-
wallpapers: "
|
201
|
-
group: "Група
|
198
|
+
tracks: "Музика"
|
199
|
+
wallpapers: "Шпалери"
|
200
|
+
group: "Група сторінок"
|
202
201
|
|
203
202
|
position:
|
204
|
-
default: "
|
205
|
-
menu: "
|
203
|
+
default: "За замовчуванням"
|
204
|
+
menu: "Головне меню"
|
206
205
|
bottom: "Внизу"
|
207
206
|
|
208
207
|
role:
|
209
208
|
kind:
|
210
|
-
guest: "
|
211
|
-
default: "
|
209
|
+
guest: "Гість"
|
210
|
+
default: "Клієнт"
|
212
211
|
moderator: "Модератор"
|
213
|
-
admin: "A
|
212
|
+
admin: "Aдміністратор"
|
214
213
|
redactor: "Редактор"
|
215
214
|
|
216
215
|
tags:
|
@@ -245,15 +244,15 @@ uk:
|
|
245
244
|
sort_order_asc: "по сортировке по возрастанию"
|
246
245
|
|
247
246
|
fileupload:
|
248
|
-
button: "
|
247
|
+
button: "Виберіть файл"
|
249
248
|
max_size: "Макс. р."
|
250
249
|
|
251
250
|
icons:
|
252
|
-
down: "
|
253
|
-
up: "
|
254
|
-
edit: "
|
251
|
+
down: "Опустити вниз"
|
252
|
+
up: "Підняти вгору"
|
253
|
+
edit: "Редагувати"
|
255
254
|
settings: "Настройки"
|
256
|
-
delete: "
|
255
|
+
delete: "Видалити"
|
257
256
|
|
258
257
|
views:
|
259
258
|
pagination:
|
@@ -26,6 +26,9 @@ module Sunrise
|
|
26
26
|
|
27
27
|
# User cannot destroy self account
|
28
28
|
cannot :destroy, ::User, :id => @user.id, :context => :sunrise
|
29
|
+
|
30
|
+
# User cannot destroy root structure
|
31
|
+
cannot :destroy, ::Structure, :kind => ::StructureType.main.id, :context => :sunrise
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
data/lib/sunrise/version.rb
CHANGED
@@ -38,6 +38,13 @@ describe Sunrise::ManagerController do
|
|
38
38
|
get :index, :model_name => "wrong"
|
39
39
|
}.should raise_error ActionController::RoutingError
|
40
40
|
end
|
41
|
+
|
42
|
+
it "should not destroy root structure" do
|
43
|
+
@root.kind.should == ::StructureType.main.id
|
44
|
+
|
45
|
+
controller.should_not_receive(:destroy)
|
46
|
+
delete :destroy, :model_name => "structures", :id => @root.id
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|