enju_leaf 1.1.0.rc18 → 1.1.0.rc19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/controllers/my_accounts_controller.rb +1 -1
- data/app/controllers/page_controller.rb +5 -5
- data/app/controllers/profiles_controller.rb +0 -1
- data/app/controllers/user_import_files_controller.rb +2 -1
- data/app/models/identity.rb +9 -0
- data/app/models/profile.rb +2 -0
- data/app/models/user_import_file.rb +0 -1
- data/app/views/devise/registrations/edit.html.erb +8 -14
- data/app/views/my_accounts/_edit_credential.html.erb +6 -21
- data/app/views/my_accounts/_edit_credential.html.slim +63 -0
- data/app/views/my_accounts/edit.html.erb +1 -0
- data/app/views/my_accounts/show.html.erb +2 -1
- data/app/views/my_accounts/show.html.slim +59 -0
- data/app/views/page/500_nosolr.html.erb +66 -0
- data/app/views/page/{_msie_acceralator.html.erb → _msie_accelerator.html.erb} +0 -0
- data/app/views/page/add_on.html.slim +7 -0
- data/app/views/page/{msie_acceralator.builder → msie_accelerator.builder} +0 -0
- data/app/views/profiles/_edit_credential.html.slim +67 -0
- data/app/views/profiles/_edit_profile.html.slim +40 -0
- data/app/views/profiles/new.html.erb +0 -5
- data/app/views/roles/index.html.erb +6 -2
- data/app/views/roles/show.html.erb +3 -1
- data/app/views/user_groups/index.html.erb +3 -1
- data/app/views/user_groups/show.html.erb +6 -2
- data/app/views/user_import_files/index.html.slim +52 -0
- data/app/views/user_import_files/new.html.slim +64 -0
- data/config/locales/devise.ja.yml +1 -1
- data/config/locales/translation_en.yml +11 -9
- data/config/locales/translation_ja.yml +2 -0
- data/config/routes.rb +6 -1
- data/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/db/migrate/20150421023923_create_identities.rb +15 -0
- data/lib/enju_leaf/controller.rb +1 -1
- data/lib/enju_leaf/user.rb +8 -8
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +13 -2
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +12 -8
- data/lib/generators/enju_leaf/setup/setup_generator.rb +14 -14
- data/lib/generators/enju_leaf/setup/templates/config/initializers/resque.rb +3 -0
- data/lib/generators/enju_leaf/setup/templates/db/seeds.rb +2 -7
- data/lib/generators/enju_leaf/setup/templates/solr/conf/schema.xml +32 -12
- data/lib/generators/enju_leaf/setup/templates/solr/conf/solrconfig.xml +599 -853
- data/spec/controllers/my_accounts_controller_spec.rb +6 -6
- data/spec/controllers/page_controller_spec.rb +2 -2
- data/spec/dummy/db/schema.rb +14 -1
- data/spec/factories/user.rb +0 -3
- data/spec/fixtures/library_groups.yml +1 -0
- data/spec/models/user_import_file_spec.rb +1 -1
- data/spec/models/user_spec.rb +0 -17
- metadata +27 -25
- data/lib/generators/enju_leaf/setup/templates/config/resque.yml +0 -3
- data/lib/generators/enju_leaf/setup/templates/solr/conf/admin-extra.html +0 -31
- data/lib/generators/enju_leaf/setup/templates/solr/conf/elevate.xml +0 -36
- data/lib/generators/enju_leaf/setup/templates/solr/conf/mapping-ISOLatin1Accent.txt +0 -246
- data/lib/generators/enju_leaf/setup/templates/solr/conf/protwords.txt +0 -21
- data/lib/generators/enju_leaf/setup/templates/solr/conf/scripts.conf +0 -24
- data/lib/generators/enju_leaf/setup/templates/solr/conf/spellings.txt +0 -2
- data/lib/generators/enju_leaf/setup/templates/solr/conf/stopwords.txt +0 -58
- data/lib/generators/enju_leaf/setup/templates/solr/conf/synonyms.txt +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4509e09fc31d795bc5906e2e173243a060a861f3
|
4
|
+
data.tar.gz: c9fcf52a57f873fb796a1d822f13a37431a8a330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb3daf7762e866839ed6dcbe080384e7ca3bf84d3d164a5e28419f918d9b1a6a16a814fd525c60d923d185ebe883e826caa6a434c6ea96d71995ed5daf109abc
|
7
|
+
data.tar.gz: 5de411ca22b80c626f276ddf1a72ee1b04962cb5fd448996e1d59c293d4326045f5a21b32689555d7e08d3d3516da78b5c29f66e0b4b257a08c75f13fc5c7db6
|
data/MIT-LICENSE
CHANGED
@@ -38,7 +38,7 @@ class MyAccountsController < ApplicationController
|
|
38
38
|
user_params = ActionController::Parameters.new(params[:profile][:user_attributes]).permit(*user_attrs)
|
39
39
|
|
40
40
|
respond_to do |format|
|
41
|
-
saved = current_user.
|
41
|
+
saved = current_user.update_attributes(user_params)
|
42
42
|
@profile.assign_attributes(profile_params)
|
43
43
|
|
44
44
|
if saved
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class PageController < ApplicationController
|
2
2
|
before_filter :clear_search_sessions, only: [:index, :advanced_search]
|
3
|
-
before_filter :store_location, only: [:advanced_search, :about, :add_on, :
|
4
|
-
before_filter :authenticate_user!, except: [:index, :advanced_search, :about, :add_on, :
|
5
|
-
before_filter :check_librarian, except: [:index, :advanced_search, :about, :add_on, :
|
3
|
+
before_filter :store_location, only: [:advanced_search, :about, :add_on, :msie_accelerator, :statistics]
|
4
|
+
before_filter :authenticate_user!, except: [:index, :advanced_search, :about, :add_on, :msie_accelerator, :opensearch, :statistics, :routing_error]
|
5
|
+
before_filter :check_librarian, except: [:index, :advanced_search, :about, :add_on, :msie_accelerator, :opensearch, :statistics, :routing_error]
|
6
6
|
helper_method :get_libraries
|
7
7
|
|
8
8
|
def index
|
@@ -35,7 +35,7 @@ class PageController < ApplicationController
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
38
|
+
def msie_accelerator
|
39
39
|
respond_to do |format|
|
40
40
|
format.xml { render layout: false }
|
41
41
|
end
|
@@ -61,7 +61,7 @@ class PageController < ApplicationController
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def system_information
|
64
|
-
@specs = Bundler.load.specs.sort
|
64
|
+
@specs = Bundler.load.specs.sort!
|
65
65
|
end
|
66
66
|
|
67
67
|
def import
|
@@ -87,7 +87,6 @@ class ProfilesController < ApplicationController
|
|
87
87
|
if current_user.has_role?('Librarian')
|
88
88
|
@profile = Profile.new(profile_params)
|
89
89
|
if @profile.user
|
90
|
-
@profile.user.operator = current_user
|
91
90
|
password = @profile.user.set_auto_generated_password
|
92
91
|
end
|
93
92
|
else
|
@@ -27,7 +27,8 @@ class UserImportFilesController < ApplicationController
|
|
27
27
|
format.json { render json: @user_import_file }
|
28
28
|
format.download {
|
29
29
|
if ENV['ENJU_STORAGE'] == 's3'
|
30
|
-
|
30
|
+
send_data Faraday.get(@user_import_file.user_import.expiring_url).body.force_encoding('UTF-8'),
|
31
|
+
filename: File.basename(@user_import_file.user_import_file_name), type: 'application/octet-stream'
|
31
32
|
else
|
32
33
|
send_file file, filename: @user_import_file.user_import_file_name, type: 'application/octet-stream'
|
33
34
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class Identity < ActiveRecord::Base
|
2
|
+
belongs_to :profile
|
3
|
+
validates :name, presence: true, uniqueness: {scope: :provider}
|
4
|
+
validates :provider, presence: true
|
5
|
+
|
6
|
+
def self.find_for_oauth(auth)
|
7
|
+
where(name: auth.uid, provider: auth.provider).first_or_create
|
8
|
+
end
|
9
|
+
end
|
data/app/models/profile.rb
CHANGED
@@ -8,6 +8,8 @@ class Profile < ActiveRecord::Base
|
|
8
8
|
belongs_to :library, validate: true
|
9
9
|
belongs_to :user_group
|
10
10
|
belongs_to :required_role, class_name: 'Role', foreign_key: 'required_role_id' #, validate: true
|
11
|
+
has_many :identities
|
12
|
+
accepts_nested_attributes_for :identities, allow_destroy: true, reject_if: :all_blank
|
11
13
|
|
12
14
|
validates_associated :user_group, :library
|
13
15
|
validates_associated :user
|
@@ -1,33 +1,27 @@
|
|
1
|
-
<div id="content_detail" class="ui-corner-all">
|
2
|
-
<h2 class="title"
|
1
|
+
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
+
<h2 class="title"><%= t('page.password') %></h2>
|
3
3
|
<div id="content_list">
|
4
4
|
|
5
|
-
<%= form_for(resource, :as => resource_name, :url =>
|
5
|
+
<%= form_for(resource, :as => resource_name, :url => user_registration_path, :html => { :method => :put }) do |f| %>
|
6
6
|
<%= devise_error_messages! %>
|
7
7
|
|
8
|
-
<p><%= f.label :
|
9
|
-
<p><%= f.email_field :email %></p>
|
10
|
-
|
11
|
-
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i></p>
|
8
|
+
<p><%= f.label :password %>
|
12
9
|
<p><%= f.password_field :password %></p>
|
13
10
|
|
14
11
|
<p><%= f.label :password_confirmation %></p>
|
15
12
|
<p><%= f.password_field :password_confirmation %></p>
|
16
13
|
|
17
|
-
<p><%= f.label :current_password %>
|
14
|
+
<p><%= f.label :current_password %>
|
18
15
|
<p><%= f.password_field :current_password %></p>
|
19
16
|
|
20
|
-
<p><%= f.submit
|
17
|
+
<p><%= f.submit t('page.update') %></p>
|
21
18
|
<% end %>
|
22
19
|
|
23
|
-
<h3>Cancel my account</h3>
|
24
|
-
|
25
|
-
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
|
26
20
|
</div>
|
27
21
|
</div>
|
28
22
|
|
29
|
-
<div id="submenu" class="ui-corner-all">
|
23
|
+
<div id="submenu" class="ui-corner-all ui-widget-content">
|
30
24
|
<ul>
|
31
|
-
<li><%= link_to
|
25
|
+
<li><%= link_to t('page.back'), :back %></li>
|
32
26
|
</ul>
|
33
27
|
</div>
|
@@ -11,27 +11,12 @@
|
|
11
11
|
<%= user_form.text_field :email %>
|
12
12
|
</div>
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<div class="field">
|
21
|
-
<%= user_form.label :password -%><br />
|
22
|
-
<%= user_form.password_field :password, class: 'resource_email' %>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
<div class="field">
|
26
|
-
<%= user_form.label :password_confirmation -%><br />
|
27
|
-
<%= user_form.password_field :password_confirmation, class: 'resource_email' %>
|
28
|
-
</div>
|
29
|
-
<% else %>
|
30
|
-
<div class="field">
|
31
|
-
<%= user_form.label :auto_generated_password -%>
|
32
|
-
<%= user_form.check_box :auto_generated_password -%>
|
33
|
-
</div>
|
34
|
-
<% end %>
|
14
|
+
<% unless profile.user == current_user %>
|
15
|
+
<div class="field">
|
16
|
+
<%= user_form.label :auto_generated_password -%>
|
17
|
+
<%= user_form.check_box :auto_generated_password -%>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
35
20
|
|
36
21
|
<div class="field">
|
37
22
|
<%= f.label :expired_at -%><br />
|
@@ -0,0 +1,63 @@
|
|
1
|
+
= f.fields_for :user do |user_form|
|
2
|
+
#left_pane_detail
|
3
|
+
.form-group
|
4
|
+
= user_form.label :username
|
5
|
+
br
|
6
|
+
= profile.user.username
|
7
|
+
.form-group
|
8
|
+
= user_form.label :email
|
9
|
+
br
|
10
|
+
= user_form.text_field :email, class: 'form-control'
|
11
|
+
.form-group
|
12
|
+
= f.label :expired_at
|
13
|
+
br
|
14
|
+
- if current_user.has_role?('Librarian')
|
15
|
+
= f.text_field :expired_at, value: profile.expired_at.try(:strftime, "%Y-%m-%d"), class: 'form-control', placeholder: "#{t('page.example')}: 2011-04-12"
|
16
|
+
- else
|
17
|
+
= l(profile.expired_at) if profile.expired_at
|
18
|
+
.form-group
|
19
|
+
.checkbox-inline
|
20
|
+
= user_form.check_box :locked, disabled: 'disabled'
|
21
|
+
= user_form.label :locked
|
22
|
+
.form-group
|
23
|
+
= user_form.label t('activerecord.models.role')
|
24
|
+
br
|
25
|
+
= user_form.fields_for :user_has_role do |u|
|
26
|
+
- if current_user.has_role?('Administrator') and current_user != profile.user
|
27
|
+
= u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {class: 'form-control'})
|
28
|
+
- else
|
29
|
+
= u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {disabled: 'disabled', class: 'form-control'})
|
30
|
+
#right_pane_detail
|
31
|
+
.form-group
|
32
|
+
= f.label :full_name
|
33
|
+
br
|
34
|
+
= f.text_field :full_name, class: 'form-control'
|
35
|
+
.form-group
|
36
|
+
= f.label :full_name_transcription
|
37
|
+
br
|
38
|
+
= f.text_field :full_name_transcription, class: 'form-control'
|
39
|
+
- if current_user.has_role?('Librarian')
|
40
|
+
.form-group
|
41
|
+
= f.label t('activerecord.models.user_group')
|
42
|
+
br
|
43
|
+
= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}, {}, {class: 'form-control'})
|
44
|
+
.form-group
|
45
|
+
= f.label :user_number
|
46
|
+
br
|
47
|
+
- if current_user.has_role?('Librarian')
|
48
|
+
= f.text_field :user_number, class: 'form-control'
|
49
|
+
- else
|
50
|
+
= profile.user_number
|
51
|
+
- if current_user.has_role?('Librarian')
|
52
|
+
.form-group
|
53
|
+
= f.label t('activerecord.models.library')
|
54
|
+
br
|
55
|
+
= f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}, {}, {class: 'form-control'})
|
56
|
+
.form-group
|
57
|
+
= f.label t('role.required_role')
|
58
|
+
br
|
59
|
+
= f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {class: 'form-control'})
|
60
|
+
.form-group
|
61
|
+
= f.label :locale
|
62
|
+
br
|
63
|
+
= f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]}, {}, {class: 'form-control'})
|
@@ -35,8 +35,9 @@
|
|
35
35
|
<% end %>
|
36
36
|
<ul>
|
37
37
|
<li><%= link_to t('page.edit'), edit_my_account_path -%></li>
|
38
|
+
<li><%= link_to t('page.password'), edit_user_registration_path -%></li>
|
38
39
|
<%- if can? :destroy, current_user -%>
|
39
|
-
|
40
|
+
<li><%= link_to t('page.destroy'), curent_user, data: {confirm: t('page.are_you_sure')}, method: :delete -%></li>
|
40
41
|
<%- end -%>
|
41
42
|
<% if defined?(EnjuSearchLog) %>
|
42
43
|
<li><%= link_to t('activerecord.models.search_history'), search_histories_path %></li>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
.row
|
2
|
+
#submenu.col-md-3
|
3
|
+
.panel.panel-default
|
4
|
+
.panel-heading
|
5
|
+
h2.panel-title
|
6
|
+
= t('activerecord.models.profile')
|
7
|
+
- if defined?(EnjuCirculation)
|
8
|
+
ul.list-group
|
9
|
+
- current_user.profile.user_group.user_group_has_checkout_types.each do |available_checkout_type|
|
10
|
+
li.list-group-item
|
11
|
+
= available_checkout_type.checkout_type.display_name.localize
|
12
|
+
| :
|
13
|
+
= current_user.checked_item_count[:"#{available_checkout_type.checkout_type.name}"]
|
14
|
+
| /
|
15
|
+
= available_checkout_type.checkout_limit
|
16
|
+
ul.list-group
|
17
|
+
li.list-group-item
|
18
|
+
= link_to t('page.edit'), edit_my_account_path
|
19
|
+
li.list-group-item
|
20
|
+
= link_to t('page.password'), edit_user_registration_path
|
21
|
+
- if policy(current_user.profile).destroy?
|
22
|
+
li.list-group-item
|
23
|
+
= link_to t('page.destroy'), curent_user, data: {confirm: t('page.are_you_sure')}, method: :delete
|
24
|
+
- if defined?(EnjuSearchLog)
|
25
|
+
li.list-group-item
|
26
|
+
= link_to t('activerecord.models.search_history'), search_histories_path
|
27
|
+
- if defined?(EnjuCirculation)
|
28
|
+
li.list-group-item
|
29
|
+
= link_to t('activerecord.models.checkout'), checkouts_path
|
30
|
+
li.list-group-item
|
31
|
+
= link_to t('activerecord.models.reserve'), reserves_path
|
32
|
+
- if defined?(EnjuQuestion)
|
33
|
+
li.list-group-item
|
34
|
+
= link_to t('activerecord.models.question'), user_questions_path(current_user)
|
35
|
+
- if defined?(EnjuBookmark)
|
36
|
+
li.list-group-item
|
37
|
+
= link_to t('activerecord.models.bookmark'), bookmarks_path
|
38
|
+
- if defined?(EnjuPurchaseRequest)
|
39
|
+
li.list-group-item
|
40
|
+
= link_to t('activerecord.models.purchase_request'), purchase_requests_path
|
41
|
+
#content_list.col-md-9
|
42
|
+
h1.panel-title
|
43
|
+
= t('page.showing', model: t('activerecord.models.user'))
|
44
|
+
p#notice
|
45
|
+
= notice
|
46
|
+
h2.resource_title
|
47
|
+
| [U]
|
48
|
+
= current_user.username
|
49
|
+
p
|
50
|
+
= t('activerecord.attributes.profile.user_number')
|
51
|
+
| :
|
52
|
+
= current_user.profile.user_number
|
53
|
+
- if defined?(EnjuCirculation)
|
54
|
+
h2
|
55
|
+
= t('activerecord.models.checkout')
|
56
|
+
=> link_to image_tag('icons/date.png', size: '16x16', alt: 'iCalendar', class: 'icon'), checkouts_path(icalendar_token: current_user.profile.checkout_icalendar_token, format: :ics) if current_user.profile.checkout_icalendar_token?
|
57
|
+
=> link_to image_tag('icons/feed.png', size: '16x16', alt: 'RSS', class: 'icon'), checkouts_path(user_id: current_user.username, format: :rss)
|
58
|
+
=> link_to image_tag('icons/page_white_excel.png', size: '16x16', alt: 'TSV', class: 'icon'), checkouts_path(user_id: current_user.username, format: :txt)
|
59
|
+
= render 'checkouts/list', checkouts: current_user.checkouts.page(params[:page])
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
<body>
|
57
|
+
<div class="dialog">
|
58
|
+
<div>
|
59
|
+
<h1>We're sorry, but something went wrong.</h1>
|
60
|
+
</div>
|
61
|
+
<p><%= t('page.nosolr_error') %></p>
|
62
|
+
<p><%= t('page.nosolr_error_description') %></p>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
File without changes
|
@@ -0,0 +1,67 @@
|
|
1
|
+
= f.fields_for :user do |user_form|
|
2
|
+
#left_pane_detail
|
3
|
+
.form-group
|
4
|
+
= user_form.label :username
|
5
|
+
br
|
6
|
+
= profile.user.username
|
7
|
+
.form-group
|
8
|
+
= user_form.label :email
|
9
|
+
br
|
10
|
+
= user_form.email_field :email, class: 'form-control'
|
11
|
+
.form-group
|
12
|
+
.checkbox-inline
|
13
|
+
= user_form.check_box :auto_generated_password
|
14
|
+
= user_form.label :auto_generated_password
|
15
|
+
.form-group
|
16
|
+
= f.label :expired_at
|
17
|
+
br
|
18
|
+
- if current_user.has_role?('Librarian')
|
19
|
+
= f.text_field :expired_at, value: profile.expired_at.try(:strftime, "%Y-%m-%d"), class: 'form-control', placeholder: "#{t('page.example')}: 2011-04-12"
|
20
|
+
- else
|
21
|
+
= l(profile.expired_at) if profile.expired_at
|
22
|
+
.form-group
|
23
|
+
.checkbox-inline
|
24
|
+
= user_form.check_box :locked
|
25
|
+
= user_form.label :locked
|
26
|
+
.form-group
|
27
|
+
= user_form.label t('activerecord.models.role')
|
28
|
+
br
|
29
|
+
= user_form.fields_for :user_has_role do |u|
|
30
|
+
- if current_user.has_role?('Administrator') and current_user != profile.user
|
31
|
+
= u.select :role_id, @roles.collect{|r| [r.display_name.localize, r.id]}
|
32
|
+
- else
|
33
|
+
= u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {disabled: 'disabled'})
|
34
|
+
#right_pane_detail
|
35
|
+
.form-group
|
36
|
+
= f.label :full_name
|
37
|
+
br
|
38
|
+
= f.text_field :full_name, class: 'form-control'
|
39
|
+
.form-group
|
40
|
+
= f.label :full_name_transcription
|
41
|
+
br
|
42
|
+
= f.text_field :full_name_transcription, class: 'form-control'
|
43
|
+
- if current_user.has_role?('Librarian')
|
44
|
+
.form-group
|
45
|
+
= f.label t('activerecord.models.user_group')
|
46
|
+
br
|
47
|
+
= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]})
|
48
|
+
.form-group
|
49
|
+
= f.label :user_number
|
50
|
+
br
|
51
|
+
- if current_user.has_role?('Librarian')
|
52
|
+
= f.text_field :user_number, class: 'form-control'
|
53
|
+
- else
|
54
|
+
= profile.user_number
|
55
|
+
- if current_user.has_role?('Librarian')
|
56
|
+
.form-group
|
57
|
+
= f.label t('activerecord.models.library')
|
58
|
+
br
|
59
|
+
= f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]})
|
60
|
+
.form-group
|
61
|
+
= f.label t('role.required_role')
|
62
|
+
br
|
63
|
+
= f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]})
|
64
|
+
.form-group
|
65
|
+
= f.label :locale
|
66
|
+
br
|
67
|
+
= f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]})
|
@@ -0,0 +1,40 @@
|
|
1
|
+
- if defined?(EnjuCirculation)
|
2
|
+
.form-group
|
3
|
+
= f.label t('user.checkout_history_icalendar_url')
|
4
|
+
br
|
5
|
+
#feed_token
|
6
|
+
- if profile.checkout_icalendar_token?
|
7
|
+
= link_to checkouts_url(icalendar_token: profile.checkout_icalendar_token, format: :ics), checkouts_url(icalendar_token: profile.checkout_icalendar_token, format: :ics)
|
8
|
+
= f.hidden_field :checkout_icalendar_token
|
9
|
+
br
|
10
|
+
| <input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('
|
11
|
+
= form_authenticity_token
|
12
|
+
| '), success:function(request){$('#feed_token').html(request);}, type:'get', url:'
|
13
|
+
= edit_my_account_path(mode: 'feed_token')
|
14
|
+
| '});" type="button" value="
|
15
|
+
= t('page.reset')
|
16
|
+
| " /> <input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('
|
17
|
+
= form_authenticity_token
|
18
|
+
| '), success:function(request){$('#feed_token').html(request);}, type:'get', url:'
|
19
|
+
= edit_my_account_path(disable: true, mode: 'feed_token')
|
20
|
+
| '});" type="button" value="
|
21
|
+
= t('page.delete')
|
22
|
+
| " />
|
23
|
+
br
|
24
|
+
- if defined?(EnjuSearchLog)
|
25
|
+
.form-group
|
26
|
+
.checkbox-inline
|
27
|
+
= f.check_box :save_search_history
|
28
|
+
= f.label :save_search_history
|
29
|
+
- if defined?(EnjuCirculation)
|
30
|
+
.form-group
|
31
|
+
.checkbox-inline
|
32
|
+
= f.check_box :save_checkout_history
|
33
|
+
= f.label :save_checkout_history
|
34
|
+
- if current_user.has_role?('Librarian')
|
35
|
+
.form-group
|
36
|
+
= f.label :note
|
37
|
+
br
|
38
|
+
= f.text_area :note, class: 'form-control'
|
39
|
+
.form-group
|
40
|
+
= f.submit class: 'btn btn-default'
|
@@ -15,11 +15,6 @@
|
|
15
15
|
<%= user_form.label :email -%>
|
16
16
|
<%= user_form.email_field :email, class: 'resource_email' -%>
|
17
17
|
</div>
|
18
|
-
|
19
|
-
<div class="field">
|
20
|
-
<%= user_form.label :email_confirmation -%>
|
21
|
-
<%= user_form.email_field :email_confirmation, class: 'resource_email' -%>
|
22
|
-
</div>
|
23
18
|
<% end %>
|
24
19
|
|
25
20
|
<div class="field">
|
@@ -14,8 +14,12 @@
|
|
14
14
|
<td><%= link_to role.name, role -%></td>
|
15
15
|
<td><%= link_to role.display_name.localize, role -%></td>
|
16
16
|
<td>
|
17
|
-
|
18
|
-
|
17
|
+
<%- if can? :update, role -%>
|
18
|
+
<%= link_to t('page.edit'), edit_role_path(role) -%>
|
19
|
+
<%- end -%>
|
20
|
+
<%- if can? :destroy, role -%>
|
21
|
+
<%= link_to t('page.destroy'), role, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
22
|
+
<%- end -%>
|
19
23
|
</td>
|
20
24
|
</tr>
|
21
25
|
<%- end -%>
|
@@ -38,7 +38,9 @@
|
|
38
38
|
|
39
39
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
40
40
|
<ul>
|
41
|
-
|
41
|
+
<%- if can? :update, @role -%>
|
42
|
+
<li><%= link_to t('page.edit'), edit_role_path(@role) -%></li>
|
43
|
+
<%- end -%>
|
42
44
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
43
45
|
</ul>
|
44
46
|
</div>
|
@@ -44,6 +44,8 @@
|
|
44
44
|
|
45
45
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
46
|
<ul>
|
47
|
-
|
47
|
+
<%- if can? :create, UserGroup -%>
|
48
|
+
<li><%= link_to t('page.new', model: t('activerecord.models.user_group')), new_user_group_path -%></li>
|
49
|
+
<%- end -%>
|
48
50
|
</ul>
|
49
51
|
</div>
|
@@ -57,8 +57,12 @@
|
|
57
57
|
|
58
58
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
59
59
|
<ul>
|
60
|
-
|
60
|
+
<%- if can? :update, @user_group -%>
|
61
|
+
<li><%= link_to t('page.edit'), edit_user_group_path(@user_group) -%></li>
|
62
|
+
<%- end -%>
|
61
63
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
62
|
-
|
64
|
+
<%- if can? :create, UserGroupHasCheckoutType -%>
|
65
|
+
<li><%= link_to t('page.new', model: t('activerecord.models.checkout_type')), new_user_group_user_group_has_checkout_type_path(@user_group) -%></li>
|
66
|
+
<%- end -%>
|
63
67
|
</ul>
|
64
68
|
</div>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
.row
|
2
|
+
#submenu.col-md-3
|
3
|
+
.panel.panel-default
|
4
|
+
.panel-heading
|
5
|
+
h2.panel-title
|
6
|
+
= t('activerecord.models.user_import_file')
|
7
|
+
ul.list-group
|
8
|
+
li.list-group-item
|
9
|
+
= link_to t('page.new', model: t('activerecord.models.user_import_file')), new_user_import_file_path
|
10
|
+
#content_list.col-md-9
|
11
|
+
.panel.panel-default
|
12
|
+
.panel-heading
|
13
|
+
h1.panel-title
|
14
|
+
= t('page.listing', model: t('activerecord.models.user_import_file'))
|
15
|
+
.panel-body
|
16
|
+
table.table.table-striped.index
|
17
|
+
thead
|
18
|
+
tr
|
19
|
+
th[style="width: 30px"]
|
20
|
+
| Id
|
21
|
+
th
|
22
|
+
= t('activerecord.attributes.user_import_file.user_import_filename')
|
23
|
+
th
|
24
|
+
= t('activerecord.attributes.user_import_file.edit_mode')
|
25
|
+
th
|
26
|
+
= t('activerecord.attributes.user_import_file.executed_at')
|
27
|
+
th
|
28
|
+
= t('activerecord.attributes.user_import_file.state')
|
29
|
+
th
|
30
|
+
tbody
|
31
|
+
- @user_import_files.each do |user_import_file|
|
32
|
+
| <tr class="line
|
33
|
+
= cycle("0", "1")
|
34
|
+
| ">
|
35
|
+
td
|
36
|
+
= link_to (user_import_file.id), user_import_file
|
37
|
+
td
|
38
|
+
= link_to user_import_file.user_import_filename, user_import_file_path(user_import_file, format: :download) if user_import_file.user_import_filename
|
39
|
+
br
|
40
|
+
= t('activerecord.models.user')
|
41
|
+
| :
|
42
|
+
= link_to user_import_file.user.username, user_import_file.user.profile if user_import_file.user.try(:profile)
|
43
|
+
td
|
44
|
+
= user_import_file.edit_mode
|
45
|
+
td
|
46
|
+
= l(user_import_file.executed_at) if user_import_file.executed_at
|
47
|
+
td
|
48
|
+
= localized_state(user_import_file.current_state)
|
49
|
+
td
|
50
|
+
=> link_to t('page.show'), user_import_file
|
51
|
+
=> link_to t('page.destroy'), user_import_file, data: {confirm: t('page.are_you_sure')}, method: :delete
|
52
|
+
= paginate(@user_import_files)
|