diff --git a/Gemfile b/Gemfile index 33403f3c0b..b9833e15b6 100644 --- a/Gemfile +++ b/Gemfile @@ -147,7 +147,7 @@ group :test do gem 'rspec-legacy_formatters' gem 'capybara', '~> 2.4.4' gem 'capybara-screenshot', '~> 1.0.4' - gem 'capybara-select2', github: 'finnlabs/capybara-select2' + gem 'capybara-select2', github: 'goodwill/capybara-select2' gem 'capybara-ng', '~> 0.2.1' gem 'selenium-webdriver', '~> 2.47.1' gem 'timecop', '~> 0.7.1' diff --git a/Gemfile.lock b/Gemfile.lock index 1d383c2821..30df1854b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,8 +7,8 @@ GIT activerecord (>= 3.0.0) GIT - remote: git://github.com/finnlabs/capybara-select2.git - revision: 4088099ecc8a03c0c3155827a89a1a51057b0e38 + remote: git://github.com/goodwill/capybara-select2.git + revision: 585192e4bb0db8d52e761ab68f08c17294806447 specs: capybara-select2 (1.0.1) capybara @@ -30,7 +30,7 @@ GIT GIT remote: https://github.com/opf/openproject-translations.git - revision: a2a7d246c6212c0867970ee44c505f97e5c96ee3 + revision: d7c6e76ff6c3a56e42102a209900c2ad85af458f branch: dev specs: openproject-translations (5.0.0.pre.alpha) diff --git a/app/assets/stylesheets/content/_forms.sass b/app/assets/stylesheets/content/_forms.sass index 4a8a6f9528..d7aec7c913 100644 --- a/app/assets/stylesheets/content/_forms.sass +++ b/app/assets/stylesheets/content/_forms.sass @@ -66,37 +66,37 @@ $form--field-types: (text-field, text-area, select, check-box, radio-button, ran .form--section padding-top: 0px + margin-bottom: 0px + + & > * + padding-left: 1rem .form--section-title background-color: $content-form-danger-zone-bg-color color: $content-form-danger-zone-font-color !important - padding: 0.5rem !important + padding: 1rem !important margin: 0 0 1rem 0 em - font-style: italics - - - p - padding-left: 0.5rem + font-style: italic - &.danger-zone--warning - font-weight: bold - color: $content-form-danger-zone-bg-color + p.danger-zone--warning + font-weight: bold + color: $content-form-danger-zone-bg-color - span.icon, - span.icon-context - vertical-align: middle - &:before - padding-left: 0px - color: $content-form-danger-zone-bg-color + span.icon, + span.icon-context + vertical-align: middle + &:before + padding-left: 0px + color: $content-form-danger-zone-bg-color .danger-zone--verification display: flex input flex-basis: 50% - margin: 0 0.5rem 0 0.5rem + margin: 0 0.5rem 0 0 .button.-highlight background: $content-form-danger-zone-bg-color @@ -493,11 +493,6 @@ input[readonly].-clickable //prevent radio-buttons from being cut at the border padding: 0 1px -.form--radio-button - // Be on par with Foundation's margin-bottom on labels. - .form & - margin-bottom: 0.5rem - .form--grouping @include grid-block($wrap: true) align-items: center @@ -512,7 +507,7 @@ input[readonly].-clickable @include grid-content(2) @include grid-visible-overflow @extend %label-style - padding: 0 1rem 0 0 + padding: 0 1rem 0.5rem 0 font-size: $form-label-fontsize line-height: $base-line-height color: $form-label-color @@ -620,3 +615,8 @@ input[readonly].-clickable li, div padding: 0 + + +.form--text-field-container + input[type=text] + margin-bottom: 0 diff --git a/app/assets/stylesheets/content/_in_place_editing.sass b/app/assets/stylesheets/content/_in_place_editing.sass index 5fce25c469..1acf0aa969 100644 --- a/app/assets/stylesheets/content/_in_place_editing.sass +++ b/app/assets/stylesheets/content/_in_place_editing.sass @@ -161,6 +161,9 @@ &:last-of-type margin-bottom: 0 + .user-field-user-link + display: inline + .inplace-edit--preview border: 1px solid $inplace-edit--border-color padding: 0.375rem diff --git a/app/assets/stylesheets/content/_notifications.lsg b/app/assets/stylesheets/content/_notifications.lsg index afb774f9c2..8b919c17b9 100644 --- a/app/assets/stylesheets/content/_notifications.lsg +++ b/app/assets/stylesheets/content/_notifications.lsg @@ -46,17 +46,6 @@ ``` -## Severe warning - -``` -
-``` - ## Success ``` diff --git a/app/assets/stylesheets/content/_notifications.sass b/app/assets/stylesheets/content/_notifications.sass index 72c5842b24..a26c292f43 100644 --- a/app/assets/stylesheets/content/_notifications.sass +++ b/app/assets/stylesheets/content/_notifications.sass @@ -153,9 +153,6 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25) &::before @include messages-icon @extend %nm-icon-warning - &.-severe - background-color: $nm-color-error-background - border-color: $nm-color-error-border &.-info::before @include messages-icon diff --git a/app/assets/stylesheets/content/_select2.scss b/app/assets/stylesheets/content/_select2.scss index 6544c893cc..3eecbd50a0 100644 --- a/app/assets/stylesheets/content/_select2.scss +++ b/app/assets/stylesheets/content/_select2.scss @@ -121,7 +121,7 @@ $se2-input-height: rem-calc(34px); $se2-line-height: 30px; $se2-button-width: 28px; $se2-arrow-button-width: 18px; -$se2-results-max-height: 500px; +$se2-results-max-height: 200px; $se-multiple-input-line-height: 19px; $se-multiple-tags-line-height: 19px; @@ -192,14 +192,27 @@ $se2-width: 100%; .select2-drop { .select2-search { + &:before { + content: "\e0a1"; + font-family: "openproject-icon-font"; + color: #E0E0E0; + position: absolute; + top: 6px; + right: 16px; + } + .select2-input { - //possible background tweaks + background-image: none !important; + padding-right: 32px; + height: $se2-input-height !important; } } .select2-results { max-height: $se2-results-max-height; overflow: auto; + margin: 4px 9px 9px 0; + padding: 0 0 0 9px; .select2-highlighted { background-color: $se2-theme-selectable-color-highlighted; @@ -208,8 +221,19 @@ $se2-width: 100%; } } -input[type="text"].select2-input { - height: $se2-input-height; +.select2-drop:not(.project-search-results) { + input[type="text"].select2-input { + height: $se2-input-height !important; + } + + .select2-search { + margin: 10px 0 6px 0; + padding: 0 9px; + + input { + margin-bottom: 0; + } + } } .columns-modal-content { diff --git a/app/assets/stylesheets/content/_tables.sass b/app/assets/stylesheets/content/_tables.sass index 5c89e011e2..ab5b8f83b5 100644 --- a/app/assets/stylesheets/content/_tables.sass +++ b/app/assets/stylesheets/content/_tables.sass @@ -26,6 +26,14 @@ // See doc/COPYRIGHT.rdoc for more details. //++ +$project-table--start-indentation: 0.5em +$project-table--child-indentation: 1.1em +$project-table--icon-distance: 5px + +@mixin calc-indentation($indentation) + // This does not work for big font-sizes + padding-left: calc(#{$indentation} * #{$project-table--child-indentation} + #{$project-table--start-indentation} - #{$project-table--icon-distance}) + table td padding: 3px 6px @@ -124,27 +132,26 @@ tr td.name a white-space: nowrap &.idnt td.project--hierarchy span - padding-left: 16px &.icon-context:before - padding: 9px 5px 0 10px + padding: 9px 5px 0 0px &.idnt-1 td.project--hierarchy - padding-left: 0.5em + @include calc-indentation(0) &.idnt-2 td.project--hierarchy - padding-left: 2em + @include calc-indentation(1) &.idnt-3 td.project--hierarchy - padding-left: 3.5em + @include calc-indentation(2) &.idnt-4 td.project--hierarchy - padding-left: 5em + @include calc-indentation(3) &.idnt-5 td.project--hierarchy - padding-left: 6.5em + @include calc-indentation(4) &.idnt-6 td.project--hierarchy - padding-left: 8em + @include calc-indentation(5) &.idnt-7 td.project--hierarchy - padding-left: 9.5em + @include calc-indentation(6) &.idnt-8 td.project--hierarchy - padding-left: 11em + @include calc-indentation(7) &.idnt-9 td.project--hierarchy - padding-left: 12.5em + @include calc-indentation(8) &.issue white-space: nowrap diff --git a/app/assets/stylesheets/layout/_top_menu.sass b/app/assets/stylesheets/layout/_top_menu.sass index a0e39cede4..dfae117492 100644 --- a/app/assets/stylesheets/layout/_top_menu.sass +++ b/app/assets/stylesheets/layout/_top_menu.sass @@ -225,17 +225,13 @@ input.top-menu-search--input background: $header-drop-down-projects-search-bg-color margin: 0 0 10px 0 - .select2-search:before - content: "\e0a1" - font-family: "openproject-icon-font" - color: #E0E0E0 - position: absolute - top: 24px - right: 20px + &:before + top: 21px + right: 26px - .select2-search input - margin: 10px 0px - padding: 9px 10px 9px 10px + .select2-search input.select2-input + margin: 10px 10px + padding: 9px 32px 9px 10px !important border: none border-radius: 25px width: 92% diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 9171fb2177..abf0360988 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -215,15 +215,9 @@ class ProjectsController < ApplicationController def destroy @project_to_destroy = @project - if params[:confirm] - @project_to_destroy.destroy - respond_to do |format| - format.html do redirect_to controller: '/admin', action: 'projects' end - end - else - flash[:error] = l(:notice_project_not_deleted) - redirect_to confirm_destroy_project_path(@project) - return + @project_to_destroy.destroy + respond_to do |format| + format.html do redirect_to controller: '/admin', action: 'projects' end end hide_project_in_layout diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 348aca3974..d602ca90b6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -39,6 +39,7 @@ end class RepositoriesController < ApplicationController include PaginationHelper + include RepositoriesHelper menu_item :repository menu_item :settings, only: [:edit, :destroy_info] @@ -303,10 +304,6 @@ class RepositoriesController < ApplicationController end end - def settings_repository_tab_path - settings_project_path(@project, tab: 'repository') - end - def find_repository @repository = @project.repository (render_404; return false) unless @repository diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index d0729b3cdf..747301127c 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -28,6 +28,10 @@ #++ module RepositoriesHelper + def settings_repository_tab_path + settings_project_path(@project, tab: 'repository') + end + def format_revision(revision) if revision.respond_to? :format_identifier revision.format_identifier diff --git a/app/models/version.rb b/app/models/version.rb index 832e0a040a..9ed5febebc 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -205,7 +205,7 @@ class Version < ActiveRecord::Base # tie the comparison to the presentation as sorting is mostly # used within sorted tables. # Thus, when the representation changes, the sorting will change as well. - to_s_with_project <=> version.to_s_with_project + to_s_with_project.downcase <=> version.to_s_with_project.downcase end # Returns the sharings that +user+ can set the version to diff --git a/app/views/account/password_recovery.html.erb b/app/views/account/password_recovery.html.erb index 20d192c206..c67d2b70df 100644 --- a/app/views/account/password_recovery.html.erb +++ b/app/views/account/password_recovery.html.erb @@ -33,8 +33,8 @@ See doc/COPYRIGHT.rdoc for more details.<%= l(:text_project_destroy_title) %>
+ <%= l('project.destroy.confirmation', identifier: @project_to_destroy.identifier)%>
<% if @project_to_destroy.descendants.any? %>
+
+ <%= l('project.destroy.info')%>
+
- <%= styled_form_tag(project_path(@project_to_destroy), method: :delete) do %>
-
- <%= submit_tag l(:button_delete), class: 'button' %>
- <% end %>
+ <%= l('project.destroy.project_verification', name: "#{h(@project_to_destroy)}").html_safe %>
- <%= l(:text_project_destroy_confirmation, identifier: @project_to_destroy.identifier)%>
+<%= styled_form_tag(project_path(@project_to_destroy),
+ class: 'danger-zone',
+ method: :delete) do %>
+
+ <%= l('project.destroy.title', name: "#{h(@project_to_destroy)}").html_safe %>
+
+
- <%= l(:text_subprojects_destroy_warning, content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))).html_safe %>
+ <% descendants = h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')) %>
+ <%= l('project.destroy.subprojects_confirmation', value: "#{h(descendants)}").html_safe %>
<% end %>
<%= l('repositories.destroy.title') %>
- <% if @repository.managed? %>
- <%= l('repositories.destroy.managed_text', project_name: @project.identifier) %>
-
- <%= l('repositories.destroy.managed_path_note', path: @repository.root_url) %>
- <% else %>
- <%= simple_format l('repositories.destroy.linked_text',
- project_name: @project.identifier, url: @repository.url) %>
+ <%= l('repositories.destroy.confirmation', project_name: @project.identifier) %>
+
+ <%= l('repositories.destroy.managed_path_note', path: @repository.root_url) %>
+
+ + <%= l('repositories.destroy.info') %> +
+<%= l('repositories.destroy.title', name: h(@repository.root_url)) %>
+ <%= simple_format l('repositories.destroy.linked_text', + project_name: @project.identifier, url: @repository.url) %>
<%= link_to project_repository_path(@project), - :method => :delete, - :class => 'button' do %> + title: l(:button_delete), + method: :delete, + class: 'button' do %>
<% end %> + <%= link_to settings_repository_tab_path, + title: l(:button_cancel), + class: 'button' do %> + + + <% end %>