Removed delete from page settings modal and added delete to settings menu.

pull/1380/head
Richard 11 years ago
parent 426fc0977a
commit a36f784f66
  1. 21
      app/assets/javascripts/angular/controllers/dialogs/settings.js
  2. 15
      app/assets/javascripts/angular/directives/work_packages/options-dropdown-directive.js
  3. 2
      config/locales/js-de.yml
  4. 2
      config/locales/js-en.yml
  5. 1
      public/templates/work_packages.html
  6. 4
      public/templates/work_packages/modals/settings.html

@ -44,19 +44,10 @@ angular.module('openproject.workPackages.controllers')
$scope.deleteQuery = false; $scope.deleteQuery = false;
$scope.updateQuery = function(deleteQuery) { $scope.updateQuery = function(deleteQuery) {
if(deleteQuery) { QueryService.saveQuery()
QueryService.deleteQuery() .then(function(data){
.then(function(data){ settingsModal.deactivate();
settingsModal.deactivate(); $scope.$emit('flashMessage', data.status);
$scope.$emit('flashMessage', data.status); });
$scope.$emit('queryResetRequired'); };
})
} else {
QueryService.saveQuery()
.then(function(data){
settingsModal.deactivate();
$scope.$emit('flashMessage', data.status);
});
}
};
}]); }]);

@ -63,6 +63,17 @@ angular.module('openproject.workPackages.directives')
} }
}; };
scope.deleteQuery = function(){
if( deleteConfirmed() ){
QueryService.deleteQuery()
.then(function(data){
settingsModal.deactivate();
scope.$emit('flashMessage', data.status);
scope.$emit('queryResetRequired');
})
}
};
scope.showColumnsModal = function(){ scope.showColumnsModal = function(){
showModal.call(columnsModal); showModal.call(columnsModal);
}; };
@ -92,6 +103,10 @@ angular.module('openproject.workPackages.directives')
scope.$emit('hideAllDropdowns'); scope.$emit('hideAllDropdowns');
this.activate(); this.activate();
} }
function deleteConfirmed() {
return $window.confirm(I18n.t('js.text_query_destroy_confirmation'));
}
} }
}; };
}]); }]);

@ -141,6 +141,7 @@ de:
other: "Sie dürfen nur {{limit}} Elemente auswählen" other: "Sie dürfen nur {{limit}} Elemente auswählen"
zero: "Sie dürfen keine Elemente auswählen" zero: "Sie dürfen keine Elemente auswählen"
text_work_packages_destroy_confirmation: "Sind Sie sicher, dass Sie die ausgewählten Arbeitspakete löschen möchten?" text_work_packages_destroy_confirmation: "Sind Sie sicher, dass Sie die ausgewählten Arbeitspakete löschen möchten?"
text_query_destroy_confirmation: "Are you sure you want to delete the selected query?"
timelines: timelines:
cancel: "Abbrechen" cancel: "Abbrechen"
change: "Planungsveränderung" change: "Planungsveränderung"
@ -229,6 +230,7 @@ de:
export: "Exportieren ..." export: "Exportieren ..."
share: "Sichtbarkeit ..." share: "Sichtbarkeit ..."
page_settings: "Page settings ..." page_settings: "Page settings ..."
delete: "Löschen"
filter: "Filter" filter: "Filter"
unselected_title: "Arbeitspakete" unselected_title: "Arbeitspakete"
modals: modals:

@ -140,6 +140,7 @@ en:
other: "You can only select {{limit}} items" other: "You can only select {{limit}} items"
zero: "You cannot select any items" zero: "You cannot select any items"
text_work_packages_destroy_confirmation: "Are you sure you want to delete the selected work package(s)?" text_work_packages_destroy_confirmation: "Are you sure you want to delete the selected work package(s)?"
text_query_destroy_confirmation: "Are you sure you want to delete the selected query?"
timelines: timelines:
cancel: Cancel cancel: Cancel
change: "Change in planning" change: "Change in planning"
@ -232,6 +233,7 @@ en:
export: "Export ..." export: "Export ..."
share: "Share ..." share: "Share ..."
page_settings: "Page settings ..." page_settings: "Page settings ..."
delete: "Delete"
filter: "Filter" filter: "Filter"
unselected_title: "Work packages" unselected_title: "Work packages"
modals: modals:

@ -65,6 +65,7 @@
<li class="dropdown-divider"></li> <li class="dropdown-divider"></li>
<li><a href ng-click="showSaveModal()"><i class="icon-action-menu icon-save1"></i>{{ I18n.t('js.toolbar.settings.save') }}</a></li> <li><a href ng-click="showSaveModal()"><i class="icon-action-menu icon-save1"></i>{{ I18n.t('js.toolbar.settings.save') }}</a></li>
<li ng-show="!query.isNew()"><a href ng-click="showSaveModal(true)"><i class="icon-action-menu icon-save1"></i>{{ I18n.t('js.toolbar.settings.save_as') }}</a></li> <li ng-show="!query.isNew()"><a href ng-click="showSaveModal(true)"><i class="icon-action-menu icon-save1"></i>{{ I18n.t('js.toolbar.settings.save_as') }}</a></li>
<li ng-show="!query.isNew()"><a href ng-click="deleteQuery()"><i class="icon-action-menu icon-delete"></i>{{ I18n.t('js.toolbar.settings.delete') }}</a></li>
<li ng-show="!query.isNew()"><a href ng-click="showShareModal()"><i class="icon-action-menu icon-publish"></i>{{ I18n.t('js.toolbar.settings.share') }}</a></li> <li ng-show="!query.isNew()"><a href ng-click="showShareModal()"><i class="icon-action-menu icon-publish"></i>{{ I18n.t('js.toolbar.settings.share') }}</a></li>
<li ng-show="!query.isNew()"><a href ng-click="showSettingsModal()"><i class="icon-action-menu icon-settings"></i>{{ I18n.t('js.toolbar.settings.page_settings') }}</a></li> <li ng-show="!query.isNew()"><a href ng-click="showSettingsModal()"><i class="icon-action-menu icon-settings"></i>{{ I18n.t('js.toolbar.settings.page_settings') }}</a></li>
</ul> </ul>

@ -8,10 +8,6 @@
<label for="name">{{ I18n.t('js.modals.label_name') }}</label> <label for="name">{{ I18n.t('js.modals.label_name') }}</label>
<input class="short" type="text" name="query_name" ng-model="query.name"></input> <input class="short" type="text" name="query_name" ng-model="query.name"></input>
</div> </div>
<div>
<label for="name">{{ I18n.t('js.modals.label_delete_page') }}</label>
<input type="checkbox" name="delete_query" ng-model="deleteQuery"></input>
</div>
<div> <div>
<button class="button_highlight" ng-click="updateQuery(deleteQuery)">{{ I18n.t('js.modals.button_submit') }}</button> <button class="button_highlight" ng-click="updateQuery(deleteQuery)">{{ I18n.t('js.modals.button_submit') }}</button>
<button class="button" ng-click="modal.closeMe()">{{ I18n.t('js.modals.button_cancel') }}</button> <button class="button" ng-click="modal.closeMe()">{{ I18n.t('js.modals.button_cancel') }}</button>

Loading…
Cancel
Save