enju_leaf 1.1.0.rc10 → 1.1.0.rc11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/enju_leaf.js +1 -1
  3. data/app/assets/javascripts/mobile.js +1 -1
  4. data/app/assets/stylesheets/enju.css +0 -2
  5. data/app/assets/stylesheets/enju_leaf.css +4 -4
  6. data/app/assets/stylesheets/mobile.css +1 -1
  7. data/app/controllers/user_import_files_controller.rb +6 -0
  8. data/app/controllers/user_import_results_controller.rb +1 -1
  9. data/app/mailers/notifier.rb +1 -1
  10. data/app/models/profile.rb +18 -0
  11. data/app/models/user_import_file.rb +46 -30
  12. data/app/models/user_import_file_state_machine.rb +2 -2
  13. data/app/models/user_import_file_transition.rb +13 -0
  14. data/app/models/user_import_result.rb +12 -0
  15. data/app/views/devise/sessions/new.html.erb +2 -2
  16. data/app/views/my_accounts/edit.html.erb +2 -2
  17. data/app/views/my_accounts/show.html.erb +2 -2
  18. data/app/views/page/403.html.erb +2 -2
  19. data/app/views/page/404.html.erb +2 -2
  20. data/app/views/page/500.html.erb +2 -2
  21. data/app/views/page/about.en.html.erb +4 -4
  22. data/app/views/page/about.ja.html.erb +4 -4
  23. data/app/views/page/add_on.html.erb +2 -2
  24. data/app/views/page/advanced_search.html.erb +10 -4
  25. data/app/views/page/export.html.erb +3 -3
  26. data/app/views/page/import.html.erb +2 -2
  27. data/app/views/page/statistics.html.erb +2 -2
  28. data/app/views/roles/edit.html.erb +2 -2
  29. data/app/views/roles/index.html.erb +2 -2
  30. data/app/views/roles/new.html.erb +2 -2
  31. data/app/views/roles/show.html.erb +2 -2
  32. data/app/views/user_groups/edit.html.erb +2 -2
  33. data/app/views/user_groups/index.html.erb +2 -2
  34. data/app/views/user_groups/new.html.erb +2 -2
  35. data/app/views/user_groups/show.html.erb +2 -2
  36. data/app/views/user_import_files/index.html.erb +2 -2
  37. data/app/views/user_import_files/new.html.erb +19 -6
  38. data/app/views/user_import_files/show.html.erb +11 -1
  39. data/app/views/user_import_results/index.html.erb +4 -4
  40. data/app/views/user_import_results/{index.csv.erb → index.tsv.erb} +1 -1
  41. data/app/views/users/edit.html.erb +2 -2
  42. data/app/views/users/index.html.erb +2 -2
  43. data/app/views/users/new.html.erb +2 -2
  44. data/app/views/users/show.html.erb +2 -2
  45. data/app/workers/user_import_file_queue.rb +7 -0
  46. data/config/initializers/mime_types.rb +1 -0
  47. data/config/initializers/paperclip.rb +12 -0
  48. data/config/initializers/resque.rb +1 -0
  49. data/config/locales/translation_en.yml +3 -0
  50. data/config/locales/translation_ja.yml +3 -0
  51. data/db/migrate/20130221154434_add_additional_attributes_to_user.rb +0 -1
  52. data/db/migrate/20140110122216_create_user_import_files.rb +0 -1
  53. data/db/migrate/20140122054321_create_profiles.rb +0 -1
  54. data/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  55. data/lib/enju_leaf/calculate_stat.rb +1 -1
  56. data/lib/enju_leaf/import_file.rb +56 -0
  57. data/lib/enju_leaf/version.rb +1 -1
  58. data/lib/generators/enju_leaf/setup/setup_generator.rb +0 -5
  59. data/lib/generators/enju_leaf/setup/templates/config/schedule.rb +0 -8
  60. data/spec/controllers/my_accounts_controller_spec.rb +1 -1
  61. data/spec/dummy/app/models/setting.rb +4 -0
  62. data/spec/dummy/db/development.sqlite3 +0 -0
  63. data/spec/dummy/db/schema.rb +2 -4
  64. data/spec/dummy/db/test.sqlite3 +0 -0
  65. data/spec/dummy/solr/default/data/index/_t.fdt +0 -0
  66. data/spec/dummy/solr/default/data/index/{_2h.fdx → _t.fdx} +0 -0
  67. data/spec/dummy/solr/default/data/index/{_2h.fnm → _t.fnm} +0 -0
  68. data/spec/dummy/solr/default/data/index/{_2h.nvd → _t.nvd} +0 -0
  69. data/spec/dummy/solr/default/data/index/{_2h.nvm → _t.nvm} +0 -0
  70. data/spec/dummy/solr/default/data/index/{_2h.si → _t.si} +0 -0
  71. data/spec/dummy/solr/default/data/index/{_2h_Lucene41_0.doc → _t_Lucene41_0.doc} +0 -0
  72. data/spec/dummy/solr/default/data/index/{_2h_Lucene41_0.pos → _t_Lucene41_0.pos} +0 -0
  73. data/spec/dummy/solr/default/data/index/{_2h_Lucene41_0.tim → _t_Lucene41_0.tim} +0 -0
  74. data/spec/dummy/solr/default/data/index/{_2h_Lucene41_0.tip → _t_Lucene41_0.tip} +0 -0
  75. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  76. data/spec/dummy/solr/default/data/index/segments_1p +0 -0
  77. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000050 +0 -0
  78. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000177 → tlog.0000000000000000051} +0 -0
  79. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000052 +0 -0
  80. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000179 → tlog.0000000000000000053} +0 -0
  81. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000054 +0 -0
  82. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000181 → tlog.0000000000000000055} +0 -0
  83. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000056 +0 -0
  84. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000183 → tlog.0000000000000000057} +0 -0
  85. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000058 +0 -0
  86. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000059 +0 -0
  87. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  88. data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
  89. data/spec/dummy/tmp/cache/assets/test/sprockets/3f8d795856d1fdf902b0be679120571a +0 -0
  90. data/spec/dummy/tmp/cache/assets/test/sprockets/5998e66e374537d52eed3fe1ca5f2bfc +0 -0
  91. data/spec/dummy/tmp/cache/assets/test/sprockets/5ea4a1824e1d67da6c4fb9aeef9f49f4 +0 -0
  92. data/spec/dummy/tmp/cache/assets/test/sprockets/87f0cb69a0df1355e33cce3949919d5a +0 -0
  93. data/spec/dummy/tmp/cache/stdout +103 -0
  94. data/spec/dummy/tmp/pids/redis-test.pid +1 -0
  95. data/spec/fixtures/roles.yml +15 -15
  96. data/spec/fixtures/user_has_roles.yml +11 -11
  97. data/spec/fixtures/user_import_files.yml +20 -2
  98. data/spec/fixtures/user_import_results.yml +12 -0
  99. data/spec/models/role_spec.rb +14 -14
  100. data/spec/models/user_has_role_spec.rb +8 -8
  101. data/spec/models/user_import_file_spec.rb +30 -2
  102. data/spec/models/user_import_result_spec.rb +12 -0
  103. data/spec/models/user_spec.rb +19 -19
  104. data/spec/spec_helper.rb +3 -0
  105. data/spec/support/resque.rb +30 -0
  106. data/vendor/assets/javascripts/jquery.colorbox.js +5 -6
  107. data/{app/assets/javascripts/jquery.mobile-1.4.2.js → vendor/assets/javascripts/jquery.mobile-1.4.3.js} +460 -187
  108. data/{app/assets/stylesheets/jquery.mobile-1.4.2.css → vendor/assets/stylesheets/jquery.mobile-1.4.3.css} +22 -17
  109. metadata +107 -101
  110. data/app/assets/javascripts/profiles.js +0 -2
  111. data/app/assets/stylesheets/normalize.css +0 -406
  112. data/app/assets/stylesheets/profiles.css +0 -4
  113. data/app/assets/stylesheets/scaffolds.css.scss +0 -56
  114. data/app/helpers/profiles_helper.rb +0 -2
  115. data/app/views/layouts/patrons.html.erb +0 -26
  116. data/app/views/layouts/patrons.mobile.erb +0 -18
  117. data/app/views/profiles/_form.html.erb +0 -53
  118. data/app/views/profiles/edit.html.erb +0 -6
  119. data/app/views/profiles/index.html.erb +0 -43
  120. data/app/views/profiles/new.html.erb +0 -14
  121. data/app/views/profiles/show.html.erb +0 -54
  122. data/spec/dummy/private/system/user_import_files/user_imports/980/190/963/original/user_delete_file.tsv +0 -4
  123. data/spec/dummy/solr/default/data/index/_2h.fdt +0 -0
  124. data/spec/dummy/solr/default/data/index/segments_57 +0 -0
  125. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000176 +0 -0
  126. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000178 +0 -0
  127. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000180 +0 -0
  128. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000182 +0 -0
  129. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000184 +0 -0
  130. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000185 +0 -0
  131. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  132. data/spec/dummy/tmp/cache/assets/test/sprockets/154f7b83f2da0e86effbe25f32135177 +0 -0
  133. data/spec/dummy/tmp/cache/assets/test/sprockets/1b984bdbd3204a51a82d0e01a1569e2d +0 -0
  134. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  135. data/spec/dummy/tmp/cache/assets/test/sprockets/3054c50144654f9c7e57bb0639a276e9 +0 -0
  136. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  137. data/spec/dummy/tmp/cache/assets/test/sprockets/3bd7a263237ba366f64d938fe5303757 +0 -0
  138. data/spec/dummy/tmp/cache/assets/test/sprockets/62899096da1a3e67660f3b88068be8c9 +0 -0
  139. data/spec/dummy/tmp/cache/assets/test/sprockets/65b2e4f67eab21b30217e29075f433b2 +0 -0
  140. data/spec/dummy/tmp/cache/assets/test/sprockets/87d24a3f43f175d4d17babe9203c79a7 +0 -0
  141. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  142. data/spec/dummy/tmp/cache/assets/test/sprockets/d38d8658b30de1d068603968227680d4 +0 -0
  143. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  144. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.add_on') -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  </div>
9
9
 
10
- <div id="submenu" class="ui-corner-all">
10
+ <div id="submenu" class="ui-corner-all ui-widget-content">
11
11
  <ul>
12
12
  </ul>
13
13
  </div>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.advanced_search') -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -9,9 +9,15 @@
9
9
  <td><%= search_field_tag 'query', nil, :class => 'search_form_short', :placeholder => t('page.search_term') -%></td>
10
10
  </tr>
11
11
  <tr>
12
- <td><label><%= t('page.tag') -%>:</label></td>
13
- <td><%= text_field_tag 'tag' -%></td>
12
+ <td><label><%= t('page.title') -%>:</label></td>
13
+ <td><%= text_field_tag 'title' -%></td>
14
14
  </tr>
15
+ <% if defined?(EnjuBookmark) %>
16
+ <tr>
17
+ <td><label><%= t('page.tag') -%>:</label></td>
18
+ <td><%= text_field_tag 'tag' -%></td>
19
+ </tr>
20
+ <% end %>
15
21
  <tr>
16
22
  <td><label><%= t('agent.creator') -%>:</label></td>
17
23
  <td><%= text_field_tag 'creator' -%></td>
@@ -73,5 +79,5 @@
73
79
  </div>
74
80
  </div>
75
81
 
76
- <div id="submenu" class="ui-corner-all">
82
+ <div id="submenu" class="ui-corner-all ui-widget-content">
77
83
  </div>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.export') -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -24,13 +24,13 @@
24
24
  </li>
25
25
  -->
26
26
  <li>
27
- <%= link_to t('activerecord.models.resource_export_file'), new_resource_export_file_path -%>
27
+ <%= link_to t('activerecord.models.resource_export_file'), resource_export_files_path -%>
28
28
  </li>
29
29
  </ul>
30
30
  </div>
31
31
  </div>
32
32
 
33
- <div id="submenu" class="ui-corner-all">
33
+ <div id="submenu" class="ui-corner-all ui-widget-content">
34
34
  <ul>
35
35
  </ul>
36
36
  </div>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.import_from_file') -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
  </div>
15
15
 
16
- <div id="submenu" class="ui-corner-all">
16
+ <div id="submenu" class="ui-corner-all ui-widget-content">
17
17
  <ul>
18
18
  <li><%= link_to t('page.add_resource_manually'), new_import_request_path -%></li>
19
19
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.statistics') -%></h1>
3
3
  <div id="content_list">
4
4
  <table class="index">
@@ -99,7 +99,7 @@
99
99
  </div>
100
100
  </div>
101
101
 
102
- <div id="submenu" class="ui-corner-all">
102
+ <div id="submenu" class="ui-corner-all ui-widget-content">
103
103
  <ul>
104
104
  </ul>
105
105
  </div>
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.role')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <li><%= link_to t('page.show'), role_path(@role) -%></li>
11
11
  <li><%= link_to t('page.back'), roles_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.role')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -24,5 +24,5 @@
24
24
  </div>
25
25
  </div>
26
26
 
27
- <div id="submenu" class="ui-corner-all">
27
+ <div id="submenu" class="ui-corner-all ui-widget-content">
28
28
  </div>
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.new', :model => t('activerecord.models.role')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <li><%= link_to t('page.back'), roles_path -%></li>
11
11
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.role')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  </div>
38
38
 
39
- <div id="submenu" class="ui-corner-all">
39
+ <div id="submenu" class="ui-corner-all ui-widget-content">
40
40
  <ul>
41
41
  <li><%= link_to t('page.edit'), edit_role_path(@role) -%></li>
42
42
  <li><%= back_to_index(flash[:page_info]) -%></li>
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.user_group')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <li><%= link_to t('page.show'), user_group_path(@user_group) -%></li>
11
11
  <li><%= link_to t('page.back'), user_groups_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.user_group')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  </div>
38
38
 
39
- <div id="submenu" class="ui-corner-all">
39
+ <div id="submenu" class="ui-corner-all ui-widget-content">
40
40
  <ul>
41
41
  <li><%= link_to t('page.new', :model => t('activerecord.models.user_group')), new_user_group_path -%></li>
42
42
  </ul>
@@ -1,11 +1,11 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.new', :model => t('activerecord.models.user_group')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'form' %>
5
5
  </div>
6
6
  </div>
7
7
 
8
- <div id="submenu" class="ui-corner-all">
8
+ <div id="submenu" class="ui-corner-all ui-widget-content">
9
9
  <ul>
10
10
  <li><%= link_to t('page.back'), user_groups_path -%></li>
11
11
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.user_group')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -55,7 +55,7 @@
55
55
  </div>
56
56
  </div>
57
57
 
58
- <div id="submenu" class="ui-corner-all">
58
+ <div id="submenu" class="ui-corner-all ui-widget-content">
59
59
  <ul>
60
60
  <li><%= link_to t('page.edit'), edit_user_group_path(@user_group) -%></li>
61
61
  <li><%= back_to_index(flash[:page_info]) -%></li>
@@ -5,7 +5,7 @@
5
5
  <table class="table table-striped index">
6
6
  <thead>
7
7
  <tr>
8
- <th>ID</th>
8
+ <th>Id</th>
9
9
  <th><%= t('activerecord.attributes.user_import_file.user_import_file_name') -%></th>
10
10
  <th><%= t('activerecord.attributes.user_import_file.executed_at') -%></th>
11
11
  <th><%= t('activerecord.models.user') -%></th>
@@ -23,7 +23,7 @@
23
23
  <td><%= l(user_import_file.executed_at) if user_import_file.executed_at -%></td>
24
24
  <td><%= link_to user_import_file.user.username, user_import_file.user -%></td>
25
25
  <td><%= user_import_file.edit_mode -%></td>
26
- <td><%= localized_state(user_import_file.state) -%></td>
26
+ <td><%= localized_state(user_import_file.current_state) -%></td>
27
27
  <td>
28
28
  <%= link_to t('page.show'), user_import_file -%>
29
29
  <%= link_to t('page.destroy'), user_import_file, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
@@ -12,16 +12,29 @@
12
12
 
13
13
  <div class="field">
14
14
  <%= f.label :edit_mode -%><br />
15
- <%= f.radio_button :edit_mode, 'create', :checked => 'checked' %>
16
- <%= f.label :edit_mode, t('page.create'), :value => 'create' %>
17
- <%= f.radio_button :edit_mode, 'update' %>
18
- <%= f.label :edit_mode, t('page.update'), :value => 'update' %>
15
+ <%= f.radio_button :edit_mode, 'create', checked: 'checked' %>
16
+ <%= f.label :edit_mode, t('page.create'), value: 'create' %>
17
+ <%= f.radio_button :edit_mode, 'update', disabled: true %>
18
+ <%= f.label :edit_mode, t('page.update'), value: 'update' %>
19
19
  <%= f.radio_button :edit_mode, 'destroy' %>
20
- <%= f.label :edit_mode, t('page.destroy'), :value => 'destroy' %>
20
+ <%= f.label :edit_mode, t('page.destroy'), value: 'destroy' %>
21
+ </div>
22
+
23
+ <div class="field">
24
+ <%= f.label :user_encoding -%><br />
25
+ <%= f.radio_button :user_encoding, 'auto_detect', checked: 'checked' %>
26
+ <%= f.label :user_encoding, t('import.auto_detect'), value: 'auto_detect' %>
27
+ <%= f.radio_button :user_encoding, 'utf-8' %>
28
+ <%= f.label :user_encoding, 'UTF-8', value: 'utf-8' %>
29
+ <%= f.radio_button :user_encoding, 'shift_jis' %>
30
+ <%= f.label :user_encoding, 'Shift_JIS', value: 'shift_jis' %>
31
+ <%= f.radio_button :user_encoding, 'euc-jp' %>
32
+ <%= f.label :user_encoding, 'EUC-JP', value: 'euc-jp' %>
21
33
  </div>
22
34
 
23
35
  <div class="actions">
24
- <%= f.submit %>
36
+ <%= f.hidden_field :mode, value: 'import' %>
37
+ <%= f.submit t('page.start_import') %>
25
38
  </div>
26
39
  <% end %>
27
40
 
@@ -43,9 +43,14 @@
43
43
  <%= @user_import_file.edit_mode -%>
44
44
  </p>
45
45
 
46
+ <p>
47
+ <strong><%= t('activerecord.attributes.user_import_file.user_encoding') -%>:</strong>
48
+ <%= @user_import_file.user_encoding -%>
49
+ </p>
50
+
46
51
  <p>
47
52
  <strong><%= t('activerecord.attributes.user_import_file.state') -%>:</strong>
48
- <%= localized_state(@user_import_file.state) -%>
53
+ <%= localized_state(@user_import_file.current_state) -%>
49
54
  </p>
50
55
 
51
56
  <p>
@@ -62,8 +67,13 @@
62
67
  </div>
63
68
 
64
69
  <div id="submenu" class="ui-corner-all ui-widget-content">
70
+ <%= form_for(@user_import_file) do |f| %>
65
71
  <ul>
66
72
  <li><%= link_to t('activerecord.models.user_import_result'), user_import_file_user_import_results_path(@user_import_file) -%></li>
67
73
  <li><%= back_to_index(flash[:page_info]) -%></li>
74
+ <% if current_user.has_role?('Administrator') %>
75
+ <li><%= link_to 'Resque', resque_path %></li>
76
+ <% end %>
68
77
  </ul>
78
+ <% end %>
69
79
  </div>
@@ -39,11 +39,11 @@
39
39
  <ul>
40
40
  <li>
41
41
  <% if @user_import_file %>
42
- <%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'TSV', :class => 'icon'), user_import_file_user_import_results_path(@user_import_file, :format => :csv, :locale => @locale.to_s)) -%>
43
- (<%= link_to 'TSV', user_import_file_user_import_results_path(:format => :csv, :locale => @locale.to_s) -%>)
42
+ <%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'TSV', :class => 'icon'), user_import_file_user_import_results_path(@user_import_file, :format => :tsv, :locale => @locale.to_s)) -%>
43
+ (<%= link_to 'TSV', user_import_file_user_import_results_path(:format => :tsv, :locale => @locale.to_s) -%>)
44
44
  <% else %>
45
- <%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'CSV', :class => 'icon'), user_import_results_path(:format => :csv, :locale => @locale.to_s)) -%>
46
- (<%= link_to 'TSV', user_import_results_path(:format => :csv, :locale => @locale.to_s) -%>)
45
+ <%= link_to((image_tag 'icons/page_white_excel.png', :size => '16x16', :alt => 'TSV', :class => 'icon'), user_import_results_path(:format => :tsv, :locale => @locale.to_s)) -%>
46
+ (<%= link_to 'TSV', user_import_results_path(:format => :tsv, :locale => @locale.to_s) -%>)
47
47
  <% end %>
48
48
  </li>
49
49
  </ul>
@@ -1,4 +1,4 @@
1
1
  username
2
2
  <%- @user_import_results.each do |user_import_result| -%>
3
- <%= user_import_result.user.try(:username) %> <%= user_import_result.body %>
3
+ "<%= user_import_result.user.try(:username) %>" <%= user_import_result.body %>
4
4
  <%- end -%>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.edit_user_profile', :login_name => @user.username) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'page/required_field' %>
@@ -63,7 +63,7 @@
63
63
  </div>
64
64
  </div>
65
65
 
66
- <div id="submenu" class="ui-corner-all">
66
+ <div id="submenu" class="ui-corner-all ui-widget-content">
67
67
  <ul>
68
68
  <li><%= link_to t('page.show'), @user -%></li>
69
69
  <li><%= link_to t('page.listing', :model => t('activerecord.models.user')), users_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.user')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
  </div>
49
49
 
50
- <div id="submenu" class="ui-corner-all">
50
+ <div id="submenu" class="ui-corner-all ui-widget-content">
51
51
  <ul>
52
52
  <%- if user_signed_in? && current_user.has_role?('Librarian') -%>
53
53
  <li><%= link_to t('page.new', :model => t('activerecord.models.user')), new_user_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.new', :model => t('activerecord.models.user')) -%></h1>
3
3
  <div id="content_list">
4
4
  <%= render 'page/required_field' %>
@@ -77,7 +77,7 @@
77
77
  </div>
78
78
  </div>
79
79
 
80
- <div id="submenu" class="ui-corner-all">
80
+ <div id="submenu" class="ui-corner-all ui-widget-content">
81
81
  <ul>
82
82
  <li><%= link_to t('page.listing', :model => t('activerecord.models.user')), users_path -%></li>
83
83
  <li><%= link_to t('page.import'), new_agent_import_file_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.user')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  </div>
48
48
 
49
- <div id="submenu" class="ui-corner-all">
49
+ <div id="submenu" class="ui-corner-all ui-widget-content">
50
50
  <% if defined?(EnjuCirculation) %>
51
51
  <ul>
52
52
  <%- @user.user_group.user_group_has_checkout_types.each do |available_checkout_type| -%>
@@ -0,0 +1,7 @@
1
+ class UserImportFileQueue
2
+ @queue = :user_import_file
3
+
4
+ def self.perform(user_import_file_id)
5
+ UserImportFile.find(user_import_file_id).import_start
6
+ end
7
+ end
@@ -3,6 +3,7 @@
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
5
  # Mime::Type.register_alias "text/html", :iphone
6
+ Mime::Type.register "text/tab-separated-values", :tsv
6
7
  Mime::Type.register "image/jpeg", :jpg
7
8
  Mime::Type.register "application/octet-stream", :download
8
9
  Mime::Type.register "application/xml", :sru
@@ -0,0 +1,12 @@
1
+ module Paperclip
2
+ class MediaTypeSpoofDetector
3
+ private
4
+ def type_from_file_command
5
+ begin
6
+ Paperclip.run("LANG=C file", "-b --mime-type :file", :file => @file.path)
7
+ rescue Cocaine::CommandLineError
8
+ ""
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }
@@ -70,6 +70,7 @@ en:
70
70
  state: State
71
71
  edit_mode: Edit mode
72
72
  error_message: Error message
73
+ user_encoding: Encoding
73
74
  user_import_result:
74
75
  body: Body
75
76
 
@@ -126,6 +127,7 @@ en:
126
127
  feed: "Feed"
127
128
  back_to_index: "Back to index"
128
129
  import: "Import from file"
130
+ start_import: "Start import"
129
131
  import_record: "Import records"
130
132
  export: "Export"
131
133
  detail: "Detail"
@@ -364,6 +366,7 @@ en:
364
366
  will_be_imported:
365
367
  one: "Resource will be impored in a %{minute} minute."
366
368
  other: "Resource will be impored in %{minute} minutes."
369
+ auto_detect: "Auto detect"
367
370
  user:
368
371
  current_password: "Current password"
369
372
  new_password: "New password"
@@ -70,6 +70,7 @@ ja:
70
70
  state: 状態
71
71
  edit_mode: 編集モード
72
72
  error_message: エラーメッセージ
73
+ user_encoding: 文字コード
73
74
  user_import_result:
74
75
  body: 本文
75
76
 
@@ -117,6 +118,7 @@ ja:
117
118
  feed: "フィード"
118
119
  back_to_index: "一覧に戻る"
119
120
  import: "インポート"
121
+ start_import: "インポートを開始"
120
122
  import_record: "書誌レコードのインポート"
121
123
  export: "エクスポート"
122
124
  detail: "詳細"
@@ -345,6 +347,7 @@ ja:
345
347
  from_file: "ファイルから"
346
348
  from_isbn: "ISBNから"
347
349
  will_be_imported: "%{minute} 分以内にインポートされます。"
350
+ auto_detect: "自動判別"
348
351
  user:
349
352
  current_password: "現在のパスワード"
350
353
  new_password: "新しいパスワード"