enju_leaf 1.1.0.rc19 → 1.1.0.rc20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/enju.css +1 -1
  3. data/app/controllers/page_controller.rb +12 -6
  4. data/app/controllers/profiles_controller.rb +1 -0
  5. data/app/controllers/roles_controller.rb +4 -1
  6. data/app/controllers/user_groups_controller.rb +2 -2
  7. data/app/controllers/user_import_files_controller.rb +1 -1
  8. data/app/models/enju_leaf/ability.rb +18 -2
  9. data/app/models/profile.rb +4 -0
  10. data/app/models/role.rb +0 -1
  11. data/app/models/user_group.rb +0 -1
  12. data/app/models/user_import_file.rb +19 -16
  13. data/app/models/user_import_result.rb +0 -1
  14. data/app/views/devise/passwords/new.html.erb +2 -3
  15. data/app/views/devise/registrations/edit.html.erb +4 -4
  16. data/app/views/my_accounts/edit.html.erb +1 -1
  17. data/app/views/my_accounts/show.html.erb +1 -1
  18. data/app/views/profiles/_edit_credential.html.erb +2 -2
  19. data/app/views/profiles/edit.html.erb +2 -4
  20. data/app/views/profiles/index.html.erb +1 -1
  21. data/app/views/user_export_files/_form.html.erb +0 -10
  22. data/config/locales/en.yml +1 -1
  23. data/config/locales/ja.yml +1 -1
  24. data/config/locales/translation_en.yml +2 -6
  25. data/config/locales/translation_ja.yml +2 -6
  26. data/lib/enju_leaf/user.rb +10 -7
  27. data/lib/enju_leaf/version.rb +1 -1
  28. data/spec/controllers/profiles_controller_spec.rb +41 -1
  29. data/spec/controllers/roles_controller_spec.rb +4 -4
  30. data/spec/controllers/user_export_files_controller_spec.rb +8 -8
  31. data/spec/controllers/user_groups_controller_spec.rb +4 -4
  32. data/spec/controllers/user_import_files_controller_spec.rb +11 -11
  33. data/spec/factories/checkout.rb +9 -0
  34. data/spec/factories/profile.rb +8 -0
  35. data/spec/factories/user.rb +3 -3
  36. data/spec/models/profile_spec.rb +7 -0
  37. data/spec/models/user_import_file_spec.rb +58 -3
  38. data/spec/spec_helper.rb +3 -0
  39. data/spec/views/profiles/edit.html.erb_spec.rb +24 -2
  40. data/spec/views/profiles/index.html.erb_spec.rb +5 -1
  41. data/spec/views/profiles/show.html.erb_spec.rb +16 -0
  42. data/spec/views/user_export_files/new.html.erb_spec.rb +19 -0
  43. metadata +37 -21
  44. data/app/views/profiles/_edit_credential.html.slim +0 -67
  45. data/app/views/profiles/_edit_profile.html.slim +0 -40
@@ -1,67 +0,0 @@
1
- = f.fields_for :user do |user_form|
2
- #left_pane_detail
3
- .form-group
4
- = user_form.label :username
5
- br
6
- = profile.user.username
7
- .form-group
8
- = user_form.label :email
9
- br
10
- = user_form.email_field :email, class: 'form-control'
11
- .form-group
12
- .checkbox-inline
13
- = user_form.check_box :auto_generated_password
14
- = user_form.label :auto_generated_password
15
- .form-group
16
- = f.label :expired_at
17
- br
18
- - if current_user.has_role?('Librarian')
19
- = f.text_field :expired_at, value: profile.expired_at.try(:strftime, "%Y-%m-%d"), class: 'form-control', placeholder: "#{t('page.example')}: 2011-04-12"
20
- - else
21
- = l(profile.expired_at) if profile.expired_at
22
- .form-group
23
- .checkbox-inline
24
- = user_form.check_box :locked
25
- = user_form.label :locked
26
- .form-group
27
- = user_form.label t('activerecord.models.role')
28
- br
29
- = user_form.fields_for :user_has_role do |u|
30
- - if current_user.has_role?('Administrator') and current_user != profile.user
31
- = u.select :role_id, @roles.collect{|r| [r.display_name.localize, r.id]}
32
- - else
33
- = u.select(:role_id, @roles.collect{|r| [r.display_name.localize, r.id]}, {}, {disabled: 'disabled'})
34
- #right_pane_detail
35
- .form-group
36
- = f.label :full_name
37
- br
38
- = f.text_field :full_name, class: 'form-control'
39
- .form-group
40
- = f.label :full_name_transcription
41
- br
42
- = f.text_field :full_name_transcription, class: 'form-control'
43
- - if current_user.has_role?('Librarian')
44
- .form-group
45
- = f.label t('activerecord.models.user_group')
46
- br
47
- = f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]})
48
- .form-group
49
- = f.label :user_number
50
- br
51
- - if current_user.has_role?('Librarian')
52
- = f.text_field :user_number, class: 'form-control'
53
- - else
54
- = profile.user_number
55
- - if current_user.has_role?('Librarian')
56
- .form-group
57
- = f.label t('activerecord.models.library')
58
- br
59
- = f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]})
60
- .form-group
61
- = f.label t('role.required_role')
62
- br
63
- = f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]})
64
- .form-group
65
- = f.label :locale
66
- br
67
- = f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]})
@@ -1,40 +0,0 @@
1
- - if defined?(EnjuCirculation)
2
- .form-group
3
- = f.label t('user.checkout_history_icalendar_url')
4
- br
5
- #feed_token
6
- - if profile.checkout_icalendar_token?
7
- = link_to checkouts_url(icalendar_token: profile.checkout_icalendar_token, format: :ics), checkouts_url(icalendar_token: profile.checkout_icalendar_token, format: :ics)
8
- = f.hidden_field :checkout_icalendar_token
9
- br
10
- | <input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('
11
- = form_authenticity_token
12
- | '), success:function(request){$('#feed_token').html(request);}, type:'get', url:'
13
- = edit_my_account_path(mode: 'feed_token')
14
- | '});" type="button" value="
15
- = t('page.reset')
16
- | " /> <input onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('
17
- = form_authenticity_token
18
- | '), success:function(request){$('#feed_token').html(request);}, type:'get', url:'
19
- = edit_my_account_path(disable: true, mode: 'feed_token')
20
- | '});" type="button" value="
21
- = t('page.delete')
22
- | " />
23
- br
24
- - if defined?(EnjuSearchLog)
25
- .form-group
26
- .checkbox-inline
27
- = f.check_box :save_search_history
28
- = f.label :save_search_history
29
- - if defined?(EnjuCirculation)
30
- .form-group
31
- .checkbox-inline
32
- = f.check_box :save_checkout_history
33
- = f.label :save_checkout_history
34
- - if current_user.has_role?('Librarian')
35
- .form-group
36
- = f.label :note
37
- br
38
- = f.text_area :note, class: 'form-control'
39
- .form-group
40
- = f.submit class: 'btn btn-default'