myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2102] trunk: removed unused routes, fixed avatar


From: noreply
Subject: [myexperiment-hackers] [2102] trunk: removed unused routes, fixed avatar urls and fixed some public views where current_user == 0
Date: Fri, 13 Feb 2009 07:53:40 -0500 (EST)

Revision
2102
Author
dgc
Date
2009-02-13 07:53:39 -0500 (Fri, 13 Feb 2009)

Log Message

removed unused routes, fixed avatar urls and fixed some public views where current_user == 0

Modified Paths

Diff

Modified: trunk/app/controllers/application.rb (2101 => 2102)


--- trunk/app/controllers/application.rb	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/controllers/application.rb	2009-02-13 12:53:39 UTC (rev 2102)
@@ -84,7 +84,7 @@
     #
     # however, if there are newer versions of contributable (uploaded not by the original uploader),
     # we do want to record viewings/downloads of this newer version by the original uploader  
-    if allow_logging 
+    if allow_logging && current_user != 0
       allow_logging = false if (contributable_or_version.contributor_type == "User" && contributable_or_version.contributor_id == current_user.id)
     end
     

Modified: trunk/app/helpers/application_helper.rb (2101 => 2102)


--- trunk/app/helpers/application_helper.rb	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/helpers/application_helper.rb	2009-02-13 12:53:39 UTC (rev 2102)
@@ -154,10 +154,14 @@
   end
   
   def avatar_url(picture_id, size=200)
-    url_for(:controller => 'pictures',
+    url = "" => 'pictures',
             :action ="" 'show',
             :id => picture_id,
             :size => "#{size}x#{size}")
+
+    # icky url fix - the Rails 1 automatic extension adding code doesn't take
+    # URL queries into account
+    url.sub('?', '.jpg?')
   end
   
   def null_avatar(size=200, alt="Anonymous")

Modified: trunk/app/views/group_announcements/_table.rhtml (2101 => 2102)


--- trunk/app/views/group_announcements/_table.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/group_announcements/_table.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -30,7 +30,7 @@
 					</td>
 			    <td class="actions"  style="width: 80px;">
 		      	<%= icon "show", group_announcement_path(group, announcement), nil, nil, "View" %>
-						<% if group.owner?(current_user.id) %>
+						<% if (current_user != 0) && (group.owner?(current_user.id)) %>
 							<%= icon('edit', edit_group_announcement_path(group, announcement), nil, nil, 'Edit') %>
 							<%= icon("destroy", group_announcement_path(group, announcement), "Delete", :confirm => "Are you sure you want to delete this announcement?", :method => :delete) %>
 						<% end %>

Modified: trunk/app/views/group_announcements/index.rhtml (2101 => 2102)


--- trunk/app/views/group_announcements/index.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/group_announcements/index.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -1,4 +1,4 @@
-<% if @group.owner?(current_user.id) %>
+<% if (current_user != 0) && @group.owner?(current_user.id) %>
 	<ul class="sectionIcons">
 	  <li><%= icon('announcement', new_group_announcement_path, nil, nil, 'New Announcement') %></li>
 	</ul>
@@ -15,4 +15,4 @@
 	<%= render :partial => "networks/table", :locals => { :collection => [ @group ] } %>
 </div>
 
-<%= render :partial => "group_announcements/table", :locals => { :collection => @announcements, :group => @group } %>
\ No newline at end of file
+<%= render :partial => "group_announcements/table", :locals => { :collection => @announcements, :group => @group } %>

Modified: trunk/app/views/group_announcements/show.rhtml (2101 => 2102)


--- trunk/app/views/group_announcements/show.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/group_announcements/show.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -1,6 +1,6 @@
 <ul class="sectionIcons">
   <li><%= icon('announcement', group_announcements_path(@group), "Return to All Announcements", nil, 'Return to All Announcements') %></li>
-	<% if @group.owner?(current_user.id) %>
+	<% if (current_user != 0) && @group.owner?(current_user.id) %>
 	  <li><%= icon('edit', edit_group_announcement_path(@group, @announcement), nil, nil, 'Edit') %></li>
 		<li>
 			<%= icon('destroy', group_announcement_path(@group, @announcement), 'Delete', { :confirm => 'Are you sure you want to delete this announcement?', :method => :delete }, 'Delete') %>
@@ -45,4 +45,4 @@
 	<div class="message">
 		<%=white_list @announcement.body_html %>
 	</div>
-</div>
\ No newline at end of file
+</div>

Modified: trunk/app/views/networks/_announcements.rhtml (2101 => 2102)


--- trunk/app/views/networks/_announcements.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/networks/_announcements.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -31,10 +31,10 @@
 			<p class="none_text">None</p>
 		<% end %>
 		<p style="font-size: 77%; text-align: center;">
-			<% if group.owner?(current_user.id) %>
+			<% if (current_user != 0) && group.owner?(current_user.id) %>
 				[ <%= link_to "New", new_group_announcement_url(group) %> ]
 			<% end %>
 			[ <%= link_to "See All", group_announcements_url(group) %> ]
 		</p>
 	</div>
-</div>
\ No newline at end of file
+</div>

Modified: trunk/app/views/networks/_table.rhtml (2101 => 2102)


--- trunk/app/views/networks/_table.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/networks/_table.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -10,7 +10,7 @@
 					</td>
 					<td style="text-align: left;">
 						<p class="title">
-							<% if network.user_id == current_user.id %>
+							<% if (current_user != 0) && (network.user_id == current_user.id) %>
 								<%= icon "network-owned", nil, nil, nil, '' %>
 							<% else %>
 								<%= icon "network-member", nil, nil, nil, '' %>

Modified: trunk/app/views/pictures/index.rhtml (2101 => 2102)


--- trunk/app/views/pictures/index.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/pictures/index.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -33,11 +33,7 @@
       <% if false %>
         <%= image_tag(url_for_file_column(picture, "data", "large")) %>
       <% end %>
-      <%= image_tag (url_for :controller => 'pictures',
-                             :action     ="" 'show',
-                             :id         => picture.id,
-                             :size       => '100x100' ),
-										:class => 'framed' %>
+      <%= image_tag avatar_url(picture.id, 100), :class => 'framed' %>
     </td>
     <td class="actions">
       <% if my_page? picture.user_id %>
@@ -57,4 +53,4 @@
 
 <% end %>
 
-<br />
\ No newline at end of file
+<br />

Modified: trunk/app/views/profiles/_form.rhtml (2101 => 2102)


--- trunk/app/views/profiles/_form.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/profiles/_form.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -23,7 +23,7 @@
     <% pictures.each do |p| %>
       <li>
         <center>
-        	<%= image_tag(url_for(:controller => 'pictures', :action  ="" 'show', :id => p.id, :size => '60x60')) %>
+        	<%= image_tag(avatar_url(p.id, 60)) %>
 					<br/>
 					<%= form.radio_button :picture_id, p.id %>
 				</center>

Modified: trunk/app/views/users/_table.rhtml (2101 => 2102)


--- trunk/app/views/users/_table.rhtml	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/app/views/users/_table.rhtml	2009-02-13 12:53:39 UTC (rev 2102)
@@ -77,7 +77,7 @@
 				       	<%= icon "edit", edit_user_path(user), nil, nil, "Edit" %>
 						  <% else %>
 							  <!-- check if the profile that we are viewing now is a friend of current user -> stored for better performance -->
-			          <% this_user_is_friend_of_current_user = user.friend?(current_user.id) %>
+			          <% this_user_is_friend_of_current_user = (current_user != 0) && user.friend?(current_user.id) %>
 								<% unless !logged_in? || this_user_is_friend_of_current_user || current_user.friendship_pending?(user.id) %>
 							  	<%= icon "friendship", new_user_friendship_url(:user_id => user.id), nil, nil, "Request Friendship" %>
 							  <% end %>

Modified: trunk/config/routes.rb (2101 => 2102)


--- trunk/config/routes.rb	2009-02-13 11:26:25 UTC (rev 2101)
+++ trunk/config/routes.rb	2009-02-13 12:53:39 UTC (rev 2102)
@@ -191,13 +191,6 @@
   # -- just remember to delete public/index.html.
 #  map.connect '', :controller => 'users'
 
-  # Allow downloading Web Service WSDL as a file with an extension
-  # instead of a file named 'wsdl'
-  map.connect ':controller/service.wsdl', :action ="" 'wsdl'
-  
-  # Sitealizer
-  map.connect '/sitealizer/:action', :controller => 'sitealizer'
-
   # Explicit redirections
   map.connect 'exercise', :controller => 'redirects', :action ="" 'exercise'
   map.connect 'google', :controller => 'redirects', :action ="" 'google'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]