Diff
Modified: trunk/app/controllers/blobs_controller.rb (2876 => 2877)
--- trunk/app/controllers/blobs_controller.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/controllers/blobs_controller.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -87,10 +87,10 @@
respond_to do |format|
format.html {
- @lod_nir = file_url(@blob)
- @lod_html = file_url(:id => @blob.id, :format => 'html')
- @lod_rdf = file_url(:id => @blob.id, :format => 'rdf')
- @lod_xml = file_url(:id => @blob.id, :format => 'xml')
+ @lod_nir = blob_url(@blob)
+ @lod_html = blob_url(:id => @blob.id, :format => 'html')
+ @lod_rdf = blob_url(:id => @blob.id, :format => 'rdf')
+ @lod_xml = blob_url(:id => @blob.id, :format => 'xml')
# show.rhtml
}
@@ -157,7 +157,7 @@
if policy_err_msg.blank?
flash[:notice] = 'File was successfully created.'
- format.html { redirect_to file_url(@blob) }
+ format.html { redirect_to blob_url(@blob) }
else
flash[:notice] = "File was successfully created. However some problems occurred, please see these below.</br></br><span style='color: red;'>" + policy_err_msg + "</span>"
format.html { redirect_to :controller => 'blobs', :id => @blob, :action ="" "edit" }
@@ -200,7 +200,7 @@
if policy_err_msg.blank?
flash[:notice] = 'File was successfully updated.'
- format.html { redirect_to file_url(@blob) }
+ format.html { redirect_to blob_url(@blob) }
else
flash[:error] = policy_err_msg
format.html { redirect_to :controller => 'blobs', :id => @blob, :action ="" "edit" }
@@ -218,10 +218,10 @@
respond_to do |format|
if success
flash[:notice] = "File has been deleted."
- format.html { redirect_to files_url }
+ format.html { redirect_to blobs_url }
else
flash[:error] = "Failed to delete File. Please contact your administrator."
- format.html { redirect_to file_url(@blob) }
+ format.html { redirect_to blob_url(@blob) }
end
end
end
@@ -265,11 +265,11 @@
# POST /files/1;favourite
def favourite
- @blob.bookmarks << Bookmark.create(:user => current_user) unless @blob.bookmarked_by_user?(current_user)
+ @blob.bookmarks << Bookmark.create(:user => current_user, :bookmarkable => @blob) unless @blob.bookmarked_by_user?(current_user)
respond_to do |format|
flash[:notice] = "You have successfully added this item to your favourites."
- format.html { redirect_to file_url(@blob) }
+ format.html { redirect_to blob_url(@blob) }
end
end
@@ -283,7 +283,7 @@
respond_to do |format|
flash[:notice] = "You have successfully removed this item from your favourites."
- redirect_url = params[:return_to] ? params[:return_to] : file_url(@blob)
+ redirect_url = params[:return_to] ? params[:return_to] : blob_url(@blob)
format.html { redirect_to redirect_url }
end
end
@@ -353,7 +353,7 @@
(err = Blob.new.errors).add(attr, message)
respond_to do |format|
- format.html { redirect_to files_url }
+ format.html { redirect_to blobs_url }
end
end
end
Modified: trunk/app/controllers/group_announcements_controller.rb (2876 => 2877)
--- trunk/app/controllers/group_announcements_controller.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/controllers/group_announcements_controller.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -30,10 +30,10 @@
respond_to do |format|
format.html {
- @lod_nir = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id)
- @lod_html = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'html')
- @lod_rdf = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'rdf')
- @lod_xml = group_announcement_url(:id => @announcement.id, :group_id => @announcement.network_id, :format => 'xml')
+ @lod_nir = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id)
+ @lod_html = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'html')
+ @lod_rdf = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'rdf')
+ @lod_xml = group_announcement_url(:id => @announcement.id, :network_id => @announcement.network_id, :format => 'xml')
# show.rhtml
}
@@ -100,7 +100,7 @@
def find_group
begin
- @group = Network.find(params[:group_id])
+ @group = Network.find(params[:network_id])
rescue ActiveRecord::RecordNotFound
error("Group couldn't be found")
end
@@ -171,7 +171,7 @@
def error(message)
flash[:error] = message
- return_to_path = @group.nil? ? groups_path : group_announcements_path(@group)
+ return_to_path = @group.nil? ? networks_path : group_announcements_path(@group)
respond_to do |format|
format.html { redirect_to return_to_path }
Modified: trunk/app/controllers/memberships_controller.rb (2876 => 2877)
--- trunk/app/controllers/memberships_controller.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/controllers/memberships_controller.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -82,7 +82,7 @@
respond_to do |format|
if @membership.accept!
flash[:notice] = 'Membership was successfully accepted.'
- format.html { redirect_to group_url(@membership.network_id) }
+ format.html { redirect_to network_url(@membership.network_id) }
else
error("Membership already accepted", "already accepted")
end
@@ -324,7 +324,7 @@
respond_to do |format|
flash[:notice] = "Membership successfully deleted"
- format.html { redirect_to(params[:return_to] ? params[:return_to] : group_path(network_id)) }
+ format.html { redirect_to(params[:return_to] ? params[:return_to] : network_path(network_id)) }
end
end
Modified: trunk/app/controllers/networks_controller.rb (2876 => 2877)
--- trunk/app/controllers/networks_controller.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/controllers/networks_controller.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -69,10 +69,10 @@
end
flash[:notice] = 'An invitation has been sent to the User.'
- format.html { redirect_to group_url(@network) }
+ format.html { redirect_to network_url(@network) }
else
flash[:error] = 'Failed to send invitation to User. Please try again or report this.'
- format.html { redirect_to invite_group_url(@network) }
+ format.html { redirect_to invite_network_url(@network) }
end
end
else
@@ -82,7 +82,7 @@
flash[:error] = "User invited is already a member of the group"
end
respond_to do |format|
- format.html { redirect_to invite_group_url(@network) }
+ format.html { redirect_to invite_network_url(@network) }
end
end
end
@@ -208,7 +208,7 @@
format.html { render :action ="" 'invite' }
else
flash[:notice] = error_msg
- format.html { redirect_to group_path(params[:id]) }
+ format.html { redirect_to network_path(params[:id]) }
end
end
end
@@ -334,10 +334,10 @@
respond_to do |format|
format.html {
- @lod_nir = group_url(@network)
- @lod_html = group_url(:id => @network.id, :format => 'html')
- @lod_rdf = group_url(:id => @network.id, :format => 'rdf')
- @lod_xml = group_url(:id => @network.id, :format => 'xml')
+ @lod_nir = network_url(@network)
+ @lod_html = network_url(:id => @network.id, :format => 'html')
+ @lod_rdf = network_url(:id => @network.id, :format => 'rdf')
+ @lod_xml = network_url(:id => @network.id, :format => 'xml')
# show.rhtml
}
@@ -372,7 +372,7 @@
@network.update_tags
end
flash[:notice] = 'Group was successfully created.'
- format.html { redirect_to group_url(@network) }
+ format.html { redirect_to network_url(@network) }
else
format.html { render :action ="" "new" }
end
@@ -385,7 +385,7 @@
if @network.update_attributes(params[:network])
@network.refresh_tags(convert_tags_to_gem_format(params[:network][:tag_list]), current_user) if params[:network][:tag_list]
flash[:notice] = 'Group was successfully updated.'
- format.html { redirect_to group_url(@network) }
+ format.html { redirect_to network_url(@network) }
else
format.html { render :action ="" "edit" }
end
@@ -398,7 +398,7 @@
respond_to do |format|
flash[:notice] = 'Group was successfully deleted.'
- format.html { redirect_to groups_url }
+ format.html { redirect_to networks_url }
end
end
@@ -466,7 +466,7 @@
(err = Network.new.errors).add(:id, message)
respond_to do |format|
- format.html { redirect_to groups_url }
+ format.html { redirect_to networks_url }
end
end
end
Modified: trunk/app/controllers/search_controller.rb (2876 => 2877)
--- trunk/app/controllers/search_controller.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/controllers/search_controller.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -35,7 +35,7 @@
when 'workflows'
redirect_to(workflows_path(:query => params[:query]))
when 'files'
- redirect_to(files_path(:query => params[:query]))
+ redirect_to(blobs_url(:query => params[:query]))
when 'packs'
redirect_to(packs_path(:query => params[:query]))
when 'services'
@@ -121,7 +121,7 @@
markup += "<item>";
markup += "<title>" + f.title + "</title>";
- markup += "<link>" + file_url(f) + "</link>";
+ markup += "<link>" + blob_url(f) + "</link>";
markup += "<description>" + sanitize(f.body_html) + "</description>";
markup += "<pubDate>" + time_string(f.created_at) + "</pubDate>";
markup += "<media:content url="" + f.named_download_url + "\"";
Modified: trunk/app/helpers/application_helper.rb (2876 => 2877)
--- trunk/app/helpers/application_helper.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/helpers/application_helper.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -106,7 +106,7 @@
end
title = truncate_to ? truncate(network.title, :length => truncate_to) : network.title
- return link_to(h(title), group_url(network))
+ return link_to(h(title), network_url(network))
end
def avatar(user_id, size=200, url=""
@@ -376,7 +376,7 @@
name = h(b.local_name)
end
- return link ? link_to(name, file_url(b)) : name
+ return link ? link_to(name, blob_url(b)) : name
else
return nil
end
Modified: trunk/app/helpers/users_helper.rb (2876 => 2877)
--- trunk/app/helpers/users_helper.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/helpers/users_helper.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -9,7 +9,7 @@
url = ""
case bookmarkableType
- when 'Blob'; url = ""
+ when 'Blob'; url = ""
when 'Workflow'; url = ""
when 'Pack'; url = ""
when 'Blog'; url = ""
Modified: trunk/app/views/blobs/_blob.rhtml (2876 => 2877)
--- trunk/app/views/blobs/_blob.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/blobs/_blob.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -23,10 +23,10 @@
</tr>
<tr>
<td colspan="2">
- <% if Authorization.is_authorized?('download', nil, blob, current_user) %><%= icon "download", download_file_path(blob) %> <% end %>
- <% if Authorization.is_authorized?('show', nil, blob, current_user) %><%= icon "show", file_path(blob), nil, nil, "View" %> <% end %>
- <% if logged_in? and Authorization.is_authorized?('edit', nil, blob, current_user) %><%= icon "edit", edit_file_path(blob) %> <% end %>
- <% if logged_in? and blob.owner?(current_user) %><%= icon "destroy", file_path(blob), nil, :confirm => 'Are you sure?', :method => :delete %><% end %>
+ <% if Authorization.is_authorized?('download', nil, blob, current_user) %><%= icon "download", download_blob_path(blob) %> <% end %>
+ <% if Authorization.is_authorized?('show', nil, blob, current_user) %><%= icon "show", blob_url(blob), nil, nil, "View" %> <% end %>
+ <% if logged_in? and Authorization.is_authorized?('edit', nil, blob, current_user) %><%= icon "edit", edit_blob_path(blob) %> <% end %>
+ <% if logged_in? and blob.owner?(current_user) %><%= icon "destroy", blob_path(blob), nil, :confirm => 'Are you sure?', :method => :delete %><% end %>
</td>
</tr>
</table>
Modified: trunk/app/views/blobs/_breadcrumbs.rhtml (2876 => 2877)
--- trunk/app/views/blobs/_breadcrumbs.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/blobs/_breadcrumbs.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,4 +1,4 @@
-<li><%= link_to 'Files', files_path -%></li>
+<li><%= link_to 'Files', blobs_path -%></li>
<% if ["show", "new", "edit", "all", "search"].include? controller.action_name.to_s -%>
<li><b>»</b></li>
@@ -8,7 +8,7 @@
<% when "new" %>
<li>Upload File</li>
<% when "edit" %>
- <li><%= link_to "#{contributable_name(@blob.id, 'Blob')}", file_path(@blob) -%></li>
+ <li><%= link_to "#{contributable_name(@blob.id, 'Blob')}", blob_path(@blob) -%></li>
<li><b>»</b></li>
<li>Manage</li>
<% when "all" %>
Modified: trunk/app/views/blobs/_table.rhtml (2876 => 2877)
--- trunk/app/views/blobs/_table.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/blobs/_table.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -22,7 +22,7 @@
<p class="title">
<%= icon "blob", nil, nil, nil, '' %>
<% title = contributable_name(blob.id, 'Blob') %>
- <%=link_to(query ? highlight_all(title, query) : title, file_path(blob)) %>
+ <%=link_to(query ? highlight_all(title, query) : title, blob_path(blob)) %>
</p>
<p style="font-size: 85%; margin-top: 0; padding-top: 0;">
@@ -79,14 +79,14 @@
<p style="font-size:85%;"><b>File type: </b><%= h blob.content_type.title %></p>
<p style="font-size: 85%;">
- <a href="" file_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
- <a href="" file_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
+ <a href="" blob_path(blob) + '#ratings' -%>"><b>Rating: </b><%= number_with_precision(blob.rating, :precision => 1) %> / 5 (<%= pluralize blob.ratings.count, 'rating' %>)</a> |
+ <a href="" blob_path(blob) + '#comments' -%>"><b>Comments: </b><%= blob.comments.count %></a> |
<b>Viewed:</b> <%=pluralize blob.contribution.site_viewings_count, "time" %> |
<b>Downloaded:</b> <%=pluralize blob.contribution.site_downloads_count, "time" %>
</p>
<% unless (tags = blob.tags).empty? %>
- <a href="" file_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+ <a href="" blob_path(blob) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
<% else %>
<p style="font-size: 85%;"><i>This File has no tags!</i></p>
@@ -95,9 +95,9 @@
<% end %>
<td class="actions" style="width: 80px;">
- <%= icon "show", file_path(blob), nil, nil, "View" %>
- <% if Authorization.is_authorized?("download", nil, blob, current_user) %><%= icon "download", download_file_path(blob) %><% end %>
- <% if mine?(blob) %><%= icon "manage", edit_file_path(blob), nil, nil, "Manage" %><% end %>
+ <%= icon "show", blob_path(blob), nil, nil, "View" %>
+ <% if Authorization.is_authorized?("download", nil, blob, current_user) %><%= icon "download", download_blob_path(blob) %><% end %>
+ <% if mine?(blob) %><%= icon "manage", edit_blob_path(blob), nil, nil, "Manage" %><% end %>
</td>
</tr>
<% end %>
Modified: trunk/app/views/blobs/edit.rhtml (2876 => 2877)
--- trunk/app/views/blobs/edit.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/blobs/edit.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -7,7 +7,7 @@
<%= error_messages_for :blob %>
-<% form_for(:blob, :url ="" file_path(@blob), :html => { :method => :put }) do |f| %>
+<% form_for(:blob, :url ="" blob_path(@blob), :html => { :method => :put }) do |f| %>
<p style="text-align: center;">
<strong>Title: </strong>
@@ -38,7 +38,7 @@
<p>
<center>
<%= submit_tag "Update",:disable_with => "Updating..." %>
- or <%= link_to "Cancel", file_path(@blob) %>
+ or <%= link_to "Cancel", blob_path(@blob) %>
</center>
</p>
<% end %>
Modified: trunk/app/views/blobs/show.rhtml (2876 => 2877)
--- trunk/app/views/blobs/show.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/blobs/show.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -2,10 +2,10 @@
<ul class="sectionIcons">
<% if mine?(@blob) -%>
- <li><%= icon('manage', edit_file_path(@blob), nil, nil, 'Manage File Entry')%></li>
+ <li><%= icon('manage', edit_blob_path(@blob), nil, nil, 'Manage File Entry')%></li>
<% end -%>
<% if Authorization.is_authorized?('destroy', nil, @blob, current_user) %>
- <li><%= icon('destroy', file_path(@blob), nil, { :confirm => 'This deletes the File and all metadata such as tags, comments and ratings. Are you sure?', :method => :delete }, 'Delete File Entry') %></li>
+ <li><%= icon('destroy', blob_path(@blob), nil, { :confirm => 'This deletes the File and all metadata such as tags, comments and ratings. Are you sure?', :method => :delete }, 'Delete File Entry') %></li>
<% end %>
</ul>
@@ -50,14 +50,14 @@
<span class="title"><%=h @blob.title %></span>
</p>
- <p>
- <b>File name:</b>
- <%=h @blob.local_name %>
+ <p>
+ <b>File name:</b>
+ <%=h @blob.local_name %>
</p>
-
- <p>
- <b>File type:</b>
- <%=h @blob.content_type.title %>
+
+ <p>
+ <b>File type:</b>
+ <%=h @blob.content_type.title %>
</p>
<br/>
@@ -104,14 +104,14 @@
<%= render :partial => "contributions/license_box", :locals => { :contributable => @blob } %>
- <%= render :partial => "contributions/credits_attributions_box", :locals => { :contributable => @blob, :edit_path => edit_file_path(@blob) } %>
+ <%= render :partial => "contributions/credits_attributions_box", :locals => { :contributable => @blob, :edit_path => edit_blob_path(@blob) } %>
<%= render :partial => "contributions/curation_box", :locals => { :contributable => @blob } %>
<%= render :partial => "tags/tags_box", :locals => { :taggable => @blob,
:owner_id => ((@blob.contributor_type == 'User') ? @blob.contributor_id : nil),
- :add_path => tag_file_path(@blob),
- :edit_path => edit_file_path(@blob),
+ :add_path => tag_blob_path(@blob),
+ :edit_path => edit_blob_path(@blob),
:allow_edit => Authorization.is_authorized?('edit', nil, @blob, current_user) } %>
<%= render :partial => "contributions/shared_with_groups_box", :locals => { :contributable => @blob } %>
@@ -123,8 +123,8 @@
<%= render :partial => "contributions/attributed_by", :locals => { :contributable => @blob } %>
<%= render :partial => "contributions/favourited_box", :locals => { :contributable => @blob,
- :add_to_favourites_path => favourite_file_url(@blob),
- :remove_from_favourites_path => favourite_delete_file_url(@blob) } %>
+ :add_to_favourites_path => favourite_blob_url(@blob),
+ :remove_from_favourites_path => favourite_delete_blob_url(@blob) } %>
<%= render :partial => "contributions/statistics_box", :locals => { :contributable => @blob } %>
</div>
@@ -149,7 +149,7 @@
<% if Authorization.is_authorized?('edit', nil, @blob, current_user) %>
<ul class="sectionIcons">
- <li><%= icon('edit', edit_file_path(@blob), nil, nil, 'Edit')%></li>
+ <li><%= icon('edit', edit_blob_path(@blob), nil, nil, 'Edit')%></li>
</ul>
<% end %>
</div>
Modified: trunk/app/views/contributions/_contributor_form.rhtml (2876 => 2877)
--- trunk/app/views/contributions/_contributor_form.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/contributions/_contributor_form.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -17,7 +17,7 @@
<p>
<b>Administrator of...</b><br/>
<% for n in user.networks_owned %>
- <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), group_path(n) %><br/>
+ <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), network_path(n) %><br/>
<% end %>
</p>
<% end %>
@@ -25,7 +25,7 @@
<p>
<b>Member of..</b><br/>
<% for n in user.networks %>
- <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), group_path(n) %><br/>
+ <%= f.radio_button(:class_id, "Network-#{n.id}", { :checked => (current.class.to_s == "Network" and current.id.to_i == n.id) }) %> - <%= link_to h(n.title), network_path(n) %><br/>
<% end %>
</p>
<% end %>
Modified: trunk/app/views/contributions/_sharing_form.rhtml (2876 => 2877)
--- trunk/app/views/contributions/_sharing_form.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/contributions/_sharing_form.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -140,48 +140,49 @@
<% end %>
<br/>
-
- <!-- Explicit Group Permissions -->
- <p><strong>Share with my Groups:</strong></p>
- <div id="group_sharing_box" class="box_editing" style="padding-left: 1em; font-size: 93%;">
- <% applicable_networks = (current_user.networks + current_user.networks_owned) %>
- <% applicable_networks.each do |n| %>
- <p>
- <% perm = find_permission_for_contributor(perms, "Network", n.id) if edit -%>
- <label for="" n.id %>">
- <input class="group_sharing" <%= 'checked' if perm %> style="margin-right: 0.3em;"
- value="<%= n.id %>" type="checkbox" name="group_sharing[<%= n.id %>][id]" id="cb_group_sharing_<%= n.id %>"
- this.checked);"/>
- <%= h(n.title) %>
- </label>
- <select name="group_sharing[<%= n.id %>][level]" style="font-size: 85%; margin: 0 0.5em;">
- <option value="0" <%= 'selected="selected"' if perm and perm.level == 0 %>>View only</option>
- <option value="1" <%= 'selected="selected"' if !edit or !perm or (perm and perm.level == 1) %>>View and Download only</option>
- <option value="2" <%= 'selected="selected"' if perm and perm.level == 2 %>>View, Download and Update</option>
- </select>
- </p>
- <% end %>
- <br/>
- <% if %w(Workflow Pack File).include?(c_type) %>
- <div id="layout_options_box">
- <strong>Layout:</strong>
- <div class="box_infotext" style="margin: 1em 0">
- <p>
- One or more of the groups you have elected to share this <%= c_type -%> with have custom layouts specified.
- To apply a group's custom layout to this <%= c_type -%>'s page, choose one from the list below or select
- "Default" to keep the <%= Conf.sitename -%> default layout. This setting can be changed at any time by
- visiting the 'edit' page.
- </p>
+ <% unless (applicable_networks = (current_user.networks + current_user.networks_owned)).empty? %>
+ <!-- Explicit Group Permissions -->
+ <p><strong>Share with my Groups:</strong></p>
+
+ <div id="group_sharing_box" class="box_editing" style="padding-left: 1em; font-size: 93%;">
+ <% applicable_networks.each do |n| %>
+ <p>
+ <% perm = find_permission_for_contributor(perms, "Network", n.id) if edit -%>
+ <label for="" n.id %>">
+ <input class="group_sharing" <%= 'checked' if perm %> style="margin-right: 0.3em;"
+ value="<%= n.id %>" type="checkbox" name="group_sharing[<%= n.id %>][id]" id="cb_group_sharing_<%= n.id %>"
+ this.checked);"/>
+ <%= h(n.title) %>
+ </label>
+ <select name="group_sharing[<%= n.id %>][level]" style="font-size: 85%; margin: 0 0.5em;">
+ <option value="0" <%= 'selected="selected"' if perm and perm.level == 0 %>>View only</option>
+ <option value="1" <%= 'selected="selected"' if !edit or !perm or (perm and perm.level == 1) %>>View and Download only</option>
+ <option value="2" <%= 'selected="selected"' if perm and perm.level == 2 %>>View, Download and Update</option>
+ </select>
+ </p>
+ <% end %>
+ <br/>
+ <% if %w(Workflow Pack File).include?(c_type) %>
+ <div id="layout_options_box">
+ <strong>Layout:</strong>
+ <div class="box_infotext" style="margin: 1em 0">
+ <p>
+ One or more of the groups you have elected to share this <%= c_type -%> with have custom layouts specified.
+ To apply a group's custom layout to this <%= c_type -%>'s page, choose one from the list below or select
+ "Default" to keep the <%= Conf.sitename -%> default layout. This setting can be changed at any time by
+ visiting the 'edit' page.
+ </p>
+ </div>
+ <% selected_option = (Conf.layouts[contributable.contribution.layout]["network_id"] unless
+ contributable.contribution.nil? || contributable.contribution.layout.nil?) %>
+ <%= select_tag "layout", "<option value="">Default</option>" +
+ options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title', selected_option) %>
+ <%# TODO: In Rails 2, have a link that allows a user to preview the selected layout using polymorphic_path %>
</div>
- <% selected_option = (Conf.layouts[contributable.contribution.layout]["network_id"] unless
- contributable.contribution.nil? || contributable.contribution.layout.nil?) %>
- <%= select_tag "layout", "<option value="">Default</option>" +
- options_from_collection_for_select(applicable_networks.select {|n| n.layout_name}, 'id','title', selected_option) %>
- <%# TODO: In Rails 2, have a link that allows a user to preview the selected layout using polymorphic_path %>
- </div>
- <% end %>
- </div>
+ <% end %>
+ </div>
+ <% end %>
</div>
</div>
Modified: trunk/app/views/contributions/_statistics.rhtml (2876 => 2877)
--- trunk/app/views/contributions/_statistics.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/contributions/_statistics.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -9,5 +9,5 @@
<% end -%>
<p style="margin-top: 0.2em;">
- <small>[ <%= link_to "see breakdown", eval("statistics_#{controller_visible_name(type.to_s.pluralize).singularize.downcase}_path(#{contributable.id})") -%> ]</small>
+ <small>[ <%= link_to "see breakdown", polymorphic_url(contributable, :action ="" :statistics) -%> ]</small>
</p>
\ No newline at end of file
Modified: trunk/app/views/gadgets/_asset_manager.rhtml (2876 => 2877)
--- trunk/app/views/gadgets/_asset_manager.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/gadgets/_asset_manager.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -41,10 +41,10 @@
<div class="content">
<ul class="gadget_list">
<% current_user.networks_owned.each do |network_owned| %>
- <li><%= icon "network-owned", nil, nil, nil, "" %> <%= link_to truncate(h(network_owned.title), :length => gadget_characters_limit), group_path(network_owned), :title => tooltip_title_attrib(h(network_owned.title)) %></li>
+ <li><%= icon "network-owned", nil, nil, nil, "" %> <%= link_to truncate(h(network_owned.title), :length => gadget_characters_limit), network_path(network_owned), :title => tooltip_title_attrib(h(network_owned.title)) %></li>
<% end %>
<% current_user.networks.each do |network_member| %>
- <li><%= icon "network-member", nil, nil, nil, "" %> <%= link_to truncate(h(network_member.title), :length => gadget_characters_limit), group_path(network_member), :title => tooltip_title_attrib(h(network_member.title)) %></li>
+ <li><%= icon "network-member", nil, nil, nil, "" %> <%= link_to truncate(h(network_member.title), :length => gadget_characters_limit), network_path(network_member), :title => tooltip_title_attrib(h(network_member.title)) %></li>
<% end %>
</ul>
</div>
Modified: trunk/app/views/group_announcements/_breadcrumbs.rhtml (2876 => 2877)
--- trunk/app/views/group_announcements/_breadcrumbs.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/group_announcements/_breadcrumbs.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,6 +1,6 @@
-<li><%= link_to 'Groups', groups_path -%></li>
+<li><%= link_to 'Groups', networks_path -%></li>
<li><b>»</b></li>
-<li><b><%= link_to h(@group.title), group_path(@group) -%></b></li>
+<li><b><%= link_to h(@group.title), network_path(@group) -%></b></li>
<li><b>»</b></li>
<li><b><%= link_to "Group Announcements", group_announcements_path(@group) -%></b>
Modified: trunk/app/views/home/_latest_comments.rhtml (2876 => 2877)
--- trunk/app/views/home/_latest_comments.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/home/_latest_comments.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -20,7 +20,7 @@
</span>
<div class="box_standout" style="font-size: 85%; margin: 0.4em 2em; padding: 0.2em 0.5em;">
<%= truncate(strip_html(white_list(c.comment)), :length => 150) %>
- <p style="text-align: right;">[ <%= link_to "More", (c.commentable_type == 'Network' ? group_url(c.commentable) + "#comment_#{c.id}" : contributable_url(c.commentable_id, c.commentable_type) + "#comment_#{c.id}") %> ]</p>
+ <p style="text-align: right;">[ <%= link_to "More", (c.commentable_type == 'Network' ? network_url(c.commentable) + "#comment_#{c.id}" : contributable_url(c.commentable_id, c.commentable_type) + "#comment_#{c.id}") %> ]</p>
</div>
<br/>
</li>
Modified: trunk/app/views/home/_latest_groups.rhtml (2876 => 2877)
--- trunk/app/views/home/_latest_groups.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/home/_latest_groups.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -12,7 +12,7 @@
<% if Authorization.is_authorized?("show", nil, g, current_user) %>
<li>
<%= icon('network', nil, nil, 'group icon', '') %>
- <b><%= link_to h(g.title), group_path(g) %></b>
+ <b><%= link_to h(g.title), network_path(g) %></b>
by <b><%= contributor(g.user_id, 'User') %></b>
(<%= timeago_fuzzy g.created_at %>)
</li>
Modified: trunk/app/views/mailer/group_invite_new_user.rhtml (2876 => 2877)
--- trunk/app/views/mailer/group_invite_new_user.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/mailer/group_invite_new_user.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -14,7 +14,7 @@
<% end -%>
You can find out more:
---> about this group : <%= Conf.base_uri + group_path(@group_id) %>
+--> about this group : <%= Conf.base_uri + network_path(@group_id) %>
--> and about me (<%= @name -%>) from my profile page : <%= url_for : false, :controller => 'users', :host => Conf.hostname, :id => @user_id, :action ="" 'show' %>
Modified: trunk/app/views/networks/_banner.rhtml (2876 => 2877)
--- trunk/app/views/networks/_banner.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/_banner.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,10 +1,10 @@
<% owner ||= true %>
<div class="network_banner">
<p>
- <strong><%= link_to h(network.title), group_path(network.id) %></strong>
+ <strong><%= link_to h(network.title), network_path(network.id) %></strong>
<% if logged_in? and network.owner? current_user.id %>
- <%= icon "edit", edit_group_path(network) %>
- <%= icon "destroy", group_path(network), nil, :confirm => "Are you sure?", :method => "destroy" %>
+ <%= icon "edit", edit_network_path(network) %>
+ <%= icon "destroy", network_path(network), nil, :confirm => "Are you sure?", :method => "destroy" %>
<% end %>
</p>
Modified: trunk/app/views/networks/_breadcrumbs.rhtml (2876 => 2877)
--- trunk/app/views/networks/_breadcrumbs.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/_breadcrumbs.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,4 +1,4 @@
-<li><%= link_to 'Groups', groups_path -%></li>
+<li><%= link_to 'Groups', networks_path -%></li>
<% if ["show", "new", "edit", "search", "all", "invite"].include? controller.action_name.to_s -%>
<li><b>»</b></li>
@@ -8,7 +8,7 @@
<% when "new" %>
<li>New Group</li>
<% when "edit" %>
- <li><%= link_to "#{h(@network.title)}", group_path(@network) %></li>
+ <li><%= link_to "#{h(@network.title)}", network_path(@network) %></li>
<li><b>»</b></li>
<li>Manage</li>
<% when "search" %>
@@ -16,7 +16,7 @@
<% when "all" %>
<li>All Groups</li>
<% when "invite" %>
- <li><%= link_to "#{h(@network.title)}", group_path(@network) %></li>
+ <li><%= link_to "#{h(@network.title)}", network_path(@network) %></li>
<li><b>»</b></li>
<li>Invite people to group</li>
<% else %>
Modified: trunk/app/views/networks/_invite.rhtml (2876 => 2877)
--- trunk/app/views/networks/_invite.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/_invite.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -9,7 +9,7 @@
var xmlhttp_<%= n.id %> = new XMLHttpRequest();
var xmlhttp_<%= n.id %>_params = "&user_id=<%= user.id %>&membership[message]=";
- xmlhttp_<%= n.id %>.open('POST', '<%= membership_invite_group_path(n) %>', true);
+ xmlhttp_<%= n.id %>.open('POST', '<%= membership_invite_network_path(n) %>', true);
// Send the proper header information along with the request
xmlhttp_<%= n.id %>.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
Modified: trunk/app/views/networks/_table.rhtml (2876 => 2877)
--- trunk/app/views/networks/_table.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/_table.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -15,7 +15,7 @@
<% else %>
<%= icon "network-member", nil, nil, nil, '' %>
<% end %>
- <%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), group_path(network)) %>
+ <%=link_to(query ? highlight_all(h(network.title), query) : h(network.title), network_path(network)) %>
</p>
<% cache(:controller => 'groups_cache', :action ="" 'listing', :id => network.id) do -%>
<p style="font-size: 85%;">
@@ -51,7 +51,7 @@
<% end -%>
<% unless (tags = network.tags).empty? -%>
- <a href="" group_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
+ <a href="" network_path(network) + '#tags' -%>"><p style="font-size: 85%;"><b>Tags:</b></p></a>
<div style="display:inline;" class="tags_onesize"><%= tag_cloud_from_collection tags, true %></div>
<% else -%>
<p style="font-size: 85%;"><i>This Group has not been tagged yet!</i></p>
@@ -66,15 +66,15 @@
<% end -%>
</td>
<td class="actions">
- <%= icon "show", group_path(network), nil, nil, "View" %>
+ <%= icon "show", network_path(network), nil, nil, "View" %>
<% if mine? network -%>
- <%= icon "manage", edit_group_path(network) %>
+ <%= icon "manage", edit_network_path(network) %>
<% elsif logged_in? %> <!-- admins can't leave the group or request membership! -->
<% if network.member?(current_user.id) %>
<!-- user is not an admin, but a member already -->
<% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", network.id, current_user.id] ) %>
<% if cur_membership %>
- <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + groups_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
+ <%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership) + "?return_to=" + networks_path, nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %>
<% end %>
<% elsif !current_user.membership_pending?(network.id) && !network.invitation_only? %>
<!-- not an admin, not a member yet and hasn't got pending request -->
Modified: trunk/app/views/networks/edit.rhtml (2876 => 2877)
--- trunk/app/views/networks/edit.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/edit.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -6,7 +6,7 @@
<%= error_messages_for :network %>
-<% form_for(:network, :url ="" group_path(@network), :html => { :method => :put }) do |f| %>
+<% form_for(:network, :url ="" network_path(@network), :html => { :method => :put }) do |f| %>
<%= render :partial => "networks/form", :object => f %>
<br/>
Modified: trunk/app/views/networks/index.rhtml (2876 => 2877)
--- trunk/app/views/networks/index.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/index.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,6 +1,6 @@
<ul class="sectionIcons">
- <li><%= icon "network-member", new_group_path, nil, nil, "Create New Group" %></li>
- <li><%= icon "view-all", all_groups_path, nil, nil, "View All Groups" %></li>
+ <li><%= icon "network-member", new_network_path, nil, nil, "Create New Group" %></li>
+ <li><%= icon "view-all", all_networks_path, nil, nil, "View All Groups" %></li>
</ul>
<% cache(:controller => 'groups', :action ="" 'all_tags') do -%>
Modified: trunk/app/views/networks/invite.rhtml (2876 => 2877)
--- trunk/app/views/networks/invite.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/invite.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -1,4 +1,4 @@
-<h1>Invite people to group: <%= link_to @network.title, group_path(@network) -%></h1>
+<h1>Invite people to group: <%= link_to @network.title, network_path(@network) -%></h1>
<p>
Here you can invite users to this group. The options are:<br/>
@@ -28,7 +28,7 @@
Select a name from the list, type in a message to the user and click "Invite".
</p>
- <% form_tag(membership_invite_group_path(@network), :method => :post) do %>
+ <% form_tag(membership_invite_network_path(@network), :method => :post) do %>
<table cellpadding="0" cellspacing="0">
<tr>
<td> </td>
@@ -55,7 +55,7 @@
Type in email addresses you want to send invitations to, personal message to new users and click "Invite".
</p>
- <% form_tag (membership_invite_external_group_path(@network), :method => :post) do %>
+ <% form_tag (membership_invite_external_network_path(@network), :method => :post) do %>
<%= hidden_field_tag "radio_choice", "" -%>
<table>
<tr>
Modified: trunk/app/views/networks/new.rhtml (2876 => 2877)
--- trunk/app/views/networks/new.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/new.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -6,7 +6,7 @@
<%= error_messages_for :network %>
-<% form_for(:network, :url ="" groups_path) do |f| %>
+<% form_for(:network, :url ="" networks_path) do |f| %>
<%= render :partial => "networks/form", :object => f %>
<br/>
Modified: trunk/app/views/networks/show.rhtml (2876 => 2877)
--- trunk/app/views/networks/show.rhtml 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/app/views/networks/show.rhtml 2011-12-09 09:05:00 UTC (rev 2877)
@@ -25,11 +25,11 @@
<% if @network.administrator?(current_user.id) %>
<li><%= icon('announcement', new_group_announcement_path(@network), 'Make a new Group Announcement', nil, 'Make a Group Announcement') -%></li>
- <li><%= icon('network-invite', invite_group_path(@network), 'Invite People', nil, 'Invite People') -%></li>
+ <li><%= icon('network-invite', invite_network_path(@network), 'Invite People', nil, 'Invite People') -%></li>
<% end %>
<% if mine? @network %>
- <li><%= icon('edit', edit_group_path(@network), 'Edit', nil, 'Edit Group') %></li>
- <li><%= icon('destroy', group_path(@network), 'Delete Group', { :confirm => 'Are you sure?', :method => :delete }, 'Delete Group') %></li>
+ <li><%= icon('edit', edit_network_path(@network), 'Edit', nil, 'Edit Group') %></li>
+ <li><%= icon('destroy', network_path(@network), 'Delete Group', { :confirm => 'Are you sure?', :method => :delete }, 'Delete Group') %></li>
<% end %>
</ul>
<% end %>
@@ -142,8 +142,8 @@
<%= render :partial => "tags/tags_box", :locals => { :taggable => @network,
:owner_id => (@network.user_id),
- :add_path => tag_group_path(@network),
- :edit_path => edit_group_path(@network),
+ :add_path => tag_network_path(@network),
+ :edit_path => edit_network_path(@network),
:allow_edit => logged_in? ? @network.user_id == current_user.id : false } %>
<%= render :partial => "announcements", :locals => { :group => @network, :count => 5 } -%>
Modified: trunk/config/routes.rb (2876 => 2877)
--- trunk/config/routes.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/config/routes.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -155,20 +155,20 @@
end
# files (downloadable)
- map.resources :files,
- :controller => :blobs,
+ map.resources :blobs,
+ :as => :files,
:collection => { :search => :get },
:member => { :download => :get,
:statistics => :get,
:favourite => :post,
:favourite_delete => :delete,
:rate => :post,
- :tag => :post } do |file|
+ :tag => :post } do |blob|
# Due to restrictions in the version of Rails used (v1.2.3),
# we cannot have reviews as nested resources in more than one top level resource.
# ie: we cannot have polymorphic nested resources.
- #file.resources :reviews
- file.resources :comments, :collection => { :timeline => :get }
+ #blob.resources :reviews
+ blob.resources :comments, :collection => { :timeline => :get }
end
# blogs
@@ -236,17 +236,17 @@
user.resources :reports, :controller => :user_reports
end
- map.resources :groups,
- :controller => :networks,
+ map.resources :networks,
+ :as => :groups,
:collection => { :all => :get, :search => :get },
:member => { :invite => :get,
:membership_invite => :post,
:membership_invite_external => :post,
:membership_request => :get,
:rate => :post,
- :tag => :post } do |group|
- group.resources :announcements, :controller => :group_announcements
- group.resources :comments, :collection => { :timeline => :get }
+ :tag => :post } do |network|
+ network.resources :group_announcements, :as => :announcements, :name_prefix => nil
+ network.resources :comments, :collection => { :timeline => :get }
end
# The priority is based upon order of creation: first created -> highest priority.
Modified: trunk/lib/rest.rb (2876 => 2877)
--- trunk/lib/rest.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/lib/rest.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -562,8 +562,8 @@
case ob.class.name
when 'Workflow'; return workflow_url(ob)
- when 'Blob'; return file_url(ob)
- when 'Network'; return group_url(ob)
+ when 'Blob'; return blob_url(ob)
+ when 'Network'; return network_url(ob)
when 'User'; return user_url(ob)
when 'Review'; return workflow_review_url(ob.reviewable, ob)
when 'Comment'; return "#{rest_resource_uri(ob.commentable)}/comments/#{ob.id}"
Modified: trunk/test/functional/blobs_controller_test.rb (2876 => 2877)
--- trunk/test/functional/blobs_controller_test.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/test/functional/blobs_controller_test.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -33,7 +33,7 @@
:attributions_files => ''
assert_equal old_count+1, Blob.count
- assert_redirected_to file_path(assigns(:blob))
+ assert_redirected_to blob_path(assigns(:blob))
end
def test_should_show_blob
@@ -56,7 +56,7 @@
:attributions_workflows => '',
:attributions_files => ''
- assert_redirected_to file_path(assigns(:blob))
+ assert_redirected_to blob_path(assigns(:blob))
end
def test_should_destroy_blob
@@ -66,6 +66,6 @@
delete :destroy, :id => 1
assert_equal old_count-1, Blob.count
- assert_redirected_to files_path
+ assert_redirected_to blobs_path
end
end
Modified: trunk/test/functional/group_announcements_controller_test.rb (2876 => 2877)
--- trunk/test/functional/group_announcements_controller_test.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/test/functional/group_announcements_controller_test.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -5,13 +5,13 @@
fixtures :group_announcements, :networks, :users
def test_should_get_index
- get :index, :group_id => networks(:dilbert_appreciation_network).id
+ get :index, :network_id => networks(:dilbert_appreciation_network).id
assert_response :success
end
def test_should_get_new
login_as(:john)
- get :new, :group_id => networks(:dilbert_appreciation_network).id
+ get :new, :network_id => networks(:dilbert_appreciation_network).id
assert assigns(:announcement)
assert_response :success
end
@@ -20,7 +20,7 @@
old_count = GroupAnnouncement.count
login_as(:john)
- post :create, :group_id => networks(:dilbert_appreciation_network).id, :announcement => { :title => 'MyAnnouncement', :body => 'Announcement body', :public => '1' }
+ post :create, :network_id => networks(:dilbert_appreciation_network).id, :announcement => { :title => 'MyAnnouncement', :body => 'Announcement body', :public => '1' }
assert_equal old_count+1, GroupAnnouncement.count
assert assigns(:announcement)
@@ -28,19 +28,19 @@
end
def test_should_show_group_announcement
- get :show, :group_id => networks(:dilbert_appreciation_network).id, :id => group_announcements(:dilbert_network_public_announcement).id
+ get :show, :network_id => networks(:dilbert_appreciation_network).id, :id => group_announcements(:dilbert_network_public_announcement).id
assert_response :success
end
def test_should_get_edit
login_as(:john)
- get :edit, :group_id => networks(:dilbert_appreciation_network).id, :id => 1
+ get :edit, :network_id => networks(:dilbert_appreciation_network).id, :id => 1
assert_response :success
end
def test_should_update_group_announcement
login_as(:john)
- put :update, :group_id => networks(:dilbert_appreciation_network).id, :id => 1, :announcement => { :title => 'MyNewTitle' }
+ put :update, :network_id => networks(:dilbert_appreciation_network).id, :id => 1, :announcement => { :title => 'MyNewTitle' }
assert_redirected_to group_announcement_path(networks(:dilbert_appreciation_network).id, assigns(:announcement))
end
@@ -48,7 +48,7 @@
old_count = GroupAnnouncement.count
login_as(:john)
- delete :destroy, :group_id => networks(:dilbert_appreciation_network).id, :id => 1
+ delete :destroy, :network_id => networks(:dilbert_appreciation_network).id, :id => 1
assert_equal old_count-1, GroupAnnouncement.count
assert_redirected_to group_announcements_path(networks(:dilbert_appreciation_network).id)
Modified: trunk/test/functional/memberships_controller_test.rb (2876 => 2877)
--- trunk/test/functional/memberships_controller_test.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/test/functional/memberships_controller_test.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -62,7 +62,7 @@
login_as(:john)
delete :destroy, :id => networks(:another_network).id, :user_id => users(:john).id
- assert_redirected_to group_path(networks(:another_network).id )
+ assert_redirected_to network_path(networks(:another_network).id )
assert_equal old_count-1, Membership.count
end
Modified: trunk/test/functional/networks_controller_test.rb (2876 => 2877)
--- trunk/test/functional/networks_controller_test.rb 2011-12-08 15:55:57 UTC (rev 2876)
+++ trunk/test/functional/networks_controller_test.rb 2011-12-09 09:05:00 UTC (rev 2877)
@@ -29,7 +29,7 @@
post :create, :network => { :user_id => '990', :title => 'test network', :unique_name => 'test_network', :new_member_policy => 'open', :description => "..." }
assert_equal old_count+1, Network.count
- assert_redirected_to group_path(assigns(:network))
+ assert_redirected_to network_path(assigns(:network))
end
def test_should_show_network
@@ -49,7 +49,7 @@
put :update, :id => 1,
:network => { :user_id => '990', :title => 'test network', :unique_name => 'update_network', :new_member_policy => 'open', :description => ".?."}
- assert_redirected_to group_path(assigns(:network))
+ assert_redirected_to network_path(assigns(:network))
end
def test_should_destroy_network
@@ -59,6 +59,6 @@
delete :destroy, :id => 1
assert_equal old_count-1, Network.count
- assert_redirected_to groups_path
+ assert_redirected_to networks_path
end
end