From a9fba2cd0acf847bced02e5ff3673b41adca151a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 1 Jan 2014 21:59:45 +0200 Subject: [PATCH] Fix modal dialogs Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/generic/common.scss | 4 + .../stylesheets/sections/merge_requests.scss | 22 +----- app/views/help/_shortcuts.html.haml | 58 +++++++------- app/views/projects/blob/_remove.html.haml | 38 ++++----- .../show/_how_to_merge.html.haml | 78 ++++++++++--------- .../merge_requests/show/_mr_accept.html.haml | 2 +- app/views/projects/wikis/_new.html.haml | 24 +++--- 7 files changed, 109 insertions(+), 117 deletions(-) diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 1544764eba1..156130c576a 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -96,6 +96,10 @@ pre.well-pre { color: #999; text-shadow: none; } + + &.label-inverse { + background-color: #333333; + } } /** Big Labels **/ diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index 0f0f8c858d1..3f0e67c769d 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -15,29 +15,9 @@ } } - .accept_group { - float: left; - border: 1px solid #ADA; - padding: 2px; - @include border-radius(5px); - background: #CEB; - - .accept_merge_request { - font-size: 13px; - float: left; - } - .remove_branch_holder { - margin-left: 20px; - margin-right: 10px; - float: left; - } - label { - color: #444; - text-align: left - } + .accept-group { } - .how_to_merge_link { @extend .primary; } diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml index e979e7c0d07..5f80a456cf7 100644 --- a/app/views/help/_shortcuts.html.haml +++ b/app/views/help/_shortcuts.html.haml @@ -1,30 +1,32 @@ #modal-shortcuts.modal.hide - .modal-header - %a.close{href: "#", "data-dismiss" => "modal"} × - %h3 Keyboard Shortcuts - .modal-body - %h5 Global Shortcuts - %p - %span.label.label-inverse s - – - Focus Search - %p - %span.label.label-inverse ? - – - Show this dialog + .modal-dialog + .modal-content + .modal-header + %a.close{href: "#", "data-dismiss" => "modal"} × + %h3 Keyboard Shortcuts + .modal-body + %h5 Global Shortcuts + %p + %span.label.label-inverse s + – + Focus Search + %p + %span.label.label-inverse ? + – + Show this dialog - %h5 Project Files browsing - %p - %span.label.label-inverse - %i.icon-arrow-up - – - Move selection up - %p - %span.label.label-inverse - %i.icon-arrow-down - – - Move selection down - %p - %span.label.label-inverse Enter - – - Open selection + %h5 Project Files browsing + %p + %span.label.label-inverse + %i.icon-arrow-up + – + Move selection up + %p + %span.label.label-inverse + %i.icon-arrow-down + – + Move selection down + %p + %span.label.label-inverse Enter + – + Open selection diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index a4600d8d5b7..76fb62b6e00 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -1,19 +1,21 @@ -%div#modal-remove-blob.modal.hide - .modal-header - %a.close{href: "#", "data-dismiss" => "modal"} × - %h3.page-title Remove #{@blob.name} - %p.light - From branch - %strong= @ref +#modal-remove-blob.modal.hide + .modal-dialog + .modal-content + .modal-header + %a.close{href: "#", "data-dismiss" => "modal"} × + %h3.page-title Remove #{@blob.name} + %p.light + From branch + %strong= @ref - .modal-body - = form_tag project_blob_path(@project, @id), method: :delete do - .form-group.commit_message-group - = label_tag 'commit_message', class: "control-label" do - Commit message - .col-sm-10 - = text_area_tag 'commit_message', params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3 - .form-group - .col-sm-10 - = submit_tag 'Remove file', class: 'btn btn-remove' - = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" + .modal-body + = form_tag project_blob_path(@project, @id), method: :delete do + .form-group.commit_message-group + = label_tag 'commit_message', class: "control-label" do + Commit message + .col-sm-10 + = text_area_tag 'commit_message', params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3 + .form-group + .col-sm-10 + = submit_tag 'Remove file', class: 'btn btn-remove' + = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 98d373e8ad4..90483094b58 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -1,42 +1,44 @@ %div#modal_merge_info.modal.hide - .modal-header - %a.close{href: "#", "data-dismiss" => "modal"} × - %h3 How to merge - .modal-body - - if @merge_request.for_fork? - - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path - - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path - %p - %strong Step 1. - Checkout target branch and get recent objects from GitLab - Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote} - remote for #{@merge_request.source_project_path} is called #{source_remote} - %pre.dark - :preserve - git checkout #{target_remote} #{@merge_request.target_branch} - git fetch #{source_remote} - %p - %strong Step 2. - Merge source branch into target branch and push changes to GitLab - %pre.dark - :preserve - git merge #{source_remote}/#{@merge_request.source_branch} - git push #{target_remote} #{@merge_request.target_branch} - - else - %p - %strong Step 1. - Checkout target branch and get recent objects from GitLab - %pre.dark - :preserve - git checkout #{@merge_request.target_branch} - git fetch origin - %p - %strong Step 2. - Merge source branch into target branch and push changes to GitLab - %pre.dark - :preserve - git merge origin/#{@merge_request.source_branch} - git push origin #{@merge_request.target_branch} + .modal-dialog + .modal-content + .modal-header + %a.close{href: "#", "data-dismiss" => "modal"} × + %h3 How to merge + .modal-body + - if @merge_request.for_fork? + - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path + - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path + %p + %strong Step 1. + Checkout target branch and get recent objects from GitLab + Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote} + remote for #{@merge_request.source_project_path} is called #{source_remote} + %pre.dark + :preserve + git checkout #{target_remote} #{@merge_request.target_branch} + git fetch #{source_remote} + %p + %strong Step 2. + Merge source branch into target branch and push changes to GitLab + %pre.dark + :preserve + git merge #{source_remote}/#{@merge_request.source_branch} + git push #{target_remote} #{@merge_request.target_branch} + - else + %p + %strong Step 1. + Checkout target branch and get recent objects from GitLab + %pre.dark + :preserve + git checkout #{@merge_request.target_branch} + git fetch origin + %p + %strong Step 2. + Merge source branch into target branch and push changes to GitLab + %pre.dark + :preserve + git merge origin/#{@merge_request.source_branch} + git push origin #{@merge_request.target_branch} :javascript diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml index 4dfb7c6fda7..546bd697fbe 100644 --- a/app/views/projects/merge_requests/show/_mr_accept.html.haml +++ b/app/views/projects/merge_requests/show/_mr_accept.html.haml @@ -14,7 +14,7 @@ %strong = link_to "click here", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" for instructions - .accept_group + .accept-group = f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request" - unless @merge_request.disallow_source_branch_removal? .remove_branch_holder diff --git a/app/views/projects/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml index 38462c7c469..cadf450db60 100644 --- a/app/views/projects/wikis/_new.html.haml +++ b/app/views/projects/wikis/_new.html.haml @@ -1,12 +1,14 @@ %div#modal-new-wiki.modal.hide - .modal-header - %a.close{href: "#", "data-dismiss" => "modal"} × - %h3.page-title New Wiki Page - .modal-body - = label_tag :new_wiki_path do - %span Page slug - = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-lg', required: true, :'data-wikis-path' => project_wikis_path(@project) - %p.hint - Please don't use spaces and slashes - .modal-footer - = link_to 'Build', '#', class: 'build-new-wiki btn btn-create' + .modal-dialog + .modal-content + .modal-header + %a.close{href: "#", "data-dismiss" => "modal"} × + %h3.page-title New Wiki Page + .modal-body + = label_tag :new_wiki_path do + %span Page slug + = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-lg', required: true, :'data-wikis-path' => project_wikis_path(@project) + %p.hint + Please don't use spaces and slashes + .modal-footer + = link_to 'Build', '#', class: 'build-new-wiki btn btn-create'