Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display membership modal actions buttons for admins and on display #1176

Merged
merged 1 commit into from Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

## Current (in progress)

- Nothing yet
- Display membership modal actions buttons for site administrators and on membership display. [#1176](https://github.com/opendatateam/udata/pull/1176)

## 1.1.7 (2017-09-25)

Expand Down
12 changes: 6 additions & 6 deletions js/components/organization/member-modal.vue
Expand Up @@ -17,10 +17,10 @@
<user-modal :user="user" v-ref:modal>
<role-form class="member-form" v-ref:form
:fields="fields" :model="member" :defs="defs"
:readonly="!is_admin" :fill="true">
:readonly="!can_edit" :fill="true">
</role-form>
<br v-if="is_admin" />
<div v-if="is_admin && !member_exists" class="btn-group btn-group-justified">
<br v-if="can_edit" />
<div v-if="can_edit" class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-success btn-flat"
@click="submit">
Expand All @@ -35,7 +35,7 @@
</button>
</div>
</div>
<div v-if="is_admin && member_exists" class="btn-group btn-group-justified">
<div v-if="can_edit && member_exists" class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-danger btn-flat" @click="delete">
<span class="fa fa-user-times"></span>
Expand Down Expand Up @@ -76,8 +76,8 @@ export default {
};
},
computed: {
is_admin() {
return this.org.is_admin(this.$root.me);
can_edit() {
return this.$root.me.is_admin || this.org.is_admin(this.$root.me);
},
member_exists() {
return this.org.is_member(this.user);
Expand Down