snippets are ready
This commit is contained in:
parent
526ad466c8
commit
9265de3d25
28 changed files with 366 additions and 8 deletions
22
app/views/snippets/show.html.haml
Normal file
22
app/views/snippets/show.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
%h2
|
||||
= "Snippet ##{@snippet.id} - #{@snippet.title}"
|
||||
|
||||
.view_file
|
||||
.view_file_header
|
||||
%strong
|
||||
= @snippet.file_name
|
||||
%br/
|
||||
.view_file_content
|
||||
- ft = handle_file_type(@snippet.file_name)
|
||||
:erb
|
||||
<%= raw Albino.colorize(@snippet.content, ft, :html, 'utf-8', "linenos=True") %>
|
||||
|
||||
- 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}"
|
||||
%br
|
||||
.snippet_notes= render "notes/notes"
|
||||
|
||||
.clear
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue