summaryrefslogtreecommitdiff
path: root/app/views/snippets/show.html.haml
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 11:46:21 +0500
committerNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 11:46:21 +0500
commit8e1e17763f169f63dc99c7a0f109fe98c87b4064 (patch)
tree7be09d97cfecfa9b0158da2cf08675580b14f4e1 /app/views/snippets/show.html.haml
parent117d1e90fdef3aaf64901ba18a5ce5bab4c668d8 (diff)
downloadgitlab-ce-8e1e17763f169f63dc99c7a0f109fe98c87b4064.tar.gz
implement snippets lifetime
Diffstat (limited to 'app/views/snippets/show.html.haml')
-rw-r--r--app/views/snippets/show.html.haml40
1 files changed, 22 insertions, 18 deletions
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index 899950b7c36..bfa1bf456e3 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -1,22 +1,26 @@
-%h2
- = "Snippet ##{@snippet.id} - #{@snippet.title}"
+- if !@snippet.expired?
+ %h2
+ = "Snippet ##{@snippet.id} - #{@snippet.title}"
-.view_file
- .view_file_header
- %strong
- = @snippet.file_name
- %br/
- .view_file_content
- :erb
- <%= raw @snippet.colorize %>
+ .view_file
+ .view_file_header
+ %strong
+ = @snippet.file_name
+ %br/
+ .view_file_content
+ :erb
+ <%= raw @snippet.colorize %>
-- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
- = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
-- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
- = link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
-.clear
-%br
-.snippet_notes= render "notes/notes"
+ - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
+ = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
+ - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
+ = link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
+ .clear
+ %br
+ .snippet_notes= render "notes/notes"
-.clear
+ .clear
+- else
+ %h2
+ Sorry, this snipped is no longer exists