enju_message 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -9
- data/app/controllers/messages_controller.rb +2 -1
- data/app/models/message.rb +1 -0
- data/app/models/message_request.rb +3 -1
- data/app/models/message_template.rb +1 -0
- data/app/views/baskets/edit.html.erb +30 -0
- data/app/views/baskets/index.html.erb +31 -0
- data/app/views/baskets/new.html.erb +29 -0
- data/app/views/baskets/show.html.erb +23 -0
- data/app/views/carrier_type_has_checkout_types/_form.html.erb +19 -0
- data/app/views/carrier_type_has_checkout_types/edit.html.erb +13 -0
- data/app/views/carrier_type_has_checkout_types/index.html.erb +33 -0
- data/app/views/carrier_type_has_checkout_types/new.html.erb +12 -0
- data/app/views/carrier_type_has_checkout_types/show.html.erb +29 -0
- data/app/views/checked_items/_checkouts.html.erb +20 -0
- data/app/views/checked_items/_list.html.erb +39 -0
- data/app/views/checked_items/edit.html.erb +21 -0
- data/app/views/checked_items/index.html.erb +32 -0
- data/app/views/checked_items/index.js.erb +1 -0
- data/app/views/checked_items/new.html.erb +20 -0
- data/app/views/checked_items/show.html.erb +24 -0
- data/app/views/checkins/_form.html.erb +24 -0
- data/app/views/checkins/_list.html.erb +51 -0
- data/app/views/checkins/edit.html.erb +26 -0
- data/app/views/checkins/index.html.erb +16 -0
- data/app/views/checkins/index.js.erb +1 -0
- data/app/views/checkins/new.html.erb +14 -0
- data/app/views/checkins/show.html.erb +24 -0
- data/app/views/checkout_stat_has_manifestations/_form.html.erb +15 -0
- data/app/views/checkout_stat_has_manifestations/edit.html.erb +13 -0
- data/app/views/checkout_stat_has_manifestations/index.html.erb +33 -0
- data/app/views/checkout_stat_has_manifestations/new.html.erb +12 -0
- data/app/views/checkout_stat_has_manifestations/show.html.erb +28 -0
- data/app/views/checkout_stat_has_users/_form.html.erb +15 -0
- data/app/views/checkout_stat_has_users/edit.html.erb +13 -0
- data/app/views/checkout_stat_has_users/index.html.erb +33 -0
- data/app/views/checkout_stat_has_users/new.html.erb +12 -0
- data/app/views/checkout_stat_has_users/show.html.erb +28 -0
- data/app/views/checkout_types/_form.html.erb +19 -0
- data/app/views/checkout_types/edit.html.erb +13 -0
- data/app/views/checkout_types/index.html.erb +50 -0
- data/app/views/checkout_types/new.html.erb +12 -0
- data/app/views/checkout_types/show.html.erb +38 -0
- data/app/views/checkouts/_form.html.erb +28 -0
- data/app/views/checkouts/_index.html.erb +23 -0
- data/app/views/checkouts/_index_overdue.html.erb +33 -0
- data/app/views/checkouts/_index_user.html.erb +44 -0
- data/app/views/checkouts/_list.html.erb +45 -0
- data/app/views/checkouts/edit.html.erb +51 -0
- data/app/views/checkouts/index.atom.builder +14 -0
- data/app/views/checkouts/index.csv.erb +4 -0
- data/app/views/checkouts/index.html.erb +11 -0
- data/app/views/checkouts/index.ics.erb +13 -0
- data/app/views/checkouts/index.rss.builder +38 -0
- data/app/views/checkouts/new.html.erb +20 -0
- data/app/views/checkouts/show.html.erb +35 -0
- data/app/views/circulation_statuses/_form.html.erb +19 -0
- data/app/views/circulation_statuses/edit.html.erb +13 -0
- data/app/views/circulation_statuses/index.html.erb +43 -0
- data/app/views/circulation_statuses/new.html.erb +12 -0
- data/app/views/circulation_statuses/show.html.erb +29 -0
- data/app/views/item_has_use_restrictions/edit.html.erb +27 -0
- data/app/views/item_has_use_restrictions/index.html.erb +32 -0
- data/app/views/item_has_use_restrictions/new.html.erb +25 -0
- data/app/views/item_has_use_restrictions/show.html.erb +29 -0
- data/app/views/lending_policies/_form.html.erb +41 -0
- data/app/views/lending_policies/edit.html.erb +13 -0
- data/app/views/lending_policies/index.html.erb +42 -0
- data/app/views/lending_policies/new.html.erb +12 -0
- data/app/views/lending_policies/show.html.erb +50 -0
- data/app/views/manifestation_checkout_stats/_form.html.erb +19 -0
- data/app/views/manifestation_checkout_stats/edit.html.erb +13 -0
- data/app/views/manifestation_checkout_stats/index.html.erb +35 -0
- data/app/views/manifestation_checkout_stats/new.html.erb +12 -0
- data/app/views/manifestation_checkout_stats/show.csv.erb +4 -0
- data/app/views/manifestation_checkout_stats/show.html.erb +55 -0
- data/app/views/manifestation_reserve_stats/_form.html.erb +19 -0
- data/app/views/manifestation_reserve_stats/edit.html.erb +13 -0
- data/app/views/manifestation_reserve_stats/index.html.erb +35 -0
- data/app/views/manifestation_reserve_stats/new.html.erb +12 -0
- data/app/views/manifestation_reserve_stats/show.csv.erb +4 -0
- data/app/views/manifestation_reserve_stats/show.html.erb +55 -0
- data/app/views/reserve_stat_has_manifestations/_form.html.erb +15 -0
- data/app/views/reserve_stat_has_manifestations/edit.html.erb +13 -0
- data/app/views/reserve_stat_has_manifestations/index.html.erb +33 -0
- data/app/views/reserve_stat_has_manifestations/new.html.erb +12 -0
- data/app/views/reserve_stat_has_manifestations/show.html.erb +28 -0
- data/app/views/reserve_stat_has_users/_form.html.erb +15 -0
- data/app/views/reserve_stat_has_users/edit.html.erb +13 -0
- data/app/views/reserve_stat_has_users/index.html.erb +33 -0
- data/app/views/reserve_stat_has_users/new.html.erb +12 -0
- data/app/views/reserve_stat_has_users/show.html.erb +28 -0
- data/app/views/reserves/_form.html.erb +49 -0
- data/app/views/reserves/_new.html.erb +44 -0
- data/app/views/reserves/_new_user.html.erb +50 -0
- data/app/views/reserves/_title.html.erb +19 -0
- data/app/views/reserves/edit.html.erb +42 -0
- data/app/views/reserves/index.atom.builder +14 -0
- data/app/views/reserves/index.csv.erb +4 -0
- data/app/views/reserves/index.html.erb +75 -0
- data/app/views/reserves/index.rss.builder +41 -0
- data/app/views/reserves/new.html.erb +5 -0
- data/app/views/reserves/show.html.erb +61 -0
- data/app/views/use_restrictions/_form.html.erb +19 -0
- data/app/views/use_restrictions/edit.html.erb +13 -0
- data/app/views/use_restrictions/index.html.erb +43 -0
- data/app/views/use_restrictions/new.html.erb +12 -0
- data/app/views/use_restrictions/show.html.erb +29 -0
- data/app/views/user_checkout_stats/_form.html.erb +19 -0
- data/app/views/user_checkout_stats/edit.html.erb +13 -0
- data/app/views/user_checkout_stats/index.html.erb +35 -0
- data/app/views/user_checkout_stats/new.html.erb +12 -0
- data/app/views/user_checkout_stats/show.csv.erb +4 -0
- data/app/views/user_checkout_stats/show.html.erb +55 -0
- data/app/views/user_group_has_checkout_types/edit.html.erb +63 -0
- data/app/views/user_group_has_checkout_types/index.html.erb +32 -0
- data/app/views/user_group_has_checkout_types/new.html.erb +62 -0
- data/app/views/user_group_has_checkout_types/show.html.erb +64 -0
- data/app/views/user_reserve_stats/_form.html.erb +19 -0
- data/app/views/user_reserve_stats/edit.html.erb +13 -0
- data/app/views/user_reserve_stats/index.html.erb +35 -0
- data/app/views/user_reserve_stats/new.html.erb +12 -0
- data/app/views/user_reserve_stats/show.csv.erb +4 -0
- data/app/views/user_reserve_stats/show.html.erb +54 -0
- data/lib/enju_message/version.rb +1 -1
- data/spec/controllers/message_requests_controller_spec.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/_0.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_0.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_0.fnm +3 -0
- data/spec/dummy/solr/data/test/index/_0.frq +1 -0
- data/spec/dummy/solr/data/test/index/_0.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_0.prx +0 -0
- data/spec/dummy/solr/data/test/index/_0.tii +0 -0
- data/spec/dummy/solr/data/test/index/_0.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_2 +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
- data/spec/factories/message_request.rb +1 -0
- metadata +143 -4
- data/spec/dummy/solr/data/test/index/segments_1 +0 -0
data/Rakefile
CHANGED
@@ -26,14 +26,6 @@ load 'rails/tasks/engine.rake'
|
|
26
26
|
|
27
27
|
Bundler::GemHelper.install_tasks
|
28
28
|
|
29
|
-
require 'rspec/core'
|
30
|
-
require 'rspec/core/rake_task'
|
31
|
-
|
32
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
33
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
34
|
-
end
|
35
|
-
|
36
|
-
task :default => :spec
|
37
29
|
require 'rake/testtask'
|
38
30
|
|
39
31
|
Rake::TestTask.new(:test) do |t|
|
@@ -43,5 +35,12 @@ Rake::TestTask.new(:test) do |t|
|
|
43
35
|
t.verbose = false
|
44
36
|
end
|
45
37
|
|
38
|
+
require 'rspec/core'
|
39
|
+
require 'rspec/core/rake_task'
|
40
|
+
|
41
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
42
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
43
|
+
end
|
46
44
|
|
47
|
-
|
45
|
+
|
46
|
+
task :default => :spec
|
@@ -77,7 +77,8 @@ class MessagesController < ApplicationController
|
|
77
77
|
# POST /messages
|
78
78
|
# POST /messages.json
|
79
79
|
def create
|
80
|
-
@message =
|
80
|
+
@message = Message.new(params[:message])
|
81
|
+
@message.sender = current_user
|
81
82
|
get_parent(@message.parent_id)
|
82
83
|
@message.receiver = User.find(@message.recipient) rescue nil
|
83
84
|
|
data/app/models/message.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'erubis'
|
2
2
|
class MessageRequest < ActiveRecord::Base
|
3
|
+
attr_accessible :body
|
4
|
+
attr_accessible :sender, :receiver, :message_template, :as => :admin
|
3
5
|
scope :not_sent, where('sent_at IS NULL AND state = ?', 'pending')
|
4
6
|
scope :sent, where(:state => 'sent')
|
5
7
|
scope :started, where(:state => 'started')
|
@@ -9,7 +11,7 @@ class MessageRequest < ActiveRecord::Base
|
|
9
11
|
has_many :messages
|
10
12
|
|
11
13
|
validates_associated :sender, :receiver, :message_template
|
12
|
-
validates_presence_of :sender, :receiver, :message_template
|
14
|
+
validates_presence_of :sender, :receiver, :message_template, :body
|
13
15
|
|
14
16
|
state_machine :initial => :pending do
|
15
17
|
before_transition any - :sent => :sent, :do => :send_message
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.basket')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@basket) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label t('activerecord.models.user') -%><br />
|
9
|
+
<%= @basket.user.username -%>
|
10
|
+
<%= f.hidden_field :user_id -%>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="field">
|
14
|
+
<%= f.label :note -%><br />
|
15
|
+
<%= f.text_area :note, :class => 'resource_textarea' -%>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="actions">
|
19
|
+
<%= f.submit %>
|
20
|
+
</div>
|
21
|
+
<%- end -%>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div id="submenu" class="ui-corner-all">
|
26
|
+
<ul>
|
27
|
+
<li><%= link_to t('page.show'), basket_path(@basket) -%></li>
|
28
|
+
<li><%= link_to t('page.back'), user_baskets_path(@basket.user) -%></li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div id="content_list">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.basket')) -%></h1>
|
3
|
+
<div id="content_detail" class="ui-corner-all">
|
4
|
+
|
5
|
+
<table class="index">
|
6
|
+
<tr>
|
7
|
+
<th><%= t('activerecord.models.user') -%></th>
|
8
|
+
<th><%= t('activerecord.attributes.basket.note') -%></th>
|
9
|
+
<th><%= t('page.updated_at') -%></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<%- @baskets.each do |basket| -%>
|
13
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
14
|
+
<td><%= basket.user.username -%></td>
|
15
|
+
<td><%= basket.note -%></td>
|
16
|
+
<td><%= basket.updated_at -%></td>
|
17
|
+
<td><%= link_to t('page.show'), basket -%></td>
|
18
|
+
</tr>
|
19
|
+
<%- end -%>
|
20
|
+
</table>
|
21
|
+
|
22
|
+
<%= will_paginate(@baskets) -%>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="submenu" class="ui-corner-all">
|
28
|
+
<ul>
|
29
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.basket')), new_basket_path -%></li>
|
30
|
+
</ul>
|
31
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.basket')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@basket, :html => {:name => 'basket_form'}) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
<div class="field">
|
8
|
+
<%= f.label t('activerecord.attributes.user.user_number') -%>
|
9
|
+
<%= f.text_field :user_number, :class => 'resource_user_number' -%>
|
10
|
+
|
11
|
+
<!--
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :note -%><br />
|
14
|
+
<%= f.text_area :note, :class => 'resource_textarea' -%>
|
15
|
+
</div>
|
16
|
+
-->
|
17
|
+
<%= f.submit t('page.read') -%>
|
18
|
+
</div>
|
19
|
+
<%- end -%>
|
20
|
+
<%= javascript_tag("$('#basket_user_number').focus()") -%>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="submenu" class="ui-corner-all">
|
25
|
+
<ul>
|
26
|
+
<li><%= link_to t('activerecord.models.checkin'), checkins_path -%></li>
|
27
|
+
<li><%= link_to t('page.search_resource', :model => t('activerecord.models.user')), users_path -%></li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div id="content_list">
|
2
|
+
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.basket')) -%></h1>
|
3
|
+
<div id="content_detail" class="ui-corner-all">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.models.user') -%>:</strong>
|
8
|
+
<%= @basket.user.username -%>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.attributes.basket.note') -%>:</strong>
|
13
|
+
<%= @basket.note -%>
|
14
|
+
</p>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div id="submenu" class="ui-corner-all">
|
19
|
+
<ul>
|
20
|
+
<li><%= link_to t('page.edit'), edit_basket_path(@basket) -%></li>
|
21
|
+
<li><%= link_to t('page.back'), user_baskets_path(@basket.user) -%></li>
|
22
|
+
</ul>
|
23
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_for(@carrier_type_has_checkout_type) do |f| -%>
|
2
|
+
<%= f.error_messages -%>
|
3
|
+
|
4
|
+
<div class="field">
|
5
|
+
<%= f.label t('activerecord.models.carrier_type') -%><br />
|
6
|
+
<%= f.select(:carrier_type_id, @carrier_types.collect{|m| [m.display_name.localize, m.id]}, :include_blank => true) -%>
|
7
|
+
</div>
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label t('activerecord.models.checkout_type') -%><br />
|
10
|
+
<%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}, :include_blank => true) -%>
|
11
|
+
</div>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :note -%><br />
|
14
|
+
<%= f.text_area :note, :class => 'resource_textarea' -%>
|
15
|
+
</div>
|
16
|
+
<div class="actions">
|
17
|
+
<%= f.submit %>
|
18
|
+
</div>
|
19
|
+
<%- end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.carrier_type_has_checkout_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.show'), @carrier_type_has_checkout_type -%></li>
|
11
|
+
<li><%= link_to t('page.back'), carrier_type_has_checkout_types_path -%></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.carrier_type_has_checkout_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<table class="index">
|
6
|
+
<tr>
|
7
|
+
<th><%= t('activerecord.models.carrier_type') -%></th>
|
8
|
+
<th><%= t('activerecord.models.checkout_type') -%></th>
|
9
|
+
<th><%= t('activerecord.attributes.carrier_type_has_checkout_type.note') -%></th>
|
10
|
+
<th></th>
|
11
|
+
</tr>
|
12
|
+
|
13
|
+
<%- @carrier_type_has_checkout_types.each do |carrier_type_has_checkout_type| -%>
|
14
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
15
|
+
<td><%= link_to carrier_type_has_checkout_type.carrier_type.display_name.localize, carrier_type_has_checkout_type.carrier_type -%></td>
|
16
|
+
<td><%= link_to carrier_type_has_checkout_type.checkout_type.display_name.localize, carrier_type_has_checkout_type.checkout_type -%></td>
|
17
|
+
<td><%= carrier_type_has_checkout_type.note -%></td>
|
18
|
+
<td>
|
19
|
+
<%= link_to t('page.edit'), edit_carrier_type_has_checkout_type_path(carrier_type_has_checkout_type) -%>
|
20
|
+
<%= link_to t('page.destroy'), carrier_type_has_checkout_type, :confirm => t('page.are_you_sure'), :method => :delete -%>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
<%- end -%>
|
24
|
+
</table>
|
25
|
+
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="submenu" class="ui-corner-all">
|
30
|
+
<ul>
|
31
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.carrier_type_has_checkout_type')), new_carrier_type_has_checkout_type_path -%></li>
|
32
|
+
</ul>
|
33
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.carrier_type_has_checkout_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<%= render 'form' %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div id="submenu" class="ui-corner-all">
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to t('page.back'), carrier_type_has_checkout_types_path -%></li>
|
11
|
+
</ul>
|
12
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.carrier_type_has_checkout_type')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.models.carrier_type') -%>:</strong>
|
8
|
+
<%= link_to @carrier_type_has_checkout_type.carrier_type.display_name.localize, @carrier_type_has_checkout_type.carrier_type -%>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.models.checkout_type') -%>:</strong>
|
13
|
+
<%= link_to @carrier_type_has_checkout_type.checkout_type.display_name.localize, @carrier_type_has_checkout_type.checkout_type -%>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.carrier_type_has_checkout_type.note') -%>:</strong>
|
18
|
+
<%= @carrier_type_has_checkout_type.note -%>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="submenu" class="ui-corner-all">
|
25
|
+
<ul>
|
26
|
+
<li><%= link_to t('page.edit'), edit_carrier_type_has_checkout_type_path(@carrier_type_has_checkout_type) -%></li>
|
27
|
+
<li><%= back_to_index(flash[:page_info]) -%></li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h3><%= t('checked_item.previous_checkout') -%></h3>
|
2
|
+
|
3
|
+
<table class="index">
|
4
|
+
<tr>
|
5
|
+
<th class="checked_item_title"><%= t('page.title') -%></th>
|
6
|
+
<th><%= t('activerecord.attributes.item.item_identifier') -%></th>
|
7
|
+
<th><%= t('activerecord.attributes.checkout.due_date') -%></th>
|
8
|
+
</tr>
|
9
|
+
|
10
|
+
<%- @basket.user.checkouts.not_returned.each_with_index do |checkout, i| -%>
|
11
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
12
|
+
<td>
|
13
|
+
<%= render 'manifestations/show_index', :manifestation => checkout.item.manifestation -%>
|
14
|
+
<%= render 'manifestations/holding', :manifestation => checkout.item.manifestation -%>
|
15
|
+
</td>
|
16
|
+
<td><%= link_to checkout.item.item_identifier, checkout.item -%></td>
|
17
|
+
<td><%= l(checkout.due_date, :format => :only_date) -%></td>
|
18
|
+
</tr>
|
19
|
+
<%- end -%>
|
20
|
+
</table>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div style="color: red"><%= flash[:message].try(:join) -%></div>
|
2
|
+
|
3
|
+
<div class="search_form">
|
4
|
+
<%= form_for :checked_item, :html => {:method => :post}, :url => basket_checked_items_path(@basket, :mode => 'list'), :remote => true do |f| -%>
|
5
|
+
<%= f.error_messages -%>
|
6
|
+
<p>
|
7
|
+
<%= t('activerecord.attributes.item.item_identifier') -%>: <%= f.text_field :item_identifier -%>
|
8
|
+
<%= t('checked_item.ignore_restriction') -%>: <%= f.check_box :ignore_restriction -%>
|
9
|
+
<%= submit_tag t('page.read') -%>
|
10
|
+
</p>
|
11
|
+
<%- end -%>
|
12
|
+
<%= javascript_tag("$('#checked_item_item_identifier').focus()") -%>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<table class="index">
|
16
|
+
<tr>
|
17
|
+
<th class="checked_item_title"><%= t('page.title') -%></th>
|
18
|
+
<th><%= t('activerecord.attributes.item.item_identifier') -%></th>
|
19
|
+
<th><%= t('activerecord.attributes.checkout.due_date') -%></th>
|
20
|
+
<th></th>
|
21
|
+
</tr>
|
22
|
+
|
23
|
+
<%- @checked_items.each_with_index do |checked_item, i| -%>
|
24
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
25
|
+
<td>
|
26
|
+
<%= render 'manifestations/show_index', :manifestation => checked_item.item.manifestation -%>
|
27
|
+
</td>
|
28
|
+
<td><%= link_to checked_item.item.item_identifier, checked_item.item -%></td>
|
29
|
+
<td><%= l(checked_item.due_date, :format => :only_date) -%></td>
|
30
|
+
<td><%= link_to t('page.destroy'), checked_item, :confirm => t('page.are_you_sure'), :method => :delete -%></td>
|
31
|
+
</tr>
|
32
|
+
<%- end -%>
|
33
|
+
</table>
|
34
|
+
|
35
|
+
<%= form_for(:basket, :url => {:controller => 'baskets', :action => 'update', :id => @basket.id}, :html => { :method => :put }) do |f| -%>
|
36
|
+
<div>
|
37
|
+
<%= f.submit t('checked_item.checkout') -%>
|
38
|
+
</div>
|
39
|
+
<%- end -%>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.checked_item')) -%></h1>
|
2
|
+
|
3
|
+
<%= form_for(@checked_item) do |f| -%>
|
4
|
+
<%= f.error_messages -%>
|
5
|
+
<div class="field">
|
6
|
+
<%= f.label t('activerecord.models.item') -%><br />
|
7
|
+
<%= f.text_field :item_id -%>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="field">
|
11
|
+
<%= f.label t('activerecord.models.basket') -%><br />
|
12
|
+
<%= f.text_field :basket_id -%>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="actions">
|
16
|
+
<%= f.submit %>
|
17
|
+
</div>
|
18
|
+
<%- end -%>
|
19
|
+
|
20
|
+
<%= link_to t('page.show'), checked_item_path(@checked_item) -%> |
|
21
|
+
<%= link_to t('page.back'), basket_checked_items_path(@checked_item.basket) -%>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.checked_item')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<div id="checked_item_list">
|
7
|
+
<%= render 'list' -%>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<br />
|
11
|
+
|
12
|
+
<%= render 'checkouts' -%>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div id="submenu" class="ui-corner-all">
|
17
|
+
<ul>
|
18
|
+
<li><%= link_to @basket.user.username, @basket.user -%></li>
|
19
|
+
</ul>
|
20
|
+
<ul>
|
21
|
+
<%- @basket.user.user_group.user_group_has_checkout_types.each do |available_checkout_type| -%>
|
22
|
+
<li>
|
23
|
+
<%= available_checkout_type.checkout_type.display_name.localize -%>:
|
24
|
+
<%= @basket.user.checked_item_count[:"#{available_checkout_type.checkout_type.name}"] -%> / <%= available_checkout_type.checkout_limit -%>
|
25
|
+
</li>
|
26
|
+
<%- end -%>
|
27
|
+
</ul>
|
28
|
+
<ul>
|
29
|
+
<li><%= link_to t('activerecord.models.checkin'), checkins_path -%></li>
|
30
|
+
<li><%= link_to t('activerecord.models.reserve'), user_reserves_path(@basket.user) -%></li>
|
31
|
+
</ul>
|
32
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
$("#checked_item_list").html("<%= escape_javascript(render('checked_items/list')) %>");
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.checked_item')) -%></h1>
|
2
|
+
|
3
|
+
<%= form_for(@checked_item, :url => basket_checked_items_path(@basket)) do |f| -%>
|
4
|
+
<%= f.error_messages -%>
|
5
|
+
<div class="field">
|
6
|
+
<%= f.label t('activerecord.models.item') -%><br />
|
7
|
+
<%= f.text_field :item_id -%>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="field">
|
11
|
+
<%= f.label t('activerecord.models.basket') -%><br />
|
12
|
+
<%= f.text_field :basket_id -%>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="actions">
|
16
|
+
<%= f.submit %>
|
17
|
+
</div>
|
18
|
+
<%- end -%>
|
19
|
+
|
20
|
+
<%= link_to t('page.back'), basket_checked_items_path(@basket) -%>
|