Skip to content

Commit

Permalink
handle displaying credentials properly
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblum committed Feb 13, 2009
1 parent 984ec0c commit 0ce04a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/controllers/apps_controller.rb
Expand Up @@ -33,7 +33,7 @@ def index
flash[:notice]="You have no existing apps"
end
apps=App.find :all
@subapps=apps.reject { |app| !app.anonymous and !current_user.apps.index(app) }
@subapps=apps.reject { |app| !app.anonymous and !@current_user.apps.index(app) }

respond_to do |format|
format.html # index.html.erb
Expand Down
25 changes: 10 additions & 15 deletions app/views/apps/index.html.erb
Expand Up @@ -32,26 +32,21 @@
<th>Credentials</th>
</tr>
<%for app in @subapps %>
<%if @current_user.login="anonymous" and app.anonymous %>
<td><%=link_to app.name, edit_app_path(app) %></td>
<td><%=h app.description %></td>
<%end%>
<%if @current_user.login!="anonymous" %>
<tr>
<td><%=link_to app.name, edit_app_path(app)%></td>
<td><%=h app.description %></td>
<td><%=h app.description %></td>
<%if !app.anonymous %>
<%sub=Membership.find_by_app_id_and_user_id app.id,@current_user.id%>
<%if sub and sub.credential%>
<td>
<%=link_to "Edit", {:action=>"getcred",:id=>app.id,:sub_id=>sub.id}%>
<%else%>
<%=link_to "Create",{:action=>"getcred",:id=>app.id,:sub_id=>sub.id}%>
</td>
<%if sub and sub.credential %>
<td>
<%=link_to "Edit", {:action=>"getcred",:id=>app.id,:sub_id=>sub.id}%>
<%else%>
<%=link_to "Create",{:action=>"getcred",:id=>app.id,:sub_id=>sub.id}%>
</td>
<%end%>
<%end%>
</tr>
<%end%>
<%end%>
<%else%>
You have no subscribed apps.
Expand Down

0 comments on commit 0ce04a9

Please sign in to comment.