From fc4735591b215e9964b2d5f1e40142d3582b1d73 Mon Sep 17 00:00:00 2001 From: Christoph Zierz - zzmedia Date: Tue, 20 May 2014 19:54:24 +0200 Subject: [PATCH 01/17] Add styles for headings h1 h2 h3 h4 - added styles for headlines h1, h2, h3, h4 --- app/assets/stylesheets/content/_headings.md | 12 +++++++ app/assets/stylesheets/content/_headings.sass | 12 +++++++ app/assets/stylesheets/global/_mixins.sass | 34 +++++++++++++++++++ app/assets/stylesheets/global/_variables.sass | 9 +++++ 4 files changed, 67 insertions(+) diff --git a/app/assets/stylesheets/content/_headings.md b/app/assets/stylesheets/content/_headings.md index 7ab8b064b8..b37bc18c1d 100644 --- a/app/assets/stylesheets/content/_headings.md +++ b/app/assets/stylesheets/content/_headings.md @@ -1 +1,13 @@ # Headings + +``` +

Headline H1

+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

+

Headline H2

+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

+

Headline H3

+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

+

Headline H4

+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.

+ +``` diff --git a/app/assets/stylesheets/content/_headings.sass b/app/assets/stylesheets/content/_headings.sass index 935f07e7cc..57ac1501e7 100644 --- a/app/assets/stylesheets/content/_headings.sass +++ b/app/assets/stylesheets/content/_headings.sass @@ -29,3 +29,15 @@ #content h2 padding-right: 340px + + +h1 + @include default-headline-h1 +h2 + @include default-headline-h2 +h3 + @include default-headline-h3 +h4 + @include default-headline-h4 + + \ No newline at end of file diff --git a/app/assets/stylesheets/global/_mixins.sass b/app/assets/stylesheets/global/_mixins.sass index 2991f196a0..a902c67c0f 100644 --- a/app/assets/stylesheets/global/_mixins.sass +++ b/app/assets/stylesheets/global/_mixins.sass @@ -37,6 +37,40 @@ $button_gray_font_color: #222222 @each $vendor in $vendors #{$vendor}transition: all 200ms ease-in-out 0s +@mixin default-headline-h1 + color: $headline_h1_font-color + font-size: $headline_h1_font_size + font-family: $font_family_normal + font-weight: normal + padding: 0 0 8px 0 + margin: 0 + +@mixin default-headline-h2 + color: $headline_h2_font-color + font-size: $headline_h2_font_size + font-family: $font_family_normal + font-weight: normal + text-transform: uppercase + padding: 0 0 8px 0 + margin: 0 + +@mixin default-headline-h3 + color: $headline_h3_font-color + font-size: $headline_h3_font_size + font-family: $font_family_normal + font-weight: normal + border-bottom: 1px solid #dddddd + padding: 0 0 8px 0 + margin: 0 0 20px 0 + +@mixin default-headline-h4 + color: $headline_h4_font-color + font-size: $headline_h4_font_size + font-family: $font_family_normal + font-weight: normal + padding: 0 0 5px 0 + margin: 0 0 20px 0 + @mixin default-font-normal($color, $font-size: 13px) color: $color font-size: $font-size diff --git a/app/assets/stylesheets/global/_variables.sass b/app/assets/stylesheets/global/_variables.sass index a497618d1c..6fc951b8a9 100644 --- a/app/assets/stylesheets/global/_variables.sass +++ b/app/assets/stylesheets/global/_variables.sass @@ -30,6 +30,15 @@ $global_font_color: #555555 !default $global_font_size: 13px !default $global_line_height: 1.5 !default +$headline_h1_font_size: 28px !default +$headline_h1_font-color: #555555 !default +$headline_h2_font_size: 22px !default +$headline_h2_font-color: #06799F !default +$headline_h3_font_size: 19px !default +$headline_h3_font-color: #555555 !default +$headline_h4_font_size: 17px !default +$headline_h4_font-color: #555555 !default + $header_height: 55px !default $header_bg_color: #3493B3 !default $header_border_bottom_color: #3493B3 !default From b21ccda101dc398d0a4ddb523094e33c31d1635c Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 14 May 2014 16:14:55 +0200 Subject: [PATCH 02/17] WIP Made a basic sort dialog which is wired up to queries service set sortation. Once the refactor is done and the wp table is wired directly to the query then hopefully this should update the sortation. --- .../angular/controllers/dialogs/sorting.js | 31 ++++++++++++- .../angular/services/query-service.js | 4 ++ .../work_packages/modals/sorting.html | 44 +++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index 99d6e2e8e0..331830a205 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -36,7 +36,36 @@ angular.module('openproject.workPackages.controllers') }); }]) -.controller('SortingModalController', ['sortingModal', function(sortingModal) { +.controller('SortingModalController', ['sortingModal', + '$scope', + 'QueryService', + function(sortingModal, $scope, QueryService) { this.name = 'Sorting'; this.closeMe = sortingModal.deactivate; + + $scope.sortByOptions = {}; + + $scope.getAvailableColumnsData = function(term, result) { + result($scope.availableColumnsData); + } + + $scope.getDirectionsData = function(term, result) { + result([{ id: 'asc', label: 'Ascending'}, { id: 'desc', label: 'Descending'}]); + } + + $scope.updateSortation = function(){ + // TODO RS: Clean this up once we have a sortation directive + var sortation = [[ $scope.selectedColumn1.id, $scope.selectedDirection1.id ], + [ $scope.selectedColumn2.id, $scope.selectedDirection2.id ], + [ $scope.selectedColumn3.id, $scope.selectedDirection3.id ]]; + QueryService.setSortation(sortation); + } + + QueryService.getAvailableColumns() + .then(function(data){ + $scope.availableColumns = data.available_columns + $scope.availableColumnsData = data.available_columns.map(function(column){ + return { id: column.name, label: column.title, other: column.title }; + }); + }); }]); diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 74644b994c..3ac01e47a7 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -148,6 +148,10 @@ angular.module('openproject.services') this.showColumns(selectedColumnNames); }, + setSortation: function(sortation) { + return query.setSortation(new Sortation(sortation)); + }, + getAvailableFilters: function(projectIdentifier){ // TODO once this is becoming more single-page-app-like keep the available filters of the query model in sync when the project identifier is changed on the scope but the page isn't reloaded var identifier = 'global'; diff --git a/public/templates/work_packages/modals/sorting.html b/public/templates/work_packages/modals/sorting.html index 5dbf9c5cea..458f16fa90 100644 --- a/public/templates/work_packages/modals/sorting.html +++ b/public/templates/work_packages/modals/sorting.html @@ -4,5 +4,49 @@

Sorting

+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ From 504237f08dfe7673879e9536ead6c4516c406f6f Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 14 May 2014 17:37:26 +0200 Subject: [PATCH 03/17] WIP wiring up initial filter values. --- Gemfile.lock | 7 +++++++ .../javascripts/angular/controllers/dialogs/sorting.js | 10 ++++++++++ app/assets/javascripts/angular/models/query.js | 4 ++++ .../javascripts/angular/services/query-service.js | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 4b59111e3e..d8665ccaa9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,6 +81,9 @@ GEM arel (3.0.3) awesome_nested_set (2.1.6) activerecord (>= 3.0.0) + better_errors (1.1.0) + coderay (>= 1.0.0) + erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) bourbon (4.0.0) @@ -324,6 +327,8 @@ GEM multi_json (~> 1.0) rubyzip websocket (~> 1.0.4) + sextant (0.2.4) + rails (>= 3.2) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) @@ -387,6 +392,7 @@ DEPENDENCIES activerecord-tableless (~> 1.0) acts_as_list (~> 0.2.0) awesome_nested_set + better_errors bourbon (~> 4.0) capybara capybara-screenshot @@ -450,6 +456,7 @@ DEPENDENCIES sass (~> 3.3.6) sass-rails! selenium-webdriver + sextant shoulda shoulda-matchers simplecov (= 0.8.0.pre) diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index 331830a205..3c348fe539 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -45,6 +45,15 @@ angular.module('openproject.workPackages.controllers') $scope.sortByOptions = {}; + $scope.initSortation = function(){ + var currentSortation = QueryService.getSortation(); + + var element = currentSortation.sortElements[0]; + $scope.selectedColumn1 = $scope.availableColumnsData.filter(function(column) { + return column.id == element.field; + })[0]; + } + $scope.getAvailableColumnsData = function(term, result) { result($scope.availableColumnsData); } @@ -67,5 +76,6 @@ angular.module('openproject.workPackages.controllers') $scope.availableColumnsData = data.available_columns.map(function(column){ return { id: column.name, label: column.title, other: column.title }; }); + $scope.initSortation(); }); }]); diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index 7fe3be3d7d..36575c8eac 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -90,6 +90,10 @@ angular.module('openproject.models') return UrlParamsHelper.buildQueryString(this.toParams()); }, + getSortation: function(){ + return this.sortation; + }, + setSortation: function(sortation){ this.sortation = sortation; }, diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 3ac01e47a7..5b7254c7e2 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -152,6 +152,10 @@ angular.module('openproject.services') return query.setSortation(new Sortation(sortation)); }, + getSortation: function() { + return query.getSortation(); + }, + getAvailableFilters: function(projectIdentifier){ // TODO once this is becoming more single-page-app-like keep the available filters of the query model in sync when the project identifier is changed on the scope but the page isn't reloaded var identifier = 'global'; From 1351608befc204fa85fbef1ee002bcb85082f069 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 15 May 2014 15:27:04 +0200 Subject: [PATCH 04/17] Wired up sorting modal to current query sortation. Not yet updating table when sortation is changed. --- .../angular/controllers/dialogs/sorting.js | 21 +++++----- .../controllers/work-packages-controller.js | 34 ++++++++++++++++- .../options-dropdown-directive.js | 32 +--------------- .../javascripts/angular/models/query.js | 8 ++++ .../angular/services/query-service.js | 4 +- .../work_packages/modals/sorting.html | 38 +++---------------- 6 files changed, 61 insertions(+), 76 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index 3c348fe539..58933e23b5 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -48,10 +48,10 @@ angular.module('openproject.workPackages.controllers') $scope.initSortation = function(){ var currentSortation = QueryService.getSortation(); - var element = currentSortation.sortElements[0]; - $scope.selectedColumn1 = $scope.availableColumnsData.filter(function(column) { - return column.id == element.field; - })[0]; + $scope.sortElements = currentSortation.sortElements.map(function(element){ + return [$scope.availableColumnsData.filter(function(column) { return column.id == element.field; })[0], + $scope.availableDirectionsData.filter(function(direction) { return direction.id == element.direction; })[0]] + }); } $scope.getAvailableColumnsData = function(term, result) { @@ -63,11 +63,12 @@ angular.module('openproject.workPackages.controllers') } $scope.updateSortation = function(){ - // TODO RS: Clean this up once we have a sortation directive - var sortation = [[ $scope.selectedColumn1.id, $scope.selectedDirection1.id ], - [ $scope.selectedColumn2.id, $scope.selectedDirection2.id ], - [ $scope.selectedColumn3.id, $scope.selectedDirection3.id ]]; - QueryService.setSortation(sortation); + var sortElements = $scope.sortElements.map(function(element){ + return { field: element[0].id, direction: element[1].id } + }) + QueryService.updateSortElements(sortElements); + + sortingModal.deactivate(); } QueryService.getAvailableColumns() @@ -78,4 +79,6 @@ angular.module('openproject.workPackages.controllers') }); $scope.initSortation(); }); + + $scope.availableDirectionsData = [{ id: 'desc', label: 'Descending'}, { id: 'asc', label: 'Ascending'}]; }]); diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index 8d47fde316..554c97af8d 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -41,11 +41,19 @@ angular.module('openproject.workPackages.controllers') 'WorkPackageLoadingHelper', 'INITIALLY_SELECTED_COLUMNS', 'OPERATORS_AND_LABELS_BY_FILTER_TYPE', + 'columnsModal', + 'exportModal', + 'saveModal', + 'settingsModal', + 'shareModal', + 'sortingModal', function($scope, $q, $window, $location, WorkPackagesTableHelper, WorkPackagesTableService, WorkPackageService, QueryService, PaginationService, WorkPackageLoadingHelper, INITIALLY_SELECTED_COLUMNS, - OPERATORS_AND_LABELS_BY_FILTER_TYPE) { + OPERATORS_AND_LABELS_BY_FILTER_TYPE, columnsModal, + exportModal, saveModal, settingsModal, shareModal, + sortingModal) { $scope.projectTypes = $window.gon.project_types; $scope.showFiltersOptions = false; @@ -202,6 +210,30 @@ angular.module('openproject.workPackages.controllers') return false; }; + // Modals + + $scope.showColumnsModal = columnsModal.activate; + $scope.showExportModal = exportModal.activate; + $scope.showSettingsModal = settingsModal.activate; + $scope.showShareModal = shareModal.activate; + + $scope.showSortingModal = function(){ + $scope.$emit('hideAllDropdowns'); + sortingModal.activate(); + }; + + $scope.showSaveModal = function(saveAs){ + $scope.$emit('hideAllDropdowns'); + if( saveAs || $scope.query.isNew() ){ + saveModal.activate(); + } else { + QueryService.saveQuery() + .then(function(data){ + $scope.$emit('flashMessage', data.status); + }); + } + }; + // Go initialSetup(); diff --git a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js index a1692506d8..b7cb0557c8 100644 --- a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js @@ -29,43 +29,13 @@ angular.module('openproject.workPackages.directives') .directive('optionsDropdown', ['I18n', - 'columnsModal', - 'exportModal', - 'saveModal', - 'settingsModal', - 'shareModal', - 'sortingModal', - function(I18n, columnsModal, exportModal, saveModal, settingsModal, shareModal, sortingModal){ + function(I18n){ return { restrict: 'AE', scope: true, link: function(scope, element, attributes) { - // Modals - scope.showColumnsModal = columnsModal.activate; - scope.showExportModal = exportModal.activate; - scope.showSettingsModal = settingsModal.activate; - scope.showShareModal = shareModal.activate; - scope.showSortingModal = sortingModal.activate; - - scope.showSaveModal = function(saveAs){ - scope.$emit('hideAllDropdowns'); - if( saveAs || scope.query.isNew() ){ - saveModal.activate(); - } else { - QueryService.saveQuery() - .then(function(data){ - scope.$emit('flashMessage', data.status); - }); - } - }; - - scope.showColumnsModal = function(){ - scope.$emit('hideAllDropdowns'); - columnsModal.activate(); - }; - scope.toggleDisplaySums = function(){ scope.query.displaySums = !scope.query.displaySums; }; diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index 36575c8eac..19a0f0b360 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -98,6 +98,14 @@ angular.module('openproject.models') this.sortation = sortation; }, + updateSortElements: function(sortElements){ + this.sortation.sortElements.length = 0; + var self = this; + angular.forEach(sortElements, function(sortElement){ + self.sortation.addSortElement(sortElement); + }) + }, + setName: function(name) { this.name = name; }, diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 5b7254c7e2..88a365e91b 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -148,8 +148,8 @@ angular.module('openproject.services') this.showColumns(selectedColumnNames); }, - setSortation: function(sortation) { - return query.setSortation(new Sortation(sortation)); + updateSortElements: function(sortation) { + return query.updateSortElements(sortation); }, getSortation: function() { diff --git a/public/templates/work_packages/modals/sorting.html b/public/templates/work_packages/modals/sorting.html index 458f16fa90..8147c299cd 100644 --- a/public/templates/work_packages/modals/sorting.html +++ b/public/templates/work_packages/modals/sorting.html @@ -4,43 +4,15 @@

Sorting

-
- - -
- -
- - -
- -
- + - + + ng-model="element[1]">
From dac8a1ca44e3eca1b9b3766cbd7a562b05220d33 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 15 May 2014 16:13:09 +0200 Subject: [PATCH 05/17] Temp solution - moved sortation watcher to wp controller. Also copied over available columns caching from columns branch. --- .../javascripts/angular/controllers/dialogs/sorting.js | 6 +++--- .../angular/controllers/work-packages-controller.js | 9 +++++++++ app/assets/javascripts/angular/services/query-service.js | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index 58933e23b5..276b08006a 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -72,9 +72,9 @@ angular.module('openproject.workPackages.controllers') } QueryService.getAvailableColumns() - .then(function(data){ - $scope.availableColumns = data.available_columns - $scope.availableColumnsData = data.available_columns.map(function(column){ + .then(function(available_columns){ + $scope.availableColumns = available_columns + $scope.availableColumnsData = available_columns.map(function(column){ return { id: column.name, label: column.title, other: column.title }; }); $scope.initSortation(); diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index 554c97af8d..053e3b14ac 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -245,4 +245,13 @@ angular.module('openproject.workPackages.controllers') } }); + // Note: Again, this was in the work packages table directive but in an isolated scope so it wasn't picking up the changes to sortation. + // Think it would probably be a good idea to have the table directive just share the scope but that requires a refactor. + $scope.$watch('query.sortation.sortElements', function(oldValue, newValue) { + if (JSON.stringify(newValue) != JSON.stringify(oldValue)) { + $scope.updateResults(); + $scope.updateBackUrl(); + } + }, true); + }]); diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 88a365e91b..20e8deaa61 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -134,6 +134,7 @@ angular.module('openproject.services') return QueryService.doGet(url, function(response){ availableColumns = response.data.available_columns; return availableColumns; +<<<<<<< HEAD }); }, @@ -146,6 +147,9 @@ angular.module('openproject.services') this.hideColumns(currentColumns.map(function(column) { return column.name; })); this.showColumns(selectedColumnNames); +======= + }) +>>>>>>> Temp solution - moved sortation watcher to wp controller. }, updateSortElements: function(sortation) { From 932d7fe0da4d2d66e81d6b3cf9cd4490c64af4e7 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 21 May 2014 14:15:31 +0200 Subject: [PATCH 06/17] Always have 3 sort elements in sort selection modal. --- .../angular/controllers/dialogs/sorting.js | 14 +++++++++++--- .../javascripts/angular/services/query-service.js | 4 ---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index 276b08006a..fb07efd8be 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -52,6 +52,10 @@ angular.module('openproject.workPackages.controllers') return [$scope.availableColumnsData.filter(function(column) { return column.id == element.field; })[0], $scope.availableDirectionsData.filter(function(direction) { return direction.id == element.direction; })[0]] }); + + while($scope.sortElements.length < 3) { + $scope.sortElements.push([]); + } } $scope.getAvailableColumnsData = function(term, result) { @@ -63,9 +67,13 @@ angular.module('openproject.workPackages.controllers') } $scope.updateSortation = function(){ - var sortElements = $scope.sortElements.map(function(element){ - return { field: element[0].id, direction: element[1].id } - }) + var sortElements = $scope.sortElements + .filter(function(element){ + return element.length == 2; + }) + .map(function(element){ + return { field: element[0].id, direction: element[1].id } + }) QueryService.updateSortElements(sortElements); sortingModal.deactivate(); diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 20e8deaa61..88a365e91b 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -134,7 +134,6 @@ angular.module('openproject.services') return QueryService.doGet(url, function(response){ availableColumns = response.data.available_columns; return availableColumns; -<<<<<<< HEAD }); }, @@ -147,9 +146,6 @@ angular.module('openproject.services') this.hideColumns(currentColumns.map(function(column) { return column.name; })); this.showColumns(selectedColumnNames); -======= - }) ->>>>>>> Temp solution - moved sortation watcher to wp controller. }, updateSortElements: function(sortation) { From 9deaf2f55c900c8d5ca18b01acb4a49b1f809a9f Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 21 May 2014 14:37:46 +0200 Subject: [PATCH 07/17] Moved modals back into dropdown directive...:> --- .../controllers/work-packages-controller.js | 34 +------------------ .../options-dropdown-directive.js | 32 ++++++++++++++++- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index 053e3b14ac..f085c9a2b2 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -41,19 +41,11 @@ angular.module('openproject.workPackages.controllers') 'WorkPackageLoadingHelper', 'INITIALLY_SELECTED_COLUMNS', 'OPERATORS_AND_LABELS_BY_FILTER_TYPE', - 'columnsModal', - 'exportModal', - 'saveModal', - 'settingsModal', - 'shareModal', - 'sortingModal', function($scope, $q, $window, $location, WorkPackagesTableHelper, WorkPackagesTableService, WorkPackageService, QueryService, PaginationService, WorkPackageLoadingHelper, INITIALLY_SELECTED_COLUMNS, - OPERATORS_AND_LABELS_BY_FILTER_TYPE, columnsModal, - exportModal, saveModal, settingsModal, shareModal, - sortingModal) { + OPERATORS_AND_LABELS_BY_FILTER_TYPE) { $scope.projectTypes = $window.gon.project_types; $scope.showFiltersOptions = false; @@ -210,30 +202,6 @@ angular.module('openproject.workPackages.controllers') return false; }; - // Modals - - $scope.showColumnsModal = columnsModal.activate; - $scope.showExportModal = exportModal.activate; - $scope.showSettingsModal = settingsModal.activate; - $scope.showShareModal = shareModal.activate; - - $scope.showSortingModal = function(){ - $scope.$emit('hideAllDropdowns'); - sortingModal.activate(); - }; - - $scope.showSaveModal = function(saveAs){ - $scope.$emit('hideAllDropdowns'); - if( saveAs || $scope.query.isNew() ){ - saveModal.activate(); - } else { - QueryService.saveQuery() - .then(function(data){ - $scope.$emit('flashMessage', data.status); - }); - } - }; - // Go initialSetup(); diff --git a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js index b7cb0557c8..a1692506d8 100644 --- a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js @@ -29,13 +29,43 @@ angular.module('openproject.workPackages.directives') .directive('optionsDropdown', ['I18n', - function(I18n){ + 'columnsModal', + 'exportModal', + 'saveModal', + 'settingsModal', + 'shareModal', + 'sortingModal', + function(I18n, columnsModal, exportModal, saveModal, settingsModal, shareModal, sortingModal){ return { restrict: 'AE', scope: true, link: function(scope, element, attributes) { + // Modals + scope.showColumnsModal = columnsModal.activate; + scope.showExportModal = exportModal.activate; + scope.showSettingsModal = settingsModal.activate; + scope.showShareModal = shareModal.activate; + scope.showSortingModal = sortingModal.activate; + + scope.showSaveModal = function(saveAs){ + scope.$emit('hideAllDropdowns'); + if( saveAs || scope.query.isNew() ){ + saveModal.activate(); + } else { + QueryService.saveQuery() + .then(function(data){ + scope.$emit('flashMessage', data.status); + }); + } + }; + + scope.showColumnsModal = function(){ + scope.$emit('hideAllDropdowns'); + columnsModal.activate(); + }; + scope.toggleDisplaySums = function(){ scope.query.displaySums = !scope.query.displaySums; }; From f97f57e2175330e629dee5899e183eae3554c4dd Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 22 May 2014 09:53:23 +0200 Subject: [PATCH 08/17] Reverted Gemfile.lock to that from dev-angular. Must have accidentally committed it. --- Gemfile.lock | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d8665ccaa9..d92961ab97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,9 +81,6 @@ GEM arel (3.0.3) awesome_nested_set (2.1.6) activerecord (>= 3.0.0) - better_errors (1.1.0) - coderay (>= 1.0.0) - erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) bourbon (4.0.0) @@ -113,13 +110,6 @@ GEM codeclimate-test-reporter (0.1.1) simplecov (>= 0.7.1, < 1.0.0) coderay (1.0.9) - coffee-rails (3.2.2) - coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.6.2) color-tools (1.3.0) columnize (0.8.9) compass (1.0.0.alpha.19) @@ -327,8 +317,6 @@ GEM multi_json (~> 1.0) rubyzip websocket (~> 1.0.4) - sextant (0.2.4) - rails (>= 3.2) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) @@ -392,14 +380,12 @@ DEPENDENCIES activerecord-tableless (~> 1.0) acts_as_list (~> 0.2.0) awesome_nested_set - better_errors bourbon (~> 4.0) capybara capybara-screenshot cocaine codeclimate-test-reporter coderay (~> 1.0.5) - coffee-rails (~> 3.2.1) color-tools (~> 1.3.0) compass (= 1.0.0.alpha.19) compass-rails! @@ -456,7 +442,6 @@ DEPENDENCIES sass (~> 3.3.6) sass-rails! selenium-webdriver - sextant shoulda shoulda-matchers simplecov (= 0.8.0.pre) From b9777f0d4fbf5a979bb8961f2b107b1983b20398 Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Thu, 22 May 2014 11:22:33 +0200 Subject: [PATCH 09/17] Merge branch 'dev-angular' into feature/ng-toolbar-sort-by --- Gemfile | 3 +- .../angular/controllers/dialogs/columns.js | 2 +- .../angular/controllers/dialogs/share.js | 11 +- .../angular/controllers/dialogs/sorting.js | 2 +- .../controllers/work-packages-controller.js | 8 +- .../components/selectable-title-directive.js | 5 + .../options-dropdown-directive.js | 8 +- .../helpers/work-packages-table-helper.js | 2 +- .../javascripts/angular/models/query.js | 6 +- .../javascripts/angular/openproject-app.js | 2 +- .../angular/services/query-service.js | 17 ++- .../services/work-packages-table-service.js | 7 +- app/assets/javascripts/application.js.erb | 2 +- .../stylesheets/content/_context_menu.sass | 101 +----------------- app/assets/stylesheets/context_menu_rtl.css | 2 + .../fonts/_openproject_icon_font.sass | 20 ++-- app/controllers/api/v3/queries_controller.rb | 1 + app/views/work_packages/index.html.erb | 2 +- .../moves/work_package_moves_new_copy.feature | 2 +- .../work-packages-controller-test.js | 4 +- .../templates/work_packages/modals/share.html | 9 ++ 21 files changed, 82 insertions(+), 134 deletions(-) diff --git a/Gemfile b/Gemfile index 98ae905d4e..faf1e37d4a 100644 --- a/Gemfile +++ b/Gemfile @@ -110,8 +110,7 @@ gem 'sprockets-rails', '2.0.0.backport1' gem 'sass-rails', git: 'https://github.com/guilleiguaran/sass-rails.git', branch: 'backport' gem 'sass', '~> 3.3.6' gem 'bourbon', '~> 4.0' -gem 'coffee-rails', '~> 3.2.1' -gem 'uglifier', '>= 1.0.3' +gem 'uglifier', '>= 1.0.3', require: false gem 'compass', '1.0.0.alpha.19' gem 'compass-rails', git: 'https://github.com/Compass/compass-rails' gem 'livingstyleguide' diff --git a/app/assets/javascripts/angular/controllers/dialogs/columns.js b/app/assets/javascripts/angular/controllers/dialogs/columns.js index ed35566a8a..b99a7effa7 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/columns.js +++ b/app/assets/javascripts/angular/controllers/dialogs/columns.js @@ -77,7 +77,7 @@ angular.module('openproject.workPackages.controllers') $scope.selectedColumnsData = convertColumnsForSelect2(selectedColumns); // Available selectable Columns - QueryService.getAvailableUnusedColumns() + QueryService.loadAvailableUnusedColumns() .then(function(availableUnusedColumns){ $scope.availableUnusedColumns = availableUnusedColumns; $scope.availableColumnsData = convertColumnsForSelect2(availableUnusedColumns); diff --git a/app/assets/javascripts/angular/controllers/dialogs/share.js b/app/assets/javascripts/angular/controllers/dialogs/share.js index 39ec1eb4c5..d13780d9f4 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/share.js +++ b/app/assets/javascripts/angular/controllers/dialogs/share.js @@ -36,7 +36,16 @@ angular.module('openproject.workPackages.controllers') }); }]) -.controller('ShareModalController', ['shareModal', function(shareModal) { +.controller('ShareModalController', ['$scope', 'shareModal', 'QueryService', function($scope, shareModal, QueryService) { this.name = 'Share'; this.closeMe = shareModal.deactivate; + $scope.query = QueryService.getQuery(); + + $scope.saveQuery = function() { + QueryService.saveQuery() + .then(function(data){ + shareModal.deactivate(); + $scope.$emit('flashMessage', data.status); + }); + } }]); diff --git a/app/assets/javascripts/angular/controllers/dialogs/sorting.js b/app/assets/javascripts/angular/controllers/dialogs/sorting.js index fb07efd8be..4f6a805235 100644 --- a/app/assets/javascripts/angular/controllers/dialogs/sorting.js +++ b/app/assets/javascripts/angular/controllers/dialogs/sorting.js @@ -79,7 +79,7 @@ angular.module('openproject.workPackages.controllers') sortingModal.deactivate(); } - QueryService.getAvailableColumns() + QueryService.loadAvailableColumns() .then(function(available_columns){ $scope.availableColumns = available_columns $scope.availableColumnsData = available_columns.map(function(column){ diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index f085c9a2b2..2df6434a0d 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -33,7 +33,6 @@ angular.module('openproject.workPackages.controllers') '$q', '$window', '$location', - 'WorkPackagesTableHelper', 'WorkPackagesTableService', 'WorkPackageService', 'QueryService', @@ -41,8 +40,7 @@ angular.module('openproject.workPackages.controllers') 'WorkPackageLoadingHelper', 'INITIALLY_SELECTED_COLUMNS', 'OPERATORS_AND_LABELS_BY_FILTER_TYPE', - function($scope, $q, $window, $location, - WorkPackagesTableHelper, WorkPackagesTableService, + function($scope, $q, $window, $location, WorkPackagesTableService, WorkPackageService, QueryService, PaginationService, WorkPackageLoadingHelper, INITIALLY_SELECTED_COLUMNS, OPERATORS_AND_LABELS_BY_FILTER_TYPE) { @@ -115,8 +113,8 @@ angular.module('openproject.workPackages.controllers') // table data WorkPackagesTableService.setColumns($scope.query.columns); WorkPackagesTableService.addColumnMetaData(meta); - WorkPackagesTableService.setRows(WorkPackagesTableHelper.getRows(workPackages, $scope.query.groupBy)); WorkPackagesTableService.setGroupBy($scope.query.groupBy); + WorkPackagesTableService.buildRows(workPackages, $scope.query.groupBy); WorkPackagesTableService.setBulkLinks(bulkLinks); // query data @@ -140,7 +138,7 @@ angular.module('openproject.workPackages.controllers') } function initAvailableColumns() { - return QueryService.getAvailableUnusedColumns($scope.projectIdentifier) + return QueryService.loadAvailableUnusedColumns($scope.projectIdentifier) .then(function(data){ $scope.availableUnusedColumns = data; }); diff --git a/app/assets/javascripts/angular/directives/components/selectable-title-directive.js b/app/assets/javascripts/angular/directives/components/selectable-title-directive.js index d485242346..91842ed04a 100644 --- a/app/assets/javascripts/angular/directives/components/selectable-title-directive.js +++ b/app/assets/javascripts/angular/directives/components/selectable-title-directive.js @@ -44,6 +44,11 @@ angular.module('openproject.uiComponents') scope.filteredGroups = angular.copy(scope.groups); }); + angular.element('#title-filter').bind('click', function(event) { + event.preventDefault(); + event.stopPropagation(); + }); + scope.reload = function(modelId, newTitle) { scope.selectedTitle = newTitle; scope.reloadMethod(modelId); diff --git a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js index a1692506d8..cca8dad4b7 100644 --- a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js @@ -35,12 +35,17 @@ angular.module('openproject.workPackages.directives') 'settingsModal', 'shareModal', 'sortingModal', - function(I18n, columnsModal, exportModal, saveModal, settingsModal, shareModal, sortingModal){ + 'QueryService', + '$window', + function(I18n, columnsModal, exportModal, saveModal, settingsModal, shareModal, sortingModal, QueryService, $window){ return { restrict: 'AE', scope: true, link: function(scope, element, attributes) { + angular.element($window).bind('click', function() { + scope.$emit('hideAllDropdowns'); + }); // Modals scope.showColumnsModal = columnsModal.activate; @@ -67,6 +72,7 @@ angular.module('openproject.workPackages.directives') }; scope.toggleDisplaySums = function(){ + scope.$emit('hideAllDropdowns'); scope.query.displaySums = !scope.query.displaySums; }; } diff --git a/app/assets/javascripts/angular/helpers/work-packages-table-helper.js b/app/assets/javascripts/angular/helpers/work-packages-table-helper.js index 9892c1509a..0f4180f3ed 100644 --- a/app/assets/javascripts/angular/helpers/work-packages-table-helper.js +++ b/app/assets/javascripts/angular/helpers/work-packages-table-helper.js @@ -31,7 +31,7 @@ angular.module('openproject.workPackages.helpers') .factory('WorkPackagesTableHelper', ['WorkPackagesHelper', function(WorkPackagesHelper) { var WorkPackagesTableHelper = { /* builds rows from work packages, see IssuesHelper */ - getRows: function(workPackages, groupBy) { + buildRows: function(workPackages, groupBy) { var rows = [], ancestors = []; var currentGroup, allGroups = [], groupIndex = -1; diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index 19a0f0b360..71e9c44388 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -58,7 +58,8 @@ angular.module('openproject.models') 'group_by': this.groupBy, 'sort': this.sortation.encode(), 'display_sums': this.displaySums, - 'name': this.name + 'name': this.name, + 'is_public': this.isPublic }].concat(this.getActiveConfiguredFilters().map(function(filter) { return filter.toParams(); })) @@ -73,7 +74,8 @@ angular.module('openproject.models') 'c[]': this.getParamColumns(), 'group_by': this.groupBy, 'sort': this.sortation.encode(), - 'display_sums': this.displaySums + 'display_sums': this.displaySums, + 'is_public': this.isPublic }].concat(this.getActiveConfiguredFilters().map(function(filter) { return filter.toParams(); })) diff --git a/app/assets/javascripts/angular/openproject-app.js b/app/assets/javascripts/angular/openproject-app.js index bcd4952217..73a06c6a76 100644 --- a/app/assets/javascripts/angular/openproject-app.js +++ b/app/assets/javascripts/angular/openproject-app.js @@ -73,7 +73,7 @@ openprojectApp config.url = window.appBasePath + config.url; return config || $q.when(config); } - } + }; }); }]) .run(['$http', function($http){ diff --git a/app/assets/javascripts/angular/services/query-service.js b/app/assets/javascripts/angular/services/query-service.js index 88a365e91b..f0d53422fe 100644 --- a/app/assets/javascripts/angular/services/query-service.js +++ b/app/assets/javascripts/angular/services/query-service.js @@ -67,7 +67,8 @@ angular.module('openproject.services') groupSums: queryData.group_sums, sums: queryData.sums, columns: selectedColumns, - groupBy: queryData.group_by + groupBy: queryData.group_by, + isPublic: queryData.is_public }); query.setSortation(new Sortation(queryData.sort_criteria)); @@ -99,6 +100,10 @@ angular.module('openproject.services') return totalEntries; }, + getAvailableUnusedColumns: function() { + return availableUnusedColumns; + }, + hideColumns: function(columnNames) { WorkPackagesTableHelper.moveColumns(columnNames, this.getSelectedColumns(), availableColumns); }, @@ -115,15 +120,19 @@ angular.module('openproject.services') return QueryService.doQuery(url); }, - getAvailableUnusedColumns: function(projectIdentifier) { - return QueryService.getAvailableColumns(projectIdentifier) + loadAvailableUnusedColumns: function(projectIdentifier) { + if(availableUnusedColumns.length) { + return $q.when(availableUnusedColumns); + } + + return QueryService.loadAvailableColumns(projectIdentifier) .then(function(available_columns) { availableUnusedColumns = WorkPackagesTableHelper.getColumnDifference(available_columns, QueryService.getSelectedColumns()); return availableUnusedColumns; }); }, - getAvailableColumns: function(projectIdentifier) { + loadAvailableColumns: function(projectIdentifier) { // TODO: Once we have a single page app we need to differentiate between different project columns if(availableColumns.length) { return $q.when(availableColumns); diff --git a/app/assets/javascripts/angular/services/work-packages-table-service.js b/app/assets/javascripts/angular/services/work-packages-table-service.js index 74380ae51e..dfb538ef12 100644 --- a/app/assets/javascripts/angular/services/work-packages-table-service.js +++ b/app/assets/javascripts/angular/services/work-packages-table-service.js @@ -31,7 +31,8 @@ angular.module('openproject.workPackages.services') .service('WorkPackagesTableService', [ '$filter', 'QueryService', - function($filter, QueryService) { + 'WorkPackagesTableHelper', + function($filter, QueryService, WorkPackagesTableHelper) { var workPackagesTableData = { allRowsChecked: false }; @@ -77,6 +78,10 @@ angular.module('openproject.workPackages.services') return workPackagesTableData.groupableColumns; }, + buildRows: function(workPackages, groupBy) { + this.setRows(WorkPackagesTableHelper.buildRows(workPackages, groupBy)); + }, + setRows: function(rows) { workPackagesTableData.rows = rows; }, diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index ce99000b25..01b09d0453 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -20,7 +20,7 @@ //= require momentjs/lang/de.js //= require jquery.atwho/dist/js/jquery.atwho.js -//= require Caret.js/src/jquery.caret +//= require Caret.js/src/jquery.caret.js //= require jquery_noconflict //= require prototype //= require effects diff --git a/app/assets/stylesheets/content/_context_menu.sass b/app/assets/stylesheets/content/_context_menu.sass index 12e44f3af2..dd4aabf581 100644 --- a/app/assets/stylesheets/content/_context_menu.sass +++ b/app/assets/stylesheets/content/_context_menu.sass @@ -34,106 +34,9 @@ padding: 0 border: 0 -.context-menu - position: absolute - font-size: 0.9em - left: -7px - top: -7px - padding: 6px - z-index: 21 - ul - @include context_menu_defaults - width: 140px - list-style: none +#work-package-context-menu, #column-context-menu + &.action-menu position: absolute - left: -7px - z-index: 20 - background: #f4f4f4 - border: 1px solid #afafaf - li - @include context_menu_defaults - position: relative - padding: 1px - padding: 6px - z-index: 39 - border: 1px solid white - background-position: 6px center - background-repeat: no-repeat - cursor: pointer - border-top: 1px solid #fff - border-bottom: 1px solid #ddd - > a - width:auto - &:hover - border: 1px solid gray - background-color: #eee - - &.folder - &:hover - z-index: 40 - div.submenu - background: url(image-path('arrow-right.png')) no-repeat right - position: absolute - height: 9px - width: 7px - top: 11px - right: 6px - ul - display: none - position: absolute - max-height: 400px - overflow-x: hidden - overflow-y: auto - left: 140px - top: -1px - width: auto - z-index: 19 - - a - @include context_menu_defaults - border: none - background-repeat: no-repeat - background-position: 1px 50% - padding: 1px 10px 1px 15px - width: 100% - - &.icon, &.icon-context - color: $content_icon_link_hover_color - font-weight: bold - padding-left: 0 - - &.disabled, &.disabled:hover - color: #ccc - - &:hover - color: #2A5685 - border: none - text-decoration: none - - &.reverse-y li.folder>ul - top: auto - bottom: 0 - &.reverse-x li.folder - ul - left: auto - right: 168px - >ul - right: 148px - -#context-menu ul ul, #context-menu li:hover ul ul - display: none - -#context-menu li:hover ul, #context-menu li:hover li:hover ul - display: block - -#context-menu li li - padding: 6px 12px - width: auto - display: block - white-space: nowrap - -#context-menu li:hover ul - display: block .hascontextmenu cursor: context-menu diff --git a/app/assets/stylesheets/context_menu_rtl.css b/app/assets/stylesheets/context_menu_rtl.css index 66c7b5888f..5258418270 100644 --- a/app/assets/stylesheets/context_menu_rtl.css +++ b/app/assets/stylesheets/context_menu_rtl.css @@ -27,6 +27,8 @@ See doc/COPYRIGHT.rdoc for more details. ++*/ +/* FIXME adapt modifications to the new action-menu component */ + #context-menu li.folder ul { left:auto; right:168px; } #context-menu li.folder>ul { left:auto; right:148px; } #context-menu li a.submenu { background:url("../images/bullet_arrow_left.png") left no-repeat; } diff --git a/app/assets/stylesheets/fonts/_openproject_icon_font.sass b/app/assets/stylesheets/fonts/_openproject_icon_font.sass index 1ed09ae63b..d5d500a0ea 100644 --- a/app/assets/stylesheets/fonts/_openproject_icon_font.sass +++ b/app/assets/stylesheets/fonts/_openproject_icon_font.sass @@ -65,11 +65,11 @@ @mixin icon6-rules padding: 0 7px 0 9px font-size: 12px - + @mixin icon-dropdown-rules padding: 0 0px 0 3px font-size: 13px - + @mixin icon-button-rules padding: 0 5px 0 0px font-size: 13px @@ -77,7 +77,7 @@ @mixin icon-context-rules padding: 0 4px 0 0 color: $content_icon_color - + @mixin icon-table-rules padding: 0 0 0 0 @@ -105,17 +105,17 @@ @include icon-common content: attr(data-icon5) @include icon5-rules - + [data-icon-dropwdown]:before @include icon-common content: attr(data-icon-dropdown) @include icon-dropdown-rules - + [data-icon-button]:before @include icon-common content: attr(data-icon-button) @include icon-button-rules - + [data-icon-table]:before @include icon-common content: attr(data-icon-table) @@ -147,15 +147,15 @@ // used for toggler icons in the project menu .icon6:before @include icon6-rules - + // used for arrow icons in buttons with dropdown .icon-dropdown:before @include icon-dropdown-rules - + // used for icons in buttons .icon-buttons:before @include icon-button-rules - + // used for icons in workpackage table .icon-table:before @include icon-table-rules @@ -166,7 +166,7 @@ float: left // used for icons in the content area, which appear in context (menus) -#context-menu .icon:before, +.action-menu .icon:before, .icon-context:before @include icon-context-rules diff --git a/app/controllers/api/v3/queries_controller.rb b/app/controllers/api/v3/queries_controller.rb index 1a34b76edd..ea3475bd73 100644 --- a/app/controllers/api/v3/queries_controller.rb +++ b/app/controllers/api/v3/queries_controller.rb @@ -122,6 +122,7 @@ module Api::V3 @query.column_names = params[:c] if params[:c] @query.column_names = nil if params[:default_columns] @query.name = params[:name] if params[:name] + @query.is_public = params[:is_public] if params[:is_public] end def visible_queries diff --git a/app/views/work_packages/index.html.erb b/app/views/work_packages/index.html.erb index cdf3a16e04..52c40b0300 100644 --- a/app/views/work_packages/index.html.erb +++ b/app/views/work_packages/index.html.erb @@ -86,7 +86,7 @@ end
  • Save
  • Save as
  • Export
  • -
  • Share
  • +
  • Share
  • Page settings
  • diff --git a/features/work_packages/moves/work_package_moves_new_copy.feature b/features/work_packages/moves/work_package_moves_new_copy.feature index cf92c9b23a..e04056f86e 100644 --- a/features/work_packages/moves/work_package_moves_new_copy.feature +++ b/features/work_packages/moves/work_package_moves_new_copy.feature @@ -128,7 +128,7 @@ Feature: Copying a work package And I open the context menu on the work packages: | issue1 | | issue2 | - And I follow "Copy" within "#work-pacakge-context-menu" + And I follow "Copy" within "#work-package-context-menu" Then I should see "Copy" within "#content" And I should not see "Move" within "#content" diff --git a/karma/tests/controllers/work-packages-controller-test.js b/karma/tests/controllers/work-packages-controller-test.js index e2e956ce2a..2d8df67e2f 100644 --- a/karma/tests/controllers/work-packages-controller-test.js +++ b/karma/tests/controllers/work-packages-controller-test.js @@ -72,7 +72,7 @@ describe('WorkPackagesController', function() { }, initQuery: function () { }, - getAvailableColumns: function () { + loadAvailableColumns: function () { return $timeout(function () { return columnData; }, 10); @@ -83,7 +83,7 @@ describe('WorkPackagesController', function() { }, 10); }, - getAvailableUnusedColumns: function() { + loadAvailableUnusedColumns: function() { return $timeout(function () { return columnData; }, 10); diff --git a/public/templates/work_packages/modals/share.html b/public/templates/work_packages/modals/share.html index dcfb9d18ee..ee3b919c71 100644 --- a/public/templates/work_packages/modals/share.html +++ b/public/templates/work_packages/modals/share.html @@ -4,5 +4,14 @@

    Share

    +
    + + +
    +
    + + +
    + From 2dd2982c97b7760d3aea59804a839c913ac8b419 Mon Sep 17 00:00:00 2001 From: Christoph Zierz - zzmedia Date: Thu, 22 May 2014 11:38:05 +0200 Subject: [PATCH 10/17] Fix menu-markup - cleaned up the action-menu markup - fixed some issues --- .../stylesheets/content/_action_menu_main.md | 80 +++++++++---------- .../content/_action_menu_main.sass | 45 +++++------ .../fonts/_openproject_icon_font.sass | 21 +++++ 3 files changed, 78 insertions(+), 68 deletions(-) diff --git a/app/assets/stylesheets/content/_action_menu_main.md b/app/assets/stylesheets/content/_action_menu_main.md index 6e7e392a0a..6742d6594e 100644 --- a/app/assets/stylesheets/content/_action_menu_main.md +++ b/app/assets/stylesheets/content/_action_menu_main.md @@ -2,50 +2,42 @@ ```
    - +
    - ``` diff --git a/app/assets/stylesheets/content/_action_menu_main.sass b/app/assets/stylesheets/content/_action_menu_main.sass index f51c50c5e2..098be13874 100644 --- a/app/assets/stylesheets/content/_action_menu_main.sass +++ b/app/assets/stylesheets/content/_action_menu_main.sass @@ -84,18 +84,18 @@ ul.action_menu_more @include contextual(-39px) .action-menu - float: left - width: 200px - border: 1px solid #dddddd - box-shadow: 1px 1px 4px #cccccc - -webkit-box-shadow: 1px 1px 4px #cccccc - padding: 3px 0 ul list-style-type: none - padding: 0 margin: 0 + + width: 200px + border: 1px solid #dddddd + box-shadow: 1px 1px 4px #cccccc + padding: 3px 0 + background: #ffffff + li - padding: 4px 10px + padding: 4px 13px 4px 10px &:hover background: #f0f0f0 &.hasnoicon @@ -105,25 +105,22 @@ ul.action_menu_more margin: 3px 0 padding: 0 font-size: 1px + &:hover ul + display: block + margin: -28px 0 0 190px + a color: $main_menu_font_color font-weight: normal - white-space: nowrap &:hover text-decoration: none + ul + display: none + position: absolute -i -.icon-actionmenu - padding: 0 10px 0 0 - font-size: 15px - line-height: 5px - vertical-align: -40% -.icon-submenu - padding: 0 0 0 0 - float: right - font-size: 15px - line-height: 5px - vertical-align: -40% - -#submenu - margin: 81px 0 0 0 \ No newline at end of file + +.icon-action-menu + @include icon-action-menu-rules +.icon-sub-menu + @include icon-sub-menu-rules + \ No newline at end of file diff --git a/app/assets/stylesheets/fonts/_openproject_icon_font.sass b/app/assets/stylesheets/fonts/_openproject_icon_font.sass index 1ed09ae63b..c45d9f2c3d 100644 --- a/app/assets/stylesheets/fonts/_openproject_icon_font.sass +++ b/app/assets/stylesheets/fonts/_openproject_icon_font.sass @@ -80,6 +80,19 @@ @mixin icon-table-rules padding: 0 0 0 0 + +@mixin icon-action-menu-rules + padding: 0 10px 0 0 + font-size: 15px + line-height: 5px + vertical-align: -40% + +@mixin icon-sub-menu-rules + padding: 0 0 0 0 + float: right + font-size: 15px + line-height: 5px + vertical-align: -40% [data-icon]:before @include icon-common @@ -120,6 +133,14 @@ @include icon-common content: attr(data-icon-table) @include icon-table-rules + +[data-icon-action-menu]:before + content: attr(data-icon-action-menu) + @include icon-action-menu-rules + +[data-icon-sub-menu]:before + content: attr(data-icon-sub-menu) + @include icon-sub-menu-rules [class^="icon-"]:before, [class*=" icon-"]:before From 5921fbd73a74a5599b58d9fb256393389fd130a1 Mon Sep 17 00:00:00 2001 From: Christoph Zierz - zzmedia Date: Thu, 22 May 2014 11:49:00 +0200 Subject: [PATCH 11/17] Remove former context menu-styles - removed former context menu-styles --- .../content/_action_menu_main.sass | 57 ------------------- 1 file changed, 57 deletions(-) diff --git a/app/assets/stylesheets/content/_action_menu_main.sass b/app/assets/stylesheets/content/_action_menu_main.sass index 098be13874..6a7ba19dfc 100644 --- a/app/assets/stylesheets/content/_action_menu_main.sass +++ b/app/assets/stylesheets/content/_action_menu_main.sass @@ -25,63 +25,6 @@ * * See doc/COPYRIGHT.rdoc for more details. ++ */ - -@mixin action_menu_defaults($margin-top: 7px) - float: right - margin-top: $margin-top - > li - float: left - position: relative - list-style: none - -@mixin contextual($margin-top: 8px) - float: right - white-space: nowrap - line-height: 1.4em - margin-top: $margin-top - padding-left: 10px - -ul.action_menu_main - @include action_menu_defaults - -ul.action_menu_specific, -.nosidebar ul.action_menu_specific - @include action_menu_defaults(-34px) - -p.subtitle + ul.action_menu_specific - @include action_menu_defaults(-57px) - -ul.action_menu_more - position: absolute - top: 23px - right: 0px - z-index: 100 - white-space: nowrap - padding: 10px - padding-top: 5px - - background: white - border: 1px solid #B7B7B7 - - box-shadow: 1px 1px 2px #aaa - > li - padding-top: 5px - - -#lower-title-bar ul.action_menu_specific - @include action_menu_defaults - padding-top: 10px - -#lower-title-bar ul.action_menu_more - bottom: 0 - right: 0 - margin-bottom: 25px - top: auto - > li.drop-down - position: relative - -.message-reply-menu - @include contextual(-39px) .action-menu ul From ee1849efe7cd5f8d78893d6673b0e946e0df47c1 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 22 May 2014 13:00:14 +0200 Subject: [PATCH 12/17] Column headers now displaying first sort element up/down arrow. --- .../work_packages/options-dropdown-directive.js | 6 +++++- app/assets/javascripts/angular/models/query.js | 6 +----- app/assets/javascripts/angular/models/sortation.js | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js index a1692506d8..65fbf6f131 100644 --- a/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js @@ -47,7 +47,6 @@ angular.module('openproject.workPackages.directives') scope.showExportModal = exportModal.activate; scope.showSettingsModal = settingsModal.activate; scope.showShareModal = shareModal.activate; - scope.showSortingModal = sortingModal.activate; scope.showSaveModal = function(saveAs){ scope.$emit('hideAllDropdowns'); @@ -66,6 +65,11 @@ angular.module('openproject.workPackages.directives') columnsModal.activate(); }; + scope.showSortingModal = function(){ + scope.$emit('hideAllDropdowns'); + sortingModal.activate(); + }; + scope.toggleDisplaySums = function(){ scope.query.displaySums = !scope.query.displaySums; }; diff --git a/app/assets/javascripts/angular/models/query.js b/app/assets/javascripts/angular/models/query.js index 19a0f0b360..25b532afb6 100644 --- a/app/assets/javascripts/angular/models/query.js +++ b/app/assets/javascripts/angular/models/query.js @@ -99,11 +99,7 @@ angular.module('openproject.models') }, updateSortElements: function(sortElements){ - this.sortation.sortElements.length = 0; - var self = this; - angular.forEach(sortElements, function(sortElement){ - self.sortation.addSortElement(sortElement); - }) + this.sortation.setSortElements(sortElements); }, setName: function(name) { diff --git a/app/assets/javascripts/angular/models/sortation.js b/app/assets/javascripts/angular/models/sortation.js index 93f7172ce3..ebe67541d0 100644 --- a/app/assets/javascripts/angular/models/sortation.js +++ b/app/assets/javascripts/angular/models/sortation.js @@ -83,6 +83,14 @@ angular.module('openproject.models') this.sortElements.unshift(sortElement); }; + Sortation.prototype.setSortElements = function(sortElements) { + var elements = this.sortElements; + elements.length = 0; + angular.forEach(sortElements, function(element){ + elements.push(element); + }); + }; + Sortation.prototype.getTargetSortationOfHeader = function(headerName) { var targetSortation = angular.copy(this); var targetSortDirection = this.getCurrentSortDirectionOfHeader(headerName) === 'asc' ? 'desc' : 'asc'; From aaeedb37685da9d5c5a0599a3453b16b266d240d Mon Sep 17 00:00:00 2001 From: Christoph Zierz - zzmedia Date: Thu, 22 May 2014 13:32:39 +0200 Subject: [PATCH 13/17] Add styles for modal popups - added styles for modal popups / lightboxes --- app/assets/stylesheets/content/_modal.md | 13 ++++++++++ app/assets/stylesheets/content/_modal.sass | 29 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/app/assets/stylesheets/content/_modal.md b/app/assets/stylesheets/content/_modal.md index d8b4b4cdf7..e536cba332 100644 --- a/app/assets/stylesheets/content/_modal.md +++ b/app/assets/stylesheets/content/_modal.md @@ -1 +1,14 @@ # Modal + +``` +
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Crasdapibus. Vivamus elementum semper
    + + +``` diff --git a/app/assets/stylesheets/content/_modal.sass b/app/assets/stylesheets/content/_modal.sass index 18202fd25e..37166f6115 100644 --- a/app/assets/stylesheets/content/_modal.sass +++ b/app/assets/stylesheets/content/_modal.sass @@ -100,3 +100,32 @@ $ng-modal-image-width: $ng-modal-image-height margin-top: 1em &:last-child padding: 0 2em + +#sample-content-behind-modal + position: absolute + z-index: 1 + padding: 10px + +#modal-dark-overlay + position: absolute + z-index: 2 + background: #000000 + opacity: 0.3 + width: 97% + height: 94% + +.modal-container + position: relative + z-index: 3 + margin: 20px auto + width: 60% + background: #ffffff + padding: 0 + .modal-header + padding: 0 + i + float: right + padding: 10px + .modal-content + padding: 20px 20px 20px 20px + \ No newline at end of file From b4bc2951cd75ed4b9e0c95e7bf48b6122816526a Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Thu, 22 May 2014 14:02:26 +0200 Subject: [PATCH 14/17] Apply new action menu styles to wp context menu --- public/templates/work_packages/work_package_context_menu.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/templates/work_packages/work_package_context_menu.html b/public/templates/work_packages/work_package_context_menu.html index b8c9704003..173dc1271b 100644 --- a/public/templates/work_packages/work_package_context_menu.html +++ b/public/templates/work_packages/work_package_context_menu.html @@ -12,7 +12,8 @@
  • TODO Priority -
      + + From afc167a50fae41b7020abae3ffd5a10ce3d37d3d Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Thu, 22 May 2014 15:38:48 +0200 Subject: [PATCH 16/17] Update close icons in modal dialogs --- app/assets/stylesheets/content/_modal.md | 17 +++--- app/assets/stylesheets/content/_modal.sass | 54 +++---------------- .../work_packages/modals/columns.html | 2 +- .../work_packages/modals/export.html | 2 +- .../templates/work_packages/modals/save.html | 2 +- .../work_packages/modals/settings.html | 2 +- .../templates/work_packages/modals/share.html | 2 +- .../work_packages/modals/sorting.html | 4 +- 8 files changed, 24 insertions(+), 61 deletions(-) diff --git a/app/assets/stylesheets/content/_modal.md b/app/assets/stylesheets/content/_modal.md index e536cba332..a1f6d21402 100644 --- a/app/assets/stylesheets/content/_modal.md +++ b/app/assets/stylesheets/content/_modal.md @@ -1,14 +1,17 @@ # Modal ``` -
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras +
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Crasdapibus. Vivamus elementum semper
      - -