diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index dc6979dc384bb55fdb9e3be57671e5bb6e26ae7f..053ce0bb80a0d3d17622dfe567c47a0809e04835 100644 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -220,13 +220,9 @@ input.button{margin-bottom: 1.5em} .ui-box .data{padding: .5em 1em} -.ui-box .buttons{background-color: #f7f8f9; padding: 1em; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; - -moz-border-radius-bottomright: 5px; - -moz-border-radius-bottomleft: 5px; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; +.ui-box .buttons{ + padding: 1em; + border-top:1px solid $lite_border_color; } .ui-box .buttons .button{padding: 8px 9px; font-size: 11px} @@ -713,3 +709,17 @@ body, button, input, select, textarea { } } + +.errors_holder { + background:#FBB; + border:1px solid $lite_border_color; + @include round-borders-all(4px); + padding:5px; + list-style:none; + font-weight: bold; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.25); + + li { + padding:10px; + } +} diff --git a/app/controllers/deploy_keys_controller.rb b/app/controllers/deploy_keys_controller.rb index 36e42789e1134363070a239963ee5b5270c2ccc4..ae3feb7256f7f61379d87b77a329dd1517176c07 100644 --- a/app/controllers/deploy_keys_controller.rb +++ b/app/controllers/deploy_keys_controller.rb @@ -1,5 +1,5 @@ class DeployKeysController < ApplicationController - respond_to :js, :html + respond_to :html layout "project" before_filter :project @@ -29,7 +29,7 @@ class DeployKeysController < ApplicationController @key = @project.deploy_keys.new(params[:key]) @key.save - respond_with(@key) + redirect_to project_deploy_keys_path(@project) end def destroy diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/deploy_keys/_form.html.haml index d3a2682ae3eb4e1de48923694bce72251ce5158b..04ea30ba202cbb21d750a9644ce787f323c44890 100644 --- a/app/views/deploy_keys/_form.html.haml +++ b/app/views/deploy_keys/_form.html.haml @@ -1,16 +1,18 @@ %div - = form_for [@project, @key], :url => project_deploy_keys_path, :remote => true do |f| + = form_for [@project, @key], :url => project_deploy_keys_path do |f| -if @key.errors.any? - %ul + %ul.errors_holder - @key.errors.full_messages.each do |msg| %li= msg - - .form-row - = f.label :title - = f.text_field :title, :style => "width:300px" - .form-row - = f.label :key - = f.text_area :key, :style => "width:300px; height:130px" - .form-row + + %table.no-borders + %tr + %td= f.label :title + %td= f.text_field :title, :style => "width:300px" + %tr + %td= f.label :key + %td= f.text_area :key, :style => "width:300px; height:130px" + %br + .merge-tabs = f.submit 'Save', :class => "grey-button" diff --git a/app/views/deploy_keys/create.js.haml b/app/views/deploy_keys/create.js.haml deleted file mode 100644 index 0e8757f880f7c65747e8e0c007ef16db8cef85f4..0000000000000000000000000000000000000000 --- a/app/views/deploy_keys/create.js.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if @key.valid? - :plain - $("#new_key_dialog").dialog("close"); - $("#keys-table .data").append("#{escape_javascript(render(:partial => 'show', :locals => {:key => @key} ))}"); - $("#no_ssh_key_defined").hide(); -- else - :plain - $("#new_key_dialog").empty(); - $("#new_key_dialog").append("#{escape_javascript(render('form'))}"); diff --git a/app/views/deploy_keys/edit.html.haml b/app/views/deploy_keys/edit.html.haml deleted file mode 100644 index 9b1b9aac2212cf3b375466b4916840be79d33345..0000000000000000000000000000000000000000 --- a/app/views/deploy_keys/edit.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%h1 Editing key - -= render 'form' - -= link_to 'Show', @key -\| -= link_to 'Back', project_deploy_keys_path diff --git a/app/views/deploy_keys/new.html.haml b/app/views/deploy_keys/new.html.haml index 9be37204567a79c6e14c8a346c01e96fd85427c0..1e6b7e771443ef1bf971baee66d63c7523c544f1 100644 --- a/app/views/deploy_keys/new.html.haml +++ b/app/views/deploy_keys/new.html.haml @@ -1,5 +1,5 @@ -%h1 New key += render "repositories/head" -= render 'form' +%h2 New Deploy key -= link_to 'Back', project_deploy_keys_path += render 'form' diff --git a/app/views/deploy_keys/new.js.haml b/app/views/deploy_keys/new.js.haml deleted file mode 100644 index 86e9db030c50f05cc5de1df4316158b4d5c48738..0000000000000000000000000000000000000000 --- a/app/views/deploy_keys/new.js.haml +++ /dev/null @@ -1,11 +0,0 @@ -:plain - var new_key_dialog = $("
"); - new_key_dialog.html("#{escape_javascript(render('form'))}"); - $(new_key_dialog).dialog({ - width: 350, - resizable: false, - draggable: false, - title: "Add new public key", - close: function(event, ui) { $("#new_key_dialog").remove();}, - modal: true - }); diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 4a5526341efd797ee21d840a1c8d2fce695b824c..19d185a1456e2e13daf4ba4a2f8fd33f13a4ff4c 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -20,18 +20,13 @@ %i %h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" - %hr - %table.no-borders - -if @issue.errors.any? - %tr - %td{:colspan => 2} - #error_explanation - - @issue.errors.full_messages.each do |msg| - %span= msg - %br - + -if @issue.errors.any? + %ul.errors_holder + - @issue.errors.full_messages.each do |msg| + %li= msg + %table.no-borders %tr %td= f.label :assignee_id %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) diff --git a/app/views/repositories/_head.html.haml b/app/views/repositories/_head.html.haml index 09a85bed5918bc1130fee73d953074936f1d3a5e..7b476362bedbd067677eb981c2da6e5ca3d2d119 100644 --- a/app/views/repositories/_head.html.haml +++ b/app/views/repositories/_head.html.haml @@ -23,6 +23,6 @@ - if current_page?(project_deploy_keys_path(@project)) - if can? current_user, :admin_project, @project - = link_to new_project_deploy_key_path(@project), :class => "add_new", :title => "New Deploy Key", :remote => true do + = link_to new_project_deploy_key_path(@project), :class => "add_new", :title => "New Deploy Key" do = image_tag "add_new.png", :width => 14 diff --git a/spec/requests/projects_deploy_keys_spec.rb b/spec/requests/projects_deploy_keys_spec.rb index 8258f2609a1ee70a0efda2d169d983c87ce9a53b..629c28871a41af80139da6b56d5bd4f3df8a2a67 100644 --- a/spec/requests/projects_deploy_keys_spec.rb +++ b/spec/requests/projects_deploy_keys_spec.rb @@ -36,7 +36,7 @@ describe "Projects", "DeployKeys" do end it "should open new key popup" do - page.should have_content("Add new public key") + page.should have_content("New Deploy key") end describe "fill in" do @@ -50,7 +50,6 @@ describe "Projects", "DeployKeys" do it "should add new key to table" do click_button "Save" - page.should_not have_content("Add new public key") page.should have_content "laptop" end end