summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/member.rb8
-rw-r--r--app/views/projects/settings/_members.rhtml3
-rw-r--r--config/locales/bg.yml3
-rw-r--r--config/locales/bs.yml3
-rw-r--r--config/locales/ca.yml3
-rw-r--r--config/locales/cs.yml3
-rw-r--r--config/locales/da.yml3
-rw-r--r--config/locales/de.yml3
-rw-r--r--config/locales/el.yml3
-rw-r--r--config/locales/en.yml1
-rw-r--r--config/locales/es.yml3
-rw-r--r--config/locales/fi.yml3
-rw-r--r--config/locales/fr.yml1
-rw-r--r--config/locales/gl.yml3
-rw-r--r--config/locales/he.yml3
-rw-r--r--config/locales/hu.yml3
-rw-r--r--config/locales/id.yml3
-rw-r--r--config/locales/it.yml3
-rw-r--r--config/locales/ja.yml3
-rw-r--r--config/locales/ko.yml3
-rw-r--r--config/locales/lt.yml3
-rw-r--r--config/locales/nl.yml3
-rw-r--r--config/locales/no.yml3
-rw-r--r--config/locales/pl.yml3
-rw-r--r--config/locales/pt-BR.yml3
-rw-r--r--config/locales/pt.yml3
-rw-r--r--config/locales/ro.yml3
-rw-r--r--config/locales/ru.yml3
-rw-r--r--config/locales/sk.yml3
-rw-r--r--config/locales/sl.yml3
-rw-r--r--config/locales/sr.yml3
-rw-r--r--config/locales/sv.yml3
-rw-r--r--config/locales/th.yml3
-rw-r--r--config/locales/tr.yml3
-rw-r--r--config/locales/uk.yml3
-rw-r--r--config/locales/vi.yml3
-rw-r--r--config/locales/zh-TW.yml3
-rw-r--r--config/locales/zh.yml3
38 files changed, 114 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 44a421745..3ef1afdef 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -57,6 +57,14 @@ class Member < ActiveRecord::Base
member_roles.detect {|mr| mr.inherited_from}.nil?
end
+ def include?(user)
+ if principal.is_a?(Group)
+ !user.nil? && user.groups.include?(principal)
+ else
+ self.user == user
+ end
+ end
+
def before_destroy
if user
# remove category based auto assignments for this member
diff --git a/app/views/projects/settings/_members.rhtml b/app/views/projects/settings/_members.rhtml
index bfea86753..c0d48b9c2 100644
--- a/app/views/projects/settings/_members.rhtml
+++ b/app/views/projects/settings/_members.rhtml
@@ -35,7 +35,8 @@
<td class="buttons">
<%= link_to_function l(:button_edit), "$('member-#{member.id}-roles').hide(); $('member-#{member.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
<%= link_to_remote(l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member},
- :method => :post
+ :method => :post,
+ :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil)
}, :title => l(:button_delete),
:class => 'icon icon-del') if member.deletable? %>
</td>
diff --git a/config/locales/bg.yml b/config/locales/bg.yml
index 4be997961..5d7e23aca 100644
--- a/config/locales/bg.yml
+++ b/config/locales/bg.yml
@@ -869,3 +869,6 @@ bg:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/bs.yml b/config/locales/bs.yml
index 015b05521..6013b9ca1 100644
--- a/config/locales/bs.yml
+++ b/config/locales/bs.yml
@@ -893,3 +893,6 @@ bs:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/ca.yml b/config/locales/ca.yml
index 59b3a44f4..4f8193f46 100644
--- a/config/locales/ca.yml
+++ b/config/locales/ca.yml
@@ -872,3 +872,6 @@ ca:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/cs.yml b/config/locales/cs.yml
index bcbf7ac99..2255ca491 100644
--- a/config/locales/cs.yml
+++ b/config/locales/cs.yml
@@ -875,3 +875,6 @@ cs:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/da.yml b/config/locales/da.yml
index 5123f241f..87cd0e1cf 100644
--- a/config/locales/da.yml
+++ b/config/locales/da.yml
@@ -895,3 +895,6 @@ da:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 81e69ef23..79619efbb 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -895,3 +895,6 @@ de:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/el.yml b/config/locales/el.yml
index 988002500..4a8ffb2b1 100644
--- a/config/locales/el.yml
+++ b/config/locales/el.yml
@@ -875,3 +875,6 @@ el:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1c421cb49..c21643c0d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -848,6 +848,7 @@ en:
text_wiki_page_nullify_children: "Keep child pages as root pages"
text_wiki_page_destroy_children: "Delete child pages and all their descendants"
text_wiki_page_reassign_children: "Reassign child pages to this parent page"
+ text_own_membership_delete_confirmation: "You are about to remove some or all of your permissions and may no longer be able to edit this project after that.\nAre you sure you want to continue?"
default_role_manager: Manager
default_role_developper: Developer
diff --git a/config/locales/es.yml b/config/locales/es.yml
index bcf8bd21f..dd0ec9dce 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -919,3 +919,6 @@ es:
setting_mail_handler_body_delimiters: Truncar correos tras una de estas líneas
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/fi.yml b/config/locales/fi.yml
index 6f255d03e..def80f980 100644
--- a/config/locales/fi.yml
+++ b/config/locales/fi.yml
@@ -905,3 +905,6 @@ fi:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 6ecfc240d..97849b554 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -856,6 +856,7 @@ fr:
text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
text_wiki_page_reassign_children: "Réaffecter les sous-pages à cette page"
+ text_own_membership_delete_confirmation: "Vous allez supprimer tout ou partie de vos permissions sur ce projet et ne serez peut-être plus autorisé à modifier ce projet.\nEtes-vous sûr de vouloir continuer ?"
default_role_manager: Manager
default_role_developper: Développeur
diff --git a/config/locales/gl.yml b/config/locales/gl.yml
index af1c6eb9a..8f65a701f 100644
--- a/config/locales/gl.yml
+++ b/config/locales/gl.yml
@@ -895,3 +895,6 @@ gl:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/he.yml b/config/locales/he.yml
index f66970cc3..f2429c607 100644
--- a/config/locales/he.yml
+++ b/config/locales/he.yml
@@ -879,3 +879,6 @@ he:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/hu.yml b/config/locales/hu.yml
index a48228cdf..70a963d3e 100644
--- a/config/locales/hu.yml
+++ b/config/locales/hu.yml
@@ -900,3 +900,6 @@
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/id.yml b/config/locales/id.yml
index e124764c7..59d52f67d 100644
--- a/config/locales/id.yml
+++ b/config/locales/id.yml
@@ -887,3 +887,6 @@ id:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/it.yml b/config/locales/it.yml
index b469099e3..2fc70a5fc 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -882,3 +882,6 @@ it:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index 0de5160e0..324abaaa7 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -904,3 +904,6 @@ ja:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/ko.yml b/config/locales/ko.yml
index 4b82b77f7..8c9de9db1 100644
--- a/config/locales/ko.yml
+++ b/config/locales/ko.yml
@@ -935,3 +935,6 @@ ko:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/lt.yml b/config/locales/lt.yml
index 8c874065f..60eec6138 100644
--- a/config/locales/lt.yml
+++ b/config/locales/lt.yml
@@ -943,3 +943,6 @@ lt:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/nl.yml b/config/locales/nl.yml
index 223df9b44..b4630b234 100644
--- a/config/locales/nl.yml
+++ b/config/locales/nl.yml
@@ -857,3 +857,6 @@ nl:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/no.yml b/config/locales/no.yml
index 461708b3b..89c034f22 100644
--- a/config/locales/no.yml
+++ b/config/locales/no.yml
@@ -870,3 +870,6 @@
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/pl.yml b/config/locales/pl.yml
index ad8040aa5..4ff9ef255 100644
--- a/config/locales/pl.yml
+++ b/config/locales/pl.yml
@@ -898,3 +898,6 @@ pl:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index ed8e83e33..2628d81d3 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -902,3 +902,6 @@ pt-BR:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index 9441e56c2..cacea6293 100644
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -887,3 +887,6 @@ pt:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/ro.yml b/config/locales/ro.yml
index f91525b73..59b2a072a 100644
--- a/config/locales/ro.yml
+++ b/config/locales/ro.yml
@@ -872,3 +872,6 @@ ro:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
index 4c2822504..682a878db 100644
--- a/config/locales/ru.yml
+++ b/config/locales/ru.yml
@@ -983,3 +983,6 @@ ru:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/sk.yml b/config/locales/sk.yml
index 53b06dc8d..cdc04803c 100644
--- a/config/locales/sk.yml
+++ b/config/locales/sk.yml
@@ -874,3 +874,6 @@ sk:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/sl.yml b/config/locales/sl.yml
index 852ad6ac3..66da1b3c4 100644
--- a/config/locales/sl.yml
+++ b/config/locales/sl.yml
@@ -871,3 +871,6 @@ sl:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/sr.yml b/config/locales/sr.yml
index fd0a5db92..4792ff08d 100644
--- a/config/locales/sr.yml
+++ b/config/locales/sr.yml
@@ -890,3 +890,6 @@
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/sv.yml b/config/locales/sv.yml
index 109ca7e6e..e6345b4f6 100644
--- a/config/locales/sv.yml
+++ b/config/locales/sv.yml
@@ -925,3 +925,6 @@ sv:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/th.yml b/config/locales/th.yml
index 294880baa..29f074739 100644
--- a/config/locales/th.yml
+++ b/config/locales/th.yml
@@ -872,3 +872,6 @@ th:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/tr.yml b/config/locales/tr.yml
index 42677a870..0bc54ad9d 100644
--- a/config/locales/tr.yml
+++ b/config/locales/tr.yml
@@ -902,3 +902,6 @@ tr:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/uk.yml b/config/locales/uk.yml
index 879b0aaa8..c6adec84b 100644
--- a/config/locales/uk.yml
+++ b/config/locales/uk.yml
@@ -871,3 +871,6 @@ uk:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/vi.yml b/config/locales/vi.yml
index afd63e9b4..ccba5434f 100644
--- a/config/locales/vi.yml
+++ b/config/locales/vi.yml
@@ -934,3 +934,6 @@ vi:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml
index 44066dbd8..54a46fd2d 100644
--- a/config/locales/zh-TW.yml
+++ b/config/locales/zh-TW.yml
@@ -968,3 +968,6 @@
enumeration_system_activity: 系統活動
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 63143e1d9..a5ecdd08f 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -899,3 +899,6 @@ zh:
setting_mail_handler_body_delimiters: Truncate emails after one of these lines
permission_add_subprojects: Create subprojects
label_subproject_new: New subproject
+ text_own_membership_delete_confirmation: |-
+ You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
+ Are you sure you want to continue?