2015-09-11 14:41:01 +05:30
|
|
|
- page_title @snippet.title, "Snippets"
|
2015-09-25 12:07:36 +05:30
|
|
|
%h4.page-title
|
2014-09-02 18:07:02 +05:30
|
|
|
= @snippet.title
|
|
|
|
|
|
|
|
- if @snippet.private?
|
|
|
|
%span.label.label-success
|
2015-04-26 12:48:37 +05:30
|
|
|
%i.fa.fa-lock
|
2014-09-02 18:07:02 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
.pull-right
|
2015-09-25 12:07:36 +05:30
|
|
|
= link_to new_snippet_path, class: "btn btn-new btn-sm", title: "New Snippet" do
|
2014-09-02 18:07:02 +05:30
|
|
|
Add new snippet
|
|
|
|
|
2015-09-25 12:07:36 +05:30
|
|
|
.append-bottom-10.prepend-top-10
|
2014-09-02 18:07:02 +05:30
|
|
|
.pull-right
|
|
|
|
%span.light
|
2015-09-25 12:07:36 +05:30
|
|
|
created by
|
2014-09-02 18:07:02 +05:30
|
|
|
= link_to user_snippets_path(@snippet.author) do
|
|
|
|
= @snippet.author_name
|
|
|
|
|
|
|
|
.back-link
|
|
|
|
- if @snippet.author == current_user
|
2015-09-25 12:07:36 +05:30
|
|
|
= link_to dashboard_snippets_path do
|
2015-04-26 12:48:37 +05:30
|
|
|
← your snippets
|
2014-09-02 18:07:02 +05:30
|
|
|
- else
|
2015-09-25 12:07:36 +05:30
|
|
|
= link_to explore_snippets_path do
|
|
|
|
← explore snippets
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
.file-holder
|
|
|
|
.file-title
|
2015-04-26 12:48:37 +05:30
|
|
|
%i.fa.fa-file
|
|
|
|
%strong
|
2014-09-02 18:07:02 +05:30
|
|
|
= @snippet.file_name
|
2015-04-26 12:48:37 +05:30
|
|
|
.file-actions
|
2014-09-02 18:07:02 +05:30
|
|
|
.btn-group
|
2015-09-11 14:41:01 +05:30
|
|
|
- if can?(current_user, :update_personal_snippet, @snippet)
|
2015-04-26 12:48:37 +05:30
|
|
|
= link_to "edit", edit_snippet_path(@snippet), class: "btn btn-sm", title: 'Edit Snippet'
|
|
|
|
= link_to "raw", raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank"
|
2014-09-02 18:07:02 +05:30
|
|
|
- if can?(current_user, :admin_personal_snippet, @snippet)
|
2015-04-26 12:48:37 +05:30
|
|
|
= link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-sm btn-remove", title: 'Delete Snippet'
|
2014-09-02 18:07:02 +05:30
|
|
|
= render 'shared/snippets/blob'
|