summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-11-26 00:19:14 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-11-26 00:19:14 +0200
commit0accbaae15926dbc1f8c17a315d58725e7fb7571 (patch)
treee38a32155ffa89818433d0c712786ebbc51a0cdf
parent80c34985c8b56b2ab8f98fb19a889e7e29e47b73 (diff)
downloadgitlab-ce-0accbaae15926dbc1f8c17a315d58725e7fb7571.tar.gz
snippets restyle
-rw-r--r--app/assets/stylesheets/application.css6
-rw-r--r--app/assets/stylesheets/issues.css.scss6
-rw-r--r--app/views/snippets/_form.html.haml54
-rw-r--r--app/views/snippets/index.html.haml4
-rw-r--r--app/views/snippets/show.html.haml23
5 files changed, 53 insertions, 40 deletions
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 73dc9af7fee..47ec5f5a91f 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -34,6 +34,9 @@
.width-65p{
width:65%;
}
+.width-100p{
+ width:100%;
+}
.append-bottom-10 {
margin-bottom:10px;
}
@@ -43,3 +46,6 @@
.no-borders {
border:none;
}
+.no-padding {
+ padding:0 !important;
+}
diff --git a/app/assets/stylesheets/issues.css.scss b/app/assets/stylesheets/issues.css.scss
index a66c43dd9e3..a283a4566f7 100644
--- a/app/assets/stylesheets/issues.css.scss
+++ b/app/assets/stylesheets/issues.css.scss
@@ -59,7 +59,11 @@
}
body.project-page .issue-form-holder table.no-borders tr,
-body.project-page .issue-form-holder table.no-borders td
+body.project-page .issue-form-holder table.no-borders td,
+body.project-page .new_snippet table tr,
+body.project-page .new_snippet table td,
+body.project-page .edit_snippet table tr,
+body.project-page .edit_snippet table td
{
&:hover {
background:none;
diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml
index b3cae65c3e9..77b0a96d91e 100644
--- a/app/views/snippets/_form.html.haml
+++ b/app/views/snippets/_form.html.haml
@@ -1,26 +1,34 @@
%div
- = form_for [@project, @snippet] do |f|
- -if @snippet.errors.any?
- %ul
- - @snippet.errors.full_messages.each do |msg|
- %li= msg
+ .ui-box.width-100p
+ %h3
+ = @snippet.new_record? ? "New snippet" : "Edit snippet ##{@snippet.id}"
+ = form_for [@project, @snippet] do |f|
+ .data.no-padding
+ %table.no-borders
+ -if @snippet.errors.any?
+ %tr
+ %td Errors
+ %td
+ #error_explanation
+ - @snippet.errors.full_messages.each do |msg|
+ %span= msg
+ %br
- %table.round-borders
- %tr
- %td= f.label :title
- %td= f.text_field :title, :placeholder => "Example Snippet"
- %tr
- %td= f.label :file_name
- %td= f.text_field :file_name, :placeholder => "example.rb"
- %tr
- %td= f.label "Lifetime"
- %td= f.select :expires_at, lifetime_select_options
- %tr
- %td{:colspan => 2}
- = f.label :content, "Code"
- %br
- %br
- = f.text_area :content
+ %tr
+ %td= f.label :title
+ %td= f.text_field :title, :placeholder => "Example Snippet"
+ %tr
+ %td= f.label :file_name
+ %td= f.text_field :file_name, :placeholder => "example.rb"
+ %tr
+ %td= f.label "Lifetime"
+ %td= f.select :expires_at, lifetime_select_options
+ %tr
+ %td{:colspan => 2}
+ = f.label :content, "Code"
+ %br
+ %br
+ = f.text_area :content
- .actions.prepend-top
- = f.submit 'Save', :class => "button"
+ .buttons
+ = f.submit 'Save', :class => "grey-button"
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
index 691ec6408a8..f34a3617052 100644
--- a/app/views/snippets/index.html.haml
+++ b/app/views/snippets/index.html.haml
@@ -2,9 +2,7 @@
- if can? current_user, :write_snippet, @project
= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
- %table.round-borders#snippets-table
- %thead
- %th
+ %table#snippets-table
= render @snippets.fresh
:javascript
$('.delete-snippet').live('ajax:success', function() {
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index 757cdb11e03..9b379cf47bd 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -1,20 +1,17 @@
- if !@snippet.expired?
- %h2
- = "Snippet ##{@snippet.id} - #{@snippet.title}"
-
- .view_file
- .view_file_header
- %strong
- = @snippet.file_name
- %br/
- .view_file_content
+ .ui-box.width-100p
+ %h3
+ = @snippet.title
+ .right= @snippet.file_name
+ .data.no-padding
:erb
<%= raw @snippet.colorize %>
- - 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}"
+ .buttons
+ - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
+ = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "grey-button"
+ - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
+ .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "grey-button delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
.clear
%br
.snippet_notes= render "notes/notes"