biovision-base 0.8.170916 → 0.8.171029

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/biovision/base/placeholders/image.svg +3 -18
  3. data/app/assets/javascripts/biovision/base/biovision.js +228 -124
  4. data/app/assets/stylesheets/biovision/base/admin.scss +8 -7
  5. data/app/assets/stylesheets/biovision/base/biovision.scss +1 -1
  6. data/app/assets/stylesheets/biovision/base/default.scss +6 -3
  7. data/app/assets/stylesheets/biovision/base/default_admin.scss +30 -0
  8. data/app/assets/stylesheets/biovision/base/layout.scss +22 -14
  9. data/app/assets/stylesheets/biovision/base/message-box.scss +8 -1
  10. data/app/controllers/admin/regions_controller.rb +0 -9
  11. data/app/controllers/admin/users_controller.rb +2 -2
  12. data/app/controllers/authentication_controller.rb +4 -1
  13. data/app/controllers/concerns/toggleable_entity.rb +12 -3
  14. data/app/controllers/regions_controller.rb +1 -1
  15. data/app/helpers/biovision_users_helper.rb +18 -8
  16. data/app/models/region.rb +6 -1
  17. data/app/models/user.rb +3 -3
  18. data/app/models/user_profile.rb +8 -0
  19. data/app/services/canonizer.rb +9 -8
  20. data/app/views/admin/metrics/show.html.erb +20 -12
  21. data/app/views/admin/privileges/entity/_groups.html.erb +12 -10
  22. data/app/views/admin/regions/entity/_in_list.html.erb +1 -1
  23. data/app/views/admin/regions/show.html.erb +1 -1
  24. data/app/views/admin/users/_filter.html.erb +2 -14
  25. data/app/views/admin/users/index.html.erb +1 -1
  26. data/app/views/admin/users/privileges.html.erb +53 -38
  27. data/app/views/agents/_filter.html.erb +28 -28
  28. data/app/views/authentication/new.jbuilder +6 -0
  29. data/app/views/editable_pages/_editable_page.html.erb +6 -0
  30. data/app/views/editable_pages/form/_ckeditor.html.erb +3 -3
  31. data/app/views/layouts/admin.html.erb +1 -1
  32. data/app/views/my/recoveries/show.html.erb +1 -1
  33. data/app/views/shared/_breadcrumbs.html.erb +6 -0
  34. data/app/views/shared/_list_of_errors.html.erb +5 -9
  35. data/config/locales/common-ru.yml +22 -22
  36. data/config/locales/users-ru.yml +9 -0
  37. data/config/routes.rb +1 -1
  38. data/db/migrate/20170301000001_create_metrics.rb +1 -1
  39. data/db/migrate/20170301000002_create_metric_values.rb +1 -1
  40. data/db/migrate/20170301000101_create_browsers.rb +1 -1
  41. data/db/migrate/20170301000102_create_agents.rb +1 -1
  42. data/db/migrate/20170301000201_create_regions.rb +4 -1
  43. data/db/migrate/20170302000001_create_users.rb +2 -1
  44. data/db/migrate/20170302000003_create_tokens.rb +1 -1
  45. data/db/migrate/20170302000005_create_codes.rb +1 -1
  46. data/db/migrate/20170302000101_create_privileges.rb +1 -1
  47. data/db/migrate/20170302000102_create_user_privileges.rb +1 -1
  48. data/db/migrate/20170302000103_create_privilege_groups.rb +1 -1
  49. data/db/migrate/20170302000104_create_privilege_group_privileges.rb +1 -1
  50. data/db/migrate/20170320000000_create_editable_pages.rb +4 -1
  51. data/db/migrate/20170425000001_create_foreign_sites.rb +1 -1
  52. data/db/migrate/20170425000002_create_foreign_users.rb +1 -1
  53. data/db/migrate/20171025222222_add_new_fields_171026.rb +29 -0
  54. data/lib/biovision/base/engine.rb +5 -0
  55. data/lib/biovision/base/version.rb +1 -1
  56. metadata +8 -4
@@ -11,6 +11,12 @@ ru:
11
11
  few: "%{count} активации"
12
12
  many: "%{count} активаций"
13
13
  other: "%{count} активаций"
14
+ age_year_count:
15
+ zero: "%{count} лет"
16
+ one: "%{count} год"
17
+ few: "%{count} года"
18
+ many: "%{count} лет"
19
+ other: "%{count} лет"
14
20
  invalid_code: "Недействительный код"
15
21
  could_not_log_in: "Не удалось выполнить вход"
16
22
  logout: "Выйти"
@@ -137,6 +143,8 @@ ru:
137
143
  privileges:
138
144
  title: "Привилегии пользователя %{user}"
139
145
  heading: "Привилегии пользователя"
146
+ filter:
147
+ search: "Искать"
140
148
  tokens:
141
149
  nav_item:
142
150
  text: "Жетоны доступа (сессии пользователей)"
@@ -303,6 +311,7 @@ ru:
303
311
  update_password: "Изменить пароль"
304
312
  no_code: "Нет кода для сброса пароля?"
305
313
  send_code: "Отправить код"
314
+ receive_code: "Получить код"
306
315
  confirmations:
307
316
  create:
308
317
  set_email: "Пожалуйста, заполните адрес электронной почты"
data/config/routes.rb CHANGED
@@ -12,7 +12,7 @@ Rails.application.routes.draw do
12
12
  get 'tos' => :tos
13
13
  end
14
14
 
15
- scope 'u/:slug', controller: :profiles do
15
+ scope 'u/:slug', controller: :profiles, constraints: { slug: /[^\/]+/ } do
16
16
  get '/' => :show, as: :user_profile
17
17
  end
18
18
 
@@ -1,4 +1,4 @@
1
- class CreateMetrics < ActiveRecord::Migration[5.0]
1
+ class CreateMetrics < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Metric.table_exists?
4
4
  create_table :metrics do |t|
@@ -1,4 +1,4 @@
1
- class CreateMetricValues < ActiveRecord::Migration[5.0]
1
+ class CreateMetricValues < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless MetricValue.table_exists?
4
4
  create_table :metric_values do |t|
@@ -1,4 +1,4 @@
1
- class CreateBrowsers < ActiveRecord::Migration[5.0]
1
+ class CreateBrowsers < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Browser.table_exists?
4
4
  create_table :browsers do |t|
@@ -1,4 +1,4 @@
1
- class CreateAgents < ActiveRecord::Migration[5.0]
1
+ class CreateAgents < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Agent.table_exists?
4
4
  create_table :agents do |t|
@@ -10,12 +10,15 @@ class CreateRegions < ActiveRecord::Migration[5.1]
10
10
  t.float :latitude
11
11
  t.float :longitude
12
12
  t.string :slug, null: false
13
- t.string :long_slug, null: false
13
+ t.string :long_slug, null: false, index: true
14
14
  t.string :name, null: false
15
15
  t.string :short_name
16
16
  t.string :locative
17
17
  t.string :image
18
18
  t.string :header_image
19
+ t.string :image_url
20
+ t.text :map_geometry
21
+ t.text :svg_geometry
19
22
  t.string :parents_cache, default: '', null: false
20
23
  t.integer :children_cache, array: true, default: [], null: false
21
24
  end
@@ -1,4 +1,4 @@
1
- class CreateUsers < ActiveRecord::Migration[5.0]
1
+ class CreateUsers < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless User.table_exists?
4
4
  create_table :users do |t|
@@ -15,6 +15,7 @@ class CreateUsers < ActiveRecord::Migration[5.0]
15
15
  t.integer :upvote_count, default: 0, null: false
16
16
  t.integer :downvote_count, default: 0, null: false
17
17
  t.integer :vote_result, default: 0, null: false
18
+ t.integer :balance, default: 0, null: false
18
19
  t.boolean :super_user, default: false, null: false
19
20
  t.boolean :deleted, default: false, null: false
20
21
  t.boolean :bot, default: false, null: false
@@ -1,4 +1,4 @@
1
- class CreateTokens < ActiveRecord::Migration[5.0]
1
+ class CreateTokens < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Token.table_exists?
4
4
  create_table :tokens do |t|
@@ -1,4 +1,4 @@
1
- class CreateCodes < ActiveRecord::Migration[5.0]
1
+ class CreateCodes < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Code.table_exists?
4
4
  create_table :codes do |t|
@@ -1,4 +1,4 @@
1
- class CreatePrivileges < ActiveRecord::Migration[5.0]
1
+ class CreatePrivileges < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless Privilege.table_exists?
4
4
  create_table :privileges do |t|
@@ -1,4 +1,4 @@
1
- class CreateUserPrivileges < ActiveRecord::Migration[5.0]
1
+ class CreateUserPrivileges < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless UserPrivilege.table_exists?
4
4
  create_table :user_privileges do |t|
@@ -1,4 +1,4 @@
1
- class CreatePrivilegeGroups < ActiveRecord::Migration[5.0]
1
+ class CreatePrivilegeGroups < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless PrivilegeGroup.table_exists?
4
4
  create_table :privilege_groups do |t|
@@ -1,4 +1,4 @@
1
- class CreatePrivilegeGroupPrivileges < ActiveRecord::Migration[5.0]
1
+ class CreatePrivilegeGroupPrivileges < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless PrivilegeGroupPrivilege.table_exists?
4
4
  create_table :privilege_group_privileges do |t|
@@ -1,10 +1,13 @@
1
- class CreateEditablePages < ActiveRecord::Migration[5.0]
1
+ class CreateEditablePages < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless EditablePage.table_exists?
4
4
  create_table :editable_pages do |t|
5
5
  t.timestamps
6
+ t.integer :priority, limit: 2, default: 1, null: false
6
7
  t.string :slug, null: false
7
8
  t.string :name, null: false
9
+ t.string :nav_group
10
+ t.string :url
8
11
  t.string :image
9
12
  t.string :title, default: '', null: false
10
13
  t.string :keywords, default: '', null: false
@@ -1,4 +1,4 @@
1
- class CreateForeignSites < ActiveRecord::Migration[5.0]
1
+ class CreateForeignSites < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless ForeignSite.table_exists?
4
4
  create_table :foreign_sites do |t|
@@ -1,4 +1,4 @@
1
- class CreateForeignUsers < ActiveRecord::Migration[5.0]
1
+ class CreateForeignUsers < ActiveRecord::Migration[5.1]
2
2
  def up
3
3
  unless ForeignUser.table_exists?
4
4
  create_table :foreign_users do |t|
@@ -0,0 +1,29 @@
1
+ class AddNewFields171026 < ActiveRecord::Migration[5.1]
2
+ def up
3
+ unless column_exists?(:regions, :image_url)
4
+ change_table :regions do |t|
5
+ t.string :image_url
6
+ t.text :map_geometry
7
+ t.text :svg_geometry
8
+ end
9
+ end
10
+
11
+ unless column_exists?(:editable_pages, :url)
12
+ change_table :editable_pages do |t|
13
+ t.integer :priority, limit: 2, default: 1, null: false
14
+ t.string :url
15
+ t.string :nav_group
16
+ end
17
+ end
18
+
19
+ unless column_exists?(:users, :balance)
20
+ change_table :users do |t|
21
+ t.integer :balance, default: 0, null: false
22
+ end
23
+ end
24
+ end
25
+
26
+ def down
27
+ # No need to rollback
28
+ end
29
+ end
@@ -13,6 +13,11 @@ module Biovision
13
13
  require_dependency(c)
14
14
  end
15
15
  end
16
+
17
+ config.generators do |g|
18
+ g.test_framework :rspec
19
+ g.fixture_replacement :factory_girl, :dir => 'spec/factories'
20
+ end
16
21
  end
17
22
 
18
23
  require 'kaminari'
@@ -1,5 +1,5 @@
1
1
  module Biovision
2
2
  module Base
3
- VERSION = '0.8.170916'
3
+ VERSION = '0.8.171029'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biovision-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.170916
4
+ version: 0.8.171029
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: 2017-09-16 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: factory_girl_rails
140
+ name: factory_bot_rails
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -164,7 +164,8 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- description: Base components for Biovision applications. Locales, some JS and SCSS
167
+ description: Base components for Biovision applications. Models, Controllers, locales,
168
+ some JS and SCSS
168
169
  email:
169
170
  - maxim.km@gmail.com
170
171
  executables: []
@@ -392,6 +393,7 @@ files:
392
393
  - app/views/application/unauthorized.jbuilder
393
394
  - app/views/authentication/_form.html.erb
394
395
  - app/views/authentication/new.html.erb
396
+ - app/views/authentication/new.jbuilder
395
397
  - app/views/browsers/_form.html.erb
396
398
  - app/views/browsers/edit.html.erb
397
399
  - app/views/browsers/new.html.erb
@@ -454,6 +456,7 @@ files:
454
456
  - app/views/regions/_form.html.erb
455
457
  - app/views/regions/edit.html.erb
456
458
  - app/views/regions/new.html.erb
459
+ - app/views/shared/_breadcrumbs.html.erb
457
460
  - app/views/shared/_counters.html.erb
458
461
  - app/views/shared/_flash_messages.html.erb
459
462
  - app/views/shared/_list_of_errors.html.erb
@@ -506,6 +509,7 @@ files:
506
509
  - db/migrate/20170425000002_create_foreign_users.rb
507
510
  - db/migrate/20170629120000_create_login_attempts.rb
508
511
  - db/migrate/20170823000001_create_stored_values.rb
512
+ - db/migrate/20171025222222_add_new_fields_171026.rb
509
513
  - lib/biovision/base.rb
510
514
  - lib/biovision/base/base_methods.rb
511
515
  - lib/biovision/base/engine.rb