enju_bookmark 0.1.2.pre14 → 0.1.2.pre15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/bookmark_stat_has_manifestations_controller.rb +12 -12
  3. data/app/controllers/bookmark_stats_controller.rb +13 -13
  4. data/app/controllers/bookmarks_controller.rb +18 -19
  5. data/app/controllers/tags_controller.rb +6 -7
  6. data/app/models/bookmark.rb +12 -12
  7. data/app/models/bookmark_stat.rb +20 -12
  8. data/app/models/bookmark_stat_has_manifestation.rb +2 -2
  9. data/app/models/bookmark_stat_state_machine.rb +13 -0
  10. data/app/models/bookmark_stat_transition.rb +20 -0
  11. data/app/models/tag.rb +5 -5
  12. data/app/views/bookmark_stat_has_manifestations/edit.html.erb +3 -3
  13. data/app/views/bookmark_stat_has_manifestations/index.html.erb +5 -5
  14. data/app/views/bookmark_stat_has_manifestations/new.html.erb +3 -3
  15. data/app/views/bookmark_stat_has_manifestations/show.html.erb +3 -3
  16. data/app/views/bookmark_stats/edit.html.erb +3 -3
  17. data/app/views/bookmark_stats/index.html.erb +6 -6
  18. data/app/views/bookmark_stats/new.html.erb +3 -3
  19. data/app/views/bookmark_stats/show.html.erb +6 -6
  20. data/app/views/bookmarks/_index.html.erb +8 -8
  21. data/app/views/bookmarks/_index_user.html.erb +9 -9
  22. data/app/views/bookmarks/_tag_cloud.html.erb +1 -1
  23. data/app/views/bookmarks/edit.html.erb +8 -8
  24. data/app/views/bookmarks/new.html.erb +7 -7
  25. data/app/views/bookmarks/show.html.erb +7 -7
  26. data/app/views/manifestations/_bookmarks_for_this_manifestation.html.erb +3 -3
  27. data/app/views/manifestations/_show_tag.html.erb +1 -1
  28. data/app/views/manifestations/_tag_edit.html.erb +8 -8
  29. data/app/views/manifestations/_tag_list.html.erb +2 -2
  30. data/app/views/tags/edit.html.erb +5 -5
  31. data/app/views/tags/index.atom.builder +2 -2
  32. data/app/views/tags/index.html.erb +8 -8
  33. data/app/views/tags/index.rss.builder +5 -5
  34. data/app/views/tags/show.html.erb +6 -6
  35. data/config/routes.rb +0 -3
  36. data/db/migrate/20081212151614_create_bookmark_stats.rb +0 -3
  37. data/db/migrate/20140812093836_add_share_bookmarks_to_profile.rb +5 -0
  38. data/lib/enju_bookmark.rb +2 -0
  39. data/lib/enju_bookmark/engine.rb +1 -1
  40. data/lib/enju_bookmark/profile.rb +13 -0
  41. data/lib/enju_bookmark/user.rb +2 -0
  42. data/lib/enju_bookmark/version.rb +1 -1
  43. data/spec/controllers/bookmark_stat_has_manifestations_controller_spec.rb +21 -21
  44. data/spec/controllers/bookmark_stats_controller_spec.rb +21 -21
  45. data/spec/controllers/bookmarks_controller_spec.rb +5 -11
  46. data/spec/controllers/tags_controller_spec.rb +15 -15
  47. data/spec/dummy/config/initializers/statesman.rb +3 -0
  48. data/spec/dummy/db/development.sqlite3 +0 -0
  49. data/spec/dummy/db/migrate/001_create_agents.rb +0 -3
  50. data/spec/dummy/db/migrate/005_create_manifestations.rb +7 -19
  51. data/spec/dummy/db/migrate/006_create_items.rb +0 -3
  52. data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
  53. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +0 -2
  54. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -3
  55. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -1
  56. data/spec/dummy/db/migrate/{20111201163718_create_user_has_roles.rb → 20100606065209_create_user_has_roles.rb} +2 -0
  57. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +0 -2
  58. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  59. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
  60. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -11
  61. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  62. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  63. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  64. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  65. data/spec/dummy/db/migrate/{20111201121844_create_roles.rb → 20130506175303_create_identifier_types.rb} +2 -2
  66. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
  67. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
  68. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
  69. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
  70. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
  71. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
  72. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
  73. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
  74. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
  75. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  76. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  77. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
  78. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  79. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  80. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  81. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
  82. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
  83. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
  84. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
  85. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
  86. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
  87. data/spec/dummy/db/migrate/{20121119153944_add_manifestation_id_to_item.rb → 20140802082007_add_manifestation_id_to_item.rb} +1 -0
  88. data/spec/dummy/db/schema.rb +215 -55
  89. data/spec/dummy/db/test.sqlite3 +0 -0
  90. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  91. data/spec/dummy/solr/default/data/index/segments_1bi +0 -0
  92. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001699 +0 -0
  93. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000000905 → tlog.0000000000000001700} +0 -0
  94. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001701 +0 -0
  95. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001702 +0 -0
  96. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001703 +0 -0
  97. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001704 +0 -0
  98. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001705 +0 -0
  99. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001706 +0 -0
  100. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001707 +0 -0
  101. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001708 +0 -0
  102. data/spec/factories/profile.rb +10 -0
  103. data/spec/factories/user.rb +0 -13
  104. data/spec/fixtures/agents.yml +0 -12
  105. data/spec/fixtures/bookmark_stats.yml +0 -4
  106. data/spec/fixtures/items.yml +60 -21
  107. data/spec/fixtures/manifestations.yml +42 -178
  108. data/spec/fixtures/profiles.yml +99 -0
  109. data/spec/fixtures/users.yml +3 -29
  110. data/spec/models/bookmark_spec.rb +1 -1
  111. data/spec/models/bookmark_stat_spec.rb +1 -3
  112. data/spec/spec_helper.rb +2 -0
  113. metadata +117 -42
  114. data/app/models/bookmark_sweeper.rb +0 -21
  115. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  116. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  117. data/spec/dummy/solr/default/data/index/segments_pf +0 -0
  118. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000904 +0 -0
  119. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000906 +0 -0
  120. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000907 +0 -0
  121. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000908 +0 -0
  122. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000909 +0 -0
  123. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000910 +0 -0
  124. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000911 +0 -0
  125. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000912 +0 -0
  126. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000913 +0 -0
@@ -4,11 +4,11 @@
4
4
  <% if bookmark.shared? %>
5
5
  <li><%= link_to bookmark.user.username, bookmark -%>
6
6
  <%- bookmark.tags.each do |tag| -%>
7
- [<%= link_to tag.name, manifestations_path(:tag => tag.name) -%>]
7
+ [<%= link_to tag.name, manifestations_path(tag: tag.name) -%>]
8
8
  <%- end -%>
9
9
  <%= bookmark.note -%>
10
10
  <%- if user_signed_in? and current_user == bookmark.user -%>
11
- <%= link_to image_tag('icons/page_edit.png', :alt => t('page.edit')), edit_bookmark_path(bookmark) -%>
11
+ <%= link_to image_tag('icons/page_edit.png', alt: t('page.edit')), edit_bookmark_path(bookmark) -%>
12
12
  <%- end -%>
13
13
  </li>
14
14
  <%- end -%>
@@ -18,7 +18,7 @@
18
18
  <p>
19
19
  <%= t('bookmark.not_bookmarked') -%>
20
20
  <%- if user_signed_in? -%>
21
- <%= link_to t('bookmark.add_to_my_bookmark'), new_bookmark_path(:bookmark => {:url => manifestation_url(manifestation)}) -%>
21
+ <%= link_to t('bookmark.add_to_my_bookmark'), new_bookmark_path(bookmark: {url: manifestation_url(manifestation)}) -%>
22
22
  <%- end -%>
23
23
  </p>
24
24
  <%- end -%>
@@ -1,5 +1,5 @@
1
1
  <div class="tag" id="tag_<%= manifestation.id -%>" style="display: none">
2
2
  <%- manifestation.tags.each do |tag| -%>
3
- <%= link_to tag.name, manifestations_path(:tag => tag.name) -%>
3
+ <%= link_to tag.name, manifestations_path(tag: tag.name) -%>
4
4
  <%- end -%>
5
5
  </div>
@@ -1,11 +1,11 @@
1
1
  <%- if user_signed_in? -%>
2
2
  <%- unless @bookmark.blank? -%>
3
3
  <!-- bookmarked_by_me -->
4
- <%= form_for(:bookmark, :url => bookmark_path(@bookmark, :mode => 'tag_edit'), :html => { :method => :put }) do |f| -%>
4
+ <%= form_for(:bookmark, url: bookmark_path(@bookmark, mode: 'tag_edit'), html: { method: :put }) do |f| -%>
5
5
  <div>
6
- <%= f.text_field :tag_list, :value => @bookmark.tag_list.join(' '), :class => 'editable_text_field' -%>
6
+ <%= f.text_field :tag_list, value: @bookmark.tag_list.join(' '), class: 'editable_text_field' -%>
7
7
  <%= submit_tag t('page.update') -%>
8
- (<a onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= manifestation_path(manifestation, :mode => 'tag_list') %>'}); return false;" href="#"><%= t('page.cancel') %></a>)
8
+ (<a onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= manifestation_path(manifestation, mode: 'tag_list') %>'}); return false;" href="#"><%= t('page.cancel') %></a>)
9
9
  <br />
10
10
  <%= t('tag.use_space_as_delimiter') -%>
11
11
  </div>
@@ -13,13 +13,13 @@
13
13
  <%= javascript_tag("$(function(){$('#bookmark_tag_list').focus()})") %>
14
14
  <%- else -%>
15
15
  <!-- bookmarked_by_other_patron_or_not_bookmarked -->
16
- <%= form_for(:bookmark, :url => bookmarks_path(:mode => 'tag_edit'), :html => { :method => :post }) do |f| -%>
16
+ <%= form_for(:bookmark, url: bookmarks_path(mode: 'tag_edit'), html: { method: :post }) do |f| -%>
17
17
  <div>
18
- <%= f.text_field :tag_list, :class => 'editable_text_field' -%>
19
- <%= f.hidden_field :title, :value => manifestation.original_title -%>
20
- <%= f.hidden_field :url, :value => manifestation_url(manifestation) -%>
18
+ <%= f.text_field :tag_list, class: 'editable_text_field' -%>
19
+ <%= f.hidden_field :title, value: manifestation.original_title -%>
20
+ <%= f.hidden_field :url, value: manifestation_url(manifestation) -%>
21
21
  <%= submit_tag t('page.create') -%>
22
- (<a onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= manifestation_path(manifestation, :mode => 'tag_list') %>'}); return false;" href="#"><%= t('page.cancel') %></a>)
22
+ (<a onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= manifestation_path(manifestation, mode: 'tag_list') %>'}); return false;" href="#"><%= t('page.cancel') %></a>)
23
23
  <br />
24
24
  <%= t('tag.use_space_as_delimiter') -%>
25
25
  </div>
@@ -3,11 +3,11 @@
3
3
  <%- manifestation.tags.each do |tag| -%>
4
4
  <%= link_to_tag(tag) -%>
5
5
  <%- if can? :delete, tag -%>
6
- <%= link_to image_tag('icons/tag_blue_edit.png', :alt => t('page.edit')), tag_path(tag.name) -%>
6
+ <%= link_to image_tag('icons/tag_blue_edit.png', alt: t('page.edit')), tag_path(tag.name) -%>
7
7
  <%- end -%>
8
8
  <%- end -%>
9
9
  <%- end -%>
10
10
  <%- if user_signed_in? -%>
11
- (<a href="#" onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= edit_manifestation_path(manifestation, :mode => 'tag_edit') %>'}); return false;"><%= t('page.edit') %></a>)
11
+ (<a href="#" onclick="$.ajax({data:'authenticity_token=' + encodeURIComponent('<%= form_authenticity_token %>'), success:function(request){$('#tag_list').html(request);}, type:'get', url:'<%= edit_manifestation_path(manifestation, mode: 'tag_edit') %>'}); return false;"><%= t('page.edit') %></a>)
12
12
  <%- end -%>
13
13
  </div>
@@ -1,12 +1,12 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.tag')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.editing', model: t('activerecord.models.tag')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <%= form_for(@tag, :url => tag_path(@tag.name)) do |f| -%>
5
+ <%= form_for(@tag, url: tag_path(@tag.name)) do |f| -%>
6
6
  <%= f.error_messages -%>
7
7
  <div class="field">
8
8
  <%= f.label :name -%><br />
9
- <%= f.text_field :name, :value => @tag.name -%>
9
+ <%= f.text_field :name, value: @tag.name -%>
10
10
  </div>
11
11
 
12
12
  <div class="actions">
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  </div>
18
18
 
19
- <div id="submenu" class="ui-corner-all">
19
+ <div id="submenu" class="ui-corner-all ui-widget-content">
20
20
  <ul>
21
21
  <li><%= link_to t('page.show'), tag_path(@tag.name) -%></li>
22
22
  <li><%= link_to t('page.back'), tags_path -%></li>
@@ -1,5 +1,5 @@
1
- atom_feed(:url => tags_url(:format => :atom)) do |feed|
2
- feed.title t('page.listing', :model => t('activerecord.models.tag')) + " (#{@library_group.display_name.localize})"
1
+ atom_feed(url: tags_url(format: :atom)) do |feed|
2
+ feed.title t('page.listing', model: t('activerecord.models.tag')) + " (#{@library_group.display_name.localize})"
3
3
  feed.updated(@tags.first ? @tags.first.created_at : Time.zone.now)
4
4
 
5
5
  @tags.each do |tag|
@@ -1,19 +1,19 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.tag')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.listing', model: t('activerecord.models.tag')) -%></h1>
3
3
  <div id="content_list">
4
4
 
5
- <%= form_for :tags, :url => tags_path, :html => {:method => 'get'} do -%>
5
+ <%= form_for :tags, url: tags_path, html: {method: 'get'} do -%>
6
6
  <p>
7
- <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
7
+ <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
8
8
  <%= submit_tag t('page.search') -%>
9
9
  </p>
10
10
  <%- end -%>
11
11
 
12
12
  <p>
13
13
  <%= t('page.sort_by') -%>:
14
- <%= link_to t('activerecord.attributes.tag.name'), tags_path(:order => 'name') -%>
15
- <%= link_to t('activerecord.attributes.tag.taggings_count'), tags_path(:sort_by => 'taggings_count') -%>
16
- <%= link_to t('page.created_at'), tags_path(:sort_by => 'created_at') -%>
14
+ <%= link_to t('activerecord.attributes.tag.name'), tags_path(order: 'name') -%>
15
+ <%= link_to t('activerecord.attributes.tag.taggings_count'), tags_path(sort_by: 'taggings_count') -%>
16
+ <%= link_to t('page.created_at'), tags_path(sort_by: 'created_at') -%>
17
17
  </p>
18
18
 
19
19
  <table class="table table-striped index">
@@ -42,7 +42,7 @@
42
42
  </div>
43
43
  </div>
44
44
 
45
- <div id="submenu" class="ui-corner-all">
45
+ <div id="submenu" class="ui-corner-all ui-widget-content">
46
46
  <ul>
47
47
  </ul>
48
48
  </div>
@@ -3,14 +3,14 @@ xml.rss('version' => "2.0",
3
3
  'xmlns:opensearch' => "http://a9.com/-/spec/opensearch/1.1/",
4
4
  'xmlns:atom' => "http://www.w3.org/2005/Atom"){
5
5
  xml.channel{
6
- xml.title t('page.listing', :model => t('activerecord.models.tag')) + " (#{@library_group.display_name.localize})"
7
- xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => nil, :only_path => true))}"
6
+ xml.title t('page.listing', model: t('activerecord.models.tag')) + " (#{@library_group.display_name.localize})"
7
+ xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: nil, only_path: true))}"
8
8
  xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
9
9
  xml.language @locale.to_s
10
10
  xml.ttl "60"
11
- xml.tag! "atom:link", :rel => 'self', :href => "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(:format => :rss, :only_path => true))}"
12
- xml.tag! "atom:link", :rel => 'alternate', :href => tags_url
13
- xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => page_opensearch_url
11
+ xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
12
+ xml.tag! "atom:link", rel: 'alternate', href: tags_url
13
+ xml.tag! "atom:link", rel: 'search', type: 'application/opensearchdescription+xml', href: page_opensearch_url
14
14
  unless params[:query].blank?
15
15
  xml.tag! "opensearch:totalResults", @count[:query_result]
16
16
  xml.tag! "opensearch:startIndex", @tags.offset + 1
@@ -1,5 +1,5 @@
1
- <div id="content_detail" class="ui-corner-all">
2
- <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.tag')) -%></h1>
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
+ <h1 class="title"><%= t('page.showing', model: t('activerecord.models.tag')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
5
5
 
@@ -15,7 +15,7 @@
15
15
  <p>
16
16
  <strong><%= t('activerecord.attributes.tag.taggings_count') -%>:</strong>
17
17
  <%= @tag.taggings.size -%>
18
- (<%= link_to t('page.search'), manifestations_path(:tag => @tag.name) -%>)
18
+ (<%= link_to t('page.search'), manifestations_path(tag: @tag.name) -%>)
19
19
  </p>
20
20
 
21
21
  <p>
@@ -26,13 +26,13 @@
26
26
  </div>
27
27
  </div>
28
28
 
29
- <div id="submenu" class="ui-corner-all">
29
+ <div id="submenu" class="ui-corner-all ui-widget-content">
30
30
  <ul>
31
31
  <li><%= link_to t('page.back'), :back -%></li>
32
32
  <li><%= link_to t('page.edit'), edit_tag_path(@tag.name) -%></li>
33
- <li><%= link_to t('page.search_resource', :model => t('activerecord.models.resource')), manifestations_path(:tag => @tag.name) -%></li>
33
+ <li><%= link_to t('page.search_resource', model: t('activerecord.models.resource')), manifestations_path(tag: @tag.name) -%></li>
34
34
  <%- if user_signed_in? -%>
35
- <li><%= link_to t('page.search_resource', :model => t('activerecord.models.bookmark')), user_bookmarks_path(current_user, :tag => @tag.name) -%></li>
35
+ <li><%= link_to t('page.search_resource', model: t('activerecord.models.bookmark')), bookmarks_path(user_id: current_user.username, tag: @tag.name) -%></li>
36
36
  <%- end -%>
37
37
  </ul>
38
38
  </div>
@@ -1,7 +1,4 @@
1
1
  Rails.application.routes.draw do
2
- resources :users do
3
- resources :bookmarks, :only => :index
4
- end
5
2
  resources :bookmarks
6
3
  resources :tags
7
4
  resources :bookmark_stats
@@ -6,11 +6,8 @@ class CreateBookmarkStats < ActiveRecord::Migration
6
6
  t.datetime :started_at
7
7
  t.datetime :completed_at
8
8
  t.text :note
9
- t.string :state
10
9
 
11
10
  t.timestamps
12
11
  end
13
-
14
- add_index :bookmark_stats, :state
15
12
  end
16
13
  end
@@ -0,0 +1,5 @@
1
+ class AddShareBookmarksToProfile < ActiveRecord::Migration
2
+ def change
3
+ add_column :profiles, :share_bookmarks, :boolean
4
+ end
5
+ end
@@ -1,5 +1,6 @@
1
1
  require "enju_bookmark/engine"
2
2
  require "enju_bookmark/user"
3
+ require "enju_bookmark/profile"
3
4
  require "enju_bookmark/manifestation"
4
5
  require "enju_bookmark/bookmark_url"
5
6
  require "enju_bookmark/calculate_stat"
@@ -11,4 +12,5 @@ module EnjuBookmark
11
12
  end
12
13
 
13
14
  ActiveRecord::Base.send :include, EnjuBookmark::BookmarkUser
15
+ ActiveRecord::Base.send :include, EnjuBookmark::BookmarkProfile
14
16
  ActiveRecord::Base.send :include, EnjuBookmark::BookmarkManifestation
@@ -1,6 +1,6 @@
1
1
  require 'enju_seed'
2
2
  require 'acts-as-taggable-on'
3
- require 'state_machine'
3
+ require 'statesman'
4
4
  require 'addressable/uri'
5
5
  require 'nkf'
6
6
 
@@ -0,0 +1,13 @@
1
+ module EnjuBookmark
2
+ module BookmarkProfile
3
+ def self.included(base)
4
+ base.extend ClassMethods
5
+ end
6
+
7
+ module ClassMethods
8
+ def enju_bookmark_profile_model
9
+ attr_accessible :share_bookmarks, as: :admin
10
+ end
11
+ end
12
+ end
13
+ end
@@ -9,6 +9,8 @@ module EnjuBookmark
9
9
  include InstanceMethods
10
10
  has_many :bookmarks, :dependent => :destroy
11
11
  acts_as_tagger
12
+
13
+ attr_accessible :share_bookmarks, as: :admin
12
14
  end
13
15
  end
14
16
 
@@ -1,3 +1,3 @@
1
1
  module EnjuBookmark
2
- VERSION = "0.1.2.pre14"
2
+ VERSION = "0.1.2.pre15"
3
3
  end
@@ -11,7 +11,7 @@ describe BookmarkStatHasManifestationsController do
11
11
  end
12
12
 
13
13
  describe "When logged in as Administrator" do
14
- login_admin
14
+ login_fixture_admin
15
15
 
16
16
  it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
17
17
  get :index
@@ -20,7 +20,7 @@ describe BookmarkStatHasManifestationsController do
20
20
  end
21
21
 
22
22
  describe "When logged in as Librarian" do
23
- login_librarian
23
+ login_fixture_librarian
24
24
 
25
25
  it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
26
26
  get :index
@@ -29,7 +29,7 @@ describe BookmarkStatHasManifestationsController do
29
29
  end
30
30
 
31
31
  describe "When logged in as Manifestation" do
32
- login_user
32
+ login_fixture_user
33
33
 
34
34
  it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
35
35
  get :index
@@ -49,7 +49,7 @@ describe BookmarkStatHasManifestationsController do
49
49
 
50
50
  describe "GET show" do
51
51
  describe "When logged in as Administrator" do
52
- login_admin
52
+ login_fixture_admin
53
53
 
54
54
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
55
55
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -59,7 +59,7 @@ describe BookmarkStatHasManifestationsController do
59
59
  end
60
60
 
61
61
  describe "When logged in as Librarian" do
62
- login_librarian
62
+ login_fixture_librarian
63
63
 
64
64
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
65
65
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -69,7 +69,7 @@ describe BookmarkStatHasManifestationsController do
69
69
  end
70
70
 
71
71
  describe "When logged in as Manifestation" do
72
- login_user
72
+ login_fixture_user
73
73
 
74
74
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
75
75
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -89,7 +89,7 @@ describe BookmarkStatHasManifestationsController do
89
89
 
90
90
  describe "GET new" do
91
91
  describe "When logged in as Administrator" do
92
- login_admin
92
+ login_fixture_admin
93
93
 
94
94
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
95
95
  get :new
@@ -99,7 +99,7 @@ describe BookmarkStatHasManifestationsController do
99
99
  end
100
100
 
101
101
  describe "When logged in as Librarian" do
102
- login_librarian
102
+ login_fixture_librarian
103
103
 
104
104
  it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
105
105
  get :new
@@ -109,7 +109,7 @@ describe BookmarkStatHasManifestationsController do
109
109
  end
110
110
 
111
111
  describe "When logged in as Manifestation" do
112
- login_user
112
+ login_fixture_user
113
113
 
114
114
  it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
115
115
  get :new
@@ -129,7 +129,7 @@ describe BookmarkStatHasManifestationsController do
129
129
 
130
130
  describe "GET edit" do
131
131
  describe "When logged in as Administrator" do
132
- login_admin
132
+ login_fixture_admin
133
133
 
134
134
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
135
135
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -139,7 +139,7 @@ describe BookmarkStatHasManifestationsController do
139
139
  end
140
140
 
141
141
  describe "When logged in as Librarian" do
142
- login_librarian
142
+ login_fixture_librarian
143
143
 
144
144
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
145
145
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -149,7 +149,7 @@ describe BookmarkStatHasManifestationsController do
149
149
  end
150
150
 
151
151
  describe "When logged in as Manifestation" do
152
- login_user
152
+ login_fixture_user
153
153
 
154
154
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
155
155
  bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
@@ -174,7 +174,7 @@ describe BookmarkStatHasManifestationsController do
174
174
  end
175
175
 
176
176
  describe "When logged in as Administrator" do
177
- login_admin
177
+ login_fixture_admin
178
178
 
179
179
  describe "with valid params" do
180
180
  it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
@@ -202,7 +202,7 @@ describe BookmarkStatHasManifestationsController do
202
202
  end
203
203
 
204
204
  describe "When logged in as Librarian" do
205
- login_librarian
205
+ login_fixture_librarian
206
206
 
207
207
  describe "with valid params" do
208
208
  it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
@@ -230,7 +230,7 @@ describe BookmarkStatHasManifestationsController do
230
230
  end
231
231
 
232
232
  describe "When logged in as Manifestation" do
233
- login_user
233
+ login_fixture_user
234
234
 
235
235
  describe "with valid params" do
236
236
  it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
@@ -292,7 +292,7 @@ describe BookmarkStatHasManifestationsController do
292
292
  end
293
293
 
294
294
  describe "When logged in as Administrator" do
295
- login_admin
295
+ login_fixture_admin
296
296
 
297
297
  describe "with valid params" do
298
298
  it "updates the requested bookmark_stat_has_manifestation" do
@@ -315,7 +315,7 @@ describe BookmarkStatHasManifestationsController do
315
315
  end
316
316
 
317
317
  describe "When logged in as Librarian" do
318
- login_librarian
318
+ login_fixture_librarian
319
319
 
320
320
  describe "with valid params" do
321
321
  it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
@@ -342,7 +342,7 @@ describe BookmarkStatHasManifestationsController do
342
342
  end
343
343
 
344
344
  describe "When logged in as Manifestation" do
345
- login_user
345
+ login_fixture_user
346
346
 
347
347
  describe "with valid params" do
348
348
  it "updates the requested bookmark_stat_has_manifestation" do
@@ -391,7 +391,7 @@ describe BookmarkStatHasManifestationsController do
391
391
  end
392
392
 
393
393
  describe "When logged in as Administrator" do
394
- login_admin
394
+ login_fixture_admin
395
395
 
396
396
  it "destroys the requested bookmark_stat_has_manifestation" do
397
397
  delete :destroy, :id => @bookmark_stat_has_manifestation.id
@@ -404,7 +404,7 @@ describe BookmarkStatHasManifestationsController do
404
404
  end
405
405
 
406
406
  describe "When logged in as Librarian" do
407
- login_librarian
407
+ login_fixture_librarian
408
408
 
409
409
  it "destroys the requested bookmark_stat_has_manifestation" do
410
410
  delete :destroy, :id => @bookmark_stat_has_manifestation.id
@@ -417,7 +417,7 @@ describe BookmarkStatHasManifestationsController do
417
417
  end
418
418
 
419
419
  describe "When logged in as Manifestation" do
420
- login_user
420
+ login_fixture_user
421
421
 
422
422
  it "destroys the requested bookmark_stat_has_manifestation" do
423
423
  delete :destroy, :id => @bookmark_stat_has_manifestation.id