mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
[feature] confirmation on project deletion
This commit is contained in:
parent
6df3c90da2
commit
d5b06d08ad
@ -338,8 +338,8 @@ Application.Controllers.controller "EditProjectController", ["$scope", "$state",
|
||||
##
|
||||
# Controller used in the public project's details page
|
||||
##
|
||||
Application.Controllers.controller "ShowProjectController", ["$scope", "$state", "projectPromise", '$location', '$uibModal', '_t'
|
||||
, ($scope, $state, projectPromise, $location, $uibModal, _t) ->
|
||||
Application.Controllers.controller "ShowProjectController", ["$scope", "$state", "projectPromise", '$location', '$uibModal', 'dialogs', '_t'
|
||||
, ($scope, $state, projectPromise, $location, $uibModal, dialogs, _t) ->
|
||||
|
||||
### PUBLIC SCOPE ###
|
||||
|
||||
@ -383,8 +383,14 @@ Application.Controllers.controller "ShowProjectController", ["$scope", "$state",
|
||||
# check the permissions
|
||||
if $scope.currentUser.role is 'admin' or $scope.projectDeletableBy($scope.currentUser)
|
||||
# delete the project then refresh the projects list
|
||||
$scope.project.$delete ->
|
||||
$state.go('app.public.projects_list', {}, {reload: true})
|
||||
dialogs.confirm
|
||||
resolve:
|
||||
object: ->
|
||||
title: _t('confirmation_required')
|
||||
msg: _t('do_you_really_want_to_delete_this_project')
|
||||
, -> # cancel confirmed
|
||||
$scope.project.$delete ->
|
||||
$state.go('app.public.projects_list', {}, {reload: true})
|
||||
else
|
||||
console.error _t('unauthorized_operation')
|
||||
|
||||
|
@ -156,6 +156,7 @@ en:
|
||||
tell_us_why_this_looks_abusive: "Tell us why this looks abusive"
|
||||
message_is_required: "Message is required."
|
||||
report: "Report"
|
||||
do_you_really_want_to_delete_this_project: "Do you really want to delete this project?"
|
||||
|
||||
machines_list:
|
||||
# list of machines
|
||||
|
@ -156,6 +156,7 @@ fr:
|
||||
tell_us_why_this_looks_abusive: "Dites nous en quoi cela vous semble abusif"
|
||||
message_is_required: "Le message est requis."
|
||||
report: "Signaler"
|
||||
do_you_really_want_to_delete_this_project: "Êtes-vous sur de vouloir supprimer ce projet ?"
|
||||
|
||||
machines_list:
|
||||
# liste des machines
|
||||
|
@ -227,7 +227,7 @@ ActiveRecord::Schema.define(version: 20160613093842) do
|
||||
t.boolean "is_read", default: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "receiver_type", limit: 255
|
||||
t.string "receiver_type"
|
||||
t.boolean "is_send", default: false
|
||||
t.jsonb "meta_data", default: {}
|
||||
end
|
||||
@ -456,8 +456,8 @@ ActiveRecord::Schema.define(version: 20160613093842) do
|
||||
t.datetime "updated_at"
|
||||
t.integer "availability_id"
|
||||
t.datetime "ex_start_at"
|
||||
t.datetime "canceled_at"
|
||||
t.datetime "ex_end_at"
|
||||
t.datetime "canceled_at"
|
||||
t.boolean "offered", default: false
|
||||
end
|
||||
|
||||
@ -615,7 +615,6 @@ ActiveRecord::Schema.define(version: 20160613093842) do
|
||||
add_index "user_trainings", ["user_id"], name: "index_user_trainings_on_user_id", using: :btree
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "username", limit: 255
|
||||
t.string "email", limit: 255, default: "", null: false
|
||||
t.string "encrypted_password", limit: 255, default: "", null: false
|
||||
t.string "reset_password_token", limit: 255
|
||||
@ -638,6 +637,7 @@ ActiveRecord::Schema.define(version: 20160613093842) do
|
||||
t.boolean "is_allow_contact", default: true
|
||||
t.integer "group_id"
|
||||
t.string "stp_customer_id", limit: 255
|
||||
t.string "username", limit: 255
|
||||
t.string "slug", limit: 255
|
||||
t.boolean "is_active", default: true
|
||||
t.boolean "invoicing_disabled", default: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user