summaryrefslogtreecommitdiff
path: root/app/views/snippets
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-18 21:34:07 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-18 21:34:07 +0200
commit8841eec426d7213de6cc381b0898be1a14e418e5 (patch)
treea8cadf2213ab903d325fb655a7f6c47db552aa21 /app/views/snippets
parent6d125d477169f93834a1b6a78da39baa77f41968 (diff)
downloadgitlab-ce-8841eec426d7213de6cc381b0898be1a14e418e5.tar.gz
Improve snippets UX
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/snippets')
-rw-r--r--app/views/snippets/_form.html.haml20
-rw-r--r--app/views/snippets/_snippet.html.haml2
2 files changed, 17 insertions, 5 deletions
diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml
index e77550e7be3..517c81fae8d 100644
--- a/app/views/snippets/_form.html.haml
+++ b/app/views/snippets/_form.html.haml
@@ -13,9 +13,20 @@
= f.label :title
.controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.control-group
- = f.label "Private?"
+ = f.label "Access"
.controls
- = f.check_box :private, {class: ''}
+ = f.label :private_true, class: 'radio-label' do
+ = f.radio_button :private, true
+ %span
+ %strong Private
+ (only you can see this snippet)
+ %br
+ = f.label :private_false, class: 'radio-label' do
+ = f.radio_button :private, false
+ %span
+ %strong Public
+ (GitLab users can can see this snippet)
+
.control-group
.file-editor
= f.label :file_name, "File"
@@ -33,9 +44,10 @@
- else
= f.submit 'Save', class: "btn-save btn"
- = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"
- 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}"
+ .pull-right.prepend-left-20
+ = link_to 'Remove', snippet_path(@snippet), confirm: 'Removed snippet cannot be restored! Are you sure?', method: :delete, class: "btn btn-remove delete-snippet", id: "destroy_snippet_#{@snippet.id}"
+ = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"
:javascript
diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml
index 8514bc3ddd0..a50d813825f 100644
--- a/app/views/snippets/_snippet.html.haml
+++ b/app/views/snippets/_snippet.html.haml
@@ -3,7 +3,7 @@
= link_to reliable_snippet_path(snippet) do
= truncate(snippet.title, length: 60)
- if snippet.private?
- %span.label.label-success
+ %span.label.label-gray
%i.icon-lock
private
%span.cgray.monospace.tiny.pull-right