enju_biblio 0.1.0.pre56 → 0.1.0.pre57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/agent_import_files_controller.rb +1 -1
- data/app/controllers/agent_import_results_controller.rb +30 -6
- data/app/controllers/agent_relationship_types_controller.rb +74 -4
- data/app/controllers/agent_relationships_controller.rb +92 -10
- data/app/controllers/agent_types_controller.rb +74 -3
- data/app/controllers/carrier_types_controller.rb +1 -1
- data/app/controllers/content_types_controller.rb +74 -4
- data/app/controllers/countries_controller.rb +66 -4
- data/app/controllers/create_types_controller.rb +74 -3
- data/app/controllers/extents_controller.rb +74 -4
- data/app/controllers/form_of_works_controller.rb +74 -4
- data/app/controllers/frequencies_controller.rb +74 -4
- data/app/controllers/identifier_types_controller.rb +4 -5
- data/app/controllers/import_requests_controller.rb +1 -1
- data/app/controllers/languages_controller.rb +66 -4
- data/app/controllers/licenses_controller.rb +74 -3
- data/app/controllers/manifestation_relationship_types_controller.rb +74 -3
- data/app/controllers/manifestation_relationships_controller.rb +92 -9
- data/app/controllers/medium_of_performances_controller.rb +74 -3
- data/app/controllers/picture_files_controller.rb +34 -10
- data/app/controllers/produce_types_controller.rb +74 -3
- data/app/controllers/realize_types_controller.rb +74 -3
- data/app/controllers/resource_import_files_controller.rb +2 -1
- data/app/controllers/resource_import_results_controller.rb +31 -11
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_import_result.rb +0 -2
- data/app/models/carrier_type.rb +1 -1
- data/app/models/identifier.rb +5 -0
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +13 -8
- data/app/models/resource_import_file.rb +73 -79
- data/app/views/agent_import_files/index.html.erb +1 -0
- data/app/views/agent_relationship_types/index.html.erb +5 -4
- data/app/views/agent_types/index.html.erb +5 -4
- data/app/views/carrier_types/index.html.erb +2 -1
- data/app/views/content_types/index.html.erb +1 -0
- data/app/views/countries/show.html.erb +5 -0
- data/app/views/create_types/index.html.erb +5 -4
- data/app/views/extents/index.html.erb +2 -1
- data/app/views/form_of_works/index.html.erb +2 -1
- data/app/views/frequencies/index.html.erb +2 -1
- data/app/views/identifier_types/index.html.erb +12 -5
- data/app/views/import_requests/index.html.erb +1 -0
- data/app/views/items/show.html.erb +3 -7
- data/app/views/languages/_form.html.erb +19 -4
- data/app/views/languages/index.html.erb +6 -5
- data/app/views/languages/show.html.erb +19 -4
- data/app/views/layouts/manifestations.html.erb +2 -1
- data/app/views/licenses/index.html.erb +2 -1
- data/app/views/manifestation_relationship_types/index.html.erb +5 -4
- data/app/views/manifestations/_call_number.html.erb +1 -1
- data/app/views/manifestations/_edit_detail.html.erb +4 -1
- data/app/views/manifestations/_form.html.erb +5 -5
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -3
- data/app/views/manifestations/_show_detail_user.html.erb +8 -3
- data/app/views/medium_of_performances/index.html.erb +2 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -0
- data/app/views/picture_files/_index_agent.html.erb +1 -0
- data/app/views/picture_files/_index_manifestation.html.erb +1 -0
- data/app/views/picture_files/show.html.erb +15 -7
- data/app/views/produce_types/index.html.erb +5 -4
- data/app/views/realize_types/index.html.erb +5 -4
- data/app/views/resource_import_files/index.html.erb +1 -0
- data/app/views/series_statements/_index.html.erb +1 -0
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -0
- data/config/locales/translation_en.yml +70 -1
- data/config/locales/translation_ja.yml +77 -8
- data/db/migrate/20140817155043_add_extent_of_text_to_manifestation.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +13 -0
- data/lib/enju_biblio/engine.rb +0 -2
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/identifier_types.yml +24 -3
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/lib/tasks/identifier_type.rb +12 -0
- data/lib/tasks/item.rb +1 -1
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +433 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +35 -35
- data/spec/controllers/agent_import_results_controller_spec.rb +11 -11
- data/spec/controllers/agent_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/agent_relationships_controller_spec.rb +53 -53
- data/spec/controllers/agent_types_controller_spec.rb +15 -15
- data/spec/controllers/agents_controller_spec.rb +96 -96
- data/spec/controllers/carrier_types_controller_spec.rb +15 -15
- data/spec/controllers/content_types_controller_spec.rb +15 -15
- data/spec/controllers/countries_controller_spec.rb +25 -25
- data/spec/controllers/create_types_controller_spec.rb +15 -15
- data/spec/controllers/creates_controller_spec.rb +50 -50
- data/spec/controllers/donates_controller_spec.rb +49 -49
- data/spec/controllers/extents_controller_spec.rb +15 -15
- data/spec/controllers/form_of_works_controller_spec.rb +15 -15
- data/spec/controllers/frequencies_controller_spec.rb +6 -6
- data/spec/controllers/identifier_types_controller_spec.rb +15 -15
- data/spec/controllers/import_requests_controller_spec.rb +50 -50
- data/spec/controllers/items_controller_spec.rb +72 -72
- data/spec/controllers/languages_controller_spec.rb +18 -18
- data/spec/controllers/licenses_controller_spec.rb +15 -15
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/manifestation_relationships_controller_spec.rb +53 -53
- data/spec/controllers/manifestations_controller_spec.rb +108 -108
- data/spec/controllers/medium_of_performances_controller_spec.rb +15 -15
- data/spec/controllers/owns_controller_spec.rb +52 -52
- data/spec/controllers/picture_files_controller_spec.rb +52 -52
- data/spec/controllers/produce_types_controller_spec.rb +15 -15
- data/spec/controllers/produces_controller_spec.rb +50 -50
- data/spec/controllers/realize_types_controller_spec.rb +15 -15
- data/spec/controllers/realizes_controller_spec.rb +51 -51
- data/spec/controllers/resource_export_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_results_controller_spec.rb +15 -15
- data/spec/controllers/series_statements_controller_spec.rb +54 -54
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +2 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -19
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-53863-1jz1wlr.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-55246-1rvhs1s.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60268-1psjqua.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60996-1cy28m2.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-67507-19qjhj3.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-69234-1cllrec.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-76875-1os6joy.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-1148-136brhb.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-473-1c326dm.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-93795-1x882ik.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94274-1xr9d9e.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94643-1fjcept.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-97947-mfqh5b.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98488-126cvb4.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98849-1lg47mm.txt +147 -0
- data/spec/dummy/solr/test/data/index/segments.gen +0 -0
- data/spec/dummy/solr/test/data/index/segments_5ur +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007580 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007581 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007582 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007583 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007584 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007585 +0 -0
- data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
- data/spec/dummy/tmp/cache/stdout +2554 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/fixtures/agent_import_results.yml +0 -3
- data/spec/fixtures/carrier_types.yml +16 -16
- data/spec/fixtures/content_types.yml +78 -29
- data/spec/fixtures/frequencies.yml +32 -62
- data/spec/fixtures/manifestations.yml +1 -1
- data/spec/models/agent_import_result_spec.rb +0 -2
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +30 -3
- data/spec/views/manifestations/show.html.erb_spec.rb +1 -1
- metadata +68 -103
- data/app/views/picture_files/_index_event.html.erb +0 -53
- data/app/views/picture_files/_index_shelf.html.erb +0 -53
- data/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/solr/test/data/index/_20i.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.si +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.si +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.si +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/segments_2uc +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003680 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003681 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003682 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 725c260ad04215dee9f9ffdec238b0d21da102bb
|
4
|
+
data.tar.gz: bee4e5ab54605fb4338aa3862edde45232d54c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83d8be25b262448587c0d51ae484f088399d079dc7c074ae2139c1a01d6e4988df9e1fd36a889ac548c5eb4459e4e8ff64202ad8b684a51572144015aa8683f
|
7
|
+
data.tar.gz: 9e0b84d885a257643145273caabd91136edb86ea5a3b02f4b1859699bb11b308603ee4d3beb09bb2566a60331c10b28775a8fa4d7feb6998a25ed559572dffac
|
@@ -92,7 +92,7 @@ class AgentImportFilesController < ApplicationController
|
|
92
92
|
@agent_import_file.destroy
|
93
93
|
|
94
94
|
respond_to do |format|
|
95
|
-
format.html { redirect_to(
|
95
|
+
format.html { redirect_to agent_import_files_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.agent_import_file')) }
|
96
96
|
format.json { head :no_content }
|
97
97
|
end
|
98
98
|
end
|
@@ -1,15 +1,39 @@
|
|
1
|
-
class AgentImportResultsController <
|
2
|
-
respond_to :html, :json, :txt
|
1
|
+
class AgentImportResultsController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
# GET /agent_import_results
|
4
|
+
# GET /agent_import_results.json
|
7
5
|
def index
|
8
|
-
@agent_import_file = AgentImportFile.where(:
|
6
|
+
@agent_import_file = AgentImportFile.where(id: params[:agent_import_file_id]).first
|
9
7
|
if @agent_import_file
|
10
8
|
@agent_import_results = @agent_import_file.agent_import_results.page(params[:page])
|
11
9
|
else
|
12
10
|
@agent_import_results = AgentImportResult.page(params[:page])
|
13
11
|
end
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.html # index.html.erb
|
15
|
+
format.json { render json: @agent_import_results }
|
16
|
+
format.txt
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /agent_import_results/1
|
21
|
+
# GET /agent_import_results/1.json
|
22
|
+
def show
|
23
|
+
respond_to do |format|
|
24
|
+
format.html # show.html.erb
|
25
|
+
format.json { render json: @agent_import_result }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# DELETE /agent_import_results/1
|
30
|
+
# DELETE /agent_import_results/1.json
|
31
|
+
def destroy
|
32
|
+
@agent_import_result.destroy
|
33
|
+
|
34
|
+
respond_to do |format|
|
35
|
+
format.html { redirect_to agent_import_results_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.agent_import_result')) }
|
36
|
+
format.json { head :no_content }
|
37
|
+
end
|
14
38
|
end
|
15
39
|
end
|
@@ -1,13 +1,83 @@
|
|
1
|
-
class AgentRelationshipTypesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class AgentRelationshipTypesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
3
|
+
# GET /agent_relationship_types
|
4
|
+
# GET /agent_relationship_types.json
|
5
|
+
def index
|
6
|
+
@agent_relationship_types = AgentRelationshipType.all
|
4
7
|
|
8
|
+
respond_to do |format|
|
9
|
+
format.html # index.html.erb
|
10
|
+
format.json { render json: @agent_relationship_types }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /agent_relationship_types/1
|
15
|
+
# GET /agent_relationship_types/1.json
|
16
|
+
def show
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # show.html.erb
|
19
|
+
format.json { render json: @agent_relationship_type }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /agent_relationship_types/new
|
24
|
+
# GET /agent_relationship_types/new.json
|
25
|
+
def new
|
26
|
+
@agent_relationship_type = AgentRelationshipType.new
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # new.html.erb
|
30
|
+
format.json { render json: @agent_relationship_type }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /agent_relationship_types/1/edit
|
35
|
+
def edit
|
36
|
+
end
|
37
|
+
|
38
|
+
# POST /agent_relationship_types
|
39
|
+
# POST /agent_relationship_types.json
|
40
|
+
def create
|
41
|
+
@agent_relationship_type = AgentRelationshipType.new(params[:agent_relationship_type])
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
if @agent_relationship_type.save
|
45
|
+
format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_relationship_type')) }
|
46
|
+
format.json { render json: @agent_relationship_type, status: :created, location: @agent_relationship_type }
|
47
|
+
else
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @agent_relationship_type.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /agent_relationship_types/1
|
55
|
+
# PUT /agent_relationship_types/1.json
|
5
56
|
def update
|
6
|
-
@agent_relationship_type = AgentRelationshipType.find(params[:id])
|
7
57
|
if params[:move]
|
8
58
|
move_position(@agent_relationship_type, params[:move])
|
9
59
|
return
|
10
60
|
end
|
11
|
-
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @agent_relationship_type.update_attributes(params[:agent_relationship_type])
|
64
|
+
format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_relationship_type')) }
|
65
|
+
format.json { head :no_content }
|
66
|
+
else
|
67
|
+
format.html { render action: "edit" }
|
68
|
+
format.json { render json: @agent_relationship_type.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /agent_relationship_types/1
|
74
|
+
# DELETE /agent_relationship_types/1.json
|
75
|
+
def destroy
|
76
|
+
@agent_relationship_type.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to agent_relationship_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.agent_relationship_type')) }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
12
82
|
end
|
13
83
|
end
|
@@ -1,22 +1,104 @@
|
|
1
|
-
class AgentRelationshipsController <
|
2
|
-
respond_to :html, :json
|
3
|
-
has_scope :page, default: 1
|
1
|
+
class AgentRelationshipsController < ApplicationController
|
4
2
|
load_and_authorize_resource
|
5
|
-
before_filter :
|
3
|
+
before_filter :get_agent
|
4
|
+
before_filter :prepare_options, only: [:new, :edit]
|
5
|
+
after_filter :solr_commit, only: [:create, :update, :destroy]
|
6
6
|
|
7
|
+
# GET /agent_relationships
|
8
|
+
# GET /agent_relationships.json
|
9
|
+
def index
|
10
|
+
case
|
11
|
+
when @agent
|
12
|
+
@agent_relationships = @agent.agent_relationships.order('agent_relationships.position').page(params[:page])
|
13
|
+
else
|
14
|
+
@agent_relationships = AgentRelationship.page(params[:page])
|
15
|
+
end
|
16
|
+
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # index.html.erb
|
19
|
+
format.json { render json: @agent_relationships }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /agent_relationships/1
|
24
|
+
# GET /agent_relationships/1.json
|
25
|
+
def show
|
26
|
+
respond_to do |format|
|
27
|
+
format.html # show.html.erb
|
28
|
+
format.json { render json: @agent_relationship }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# GET /agent_relationships/new
|
7
33
|
def new
|
34
|
+
if @agent.blank?
|
35
|
+
redirect_to agents_url
|
36
|
+
return
|
37
|
+
else
|
38
|
+
@agent_relationship = AgentRelationship.new
|
39
|
+
@agent_relationship.agent = @agent
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# GET /agent_relationships/1/edit
|
44
|
+
def edit
|
45
|
+
end
|
46
|
+
|
47
|
+
# POST /agent_relationships
|
48
|
+
# POST /agent_relationships.json
|
49
|
+
def create
|
8
50
|
@agent_relationship = AgentRelationship.new(params[:agent_relationship])
|
9
|
-
|
10
|
-
|
51
|
+
|
52
|
+
respond_to do |format|
|
53
|
+
if @agent_relationship.save
|
54
|
+
format.html { redirect_to @agent_relationship, notice: t('controller.successfully_created', model: t('activerecord.models.agent_relationship')) }
|
55
|
+
format.json { render json: @agent_relationship, status: :created, location: @agent_relationship }
|
56
|
+
else
|
57
|
+
prepare_options
|
58
|
+
format.html { render action: "new" }
|
59
|
+
format.json { render json: @agent_relationship.errors, status: :unprocessable_entity }
|
60
|
+
end
|
61
|
+
end
|
11
62
|
end
|
12
63
|
|
64
|
+
# PUT /agent_relationships/1
|
65
|
+
# PUT /agent_relationships/1.json
|
13
66
|
def update
|
14
|
-
|
15
|
-
if params[:move]
|
16
|
-
move_position(@agent_relationship, params[:move])
|
67
|
+
# 並べ替え
|
68
|
+
if @agent and params[:move]
|
69
|
+
move_position(@agent_relationship, params[:move], false)
|
70
|
+
redirect_to agent_relationships_url(agent_id: @agent_relationship.parent_id)
|
17
71
|
return
|
18
72
|
end
|
19
|
-
|
73
|
+
|
74
|
+
respond_to do |format|
|
75
|
+
if @agent_relationship.update_attributes(params[:agent_relationship])
|
76
|
+
format.html { redirect_to @agent_relationship, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_relationship')) }
|
77
|
+
format.json { head :no_content }
|
78
|
+
else
|
79
|
+
prepare_options
|
80
|
+
format.html { render action: "edit" }
|
81
|
+
format.json { render json: @agent_relationship.errors, status: :unprocessable_entity }
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# DELETE /agent_relationships/1
|
87
|
+
# DELETE /agent_relationships/1.json
|
88
|
+
def destroy
|
89
|
+
@agent_relationship.destroy
|
90
|
+
|
91
|
+
respond_to do |format|
|
92
|
+
format.html {
|
93
|
+
flash[:notice] = t('controller.successfully_deleted', model: t('activerecord.models.agent_relationship'))
|
94
|
+
if @agent
|
95
|
+
redirect_to agents_url(agent_id: @agent.id)
|
96
|
+
else
|
97
|
+
redirect_to agent_relationships_url
|
98
|
+
end
|
99
|
+
}
|
100
|
+
format.json { head :no_content }
|
101
|
+
end
|
20
102
|
end
|
21
103
|
|
22
104
|
private
|
@@ -1,12 +1,83 @@
|
|
1
|
-
class AgentTypesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class AgentTypesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
3
|
+
# GET /agent_types
|
4
|
+
# GET /agent_types.json
|
5
|
+
def index
|
6
|
+
@agent_types = AgentType.all
|
4
7
|
|
8
|
+
respond_to do |format|
|
9
|
+
format.html # index.html.erb
|
10
|
+
format.json { render json: @agent_types }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /agent_types/1
|
15
|
+
# GET /agent_types/1.json
|
16
|
+
def show
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # show.html.erb
|
19
|
+
format.json { render json: @agent_type }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /agent_types/new
|
24
|
+
# GET /agent_types/new.json
|
25
|
+
def new
|
26
|
+
@agent_type = AgentType.new
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # new.html.erb
|
30
|
+
format.json { render json: @agent_type }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /agent_types/1/edit
|
35
|
+
def edit
|
36
|
+
end
|
37
|
+
|
38
|
+
# POST /agent_types
|
39
|
+
# POST /agent_types.json
|
40
|
+
def create
|
41
|
+
@agent_type = AgentType.new(params[:agent_type])
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
if @agent_type.save
|
45
|
+
format.html { redirect_to @agent_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_type')) }
|
46
|
+
format.json { render json: @agent_type, status: :created, location: @agent_type }
|
47
|
+
else
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @agent_type.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /agent_types/1
|
55
|
+
# PUT /agent_types/1.json
|
5
56
|
def update
|
6
57
|
if params[:move]
|
7
58
|
move_position(@agent_type, params[:move])
|
8
59
|
return
|
9
60
|
end
|
10
|
-
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @agent_type.update_attributes(params[:agent_type])
|
64
|
+
format.html { redirect_to @agent_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_type')) }
|
65
|
+
format.json { head :no_content }
|
66
|
+
else
|
67
|
+
format.html { render action: "edit" }
|
68
|
+
format.json { render json: @agent_type.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /agent_types/1
|
74
|
+
# DELETE /agent_types/1.json
|
75
|
+
def destroy
|
76
|
+
@agent_type.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to agent_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.agent_type')) }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
11
82
|
end
|
12
83
|
end
|
@@ -80,7 +80,7 @@ class CarrierTypesController < ApplicationController
|
|
80
80
|
@carrier_type.destroy
|
81
81
|
|
82
82
|
respond_to do |format|
|
83
|
-
format.html { redirect_to carrier_types_url }
|
83
|
+
format.html { redirect_to carrier_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.carrier_type')) }
|
84
84
|
format.json { head :no_content }
|
85
85
|
end
|
86
86
|
end
|
@@ -1,13 +1,83 @@
|
|
1
|
-
class ContentTypesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class ContentTypesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
3
|
+
# GET /content_types
|
4
|
+
# GET /content_types.json
|
5
|
+
def index
|
6
|
+
@content_types = ContentType.all
|
4
7
|
|
8
|
+
respond_to do |format|
|
9
|
+
format.html # index.html.erb
|
10
|
+
format.json { render json: @content_types }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /content_types/1
|
15
|
+
# GET /content_types/1.json
|
16
|
+
def show
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # show.html.erb
|
19
|
+
format.json { render json: @content_type }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /content_types/new
|
24
|
+
# GET /content_types/new.json
|
25
|
+
def new
|
26
|
+
@content_type = ContentType.new
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # new.html.erb
|
30
|
+
format.json { render json: @content_type }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /content_types/1/edit
|
35
|
+
def edit
|
36
|
+
end
|
37
|
+
|
38
|
+
# POST /content_types
|
39
|
+
# POST /content_types.json
|
40
|
+
def create
|
41
|
+
@content_type = ContentType.new(params[:content_type])
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
if @content_type.save
|
45
|
+
format.html { redirect_to @content_type, notice: t('controller.successfully_created', model: t('activerecord.models.content_type')) }
|
46
|
+
format.json { render json: @content_type, status: :created, location: @content_type }
|
47
|
+
else
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @content_type.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /content_types/1
|
55
|
+
# PUT /content_types/1.json
|
5
56
|
def update
|
6
|
-
@content_type = ContentType.find(params[:id])
|
7
57
|
if params[:move]
|
8
58
|
move_position(@content_type, params[:move])
|
9
59
|
return
|
10
60
|
end
|
11
|
-
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @content_type.update_attributes(params[:content_type])
|
64
|
+
format.html { redirect_to @content_type, notice: t('controller.successfully_updated', model: t('activerecord.models.content_type')) }
|
65
|
+
format.json { head :no_content }
|
66
|
+
else
|
67
|
+
format.html { render action: "edit" }
|
68
|
+
format.json { render json: @content_type.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /content_types/1
|
74
|
+
# DELETE /content_types/1.json
|
75
|
+
def destroy
|
76
|
+
@content_type.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to content_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.content_type')) }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
12
82
|
end
|
13
83
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
class CountriesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class CountriesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
4
|
-
|
3
|
+
# GET /countries
|
4
|
+
# GET /countries.json
|
5
5
|
def index
|
6
6
|
@countries = Country.page(params[:page])
|
7
7
|
|
@@ -11,11 +11,73 @@ class CountriesController < InheritedResources::Base
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
# GET /countries/1
|
15
|
+
# GET /countries/1.json
|
16
|
+
def show
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # show.html.erb
|
19
|
+
format.json { render json: @country }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /countries/new
|
24
|
+
# GET /countries/new.json
|
25
|
+
def new
|
26
|
+
@country = Country.new
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # new.html.erb
|
30
|
+
format.json { render json: @country }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /countries/1/edit
|
35
|
+
def edit
|
36
|
+
end
|
37
|
+
|
38
|
+
# POST /countries
|
39
|
+
# POST /countries.json
|
40
|
+
def create
|
41
|
+
@country = Country.new(params[:country])
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
if @country.save
|
45
|
+
format.html { redirect_to @country, notice: t('controller.successfully_created', model: t('activerecord.models.country')) }
|
46
|
+
format.json { render json: @country, status: :created, location: @country }
|
47
|
+
else
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @country.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /countries/1
|
55
|
+
# PUT /countries/1.json
|
14
56
|
def update
|
15
57
|
if params[:move]
|
16
58
|
move_position(@country, params[:move])
|
17
59
|
return
|
18
60
|
end
|
19
|
-
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @country.update_attributes(params[:country])
|
64
|
+
format.html { redirect_to @country, notice: t('controller.successfully_updated', model: t('activerecord.models.country')) }
|
65
|
+
format.json { head :no_content }
|
66
|
+
else
|
67
|
+
format.html { render action: "edit" }
|
68
|
+
format.json { render json: @country.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /countries/1
|
74
|
+
# DELETE /countries/1.json
|
75
|
+
def destroy
|
76
|
+
@country.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to countries_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.country')) }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
20
82
|
end
|
21
83
|
end
|
@@ -1,12 +1,83 @@
|
|
1
|
-
class CreateTypesController <
|
2
|
-
respond_to :html, :json
|
1
|
+
class CreateTypesController < ApplicationController
|
3
2
|
load_and_authorize_resource
|
3
|
+
# GET /create_types
|
4
|
+
# GET /create_types.json
|
5
|
+
def index
|
6
|
+
@create_types = CreateType.all
|
4
7
|
|
8
|
+
respond_to do |format|
|
9
|
+
format.html # index.html.erb
|
10
|
+
format.json { render json: @create_types }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /create_types/1
|
15
|
+
# GET /create_types/1.json
|
16
|
+
def show
|
17
|
+
respond_to do |format|
|
18
|
+
format.html # show.html.erb
|
19
|
+
format.json { render json: @create_type }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# GET /create_types/new
|
24
|
+
# GET /create_types/new.json
|
25
|
+
def new
|
26
|
+
@create_type = CreateType.new
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
format.html # new.html.erb
|
30
|
+
format.json { render json: @create_type }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# GET /create_types/1/edit
|
35
|
+
def edit
|
36
|
+
end
|
37
|
+
|
38
|
+
# POST /create_types
|
39
|
+
# POST /create_types.json
|
40
|
+
def create
|
41
|
+
@create_type = CreateType.new(params[:create_type])
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
if @create_type.save
|
45
|
+
format.html { redirect_to @create_type, notice: t('controller.successfully_created', model: t('activerecord.models.create_type')) }
|
46
|
+
format.json { render json: @create_type, status: :created, location: @create_type }
|
47
|
+
else
|
48
|
+
format.html { render action: "new" }
|
49
|
+
format.json { render json: @create_type.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# PUT /create_types/1
|
55
|
+
# PUT /create_types/1.json
|
5
56
|
def update
|
6
57
|
if params[:move]
|
7
58
|
move_position(@create_type, params[:move])
|
8
59
|
return
|
9
60
|
end
|
10
|
-
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @create_type.update_attributes(params[:create_type])
|
64
|
+
format.html { redirect_to @create_type, notice: t('controller.successfully_updated', model: t('activerecord.models.create_type')) }
|
65
|
+
format.json { head :no_content }
|
66
|
+
else
|
67
|
+
format.html { render action: "edit" }
|
68
|
+
format.json { render json: @create_type.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /create_types/1
|
74
|
+
# DELETE /create_types/1.json
|
75
|
+
def destroy
|
76
|
+
@create_type.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to create_types_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.create_type')) }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
11
82
|
end
|
12
83
|
end
|