Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
hiding admin functionality from non-owhers
Browse files Browse the repository at this point in the history
  • Loading branch information
kellishaver committed Oct 19, 2008
1 parent a5c6098 commit cbe0172
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/views/code_snippets/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Code: (<%= current_project.code_snippets.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_code_btn.png", :alt=>"New Code Snippet"), new_project_code_snippet_path(project_param) %></span></h2>
<h2><span>Code: (<%= current_project.code_snippets.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_code_btn.png", :alt=>"New Code Snippet"), new_project_code_snippet_path(project_param) %></span><% end %></h2>
<ul class="linklist">
<%
if current_project.code_snippets.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/code_snippets/index.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Browsing Code Snippets for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_code_btn.png", :alt=>"New Code Snippet"), new_project_code_snippet_path(project_param) %>
<% if owner? %><%= link_to image_tag("/images/new_code_btn.png", :alt=>"New Code Snippet"), new_project_code_snippet_path(project_param) %><% end %>
<ul class="linklist">
<%
if current_project.code_snippets.count > 0
Expand Down
4 changes: 2 additions & 2 deletions app/views/code_snippets/show.html.erb
Expand Up @@ -3,10 +3,10 @@
<div id="left_col">
<% title "Code Snippet: " + @code_snippet.name %>
<h1><%= yield(:title) %></h1>
<p>
<% if owner? %><p>
<%= link_to image_tag("/images/edit_code_btn.png", :alt => "Edit Code"), edit_project_code_snippet_path(project_param, @code_snippet) %>
<%= link_to image_tag("/images/delete_code_btn.png", :alt => "Delete Code"), [current_project, @code_snippet], :confirm => 'Are you sure?', :method => :delete %>
</p>
</p><% end %>
<p>
<strong>Project:</strong>
<%=h @code_snippet.project.name %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/links/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Links: (<%= current_project.links.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_link_btn.png", :alt=>"New Link"), new_project_link_path(project_param) + "?width=630&height=250", :class => "thickbox" %></span></h2>
<h2><span>Links: (<%= current_project.links.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_link_btn.png", :alt=>"New Link"), new_project_link_path(project_param) + "?width=630&height=250", :class => "thickbox" %></span><% end %></h2>
<ul class="linklist">
<%
if current_project.links.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/links/index.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Browse Links for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_link_btn.png", :alt=>"New Link"), new_project_link_path(project_param) + "?width=630&height=250", :class => "thickbox" %>
<% if owner? %><%= link_to image_tag("/images/new_link_btn.png", :alt=>"New Link"), new_project_link_path(project_param) + "?width=630&height=250", :class => "thickbox" %> <% end %>
<ul class="linklist managelist">
<%
if current_project.links.count > 0
Expand Down
4 changes: 2 additions & 2 deletions app/views/notes/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Notes: (<%= current_project.notes.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_note_btn.png", :alt=>"New Note"), new_project_note_path(project_param) %></span></h2>
<div class="item">
<h2><span>Notes: (<%= current_project.notes.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_note_btn.png", :alt=>"New Note"), new_project_note_path(project_param) %></span><% end %></h2>
<ul class="linklist">
<%
if current_project.notes.count > 0
Expand Down
4 changes: 3 additions & 1 deletion app/views/notes/index.html.erb
@@ -1,7 +1,9 @@
<div id="left_col">
<% title "Browse Notes for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_note_btn.png", :alt=>"New Note"), new_project_note_path(project_param) %>
<% if owner? %>
<%= link_to image_tag("/images/new_note_btn.png", :alt=>"New Note"), new_project_note_path(project_param) %>
<% end %>
<ul class="linklist">
<%
if current_project.notes.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/palettes/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Palettes: (<%= current_project.palettes.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_palette_btn.png", :alt=>"New Palette"), new_project_palette_path(project_param) %></span></h2>
<h2><span>Palettes: (<%= current_project.palettes.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_palette_btn.png", :alt=>"New Palette"), new_project_palette_path(project_param) %></span><% end %></h2>
<ul class="linklist">
<%
if current_project.palettes.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/palettes/index.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Browse Palettes for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_palette_btn.png", :alt=>"New Palette"), new_project_palette_path(project_param) %>
<% if owner? %><%= link_to image_tag("/images/new_palette_btn.png", :alt=>"New Palette"), new_project_palette_path(project_param) %><% end %>
<ul class="linklist">
<%
if current_project.palettes.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/photos/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Photos: (<%= current_project.photos.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %></span></h2>
<h2><span>Photos: (<%= current_project.photos.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %></span><% end %></h2>
<%
if current_project.photos.count > 0
for photo in current_project.photos.recent(3) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/photos/index.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Browse Photos for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class=> "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %>
<% if owner? %><%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class=> "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %><% end %>
<br /><br />
<%
if current_project.photos.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/photos/manage.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Manage Photos for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class=> "thickbox" %>
<% if owner? %><%= link_to image_tag("/images/new_photo_btn.png", :alt=>"New Photo"), new_project_photo_path(project_param) + "?width=510&height=230", :class=> "thickbox" %><% end %>
<ul class="linklist managelist">
<%
if current_project.photos.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/screenshots/_latest.html.erb
@@ -1,5 +1,5 @@
<div class="item">
<h2><span>Photos: (<%= current_project.screenshots.count %>)</span><span class="align_right"><%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %></span></h2>
<h2><span>Photos: (<%= current_project.screenshots.count %>)</span><% if owner? %><span class="align_right"><%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_photos_path(project_param) %></span><% end %></h2>
<%
if current_project.screenshots.count > 0
for screenshot in current_project.screenshots.recent(3) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/screenshots/index.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Browse Screenshots for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %>
<% if owner? %><%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %><% end %>
<br /><br />
<%
if current_project.screenshots.count > 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/screenshots/manage.html.erb
@@ -1,7 +1,7 @@
<div id="left_col">
<% title "Manage Screenshots for: " + current_project.name %>
<h1><%= yield(:title) %></h1>
<%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_screenshots_path(project_param) %>
<% if owner? %><%= link_to image_tag("/images/new_screenshot_btn.png", :alt=>"New Screenshot"), new_project_screenshot_path(project_param) + "?width=410&height=230", :class => "thickbox" %> &nbsp; <%= link_to image_tag("/images/manage_btn.png", :alt=>"Manage Photos"), manage_project_screenshots_path(project_param) %><% end %>
<ul class="linklist managelist">
<%
if current_project.screenshots.count > 0
Expand Down

0 comments on commit cbe0172

Please sign in to comment.