sunrise-cms 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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(["id in (?)", params[:ids]]) unless params[:ids].blank?
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
- <%= link_to '', edit_path(abstract_model.parent_hash.merge(:id => record.id)), :class => "btn_edit", :id => dom_id(record, :edit) if can?(:edit, record) %>
6
-
7
- <%= 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) %>
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
@@ -1,3 +1,3 @@
1
1
  module Sunrise
2
- VERSION = "0.4.0".freeze
2
+ VERSION = "0.4.1".freeze
3
3
  end
@@ -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