summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-07-18 13:08:48 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-07-18 13:08:48 +0300
commitbbb06e504e387762bb5a073d1f0debdc05e03f98 (patch)
tree7c27bb8662bbd3bd0c90bc13290a1171fe804ad0 /app
parent02e39563c8e931c94a650f36d8732beecc068019 (diff)
downloadgitlab-ce-bbb06e504e387762bb5a073d1f0debdc05e03f98.tar.gz
Add seeds and improve ui. Remove snippet expires_at
Diffstat (limited to 'app')
-rw-r--r--app/views/snippets/_form.html.haml9
-rw-r--r--app/views/snippets/_snippet.html.haml26
-rw-r--r--app/views/snippets/_snippets.html.haml2
-rw-r--r--app/views/snippets/show.html.haml25
4 files changed, 36 insertions, 26 deletions
diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml
index 05502503bee..e5c63afe980 100644
--- a/app/views/snippets/_form.html.haml
+++ b/app/views/snippets/_form.html.haml
@@ -16,9 +16,6 @@
= f.label "Private?"
.input= f.check_box :private, {class: ''}
.clearfix
- = f.label "Lifetime"
- .input= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'}
- .clearfix
.file-editor
= f.label :file_name, "File"
.input
@@ -30,7 +27,11 @@
= f.hidden_field :content, class: 'snippet-file-content'
.form-actions
- = f.submit 'Save', class: "btn-save btn"
+ - if @snippet.new_record?
+ = f.submit 'Create snippet', class: "btn-create btn"
+ - else
+ = f.submit 'Save', class: "btn-save btn"
+
= link_to "Cancel", snippets_path(@project), class: " btn"
- unless @snippet.new_record?
.pull-right= link_to 'Destroy', snippet_path(@snippet), confirm: 'Removed snippet cannot be restored! Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}"
diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml
index a013cdfe16a..c96b6f83f0b 100644
--- a/app/views/snippets/_snippet.html.haml
+++ b/app/views/snippets/_snippet.html.haml
@@ -1,13 +1,12 @@
%li
- .snippet-title
- - if snippet.private?
- = private_icon
- - else
- = public_icon
+ %h4.snippet-title
= link_to reliable_snippet_path(snippet) do
- %h5.inline
- = truncate(snippet.title, length: 60)
- %span.cgray
+ = truncate(snippet.title, length: 60)
+ - if snippet.private?
+ %span.label.label-success
+ %i.icon-lock
+ private
+ %span.cgray.monospace.tiny.pull-right
= snippet.file_name
%small.pull-right.cgray
@@ -15,16 +14,11 @@
= link_to snippet.project.name_with_namespace, project_path(snippet.project)
%span
\|
- Expires:
- - if snippet.expires_at
- = snippet.expires_at.to_date.to_s(:short)
- - else
- Never
- .snippet-info.prepend-left-20
+ .snippet-info
= "##{snippet.id}"
- %span.light
+ %span
by
= image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
= snippet.author_name
-
+ %span.light #{time_ago_in_words(snippet.created_at)} ago
diff --git a/app/views/snippets/_snippets.html.haml b/app/views/snippets/_snippets.html.haml
index 636bf37f6d9..05365dd8b88 100644
--- a/app/views/snippets/_snippets.html.haml
+++ b/app/views/snippets/_snippets.html.haml
@@ -4,4 +4,4 @@
%li
%h3.nothing_here_message Nothing here.
-= paginate @snippets
+= paginate @snippets, theme: 'gitlab'
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index b112511a880..811e429d22a 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -1,15 +1,30 @@
%h3.page-title
+ = @snippet.title
+
- if @snippet.private?
- %i{:class => "icon-lock cgreen has_bottom_tooltip", "data-original-title" => "Private snippet"}
- - else
- %i{:class => "icon-globe cblue has_bottom_tooltip", "data-original-title" => "Public snippet"}
+ %span.label.label-success
+ %i.icon-lock
+ private
- = @snippet.title
+ .pull-right
+ = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do
+ Add new snippet
- %small.pull-right
+
+.append-bottom-20
+ .pull-right
= "##{@snippet.id}"
%span.light
by
= image_tag gravatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
= @snippet.author_name
+
+ .back-link
+ - if @snippet.author == current_user
+ = link_to user_snippets_path(current_user) do
+ &larr; my snippets
+ - else
+ = link_to snippets_path do
+ &larr; discover snippets
+
%div= render 'blob'