BigW Consortium Gitlab

Commit c9ea5f13 by Dmitriy Zaporozhets

deploy key creation restyled

parent 809413d9
...@@ -220,13 +220,9 @@ input.button{margin-bottom: 1.5em} ...@@ -220,13 +220,9 @@ input.button{margin-bottom: 1.5em}
.ui-box .data{padding: .5em 1em} .ui-box .data{padding: .5em 1em}
.ui-box .buttons{background-color: #f7f8f9; padding: 1em; .ui-box .buttons{
-webkit-border-bottom-right-radius: 5px; padding: 1em;
-webkit-border-bottom-left-radius: 5px; border-top:1px solid $lite_border_color;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
} }
.ui-box .buttons .button{padding: 8px 9px; font-size: 11px} .ui-box .buttons .button{padding: 8px 9px; font-size: 11px}
...@@ -713,3 +709,17 @@ body, button, input, select, textarea { ...@@ -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;
}
}
class DeployKeysController < ApplicationController class DeployKeysController < ApplicationController
respond_to :js, :html respond_to :html
layout "project" layout "project"
before_filter :project before_filter :project
...@@ -29,7 +29,7 @@ class DeployKeysController < ApplicationController ...@@ -29,7 +29,7 @@ class DeployKeysController < ApplicationController
@key = @project.deploy_keys.new(params[:key]) @key = @project.deploy_keys.new(params[:key])
@key.save @key.save
respond_with(@key) redirect_to project_deploy_keys_path(@project)
end end
def destroy def destroy
......
%div %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? -if @key.errors.any?
%ul %ul.errors_holder
- @key.errors.full_messages.each do |msg| - @key.errors.full_messages.each do |msg|
%li= msg %li= msg
.form-row %table.no-borders
= f.label :title %tr
= f.text_field :title, :style => "width:300px" %td= f.label :title
.form-row %td= f.text_field :title, :style => "width:300px"
= f.label :key %tr
= f.text_area :key, :style => "width:300px; height:130px" %td= f.label :key
.form-row %td= f.text_area :key, :style => "width:300px; height:130px"
%br
.merge-tabs
= f.submit 'Save', :class => "grey-button" = f.submit 'Save', :class => "grey-button"
- 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'))}");
%h1 Editing key
= render 'form'
= link_to 'Show', @key
\|
= link_to 'Back', project_deploy_keys_path
%h1 New key = render "repositories/head"
= render 'form' %h2 New Deploy key
= link_to 'Back', project_deploy_keys_path = render 'form'
:plain
var new_key_dialog = $("<div id='new_key_dialog'></div>");
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
});
...@@ -20,18 +20,13 @@ ...@@ -20,18 +20,13 @@
%i %i
%h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" %h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
%hr %hr
%table.no-borders -if @issue.errors.any?
-if @issue.errors.any? %ul.errors_holder
%tr - @issue.errors.full_messages.each do |msg|
%td{:colspan => 2} %li= msg
#error_explanation
- @issue.errors.full_messages.each do |msg|
%span= msg
%br
%table.no-borders
%tr %tr
%td= f.label :assignee_id %td= f.label :assignee_id
%td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" })
......
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
- if current_page?(project_deploy_keys_path(@project)) - if current_page?(project_deploy_keys_path(@project))
- if can? current_user, :admin_project, @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 = image_tag "add_new.png", :width => 14
...@@ -36,7 +36,7 @@ describe "Projects", "DeployKeys" do ...@@ -36,7 +36,7 @@ describe "Projects", "DeployKeys" do
end end
it "should open new key popup" do it "should open new key popup" do
page.should have_content("Add new public key") page.should have_content("New Deploy key")
end end
describe "fill in" do describe "fill in" do
...@@ -50,7 +50,6 @@ describe "Projects", "DeployKeys" do ...@@ -50,7 +50,6 @@ describe "Projects", "DeployKeys" do
it "should add new key to table" do it "should add new key to table" do
click_button "Save" click_button "Save"
page.should_not have_content("Add new public key")
page.should have_content "laptop" page.should have_content "laptop"
end end
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