biovision-regions 0.1.180316 → 0.2.180419
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/regions_controller.rb +3 -3
- data/app/helpers/biovision_regions_helper.rb +1 -1
- data/app/views/admin/privileges/entity/_region.html.erb +1 -1
- data/app/views/admin/regions/entity/_in_list.html.erb +3 -3
- data/app/views/admin/regions/show.html.erb +1 -1
- data/app/views/regions/_region.jbuilder +2 -2
- data/app/views/regions/edit.html.erb +1 -1
- data/app/views/regions/new.html.erb +1 -1
- data/config/routes.rb +16 -13
- data/lib/biovision/regions/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8d872c992f6cbe52c52491f72b11dc2c8b22383fd4ab25fd1c3139825b1e84
|
4
|
+
data.tar.gz: 799d93c776c2e189cfd31d6e788125faa327c64e8f8b906e8f468eaaf4b00321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb8316732d0777858197867b8e649beae50324fa95f9dad839383f6be2400a816cc289ad8a60cab488670af6917be1df69586b7cb9dd910a7025ac6ffa238d27
|
7
|
+
data.tar.gz: 48546040871b82df582ad4b9aad6fb4716b487d5e5aa5d39a6f56ad38df9b2256f46b9e70d6be64442b62ee487a324575bd32c8f07853ac7167ba36ef339fcab
|
@@ -14,7 +14,7 @@ class RegionsController < ApplicationController
|
|
14
14
|
def create
|
15
15
|
@entity = Region.new(creation_parameters)
|
16
16
|
if @entity.save
|
17
|
-
form_processed_ok(admin_region_path(@entity.id))
|
17
|
+
form_processed_ok(admin_region_path(id: @entity.id))
|
18
18
|
else
|
19
19
|
form_processed_with_error(:new)
|
20
20
|
end
|
@@ -34,7 +34,7 @@ class RegionsController < ApplicationController
|
|
34
34
|
# patch /regions/:id
|
35
35
|
def update
|
36
36
|
if @entity.update(entity_parameters)
|
37
|
-
form_processed_ok(admin_region_path(@entity.id))
|
37
|
+
form_processed_ok(admin_region_path(id: @entity.id))
|
38
38
|
else
|
39
39
|
form_processed_with_error(:edit)
|
40
40
|
end
|
@@ -70,7 +70,7 @@ class RegionsController < ApplicationController
|
|
70
70
|
|
71
71
|
def restrict_editing
|
72
72
|
if @entity.locked? || !@entity.editable_by?(current_user)
|
73
|
-
redirect_to admin_region_path(@entity.id), alert: t('regions.edit.forbidden')
|
73
|
+
redirect_to admin_region_path(id: @entity.id), alert: t('regions.edit.forbidden')
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= label_tag element_id, region.name %>
|
5
5
|
</div>
|
6
6
|
<% if region.children_cache.any? %>
|
7
|
-
<ul class="regions" data-url="<%= regions_admin_privilege_path(privilege.id, parent_id: region.id, user_id: user.id) %>">
|
7
|
+
<ul class="regions" data-url="<%= regions_admin_privilege_path(id: privilege.id, parent_id: region.id, user_id: user.id) %>">
|
8
8
|
<li>
|
9
9
|
<button class="add_regions" type="button"><%= t('.deeper_level') %></button>
|
10
10
|
</li>
|
@@ -9,12 +9,12 @@
|
|
9
9
|
<div class="secondary info">
|
10
10
|
<%= t(:user_count, count: entity.users_count) %>
|
11
11
|
</div>
|
12
|
-
<%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_region_path(entity.id) } %>
|
12
|
+
<%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_region_path(id: entity.id) } %>
|
13
13
|
|
14
14
|
<ul class="actions">
|
15
15
|
<li class="lockable <%= (entity.editable_by?(current_user) && !entity.locked?) ? '' : 'hidden' %>">
|
16
|
-
<%= edit_icon edit_region_path(entity) %>
|
16
|
+
<%= edit_icon edit_region_path(id: entity.id) %>
|
17
17
|
</li>
|
18
|
-
<%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_region_path(entity) } %>
|
18
|
+
<%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_region_path(id: entity.id) } %>
|
19
19
|
</ul>
|
20
20
|
</div>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<ul class="actions">
|
14
14
|
<li><%= back_icon(admin_regions_path) %></li>
|
15
15
|
<% if @entity.editable_by?(current_user) && !@entity.locked? %>
|
16
|
-
<li><%= edit_icon edit_region_path(@entity.id) %></li>
|
16
|
+
<li><%= edit_icon edit_region_path(id: @entity.id) %></li>
|
17
17
|
<% end %>
|
18
18
|
</ul>
|
19
19
|
|
@@ -4,8 +4,8 @@ json.attributes do
|
|
4
4
|
json.(region, :parent_id, :name, :short_name, :priority, :slug, :long_slug)
|
5
5
|
end
|
6
6
|
json.links do
|
7
|
-
json.self region_path(region.id, format: :json)
|
8
|
-
json.children children_region_path(region.id)
|
7
|
+
json.self region_path(id: region.id, format: :json)
|
8
|
+
json.children children_region_path(id: region.id)
|
9
9
|
end
|
10
10
|
json.meta do
|
11
11
|
json.child_count region.children_cache.count
|
data/config/routes.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
+
scope '(:locale)', constraints: { locale: /ru|en/ } do
|
3
|
+
namespace :admin do
|
4
|
+
resources :regions, only: [:index, :show] do
|
5
|
+
member do
|
6
|
+
post 'priority', defaults: { format: :json }
|
7
|
+
post 'toggle', defaults: { format: :json }
|
8
|
+
put 'lock', defaults: { format: :json }
|
9
|
+
delete 'lock', action: :unlock, defaults: { format: :json }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# get 'privileges/:id/regions' => 'privileges#regions', as: :regions_admin_privilege, defaults: { format: :json }
|
14
|
+
end
|
2
15
|
|
3
|
-
|
4
|
-
resources :regions, only: [:index, :show] do
|
16
|
+
resources :regions, except: [:update, :destroy] do
|
5
17
|
member do
|
6
|
-
|
7
|
-
post 'toggle', defaults: { format: :json }
|
8
|
-
put 'lock', defaults: { format: :json }
|
9
|
-
delete 'lock', action: :unlock, defaults: { format: :json }
|
18
|
+
get 'children', defaults: { format: :json }
|
10
19
|
end
|
11
20
|
end
|
12
|
-
|
13
|
-
# get 'privileges/:id/regions' => 'privileges#regions', as: :regions_admin_privilege, defaults: { format: :json }
|
14
21
|
end
|
15
22
|
|
16
|
-
resources :regions
|
17
|
-
member do
|
18
|
-
get 'children', defaults: { format: :json }
|
19
|
-
end
|
20
|
-
end
|
23
|
+
resources :regions, only: [:update, :destroy]
|
21
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biovision-regions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.180419
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxim Khan-Magomedov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: '0'
|
241
241
|
requirements: []
|
242
242
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.7.
|
243
|
+
rubygems_version: 2.7.6
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: Regional module for biovision-based application
|