enju_circulation 0.1.2 → 0.2.0.beta.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.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/carrier_type_has_checkout_types_controller.rb +14 -4
- data/app/controllers/checked_items_controller.rb +13 -2
- data/app/controllers/checkins_controller.rb +13 -3
- data/app/controllers/checkout_types_controller.rb +12 -2
- data/app/controllers/checkouts_controller.rb +26 -25
- data/app/controllers/circulation_statuses_controller.rb +11 -1
- data/app/controllers/concerns/enju_circulation/controller.rb +12 -0
- data/app/controllers/demands_controller.rb +12 -2
- data/app/controllers/item_has_use_restrictions_controller.rb +13 -2
- data/app/controllers/lending_policies_controller.rb +18 -4
- data/app/controllers/manifestation_checkout_stats_controller.rb +14 -6
- data/app/controllers/manifestation_reserve_stats_controller.rb +15 -4
- data/app/controllers/reserves_controller.rb +17 -9
- data/app/controllers/use_restrictions_controller.rb +11 -1
- data/app/controllers/user_checkout_stats_controller.rb +14 -4
- data/app/controllers/user_group_has_checkout_types_controller.rb +12 -2
- data/app/controllers/user_reserve_stats_controller.rb +14 -4
- data/app/helpers/items_helper.rb +2 -2
- data/app/jobs/manifestation_checkout_stat_job.rb +7 -0
- data/app/jobs/manifestation_reserve_stat_job.rb +7 -0
- data/app/jobs/user_checkout_stat_job.rb +7 -0
- data/app/jobs/user_reserve_stat_job.rb +7 -0
- data/app/models/checked_item.rb +1 -1
- data/app/models/concerns/enju_circulation/enju_accept.rb +16 -0
- data/app/models/concerns/enju_circulation/enju_basket.rb +30 -0
- data/app/models/concerns/enju_circulation/enju_carrier_type.rb +11 -0
- data/app/models/concerns/enju_circulation/enju_item.rb +157 -0
- data/app/models/concerns/enju_circulation/enju_manifestation.rb +77 -0
- data/app/models/concerns/enju_circulation/enju_profile.rb +13 -0
- data/app/models/concerns/enju_circulation/enju_user.rb +50 -0
- data/app/models/concerns/enju_circulation/enju_user_group.rb +17 -0
- data/app/models/concerns/enju_circulation/enju_withdraw.rb +16 -0
- data/app/models/manifestation_checkout_stat_state_machine.rb +1 -1
- data/app/models/reserve.rb +7 -2
- data/app/policies/carrier_type_has_checkout_type_policy.rb +21 -0
- data/app/policies/checked_item_policy.rb +21 -0
- data/app/policies/checkin_policy.rb +21 -0
- data/app/policies/checkout_policy.rb +39 -0
- data/app/policies/checkout_type_policy.rb +23 -0
- data/app/policies/circulation_status_policy.rb +23 -0
- data/app/policies/demand_policy.rb +21 -0
- data/app/policies/item_has_use_restriction_policy.rb +21 -0
- data/app/policies/item_policy.rb +27 -0
- data/app/policies/lending_policy_policy.rb +21 -0
- data/app/policies/manifestation_checkout_stat_policy.rb +21 -0
- data/app/policies/manifestation_reserve_stat_policy.rb +21 -0
- data/app/policies/reserve_policy.rb +37 -0
- data/app/policies/use_restriction_policy.rb +23 -0
- data/app/policies/user_checkout_stat_policy.rb +21 -0
- data/app/policies/user_group_has_checkout_type_policy.rb +21 -0
- data/app/policies/user_reserve_stat_policy.rb +21 -0
- data/app/views/carrier_type_has_checkout_types/index.html.erb +3 -3
- data/app/views/carrier_type_has_checkout_types/show.html.erb +1 -1
- data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +5 -0
- data/app/views/carrier_types/_checkout_form.html.erb +2 -4
- data/app/views/checkout_types/index.html.erb +4 -4
- data/app/views/checkout_types/show.html.erb +2 -2
- data/app/views/checkouts/_index.html.erb +1 -1
- data/app/views/checkouts/_index_overdue.html.erb +4 -5
- data/app/views/checkouts/_index_user.html.erb +5 -5
- data/app/views/checkouts/_list.html.erb +2 -2
- data/app/views/checkouts/_reserved_facet.html.erb +2 -2
- data/app/views/checkouts/edit.html.erb +1 -1
- data/app/views/checkouts/index.html.erb +2 -2
- data/app/views/checkouts/index.rss.builder +2 -2
- data/app/views/checkouts/index.txt.erb +1 -1
- data/app/views/checkouts/show.html.erb +10 -6
- data/app/views/circulation_statuses/index.html.erb +4 -4
- data/app/views/circulation_statuses/show.html.erb +1 -1
- data/app/views/reserves/_state_facet.html.erb +2 -2
- data/app/views/reserves/index.html.erb +6 -4
- data/app/views/reserves/show.html.erb +1 -1
- data/app/views/use_restrictions/index.html.erb +4 -4
- data/app/views/use_restrictions/show.html.erb +1 -1
- data/app/views/user_group_has_checkout_types/index.html.erb +3 -3
- data/app/views/user_group_has_checkout_types/show.html.erb +1 -1
- data/app/views/user_groups/_checkout_form.html.erb +2 -16
- data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +14 -0
- data/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +9 -0
- data/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +9 -0
- data/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +9 -0
- data/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +9 -0
- data/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +9 -0
- data/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
- data/lib/enju_circulation/version.rb +1 -1
- data/lib/enju_circulation.rb +0 -20
- data/lib/generators/enju_circulation/setup/setup_generator.rb +16 -4
- data/lib/tasks/enju_circulation_tasks.rake +1 -1
- data/spec/controllers/carrier_type_has_checkout_types_controller_spec.rb +13 -13
- data/spec/controllers/checked_items_controller_spec.rb +6 -6
- data/spec/controllers/checkins_controller_spec.rb +6 -6
- data/spec/controllers/checkout_types_controller_spec.rb +11 -11
- data/spec/controllers/checkouts_controller_spec.rb +72 -71
- data/spec/controllers/circulation_statuses_controller_spec.rb +12 -12
- data/spec/controllers/item_has_use_restrictions_controller_spec.rb +11 -11
- data/spec/controllers/lending_policies_controller_spec.rb +14 -14
- data/spec/controllers/manifestation_checkout_stats_controller_spec.rb +6 -6
- data/spec/controllers/manifestation_reserve_stats_controller_spec.rb +6 -6
- data/spec/controllers/reserves_controller_spec.rb +5 -5
- data/spec/controllers/use_restrictions_controller_spec.rb +14 -14
- data/spec/controllers/user_checkout_stats_controller_spec.rb +8 -8
- data/spec/controllers/user_group_has_checkout_types_controller_spec.rb +11 -11
- data/spec/controllers/user_reserve_stats_controller_spec.rb +8 -8
- data/spec/dummy/app/assets/javascripts/application.js +1 -0
- data/spec/dummy/app/controllers/application_controller.rb +8 -4
- data/spec/dummy/app/models/user.rb +3 -5
- data/spec/dummy/config/application.rb +6 -37
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/enju_leaf.rb +5 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +30 -2
- data/spec/fixtures/profiles.yml +1 -1
- data/spec/models/manifestation_checkout_stat_spec.rb +3 -4
- data/spec/models/manifestation_reserve_stat_spec.rb +1 -1
- data/spec/models/user_checkout_stat_spec.rb +1 -1
- data/spec/models/user_reserve_stat_spec.rb +1 -1
- data/spec/support/devise.rb +2 -2
- data/spec/views/checkout_types/index.html.erb_spec.rb +1 -0
- data/spec/views/checkout_types/show.html.erb_spec.rb +1 -0
- data/spec/views/checkouts/index.html.erb_spec.rb +1 -3
- data/spec/views/checkouts/show.html.erb_spec.rb +5 -4
- data/spec/views/profiles/show.html.erb_spec.rb +2 -1
- data/spec/views/reserves/index.html.erb_spec.rb +3 -0
- data/spec/views/use_restrictions/index.html.erb_spec.rb +1 -0
- data/spec/views/use_restrictions/show.html.erb_spec.rb +1 -0
- metadata +147 -38
- data/app/models/enju_circulation/ability.rb +0 -114
- data/app/views/circulation_statuses/show.mobile.erb +0 -24
- data/app/workers/manifestation_checkout_stat_queue.rb +0 -7
- data/app/workers/manifestation_reserve_stat_queue.rb +0 -7
- data/app/workers/user_checkout_stat_queue.rb +0 -7
- data/app/workers/user_reserve_stat_queue.rb +0 -7
- data/lib/enju_circulation/accept.rb +0 -23
- data/lib/enju_circulation/basket.rb +0 -37
- data/lib/enju_circulation/carrier_type.rb +0 -15
- data/lib/enju_circulation/controller.rb +0 -21
- data/lib/enju_circulation/item.rb +0 -166
- data/lib/enju_circulation/manifestation.rb +0 -84
- data/lib/enju_circulation/profile.rb +0 -23
- data/lib/enju_circulation/user.rb +0 -61
- data/lib/enju_circulation/user_group.rb +0 -21
- data/lib/enju_circulation/withdraw.rb +0 -23
- data/spec/dummy/app/models/ability.rb +0 -111
- data/spec/dummy/app/models/local_agent.rb +0 -13
- data/spec/dummy/config/application.yml +0 -42
@@ -0,0 +1,21 @@
|
|
1
|
+
class ItemHasUseRestrictionPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Administrator')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Administrator')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Administrator')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class ItemPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
true if user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit?
|
15
|
+
true if user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def update?
|
19
|
+
true if user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
|
22
|
+
def destroy?
|
23
|
+
if user.try(:has_role?, 'Librarian')
|
24
|
+
record.removable?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class LendingPolicyPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
false
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Administrator')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Administrator')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class ManifestationCheckoutStatPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class ManifestationReserveStatPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class ReservePolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'User')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
if user.try(:has_role?, 'Librarian')
|
8
|
+
true
|
9
|
+
elsif user and user == record.user
|
10
|
+
true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def create?
|
15
|
+
if user.try(:has_role?, 'Librarian')
|
16
|
+
true
|
17
|
+
elsif user.try(:has_role?, 'User')
|
18
|
+
true if user.profile.user_number.try(:present?)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def update?
|
23
|
+
if user.try(:has_role?, 'Librarian')
|
24
|
+
true
|
25
|
+
elsif user and user == record.user
|
26
|
+
true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def destroy?
|
31
|
+
if user.try(:has_role?, 'Librarian')
|
32
|
+
true
|
33
|
+
elsif user and user == record.user
|
34
|
+
true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class UseRestrictionPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true if user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true if user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
false
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
if user.try(:has_role?, 'Administrator')
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def destroy?
|
21
|
+
false
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class UserCheckoutStatPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Administrator')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class UserGroupHasCheckoutTypePolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Administrator')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Administrator')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Administrator')
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class UserReserveStatPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
user.try(:has_role?, 'Administrator')
|
20
|
+
end
|
21
|
+
end
|
@@ -17,10 +17,10 @@
|
|
17
17
|
<td><%= carrier_type_has_checkout_type.note -%></td>
|
18
18
|
<td>
|
19
19
|
<%= link_to t('page.show'), carrier_type_has_checkout_type -%>
|
20
|
-
<%- if
|
20
|
+
<%- if policy(carrier_type_has_checkout_type).update? -%>
|
21
21
|
<%= link_to t('page.edit'), edit_carrier_type_has_checkout_type_path(carrier_type_has_checkout_type) -%>
|
22
22
|
<% end %>
|
23
|
-
<%- if
|
23
|
+
<%- if policy(carrier_type_has_checkout_type).destroy? -%>
|
24
24
|
<%= link_to t('page.destroy'), carrier_type_has_checkout_type, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
25
25
|
<% end %>
|
26
26
|
</td>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
|
34
34
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
35
35
|
<ul>
|
36
|
-
<%- if
|
36
|
+
<%- if policy(CarrierTypeHasCheckoutType).create? -%>
|
37
37
|
<li><%= link_to t('page.new', model: t('activerecord.models.carrier_type_has_checkout_type')), new_carrier_type_has_checkout_type_path -%></li>
|
38
38
|
<% end %>
|
39
39
|
</ul>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
|
-
<% if
|
26
|
+
<% if policy(@carrier_type_has_checkout_type).update? %>
|
27
27
|
<li><%= link_to t('page.edit'), edit_carrier_type_has_checkout_type_path(@carrier_type_has_checkout_type) -%></li>
|
28
28
|
<% end %>
|
29
29
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -1,9 +1,7 @@
|
|
1
1
|
<div class="field">
|
2
2
|
<%= f.label t('activerecord.models.carrier_type_has_checkout_type') %><br />
|
3
3
|
<%= f.fields_for :carrier_type_has_checkout_types do |checkout_form| %>
|
4
|
-
<%=
|
5
|
-
<%= checkout_form.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}) %>
|
6
|
-
<%= checkout_form.link_to_remove t('page.remove'), confirm: t('page.are_you_sure') %>
|
4
|
+
<%= render 'carrier_type_has_checkout_type_fields', f: checkout_form %>
|
7
5
|
<% end %>
|
8
|
-
<p><%=
|
6
|
+
<p><%= link_to_add_association t('page.add'), f, :carrier_type_has_checkout_types %></p>
|
9
7
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%- @checkout_types.each do |checkout_type| -%>
|
18
18
|
<tr class="line<%= cycle("0", "1") -%>">
|
19
19
|
<td>
|
20
|
-
<%- if
|
20
|
+
<%- if policy(checkout_type).update? -%>
|
21
21
|
<%= move_position(checkout_type) -%>
|
22
22
|
<%- end -%>
|
23
23
|
</td>
|
@@ -28,10 +28,10 @@
|
|
28
28
|
<%= checkout_type.note %>
|
29
29
|
</td>
|
30
30
|
<td>
|
31
|
-
<%- if
|
31
|
+
<%- if policy(checkout_type).update? -%>
|
32
32
|
<%= link_to t('page.edit'), edit_checkout_type_path(checkout_type) -%>
|
33
33
|
<% end %>
|
34
|
-
<%- if
|
34
|
+
<%- if policy(checkout_type).destroy? -%>
|
35
35
|
<%= link_to t('page.destroy'), checkout_type_path(checkout_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
36
36
|
<%- end -%>
|
37
37
|
</td>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
46
|
<ul>
|
47
|
-
<%- if
|
47
|
+
<%- if policy(CheckoutType).create? -%>
|
48
48
|
<li><%= link_to t('page.new', model: t('activerecord.models.checkout_type')), new_checkout_type_path -%></li>
|
49
49
|
<%- end -%>
|
50
50
|
</ul>
|
@@ -31,11 +31,11 @@
|
|
31
31
|
|
32
32
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
33
33
|
<ul>
|
34
|
-
<%- if
|
34
|
+
<%- if policy(@checkout_type).update? -%>
|
35
35
|
<li><%= link_to t('page.edit'), edit_checkout_type_path(@checkout_type) -%></li>
|
36
36
|
<%- end -%>
|
37
37
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
38
|
-
<%- if
|
38
|
+
<%- if policy(UserGroupHasCheckoutType).create? -%>
|
39
39
|
<li><%= link_to t('page.new', model: t('activerecord.models.user_group_has_checkout_type')), new_checkout_type_user_group_has_checkout_type_path(@checkout_type) -%></li>
|
40
40
|
<%- end -%>
|
41
41
|
</ul>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
15
15
|
<ul>
|
16
16
|
<li><%= link_to t('checkout.my_checkout'), checkouts_path(user_id: current_user.username) -%></li>
|
17
|
-
<li><%= link_to t('page.overdue'), checkouts_path(
|
17
|
+
<li><%= link_to t('page.overdue'), checkouts_path(days_overdue: 1) -%></li>
|
18
18
|
</ul>
|
19
19
|
<%= render 'reserved_facet' %>
|
20
20
|
<h4><%= t('page.other_format') %></h4>
|
@@ -6,7 +6,6 @@
|
|
6
6
|
<p>
|
7
7
|
<%= t('checkout.number_of_day_overdue') -%>:
|
8
8
|
<%= text_field_tag 'days_overdue', h(@days_overdue), class: 'resource_integer' -%>
|
9
|
-
<%= hidden_field_tag 'view', 'overdue' -%>
|
10
9
|
<%= submit_tag t('page.search') -%>
|
11
10
|
</p>
|
12
11
|
<%- end -%>
|
@@ -28,12 +27,12 @@
|
|
28
27
|
<h4><%= t('page.other_format') %></h4>
|
29
28
|
<ul>
|
30
29
|
<li>
|
31
|
-
<%= link_to 'RSS', checkouts_path(format: :rss,
|
32
|
-
<%= link_to (image_tag 'icons/feed.png', size: '16x16', alt: 'RSS', class: 'icon'), checkouts_path(format: :rss,
|
30
|
+
<%= link_to 'RSS', checkouts_path(format: :rss, days_overdue: 1) -%>
|
31
|
+
<%= link_to (image_tag 'icons/feed.png', size: '16x16', alt: 'RSS', class: 'icon'), checkouts_path(format: :rss, days_overdue: 1) -%>
|
33
32
|
</li>
|
34
33
|
<li>
|
35
|
-
<%= link_to 'TSV', checkouts_path(format: :txt,
|
36
|
-
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', alt: 'TSV', class: 'icon'), checkouts_path(format: :txt,
|
34
|
+
<%= link_to 'TSV', checkouts_path(format: :txt, days_overdue: 1, locale: @locale.to_s) -%>
|
35
|
+
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', alt: 'TSV', class: 'icon'), checkouts_path(format: :txt, days_overdue: 1, locale: @locale.to_s) -%>
|
37
36
|
</li>
|
38
37
|
</ul>
|
39
38
|
</div>
|
@@ -33,14 +33,14 @@
|
|
33
33
|
<%= link_to (image_tag 'icons/date.png', size: '16x16', alt: 'iCalendar', class: 'icon'), checkouts_path(user_id: user.username, format: :ics) -%>
|
34
34
|
</li>
|
35
35
|
<% end %>
|
36
|
-
<%- if params[:
|
36
|
+
<%- if params[:days_overdue].present? -%>
|
37
37
|
<li>
|
38
|
-
<%= link_to 'RSS', checkouts_path(user_id: user.username, format: :rss,
|
39
|
-
<%= link_to (image_tag 'icons/feed.png', size: '16x16', alt: 'RSS', class: 'icon'), checkouts_path(user_id: user.username, format: :rss,
|
38
|
+
<%= link_to 'RSS', checkouts_path(user_id: user.username, format: :rss, days_overdue: 1) -%>
|
39
|
+
<%= link_to (image_tag 'icons/feed.png', size: '16x16', alt: 'RSS', class: 'icon'), checkouts_path(user_id: user.username, format: :rss, days_overdue: 1) -%>
|
40
40
|
</li>
|
41
41
|
<li>
|
42
|
-
<%= link_to 'TSV', checkouts_path(user_id: user.username, format: :txt,
|
43
|
-
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', alt: 'TSV', class: 'icon'), checkouts_path(user_id: user.username, format: :txt,
|
42
|
+
<%= link_to 'TSV', checkouts_path(user_id: user.username, format: :txt, days_overdue: 1, locale: @locale.to_s) -%>
|
43
|
+
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', alt: 'TSV', class: 'icon'), checkouts_path(user_id: user.username, format: :txt, days_overdue: 1, locale: @locale.to_s) -%>
|
44
44
|
</li>
|
45
45
|
<%- else -%>
|
46
46
|
<li>
|
@@ -34,12 +34,12 @@
|
|
34
34
|
<% end %>
|
35
35
|
</td>
|
36
36
|
<td>
|
37
|
-
<%- if
|
37
|
+
<%- if policy(checkout).update? -%>
|
38
38
|
<% unless checkout.checkin %>
|
39
39
|
<%= link_to t('checkout.extend'), edit_checkout_path(checkout) -%>
|
40
40
|
<% end %>
|
41
41
|
<%- end -%>
|
42
|
-
<%- if
|
42
|
+
<%- if policy(checkout).destroy? -%>
|
43
43
|
<%= link_to t('page.destroy'), checkout, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
44
44
|
<%- end -%>
|
45
45
|
</td>
|
@@ -4,11 +4,11 @@
|
|
4
4
|
<% facet.value ? facet_reserved = true : facet_reserved = false %>
|
5
5
|
<li>
|
6
6
|
<%- if @reserved == facet_reserved -%><strong><%- end -%>
|
7
|
-
<%= link_to "#{localized_boolean(facet.value)} (#{facet.count})", url_for(params.merge(page: nil, reserved: facet.value.to_s, view: nil, only_path: true)) -%>
|
7
|
+
<%= link_to "#{localized_boolean(facet.value)} (#{facet.count})", url_for(params.permit.merge(page: nil, reserved: facet.value.to_s, view: nil, only_path: true)) -%>
|
8
8
|
<%- if @reserved == facet_reserved -%></strong><%- end -%>
|
9
9
|
</li>
|
10
10
|
<%- end -%>
|
11
11
|
<%- unless @reserved.nil? -%>
|
12
|
-
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(reserved: nil, page: nil, view: nil, only_path: true)) -%></li>
|
12
|
+
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(reserved: nil, page: nil, view: nil, only_path: true)) -%></li>
|
13
13
|
<%- end -%>
|
14
14
|
</ul>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<ul>
|
46
46
|
<li><%= link_to t('page.show'), @checkout -%></li>
|
47
47
|
<% if @checkout.user %>
|
48
|
-
<li><%= link_to t('page.back'),
|
48
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
49
49
|
<% end %>
|
50
50
|
</ul>
|
51
51
|
</div>
|
@@ -4,14 +4,14 @@
|
|
4
4
|
<% elsif @item %>
|
5
5
|
<%= render 'index_item', item: @item -%>
|
6
6
|
<% else %>
|
7
|
-
<%- if params[:
|
7
|
+
<%- if params[:days_overdue].present? -%>
|
8
8
|
<%= render 'index_overdue' -%>
|
9
9
|
<%- else -%>
|
10
10
|
<%= render 'index' -%>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
13
13
|
<% else %>
|
14
|
-
<%- if params[:
|
14
|
+
<%- if params[:days_overdue].present? -%>
|
15
15
|
<%= render 'index_overdue' -%>
|
16
16
|
<%- else -%>
|
17
17
|
<%= render 'index_user', user: current_user -%>
|
@@ -6,12 +6,12 @@ xml.rss('version' => "2.0",
|
|
6
6
|
if @user
|
7
7
|
xml.title t('checkout.user_checkout', login_name: @user.username)
|
8
8
|
xml.link checkouts_url(user_id: @user.username)
|
9
|
-
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
|
9
|
+
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
|
10
10
|
xml.tag! "atom:link", rel: 'alternate', href: checkouts_url(user_id: @user.username)
|
11
11
|
else
|
12
12
|
xml.title t('checkout.library_group_checkout', library_group_name: @library_group.display_name.localize)
|
13
13
|
xml.link checkouts_url
|
14
|
-
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
|
14
|
+
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
|
15
15
|
xml.tag! "atom:link", rel: 'alternate', href: checkouts_url
|
16
16
|
end
|
17
17
|
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%- if params[:
|
1
|
+
<%- if params[:days_overdue].present? -%><%= 'Overdue items' -%><%- else -%><%= 'Checkout items' -%><%- end -%> (created_at: <%= Time.now -%>)<%= "\n" -%>
|
2
2
|
<%- @checkouts.each do |checkout| -%>
|
3
3
|
"<%=h checkout.user.try(:username) -%>" "<%=h checkout.item.item_identifier -%>" "<%=h checkout.item.manifestation.original_title -%>" "<%=h checkout.created_at -%>" "<%= checkout.due_date -%>"<%= "\n" -%>
|
4
4
|
<%- end -%>
|
@@ -12,10 +12,16 @@
|
|
12
12
|
<strong><%= t('activerecord.attributes.checkout.due_date') -%></strong><br />
|
13
13
|
<%= l(@checkout.due_date, format: :only_date) if @checkout.due_date -%>
|
14
14
|
</p>
|
15
|
-
<%- if
|
15
|
+
<%- if policy(@checkout).update? -%>
|
16
16
|
<p>
|
17
17
|
<strong><%= t('checkout.current_user') -%></strong><br />
|
18
|
-
|
18
|
+
<% if @checkout.user.try(:profile) -%>
|
19
|
+
<%= link_to @checkout.user_username, @checkout.user.profile if @checkout.user.try(:profile) -%>
|
20
|
+
(
|
21
|
+
<%= t('activerecord.attributes.profile.user_number') %>:
|
22
|
+
<%= @checkout.user.profile.user_number %>
|
23
|
+
)
|
24
|
+
<% end %>
|
19
25
|
</p>
|
20
26
|
<%- end -%>
|
21
27
|
</div>
|
@@ -25,11 +31,9 @@
|
|
25
31
|
<%= render 'manifestations/book_jacket', manifestation: @checkout.item.manifestation -%>
|
26
32
|
<ul>
|
27
33
|
<li><%= link_to t('page.edit'), edit_checkout_path(@checkout) -%></li>
|
28
|
-
|
29
|
-
<li><%= link_to t('page.back'), checkouts_path(user_id: @checkout.user.username) -%></li>
|
30
|
-
<% end %>
|
34
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
31
35
|
<%- if current_user.has_role?('Librarian') -%>
|
32
|
-
<li><%= link_to t('page.
|
36
|
+
<li><%= link_to t('page.listing', model: t('activerecord.models.checkout')), checkouts_path -%></li>
|
33
37
|
<%- end -%>
|
34
38
|
</ul>
|
35
39
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%- @circulation_statuses.each do |circulation_status| -%>
|
18
18
|
<tr class="line<%= cycle("0", "1") -%>">
|
19
19
|
<td>
|
20
|
-
<%- if
|
20
|
+
<%- if policy(circulation_status).update? -%>
|
21
21
|
<%= move_position(circulation_status) -%>
|
22
22
|
<%- end -%>
|
23
23
|
</td>
|
@@ -28,10 +28,10 @@
|
|
28
28
|
<%= circulation_status.note %>
|
29
29
|
</td>
|
30
30
|
<td>
|
31
|
-
<%- if
|
31
|
+
<%- if policy(circulation_status).update? -%>
|
32
32
|
<%= link_to t('page.edit'), edit_circulation_status_path(circulation_status) -%>
|
33
33
|
<% end %>
|
34
|
-
<%- if
|
34
|
+
<%- if policy(circulation_status).destroy? -%>
|
35
35
|
<%= link_to t('page.destroy'), circulation_status_path(circulation_status), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
36
36
|
<%- end -%>
|
37
37
|
</td>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
46
46
|
<ul>
|
47
|
-
<%- if
|
47
|
+
<%- if policy(CirculationStatus).create? -%>
|
48
48
|
<li><%= link_to t('page.new', model: t('activerecord.models.circulation_status')), new_circulation_status_path -%></li>
|
49
49
|
<%- end -%>
|
50
50
|
</ul>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(@circulation_status).update? -%>
|
27
27
|
<li><%= link_to t('page.edit'), edit_circulation_status_path(@circulation_status) -%></li>
|
28
28
|
<%- end -%>
|
29
29
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -4,12 +4,12 @@
|
|
4
4
|
<% @state_facet.each do |state| %>
|
5
5
|
<li>
|
6
6
|
<% if state.value == params[:state].to_s.downcase %><strong><% end %>
|
7
|
-
<%= link_to "#{i18n_state(state.value)} (#{state.count})", url_for(params.merge(state: state.value, page: nil, view: nil, only_path: true)) %>
|
7
|
+
<%= link_to "#{i18n_state(state.value)} (#{state.count})", url_for(params.permit.merge(state: state.value, page: nil, view: nil, only_path: true)) %>
|
8
8
|
<% if state.value == params[:state].to_s.downcase %></strong><% end %>
|
9
9
|
</li>
|
10
10
|
<% end %>
|
11
11
|
<%- if params[:state] -%>
|
12
|
-
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(state: nil, page: nil, view: nil, only_path: true)) -%></li>
|
12
|
+
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(state: nil, page: nil, view: nil, only_path: true)) -%></li>
|
13
13
|
<%- end -%>
|
14
14
|
</ul>
|
15
15
|
<%- end -%>
|
@@ -21,12 +21,12 @@
|
|
21
21
|
<%- if @sort_by == :created_at -%>
|
22
22
|
<strong><%= t('activerecord.attributes.reserve.created_at') -%></strong>
|
23
23
|
<%- else -%>
|
24
|
-
<%= link_to t('activerecord.attributes.reserve.created_at'), url_for(params.merge(sort_by: nil, only_path: true)) -%>
|
24
|
+
<%= link_to t('activerecord.attributes.reserve.created_at'), url_for(params.permit.merge(sort_by: nil, only_path: true)) -%>
|
25
25
|
<% end %>
|
26
26
|
<%- if @sort_by == :title -%>
|
27
27
|
<strong><%= t('page.title') -%></strong>
|
28
28
|
<%- else -%>
|
29
|
-
<%= link_to t('page.title'), url_for(params.merge(sort_by: 'title', only_path: true)) -%>
|
29
|
+
<%= link_to t('page.title'), url_for(params.permit.merge(sort_by: 'title', only_path: true)) -%>
|
30
30
|
<%- end -%>
|
31
31
|
</p>
|
32
32
|
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<th style="width: 30px">Id</th>
|
36
36
|
<th><%= t('activerecord.models.manifestation') -%></th>
|
37
37
|
<th style="width: 80px"><%= t('activerecord.attributes.reserve.state') -%></th>
|
38
|
-
<%- if
|
38
|
+
<%- if policy(Reserve).create? -%>
|
39
39
|
<th style="width: 70px"></th>
|
40
40
|
<% end %>
|
41
41
|
</tr>
|
@@ -61,13 +61,15 @@
|
|
61
61
|
<% end %>
|
62
62
|
</td>
|
63
63
|
<td>
|
64
|
-
<%- if
|
64
|
+
<%- if policy(reserve).update? -%>
|
65
65
|
<%= link_to t('page.edit'), edit_reserve_path(reserve) -%>
|
66
66
|
<%- if reserve.user.reserves.waiting.include?(reserve) -%>
|
67
67
|
<br />
|
68
68
|
<%= link_to t('page.cancel'), reserve_path(reserve, mode: 'cancel'), data: {confirm: t('page.are_you_sure')}, method: :put -%>
|
69
69
|
<%- else -%>
|
70
70
|
<br />
|
71
|
+
<% end %>
|
72
|
+
<%- if policy(reserve).destroy? -%>
|
71
73
|
<%= link_to t('page.destroy'), reserve, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
72
74
|
<%- end -%>
|
73
75
|
<%- end -%>
|
@@ -73,7 +73,7 @@
|
|
73
73
|
<%- else -%>
|
74
74
|
<li><%= link_to t('page.destroy'), @reserve, data: {confirm: t('page.are_you_sure')}, method: :delete -%></li>
|
75
75
|
<%- end -%>
|
76
|
-
<li><%= link_to t('page.
|
76
|
+
<li><%= link_to t('page.listing', model: t('activerecord.models.reserve')), reserves_path %></li>
|
77
77
|
</ul>
|
78
78
|
<!--
|
79
79
|
<p>TODO: 予約取り消し時に、次の予約者に連絡する</p>
|