diff --git a/Gemfile b/Gemfile index 0e64277ba5..0e226f300a 100644 --- a/Gemfile +++ b/Gemfile @@ -96,6 +96,7 @@ gem 'sprockets-rails', git: 'https://github.com/finnlabs/sprockets-rails.git', gem 'non-stupid-digest-assets' gem 'sass-rails', git: 'https://github.com/guilleiguaran/sass-rails.git', branch: 'backport' gem 'sass', '~> 3.4.9' +gem 'autoprefixer-rails' gem 'bourbon', '~> 4.1.1' gem 'uglifier', '>= 1.0.3', require: false gem 'livingstyleguide', '~> 1.2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 3ccebfc8ce..34bb030072 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -85,6 +85,9 @@ GEM activerecord (>= 3.0) addressable (2.3.4) arel (3.0.3) + autoprefixer-rails (5.1.5) + execjs + json awesome_nested_set (2.1.6) activerecord (>= 3.0.0) axiom-types (0.1.1) @@ -447,6 +450,7 @@ DEPENDENCIES activerecord-jdbcpostgresql-adapter activerecord-tableless (~> 1.0) acts_as_list (~> 0.2.0) + autoprefixer-rails awesome_nested_set bourbon (~> 4.1.1) capybara (~> 2.3.0) diff --git a/app/assets/stylesheets/content/_in_place_editing.sass b/app/assets/stylesheets/content/_in_place_editing.sass index 16d2f8f487..9e353448e0 100644 --- a/app/assets/stylesheets/content/_in_place_editing.sass +++ b/app/assets/stylesheets/content/_in_place_editing.sass @@ -1,6 +1,6 @@ .inplace-editor display: inline - font-size: initial + font-size: medium .ined-input-wrapper-inner display: inline &.busy @@ -58,9 +58,7 @@ .ng-invalid background: lightpink!important .ined-dashboard - padding-left: 29px min-height: 42px - width: 502px .ined-errors float: right display: inline-block @@ -88,6 +86,9 @@ text-decoration: none &:hover background: #f0f0f0 + &.type-text + .ined-dashboard + width: 90% &.type-wiki_textarea textarea min-height: 200px @@ -108,7 +109,7 @@ float: right .ined-dashboard padding-left: 0px - width: 526px + width: 100% .ined-controls left: 0px z-index: 1 diff --git a/browserslist b/browserslist new file mode 100644 index 0000000000..56d3d08cc4 --- /dev/null +++ b/browserslist @@ -0,0 +1,8 @@ +# OpenProject supported browsers +# https://www.openproject.org/systemrequirements/ +# +> 5% +last 2 Chrome versions +last 2 Safari versions +Firefox >= 31 +IE >= 10 diff --git a/config/initializers/module_handler.rb b/config/initializers/module_handler.rb index 418b8051c8..5de0332b0d 100644 --- a/config/initializers/module_handler.rb +++ b/config/initializers/module_handler.rb @@ -27,7 +27,7 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -unless OpenProject::Configuration['disabled_modules'].empty? - to_disable = OpenProject::Configuration['disabled_modules'] +if OpenProject::Configuration.disabled_modules.any? + to_disable = OpenProject::Configuration.disabled_modules OpenProject::Plugins::ModuleHandler.disable_modules(to_disable) end diff --git a/frontend/app/ui_components/inplace-editor-dispatcher.js b/frontend/app/ui_components/inplace-editor-dispatcher.js index 69e59fa537..d1c3617578 100644 --- a/frontend/app/ui_components/inplace-editor-dispatcher.js +++ b/frontend/app/ui_components/inplace-editor-dispatcher.js @@ -147,6 +147,15 @@ module.exports = function($sce, $http, $timeout, AutoCompleteHelper, TextileServ text: { link: function(scope, element) { enableAutoCompletion(element); + scope.$on('startEditing', function() { + $timeout(function() { + element.find('.ined-dashboard').css({ + 'margin-left': element + .closest('.work-packages--details-content') + .find('.select-type:first').width() + }); + }, 0, false); + }); } }, diff --git a/lib/open_project/configuration/helpers.rb b/lib/open_project/configuration/helpers.rb index e54ee53da0..8b73b05390 100644 --- a/lib/open_project/configuration/helpers.rb +++ b/lib/open_project/configuration/helpers.rb @@ -99,7 +99,7 @@ module OpenProject if value =~ / / value.split ' ' else - value + Array(value) end end diff --git a/packaging/setup b/packaging/setup index a612f2af58..9aa154d382 100755 --- a/packaging/setup +++ b/packaging/setup @@ -1,5 +1,5 @@ #!/usr/bin/env bash -echo "ruby '2.1.4'" > Gemfile.local +echo "ruby '2.1.5'" > Gemfile.local cp -f packaging/conf/configuration.yml config/configuration.yml sed -i "s|config.serve_static_assets = false|config.serve_static_assets = true|" config/environments/production.rb diff --git a/spec/lib/open_project/configuration/helpers_spec.rb b/spec/lib/open_project/configuration/helpers_spec.rb new file mode 100644 index 0000000000..dbe9384153 --- /dev/null +++ b/spec/lib/open_project/configuration/helpers_spec.rb @@ -0,0 +1,89 @@ +#-- copyright +# OpenProject is a project management system. +# Copyright (C) 2012-2015 the OpenProject Foundation (OPF) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See doc/COPYRIGHT.rdoc for more details. +#++ + +require 'spec_helper' +require 'open_project/configuration/helpers' + +describe OpenProject::Configuration::Helpers do + let(:config) { + {}.tap do |config| + config.extend OpenProject::Configuration::Helpers + end + } + + describe '#array' do + def array(value) + config.send :array, value + end + + context 'with single string value' do + it 'returns an array containing the value' do + arr = array 'test' + + expect(arr).to eq ['test'] + end + end + + context 'with an array' do + it 'returns the array' do + arr = ['arrgh'] + + expect(array(arr)).to eq arr + end + end + + context 'with a space separated string' do + it 'returns an array of the values' do + value = 'one two three' + + expect(array(value)).to eq ['one', 'two', 'three'] + end + end + end + + describe '#hidden_menu_items' do + before do + items = config['hidden_menu_items'] = {} + items['admin_menu'] = 'users colors' + items['project_menu'] = 'info' + items['top_menu'] = [] + end + + it 'works with arrays' do + expect(config.hidden_menu_items['top_menu']).to eq [] + end + + it 'works with single string values' do + expect(config.hidden_menu_items['project_menu']).to eq ['info'] + end + + it 'work with space separated string values' do + expect(config.hidden_menu_items['admin_menu']).to eq ['users', 'colors'] + end + end +end