biovision-base 0.15.180415 → 0.15.180502

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b32ca23796647159d2a821d53b9b83ece30a748e846c666b55aa8d24579c8fc7
4
- data.tar.gz: f00de9e1ea2772e8863b66f96f1fea59c0d5675f0062dd87ce015eba7b3bfa0f
3
+ metadata.gz: 2a1498261b5c92964dc68ed231731b1edbe106d0b41e1cae16c10527ec1891d4
4
+ data.tar.gz: e4968f3a7396a9d54d95840ea4435a6198c85a12db44519b06738e7261c12016
5
5
  SHA512:
6
- metadata.gz: 5ebdb6a0c58f56706b1b93fdaa2fe23e17f801c53aca06bd018e5e1b2fcff96eafd8aa3e0a99dfc4c16f00d522c44e2ff6432df42843278becff5920ce3adf84
7
- data.tar.gz: 7af837c64015a5694ed8b917b7b1ee9e8579c1943318ffdae4d3f73a797d7ca61bcb653f27181b07c1359adbfea1a374da1f18a4165a067e17018c879dd2f75d
6
+ metadata.gz: 1b96d1c6787eea0003c5e8d0c5341385761a75348944d9d7212ef31e7b03b9575ff43b8feb88b648d1e492abde88549bb12a41724714ca456be99b0020edc1be
7
+ data.tar.gz: f35baf097a33a05fa6c1deaf62823a92657942f40f7e0bdd41dfd832869cad03b17a57d7af2bf2fa9c0d2643ab4ea28d19b1a9e90609b90af6c02a6cee1d2751
@@ -442,13 +442,22 @@ document.addEventListener('DOMContentLoaded', function () {
442
442
 
443
443
  document.querySelectorAll('form[data-remote]').forEach(function (form) {
444
444
  const button = form.querySelector('button[type=submit]');
445
+ const loading_message = form.querySelector('.loading_message');
445
446
 
446
447
  form.addEventListener('ajax:before', function () {
447
448
  button.disabled = true;
449
+
450
+ if (loading_message) {
451
+ loading_message.classList.remove('hidden');
452
+ }
448
453
  });
449
454
 
450
455
  form.addEventListener('ajax:complete', function () {
451
456
  button.disabled = false;
457
+
458
+ if (loading_message) {
459
+ loading_message.classList.add('hidden');
460
+ }
452
461
  });
453
462
  });
454
463
 
@@ -1,6 +1,8 @@
1
1
  :root {
2
2
  --content-width: #{$content-width};
3
3
  --content-width-min: #{$content-width-min};
4
+ --spacer-xs: .5rem;
5
+ --spacer-s: 1rem;
4
6
  }
5
7
 
6
8
  html {
@@ -135,7 +137,7 @@ article {
135
137
  min-width: 1ch;
136
138
  }
137
139
 
138
- input:not([type=checkbox]):not([type=radio]):not([size]):not([type=date]):not([max]),
140
+ input:not([type=checkbox]):not([type=radio]):not([size]):not([type=date]):not([max]):not([min]),
139
141
  textarea {
140
142
  width: 100%;
141
143
  }
@@ -192,6 +194,21 @@ article {
192
194
  }
193
195
  }
194
196
 
197
+ .list-of-entities {
198
+ .data {
199
+ > div:first-of-type {
200
+ margin-bottom: var(--spacer-xs);
201
+ }
202
+
203
+ nav {
204
+ margin: var(--spacer-s) 0;
205
+
206
+ a:not(:last-of-type) {
207
+ margin-right: var(--spacer-xs);
208
+ }
209
+ }
210
+ }
211
+ }
195
212
 
196
213
  nav.admin-breadcrumbs {
197
214
  margin-bottom: .8rem;
@@ -1,8 +1,4 @@
1
- class My::IndexController < ApplicationController
2
- before_action :restrict_anonymous_access
3
-
4
- # layout 'profile'
5
-
1
+ class My::IndexController < ProfileController
6
2
  # get /my
7
3
  def index
8
4
  end
@@ -4,6 +4,8 @@ class My::ProfilesController < ApplicationController
4
4
  before_action :redirect_authorized_user, only: [:new, :create]
5
5
  before_action :restrict_anonymous_access, except: [:new, :create]
6
6
 
7
+ layout 'profile', only: [:show, :edit]
8
+
7
9
  # get /my/profile/new
8
10
  def new
9
11
  @entity = User.new
@@ -40,7 +42,7 @@ class My::ProfilesController < ApplicationController
40
42
  protected
41
43
 
42
44
  def redirect_authorized_user
43
- redirect_to my_profile_path if current_user.is_a? User
45
+ redirect_to my_path if current_user.is_a? User
44
46
  end
45
47
 
46
48
  def create_user
@@ -1,7 +1,6 @@
1
- class My::TokensController < ApplicationController
1
+ class My::TokensController < ProfileController
2
2
  include ToggleableEntity
3
3
 
4
- before_action :restrict_anonymous_access
5
4
  before_action :set_entity, except: [:index]
6
5
 
7
6
  # get /my
@@ -0,0 +1,9 @@
1
+ class ProfileController < ApplicationController
2
+ before_action :restrict_access
3
+
4
+ protected
5
+
6
+ def restrict_access
7
+ restrict_anonymous_access
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ <div class="sidebar">
2
+ <nav>
3
+ <ul>
4
+ <li><%= render 'my/profiles/nav_item' %></li>
5
+ <li><%= render 'my/tokens/nav_item' %></li>
6
+ <li><%= render 'my/login_attempts/nav_item' %></li>
7
+ <%= render 'my/index/sidebar/biovision_courses' if Gem.loaded_specs.key?('biovision-courses') %>
8
+ <%= render 'my/index/index/custom_sidebar' %>
9
+ <% if UserPrivilege.user_has_any_privilege?(current_user) %>
10
+ <li><%= link_to t('admin.index.index.heading'), admin_path %></li>
11
+ <% end %>
12
+ <li><%= link_to t(:logout), logout_path, method: :delete %></li>
13
+ </ul>
14
+ </nav>
15
+ </div>
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <title><%= yield :meta_title %></title>
6
- <%= stylesheet_link_tag 'admin', media: 'all' %>
6
+ <%= stylesheet_link_tag 'application', media: 'all' %>
7
7
  <%= javascript_include_tag 'application' %>
8
8
  <%= csrf_meta_tags %>
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
@@ -13,9 +13,16 @@
13
13
 
14
14
  <main id="main">
15
15
  <%= render 'shared/flash_messages' %>
16
- <%= render 'shared/breadcrumbs' %>
16
+ <%= render 'shared/breadcrumbs_profile' %>
17
17
 
18
- <%= yield %>
18
+ <div id="profile-content">
19
+ <% unless content_for?(:hide_sidebar) || current_user.nil? %>
20
+ <%= render 'layouts/profile/sidebar' %>
21
+ <% end %>
22
+ <div class="content">
23
+ <%= yield %>
24
+ </div>
25
+ </div>
19
26
  </main>
20
27
 
21
28
  <%= render 'layouts/profile/footer' %>
@@ -1,13 +1,15 @@
1
- <nav>
2
- <ul>
3
- <li><%= render 'my/profiles/nav_item' %></li>
4
- <li><%= render 'my/tokens/nav_item' %></li>
5
- <li><%= render 'my/login_attempts/nav_item' %></li>
6
- <%= render 'my/index/sidebar/biovision_courses' if Gem.loaded_specs.key?('biovision-courses') %>
7
- <%= render 'my/index/index/custom_sidebar' %>
8
- <% if UserPrivilege.user_has_any_privilege?(current_user) %>
9
- <li><%= link_to t('admin.index.index.heading'), admin_path %></li>
10
- <% end %>
11
- <li><%= link_to t(:logout), logout_path, method: :delete %></li>
12
- </ul>
13
- </nav>
1
+ <div class="sidebar">
2
+ <nav>
3
+ <ul>
4
+ <li><%= render 'my/profiles/nav_item' %></li>
5
+ <li><%= render 'my/tokens/nav_item' %></li>
6
+ <li><%= render 'my/login_attempts/nav_item' %></li>
7
+ <%= render 'my/index/sidebar/biovision_courses' if Gem.loaded_specs.key?('biovision-courses') %>
8
+ <%= render 'my/index/index/custom_sidebar' %>
9
+ <% if UserPrivilege.user_has_any_privilege?(current_user) %>
10
+ <li><%= link_to t('admin.index.index.heading'), admin_path %></li>
11
+ <% end %>
12
+ <li><%= link_to t(:logout), logout_path, method: :delete %></li>
13
+ </ul>
14
+ </nav>
15
+ </div>
@@ -1,14 +1,5 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
- <% content_for :breadcrumbs do %>
3
- <span><%= t('.heading') %></span>
4
- <% end %>
5
2
 
6
3
  <article id="my-index" class="profile-content">
7
- <div class="sidebar dashboard">
8
- <%= render 'my/index/index/sidebar' %>
9
- </div>
10
-
11
- <div class="content">
12
- <%= render 'my/index/index/dashboard' %>
13
- </div>
4
+ <%= render 'my/index/index/dashboard' %>
14
5
  </article>
@@ -0,0 +1,7 @@
1
+ <% if content_for? :breadcrumbs %>
2
+ <nav class="breadcrumbs">
3
+ <%# link_to(t(:home), root_path) %>
4
+ <%= link_to(t('my.index.index.heading'), my_path) %>
5
+ <%= yield :breadcrumbs %>
6
+ </nav>
7
+ <% end %>
@@ -19,6 +19,8 @@ class CreatePrivileges < ActiveRecord::Migration[5.1]
19
19
  add_foreign_key :privileges, :privileges, column: :parent_id, on_update: :cascade, on_delete: :cascade
20
20
 
21
21
  add_index :privileges, :slug, unique: true
22
+
23
+ create_privileges
22
24
  end
23
25
  end
24
26
 
@@ -1,5 +1,5 @@
1
1
  module Biovision
2
2
  module Base
3
- VERSION = '0.15.180415'
3
+ VERSION = '0.15.180502'
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.15.180415
4
+ version: 0.15.180502
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-04-19 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -253,6 +253,7 @@ files:
253
253
  - app/controllers/my/tokens_controller.rb
254
254
  - app/controllers/privilege_groups_controller.rb
255
255
  - app/controllers/privileges_controller.rb
256
+ - app/controllers/profile_controller.rb
256
257
  - app/controllers/profiles_controller.rb
257
258
  - app/controllers/stored_values_controller.rb
258
259
  - app/controllers/tokens_controller.rb
@@ -456,6 +457,7 @@ files:
456
457
  - app/views/layouts/profile.html.erb
457
458
  - app/views/layouts/profile/_footer.html.erb
458
459
  - app/views/layouts/profile/_header.html.erb
460
+ - app/views/layouts/profile/_sidebar.html.erb
459
461
  - app/views/layouts/profile/header/_navigation.html.erb
460
462
  - app/views/media_files/_form.html.erb
461
463
  - app/views/media_files/ckeditor.html.erb
@@ -505,6 +507,7 @@ files:
505
507
  - app/views/profiles/_profile.html.erb
506
508
  - app/views/profiles/show.html.erb
507
509
  - app/views/shared/_breadcrumbs.html.erb
510
+ - app/views/shared/_breadcrumbs_profile.html.erb
508
511
  - app/views/shared/_counters.html.erb
509
512
  - app/views/shared/_flash_messages.html.erb
510
513
  - app/views/shared/_list_of_errors.html.erb