Commit 8841eec4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve snippets UX

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 6d125d47
...@@ -93,6 +93,12 @@ pre.well-pre { ...@@ -93,6 +93,12 @@ pre.well-pre {
font-size: 12px; font-size: 12px;
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
&.label-gray {
background-color: #eee;
color: #999;
text-shadow: none;
}
} }
/** Big Labels **/ /** Big Labels **/
......
...@@ -3,6 +3,16 @@ form { ...@@ -3,6 +3,16 @@ form {
label { label {
@extend .control-label; @extend .control-label;
&.radio-label {
text-align: left;
width: 100%;
margin-left: 0;
input[type="radio"] {
margin-top: 1px !important;
}
}
} }
} }
......
...@@ -13,9 +13,20 @@ ...@@ -13,9 +13,20 @@
= f.label :title = f.label :title
.controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true .controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.control-group .control-group
= f.label "Private?" = f.label "Access"
.controls .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 .control-group
.file-editor .file-editor
= f.label :file_name, "File" = f.label :file_name, "File"
...@@ -33,9 +44,10 @@ ...@@ -33,9 +44,10 @@
- else - else
= f.submit 'Save', class: "btn-save btn" = f.submit 'Save', class: "btn-save btn"
= link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"
- unless @snippet.new_record? - 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 :javascript
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= link_to reliable_snippet_path(snippet) do = link_to reliable_snippet_path(snippet) do
= truncate(snippet.title, length: 60) = truncate(snippet.title, length: 60)
- if snippet.private? - if snippet.private?
%span.label.label-success %span.label.label-gray
%i.icon-lock %i.icon-lock
private private
%span.cgray.monospace.tiny.pull-right %span.cgray.monospace.tiny.pull-right
......
...@@ -19,7 +19,7 @@ class SnippetsFeature < Spinach::FeatureSteps ...@@ -19,7 +19,7 @@ class SnippetsFeature < Spinach::FeatureSteps
end end
And 'I click link "Destroy"' do And 'I click link "Destroy"' do
click_link "Destroy" click_link "Remove"
end end
And 'I submit new snippet "Personal snippet three"' do And 'I submit new snippet "Personal snippet three"' do
...@@ -46,7 +46,7 @@ class SnippetsFeature < Spinach::FeatureSteps ...@@ -46,7 +46,7 @@ class SnippetsFeature < Spinach::FeatureSteps
end end
And 'I uncheck "Private" checkbox' do And 'I uncheck "Private" checkbox' do
find(:xpath, "//input[@id='personal_snippet_private']").set true choose "Public"
click_button "Save" click_button "Save"
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment