enju_event 0.3.5 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/app/controllers/event_import_files_controller.rb +0 -1
- data/app/controllers/event_import_results_controller.rb +4 -4
- data/app/controllers/events_controller.rb +1 -1
- data/app/controllers/places_controller.rb +1 -1
- data/app/models/event.rb +37 -49
- data/app/models/event_category.rb +9 -7
- data/app/models/event_export_file.rb +9 -12
- data/app/models/event_import_file.rb +9 -5
- data/app/models/event_import_result.rb +1 -6
- data/app/views/event_categories/_form.html.erb +1 -1
- data/app/views/event_categories/index.html.erb +1 -1
- data/app/views/event_categories/show.html.erb +1 -1
- data/app/views/event_import_files/new.html.erb +2 -2
- data/app/views/event_import_files/show.html.erb +74 -70
- data/app/views/event_import_results/index.html.erb +12 -1
- data/app/views/event_import_results/index.txt.erb +3 -0
- data/app/views/events/_form.html.erb +2 -2
- data/app/views/events/index.atom.builder +2 -2
- data/app/views/events/index.html+phone.erb +2 -2
- data/app/views/events/index.html.erb +5 -5
- data/app/views/events/index.ics.erb +1 -1
- data/app/views/events/index.json.jbuilder +1 -1
- data/app/views/events/index.rss.builder +2 -2
- data/app/views/events/index.txt.erb +4 -0
- data/app/views/events/show.html+phone.erb +3 -3
- data/app/views/events/show.html.erb +3 -3
- data/app/views/layouts/calendar.html.erb +4 -4
- data/app/views/participates/index.html.erb +1 -1
- data/app/views/participates/show.html.erb +1 -1
- data/app/views/picture_files/_index_event.html.erb +1 -1
- data/config/locales/translation_en.yml +0 -1
- data/config/locales/translation_ja.yml +0 -1
- data/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/lib/enju_event/engine.rb +1 -0
- data/lib/enju_event/version.rb +1 -1
- data/lib/generators/enju_event/setup/setup_generator.rb +3 -3
- data/lib/generators/enju_event/setup/templates/db/fixtures/event_categories.yml +35 -6
- data/spec/controllers/event_import_results_controller_spec.rb +2 -2
- data/spec/controllers/events_controller_spec.rb +2 -2
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
- data/spec/dummy/db/schema.rb +148 -266
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/event_category.rb +4 -2
- data/spec/factories/library.rb +2 -0
- data/spec/fixtures/agent_types.yml +11 -11
- data/spec/fixtures/event_categories.yml +14 -13
- data/spec/fixtures/event_export_files.yml +1 -1
- data/spec/fixtures/events.yml +22 -29
- data/spec/fixtures/libraries.yml +30 -32
- data/spec/fixtures/library_groups.yml +44 -20
- data/spec/fixtures/shelves.yml +16 -15
- data/spec/models/event_category_spec.rb +8 -7
- data/spec/models/event_export_file_spec.rb +1 -1
- data/spec/models/event_spec.rb +14 -13
- data/spec/rails_helper.rb +5 -1
- data/spec/system/events_spec.rb +0 -5
- metadata +256 -389
- data/app/views/event_import_files/_results.html.erb +0 -26
- data/app/views/event_import_results/index.text.ruby +0 -5
- data/app/views/events/index.text.ruby +0 -7
- data/app/views/layouts/mailer.html.erb +0 -13
- data/app/views/layouts/mailer.text.erb +0 -1
- data/config/brakeman.ignore +0 -66
- data/spec/dummy/app/assets/config/manifest.js +0 -5
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -13
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +0 -21
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +0 -13
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +0 -11
- data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +0 -14
- data/spec/dummy/db/migrate/20181030074920_add_not_null_to_position_on_library.rb +0 -14
- data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +0 -27
- data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +0 -10
- data/spec/dummy/db/migrate/20190314151124_add_full_name_translations_to_create.rb +0 -7
- data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/spec/mailers/event_export_spec.rb +0 -5
- data/spec/mailers/event_import_spec.rb +0 -5
- data/spec/mailers/previews/event_export_preview.rb +0 -4
- data/spec/mailers/previews/event_import_preview.rb +0 -4
- data/spec/system/event_import_results_spec.rb +0 -17
- data/spec/views/event_import_results/index.text.ruby_spec.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63a31bb020f3875c6255cb7a9df0a42a725699153d9bae594d91d67de835bc31
|
4
|
+
data.tar.gz: 7efbfc7e8433e334c28b188b274bdc8ad1e78a4cf91f6124a43ee61e0ff7ae08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d271fbf21f3e5a5d95a61a58c839aefb0066eac738cc9654f8bfec4bcb0e5ee093af6d53f99e51a667256563ca5b22b78e9e4b2ac896830b5560a598a1d298b4
|
7
|
+
data.tar.gz: '058e66132258e9348ae9312059b4bafc36d875c5c6561105e8547756b8bdd1ced620ed018a30f4659b8e690795cfaba6adb9114b4055b7b4038edbf9e01d197f'
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# EnjuEvent
|
2
|
-
[![
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/next-l/enju_event/badge.svg?branch=
|
4
|
-
[![security](https://hakiri.io/github/next-l/enju_event/
|
2
|
+
[![CircleCI](https://circleci.com/gh/next-l/enju_event.svg?style=svg)](https://circleci.com/gh/next-l/enju_event)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/next-l/enju_event/badge.svg?branch=master)](https://coveralls.io/github/next-l/enju_event?branch=master)
|
4
|
+
[![security](https://hakiri.io/github/next-l/enju_event/master.svg)](https://hakiri.io/github/next-l/enju_event/master)
|
5
5
|
|
6
6
|
This project rocks and uses MIT-LICENSE.
|
7
7
|
|
data/Rakefile
CHANGED
@@ -22,7 +22,6 @@ class EventImportFilesController < ApplicationController
|
|
22
22
|
file = @event_import_file.event_import.path
|
23
23
|
end
|
24
24
|
end
|
25
|
-
@event_import_results = @event_import_file.event_import_results.page(params[:page])
|
26
25
|
|
27
26
|
respond_to do |format|
|
28
27
|
format.html # show.html.erb
|
@@ -5,17 +5,17 @@ class EventImportResultsController < ApplicationController
|
|
5
5
|
# GET /event_import_results
|
6
6
|
# GET /event_import_results.json
|
7
7
|
def index
|
8
|
-
@event_import_file = EventImportFile.
|
8
|
+
@event_import_file = EventImportFile.where(id: params[:event_import_file_id]).first
|
9
9
|
if @event_import_file
|
10
|
-
@event_import_results = @event_import_file.event_import_results.
|
10
|
+
@event_import_results = @event_import_file.event_import_results.page(params[:page])
|
11
11
|
else
|
12
|
-
@event_import_results = EventImportResult.
|
12
|
+
@event_import_results = EventImportResult.page(params[:page])
|
13
13
|
end
|
14
14
|
|
15
15
|
respond_to do |format|
|
16
16
|
format.html # index.html.erb
|
17
17
|
format.json { render json: @event_import_results }
|
18
|
-
format.
|
18
|
+
format.txt
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
data/app/models/event.rb
CHANGED
@@ -56,43 +56,30 @@ class Event < ApplicationRecord
|
|
56
56
|
self.display_name = name if display_name.blank?
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
updated_at: updated_at
|
59
|
+
def self.export(options = {format: :txt})
|
60
|
+
header = %w(
|
61
|
+
name
|
62
|
+
event_category
|
63
|
+
library
|
64
|
+
start_at
|
65
|
+
end_at
|
66
|
+
all_day
|
67
|
+
)
|
68
|
+
lines = []
|
69
|
+
Event.find_each.map{|e|
|
70
|
+
line = []
|
71
|
+
line << e.name
|
72
|
+
line << e.event_category.name
|
73
|
+
line << e.library.name
|
74
|
+
line << e.start_at
|
75
|
+
line << e.end_at
|
76
|
+
line << e.all_day
|
77
|
+
lines << line
|
79
78
|
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
# TSVでのエクスポート
|
85
|
-
# @param [String] role 権限
|
86
|
-
# @param [String] col_sep 区切り文字
|
87
|
-
def self.export(role: 'Guest', col_sep: "\t")
|
88
|
-
file = Tempfile.create('event_export') do |f|
|
89
|
-
f.write Event.csv_header(role: role).to_csv(col_sep: col_sep)
|
90
|
-
Event.find_each do |event|
|
91
|
-
f.write event.to_hash(role: role).values.to_csv(col_sep: col_sep)
|
92
|
-
end
|
93
|
-
|
94
|
-
f.rewind
|
95
|
-
f.read
|
79
|
+
if options[:format] == :txt
|
80
|
+
lines.map{|line| line.to_csv(col_sep: "\t")}.unshift(header.to_csv(col_sep: "\t")).join
|
81
|
+
else
|
82
|
+
event
|
96
83
|
end
|
97
84
|
end
|
98
85
|
end
|
@@ -101,17 +88,18 @@ end
|
|
101
88
|
#
|
102
89
|
# Table name: events
|
103
90
|
#
|
104
|
-
# id
|
105
|
-
# library_id
|
106
|
-
# event_category_id
|
107
|
-
# name
|
108
|
-
# note
|
109
|
-
# start_at
|
110
|
-
# end_at
|
111
|
-
# all_day
|
112
|
-
# deleted_at
|
113
|
-
# display_name
|
114
|
-
# created_at
|
115
|
-
# updated_at
|
116
|
-
# place_id
|
91
|
+
# id :integer not null, primary key
|
92
|
+
# library_id :integer not null
|
93
|
+
# event_category_id :integer not null
|
94
|
+
# name :string
|
95
|
+
# note :text
|
96
|
+
# start_at :datetime
|
97
|
+
# end_at :datetime
|
98
|
+
# all_day :boolean default(FALSE), not null
|
99
|
+
# deleted_at :datetime
|
100
|
+
# display_name :text
|
101
|
+
# created_at :datetime
|
102
|
+
# updated_at :datetime
|
103
|
+
# place_id :integer
|
104
|
+
# display_name_translations :jsonb not null
|
117
105
|
#
|
@@ -4,17 +4,19 @@ class EventCategory < ApplicationRecord
|
|
4
4
|
has_many :events
|
5
5
|
|
6
6
|
paginates_per 10
|
7
|
+
translates :display_name
|
7
8
|
end
|
8
9
|
|
9
10
|
# == Schema Information
|
10
11
|
#
|
11
12
|
# Table name: event_categories
|
12
13
|
#
|
13
|
-
# id
|
14
|
-
# name
|
15
|
-
# display_name
|
16
|
-
# note
|
17
|
-
# position
|
18
|
-
# created_at
|
19
|
-
# updated_at
|
14
|
+
# id :integer not null, primary key
|
15
|
+
# name :string not null
|
16
|
+
# display_name :text
|
17
|
+
# note :text
|
18
|
+
# position :integer
|
19
|
+
# created_at :datetime
|
20
|
+
# updated_at :datetime
|
21
|
+
# display_name_translations :jsonb not null
|
20
22
|
#
|
@@ -26,17 +26,14 @@ class EventExportFile < ApplicationRecord
|
|
26
26
|
to: :state_machine
|
27
27
|
|
28
28
|
def export!
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
save!
|
38
|
-
transition_to!(:completed)
|
39
|
-
end
|
29
|
+
transition_to!(:started)
|
30
|
+
tempfile = Tempfile.new(['event_export_file_', '.txt'])
|
31
|
+
file = Event.export(format: :txt)
|
32
|
+
tempfile.puts(file)
|
33
|
+
tempfile.close
|
34
|
+
self.event_export = File.new(tempfile.path, "r")
|
35
|
+
save!
|
36
|
+
transition_to!(:completed)
|
40
37
|
mailer = EventExportMailer.completed(self)
|
41
38
|
send_message(mailer)
|
42
39
|
rescue => e
|
@@ -64,7 +61,7 @@ end
|
|
64
61
|
# user_id :integer
|
65
62
|
# event_export_file_name :string
|
66
63
|
# event_export_content_type :string
|
67
|
-
# event_export_file_size :
|
64
|
+
# event_export_file_size :bigint
|
68
65
|
# event_export_updated_at :datetime
|
69
66
|
# executed_at :datetime
|
70
67
|
# created_at :datetime
|
@@ -51,7 +51,9 @@ class EventImportFile < ApplicationRecord
|
|
51
51
|
rows.each do |row|
|
52
52
|
row_num += 1
|
53
53
|
next if row['dummy'].to_s.strip.present?
|
54
|
-
event_import_result = EventImportResult.new
|
54
|
+
event_import_result = EventImportResult.new
|
55
|
+
event_import_result.assign_attributes({ event_import_file_id: id, body: row.fields.join("\t") })
|
56
|
+
event_import_result.save!
|
55
57
|
|
56
58
|
event = Event.new
|
57
59
|
event.name = row['name'].to_s.strip
|
@@ -65,10 +67,10 @@ class EventImportFile < ApplicationRecord
|
|
65
67
|
else
|
66
68
|
event.all_day = false
|
67
69
|
end
|
68
|
-
library = Library.
|
70
|
+
library = Library.where(name: row['library']).first
|
69
71
|
library = default_library || Library.web if library.blank?
|
70
72
|
event.library = library
|
71
|
-
event_category = EventCategory.
|
73
|
+
event_category = EventCategory.where(name: row['event_category']).first
|
72
74
|
event_category = default_event_category if event_category.blank?
|
73
75
|
event.event_category = event_category
|
74
76
|
|
@@ -111,7 +113,7 @@ class EventImportFile < ApplicationRecord
|
|
111
113
|
event = Event.find(row['id'].to_s.strip)
|
112
114
|
event_category = EventCategory.where(name: row['event_category'].to_s.strip).first
|
113
115
|
event.event_category = event_category if event_category
|
114
|
-
library = Library.
|
116
|
+
library = Library.where(name: row['library'].to_s.strip).first
|
115
117
|
event.library = library if library
|
116
118
|
event.name = row['name'] if row['name'].to_s.strip.present?
|
117
119
|
event.start_at = Time.zone.parse(row['start_at']) if row['start_at'].present?
|
@@ -181,7 +183,9 @@ class EventImportFile < ApplicationRecord
|
|
181
183
|
|
182
184
|
def open_import_file(tempfile)
|
183
185
|
file = CSV.open(tempfile, col_sep: "\t")
|
184
|
-
header_columns =
|
186
|
+
header_columns = %w(
|
187
|
+
id name display_name library event_category start_at end_at all_day note dummy
|
188
|
+
)
|
185
189
|
header = file.first
|
186
190
|
ignored_columns = header - header_columns
|
187
191
|
unless ignored_columns.empty?
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class EventImportResult < ApplicationRecord
|
2
|
+
default_scope { order('event_import_results.id') }
|
2
3
|
scope :file_id, proc{|file_id| where(event_import_file_id: file_id)}
|
3
4
|
scope :failed, -> { where(event_id: nil) }
|
4
5
|
|
@@ -6,12 +7,6 @@ class EventImportResult < ApplicationRecord
|
|
6
7
|
belongs_to :event, optional: true
|
7
8
|
|
8
9
|
validates :event_import_file_id, presence: true
|
9
|
-
|
10
|
-
def self.header
|
11
|
-
%w(
|
12
|
-
id name display_name library event_category start_at end_at all_day note dummy
|
13
|
-
)
|
14
|
-
end
|
15
10
|
end
|
16
11
|
|
17
12
|
# == Schema Information
|
@@ -34,13 +34,13 @@
|
|
34
34
|
|
35
35
|
<div class="field">
|
36
36
|
<%= f.label :default_event_category_id -%>
|
37
|
-
<%= f.select(:default_event_category_id, @event_categories.collect{|e| [e.display_name
|
37
|
+
<%= f.select(:default_event_category_id, @event_categories.collect{|e| [e.display_name, e.id]}) -%><br />
|
38
38
|
<%= t('event_import_file.default_event_category') %>
|
39
39
|
</div>
|
40
40
|
|
41
41
|
<div class="field">
|
42
42
|
<%= f.label :default_library_id -%>
|
43
|
-
<%= f.select(:default_library_id, @libraries.collect{|l| [l.display_name
|
43
|
+
<%= f.select(:default_library_id, @libraries.collect{|l| [l.display_name, l.id]}) -%><br />
|
44
44
|
<%= t('event_import_file.default_library') %>
|
45
45
|
</div>
|
46
46
|
|
@@ -1,81 +1,85 @@
|
|
1
1
|
<div id="content_detail" class="ui-corner-all ui-widget-content">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<p>
|
7
|
-
<strong>Id:</strong>
|
8
|
-
<%= @event_import_file.id -%>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<% if @event_import_file.event_import_file_name %>
|
12
|
-
<p>
|
13
|
-
<strong><%= t('activerecord.attributes.event_import_file.event_import_file_name') -%>:</strong>
|
14
|
-
<%= link_to @event_import_file.event_import_file_name, event_import_file_path(@event_import_file, format: :download) %>
|
15
|
-
(<%= @event_import_file.event_import_content_type -%>)
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<p>
|
19
|
-
<strong><%= t('activerecord.attributes.event_import_file.event_import_file_size') -%>:</strong>
|
20
|
-
<%= @event_import_file.event_import_file_size -%>
|
21
|
-
</p>
|
22
|
-
<% end %>
|
2
|
+
<h1 class="title"><%= t('page.showing', model: t('activerecord.models.event_import_file')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
23
5
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
<p>
|
60
|
-
<strong><%= t('activerecord.attributes.event_import_file.error_message') -%>:</strong>
|
61
|
-
<%= simple_format(@event_import_file.error_message) -%>
|
62
|
-
</p>
|
63
|
-
|
64
|
-
<p>
|
65
|
-
<strong><%= t('activerecord.models.user') -%>:</strong>
|
66
|
-
<%= link_to @event_import_file.user.username, @event_import_file.user.profile if @event_import_file.user.try(:profile) -%>
|
67
|
-
</p>
|
68
|
-
|
69
|
-
<% if @event_import_results %>
|
70
|
-
<%= render 'results' %>
|
71
|
-
<% end %>
|
6
|
+
<p>
|
7
|
+
<strong>Id:</strong>
|
8
|
+
<%= @event_import_file.id -%>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.attributes.event_import_file.event_import_file_name') -%>:</strong>
|
13
|
+
<%= link_to @event_import_file.event_import_file_name, event_import_file_path(@event_import_file, format: :download) if @event_import_file.event_import_file_name %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.event_import_file.event_import_content_type') -%>:</strong>
|
18
|
+
<%= @event_import_file.event_import_content_type -%>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
<strong><%= t('activerecord.attributes.event_import_file.event_import_file_size') -%>:</strong>
|
23
|
+
<%= @event_import_file.event_import_file_size -%>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
<p>
|
27
|
+
<strong><%= t('activerecord.attributes.event_import_file.event_import_fingerprint') -%>:</strong>
|
28
|
+
<%= @event_import_file.event_import_fingerprint -%>
|
29
|
+
</p>
|
30
|
+
|
31
|
+
<p>
|
32
|
+
<strong><%= t('page.created_at') -%>:</strong>
|
33
|
+
<%= l(@event_import_file.created_at) if @event_import_file.created_at -%>
|
34
|
+
</p>
|
35
|
+
|
36
|
+
<p>
|
37
|
+
<strong><%= t('activerecord.attributes.event_import_file.executed_at') -%>:</strong>
|
38
|
+
<%= l(@event_import_file.executed_at) if @event_import_file.executed_at -%>
|
39
|
+
</p>
|
72
40
|
|
73
|
-
|
41
|
+
<p>
|
42
|
+
<strong><%= t('activerecord.attributes.event_import_file.edit_mode') -%>:</strong>
|
43
|
+
<%= @event_import_file.edit_mode -%>
|
44
|
+
</p>
|
45
|
+
|
46
|
+
<p>
|
47
|
+
<strong><%= t('activerecord.attributes.event_import_file.user_encoding') -%>:</strong>
|
48
|
+
<%= @event_import_file.user_encoding -%>
|
49
|
+
</p>
|
50
|
+
|
51
|
+
<p>
|
52
|
+
<strong><%= t('activerecord.attributes.event_import_file.default_event_category_id') -%>:</strong>
|
53
|
+
<%= link_to @event_import_file.default_event_category.display_name, @event_import_file.default_event_category if @event_import_file.default_event_category.try(:display_name) -%>
|
54
|
+
</p>
|
55
|
+
|
56
|
+
<p>
|
57
|
+
<strong><%= t('activerecord.attributes.event_import_file.default_library_id') -%>:</strong>
|
58
|
+
<%= link_to @event_import_file.default_library.display_name, @event_import_file.default_library if @event_import_file.default_library.try(:display_name) -%>
|
59
|
+
</p>
|
60
|
+
|
61
|
+
<p>
|
62
|
+
<strong><%= t('activerecord.attributes.event_import_file.state') -%>:</strong>
|
63
|
+
<%= localized_state(@event_import_file.current_state) -%>
|
64
|
+
</p>
|
65
|
+
|
66
|
+
<p>
|
67
|
+
<strong><%= t('activerecord.attributes.event_import_file.error_message') -%>:</strong>
|
68
|
+
<%= @event_import_file.error_message -%>
|
69
|
+
</p>
|
70
|
+
|
71
|
+
<p>
|
72
|
+
<strong><%= t('activerecord.models.user') -%>:</strong>
|
73
|
+
<%= link_to @event_import_file.user.username, @event_import_file.user.profile if @event_import_file.user.try(:profile) -%>
|
74
|
+
</p>
|
75
|
+
|
76
|
+
</div>
|
74
77
|
</div>
|
75
78
|
|
76
79
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
77
80
|
<%= form_for(@event_import_file) do |f| %>
|
78
81
|
<ul>
|
82
|
+
<li><%= link_to t('activerecord.models.event_import_result'), event_import_results_path(event_import_file_id: @event_import_file.id) -%></li>
|
79
83
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
80
84
|
<% if current_user.has_role?('Administrator') %>
|
81
85
|
<li><%= link_to 'Resque', resque_path %></li>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
<br />
|
22
22
|
<%=l event_import_result.created_at %>
|
23
23
|
</td>
|
24
|
-
<td><%= link_to event_import_result.event.display_name
|
24
|
+
<td><%= link_to event_import_result.event.display_name, event_import_result.event if event_import_result.event %></td>
|
25
25
|
<td>
|
26
26
|
<%= link_to t('page.show'), event_import_result %>
|
27
27
|
<%= link_to t('page.destroy'), event_import_result, data: {confirm: t('page.are_you_sure')}, method: :delete %>
|
@@ -36,4 +36,15 @@
|
|
36
36
|
</div>
|
37
37
|
|
38
38
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
39
|
+
<ul>
|
40
|
+
<li>
|
41
|
+
<% if @event_import_file %>
|
42
|
+
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), event_import_results_path(event_import_file_id: @event_import_file.id, format: :txt, locale: @locale.to_s) -%>
|
43
|
+
(<%= link_to 'TSV', event_import_results_path(event_import_file_id: @event_import_file.id, format: :txt, locale: @locale.to_s) -%>)
|
44
|
+
<% else %>
|
45
|
+
<%= link_to (image_tag 'icons/page_white_excel.png', size: '16x16', class: 'enju_icon', alt: 'TSV'), event_import_results_path(format: :txt, locale: @locale.to_s) -%>
|
46
|
+
(<%= link_to 'TSV', event_import_results_path(format: :txt, locale: @locale.to_s) -%>)
|
47
|
+
<% end %>
|
48
|
+
</li>
|
49
|
+
</ul>
|
39
50
|
</div>
|
@@ -3,12 +3,12 @@
|
|
3
3
|
|
4
4
|
<div class="field">
|
5
5
|
<%= f.label t('activerecord.models.event_category') -%><br />
|
6
|
-
<%= f.select(:event_category_id, @event_categories.collect{|e| [e.display_name
|
6
|
+
<%= f.select(:event_category_id, @event_categories.collect{|e| [e.display_name, e.id]}) -%>
|
7
7
|
</div>
|
8
8
|
|
9
9
|
<div class="field">
|
10
10
|
<%= f.label t('activerecord.models.library') -%><br />
|
11
|
-
<%= f.select(:library_id, @libraries.collect{|l| [l.display_name
|
11
|
+
<%= f.select(:library_id, @libraries.collect{|l| [l.display_name, l.id]}) -%>
|
12
12
|
</div>
|
13
13
|
|
14
14
|
<div class="field">
|
@@ -1,10 +1,10 @@
|
|
1
1
|
atom_feed(url: events_url(format: :atom)) do |feed|
|
2
|
-
feed.title t('event.library_group_event', library_group_name: @library_group.display_name
|
2
|
+
feed.title t('event.library_group_event', library_group_name: @library_group.display_name)
|
3
3
|
feed.updated(@events.first ? @events.first.created_at : Time.zone.now)
|
4
4
|
|
5
5
|
@events.each do |event|
|
6
6
|
feed.entry(event) do |entry|
|
7
|
-
entry.title(event.display_name
|
7
|
+
entry.title(event.display_name)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<div data-role="content">
|
6
6
|
<%- if @library -%>
|
7
|
-
<h2><%= link_to @library.display_name
|
7
|
+
<h2><%= link_to @library.display_name, @library -%></h2>
|
8
8
|
<%- else -%>
|
9
9
|
<h2><%= t('event.all_libraries') -%></h2>
|
10
10
|
<%- end -%>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<ul data-role="listview">
|
40
40
|
<%- @events.each_with_index do |event, i| -%>
|
41
41
|
<li>
|
42
|
-
<%= link_to event.display_name
|
42
|
+
<%= link_to event.display_name, event -%>
|
43
43
|
<br />
|
44
44
|
<%= l(event.start_at, format: :short) -%>
|
45
45
|
-
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<p id="notice"><%= notice %></p>
|
5
5
|
|
6
6
|
<%- if @library -%>
|
7
|
-
<h2><%= link_to @library.display_name
|
7
|
+
<h2><%= link_to @library.display_name, @library -%></h2>
|
8
8
|
<%- else -%>
|
9
9
|
<h2><%= t('event.all_libraries') -%></h2>
|
10
10
|
<%- end -%>
|
@@ -46,12 +46,12 @@
|
|
46
46
|
<%- @events.each_with_index do |event, i| -%>
|
47
47
|
<tr class="line<%= cycle("0", "1") -%>">
|
48
48
|
<td>
|
49
|
-
<%= link_to event.library.display_name
|
49
|
+
<%= link_to event.library.display_name, event.library -%>
|
50
50
|
<br />
|
51
|
-
<%= event.event_category.display_name
|
51
|
+
<%= event.event_category.display_name -%>
|
52
52
|
</td>
|
53
53
|
<td>
|
54
|
-
<%= link_to event.display_name
|
54
|
+
<%= link_to event.display_name, event -%>
|
55
55
|
<br />
|
56
56
|
<%= l(event.start_at, format: :short) -%>
|
57
57
|
-
|
@@ -97,7 +97,7 @@
|
|
97
97
|
<ul>
|
98
98
|
<li><%= link_to t('event.all_libraries'), url_for(filtered_params.merge(library_id: nil, page: nil)) -%></li>
|
99
99
|
<%- @libraries.each do |library| -%>
|
100
|
-
<li><%= link_to library.display_name
|
100
|
+
<li><%= link_to library.display_name, url_for(filtered_params.merge(library_id: library.name, mode: params[:mode])) -%></li>
|
101
101
|
<%- end -%>
|
102
102
|
</ul>
|
103
103
|
<p>
|