Some random quick (#9111)

* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning
This commit is contained in:
Keith Holliday
2017-09-30 17:54:27 -05:00
committed by GitHub
parent 1d50027f51
commit c9b99d1ecf
4 changed files with 27 additions and 26 deletions

View File

@@ -68,7 +68,7 @@
button.btn.btn-secondary(v-once, @click='edit()') {{$t('editChallenge')}} button.btn.btn-secondary(v-once, @click='edit()') {{$t('editChallenge')}}
div(v-if='isLeader') div(v-if='isLeader')
button.btn.btn-danger(v-once, @click='closeChallenge()') {{$t('endChallenge')}} button.btn.btn-danger(v-once, @click='closeChallenge()') {{$t('endChallenge')}}
div(v-if='isLeader') div(v-if='isLeader || isAdmin')
button.btn.btn-secondary(v-once, @click='exportChallengeCsv()') {{$t('exportChallengeCsv')}} button.btn.btn-secondary(v-once, @click='exportChallengeCsv()') {{$t('exportChallengeCsv')}}
div(v-if='isLeader') div(v-if='isLeader')
button.btn.btn-secondary(v-once, @click='cloneChallenge()') {{$t('clone')}} button.btn.btn-secondary(v-once, @click='cloneChallenge()') {{$t('clone')}}
@@ -246,6 +246,9 @@ export default {
if (!this.challenge.leader) return false; if (!this.challenge.leader) return false;
return this.user._id === this.challenge.leader._id; return this.user._id === this.challenge.leader._id;
}, },
isAdmin () {
return Boolean(this.user.contributor.admin);
},
canJoin () { canJoin () {
return !this.isMember; return !this.isMember;
}, },
@@ -403,6 +406,7 @@ export default {
cloneChallenge () { cloneChallenge () {
this.cloning = true; this.cloning = true;
this.$store.state.challengeOptions.tasksToClone = this.tasksByType; this.$store.state.challengeOptions.tasksToClone = this.tasksByType;
this.$store.state.challengeOptions.workingChallenge = Object.assign({}, this.$store.state.challengeOptions.workingChallenge, this.challenge);
this.$root.$emit('show::modal', 'challenge-modal'); this.$root.$emit('show::modal', 'challenge-modal');
}, },
}, },

View File

@@ -31,11 +31,13 @@
.row.new-message-row .row.new-message-row
textarea(:placeholder="!isParty ? $t('chatPlaceholder') : $t('partyChatPlaceholder')", v-model='newMessage', @keydown='updateCarretPosition') textarea(:placeholder="!isParty ? $t('chatPlaceholder') : $t('partyChatPlaceholder')", v-model='newMessage', @keydown='updateCarretPosition')
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat') autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :chat='group.chat')
button.btn.btn-secondary.send-chat.float-left(v-once, @click='sendMessage()') {{ $t('send') }}
.row .row
.col-6 .col-6
button.btn.btn-secondary.float-left.fetch(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }} button.btn.btn-secondary.float-left.fetch(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }}
button.btn.btn-secondary.float-left(v-once, @click='reverseChat()') {{ $t('reverseChat') }} button.btn.btn-secondary.float-left(v-once, @click='reverseChat()') {{ $t('reverseChat') }}
.col-6
button.btn.btn-secondary.send-chat.float-right(v-once, @click='sendMessage()') {{ $t('send') }}
.row.community-guidelines(v-if='!communityGuidelinesAccepted') .row.community-guidelines(v-if='!communityGuidelinesAccepted')
div.col-8(v-once, v-html="$t('communityGuidelinesIntro')") div.col-8(v-once, v-html="$t('communityGuidelinesIntro')")
@@ -301,13 +303,6 @@
.new-message-row { .new-message-row {
position: relative; position: relative;
} }
.send-chat {
z-index: 10;
position: absolute;
right: 1em;
bottom: 1em;
}
} }
.toggle-up .svg-icon, .toggle-down .svg-icon { .toggle-up .svg-icon, .toggle-down .svg-icon {

View File

@@ -15,10 +15,10 @@
.row .row
.col-6 .col-6
button.btn.btn-secondary.send-chat.float-left(v-once, @click='sendMessage()') {{ $t('send') }} button.btn.btn-secondary.float-left.fetch(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }}
button.btn.btn-secondary.float-left(v-once, @click='reverseChat()') {{ $t('reverseChat') }}
.col-6 .col-6
button.btn.btn-secondary.float-right.fetch(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }} button.btn.btn-secondary.send-chat.float-right(v-once, @click='sendMessage()') {{ $t('send') }}
button.btn.btn-secondary.float-right(v-once, @click='reverseChat()') {{ $t('reverseChat') }}
.row.community-guidelines(v-if='!communityGuidelinesAccepted') .row.community-guidelines(v-if='!communityGuidelinesAccepted')
div.col-8(v-once, v-html="$t('communityGuidelinesIntro')") div.col-8(v-once, v-html="$t('communityGuidelinesIntro')")

View File

@@ -248,6 +248,22 @@
div.popover-content {{ $t('clickOnPetToFeed', {foodName: currentDraggingFood.text() }) }} div.popover-content {{ $t('clickOnPetToFeed', {foodName: currentDraggingFood.text() }) }}
</template> </template>
<style lang='scss' scoped>
.group {
height: 130px;
overflow: hidden;
}
.pet-row {
max-width: 100%;
flex-wrap: wrap;
.item {
margin-right: .5em;
}
}
</style>
<style lang="scss"> <style lang="scss">
@import '~client/assets/scss/colors.scss'; @import '~client/assets/scss/colors.scss';
@import '~client/assets/scss/modal.scss'; @import '~client/assets/scss/modal.scss';
@@ -274,20 +290,6 @@
top: -16px !important; top: -16px !important;
} }
.group {
height: 130px;
overflow: hidden;
}
.pet-row {
max-width: 100%;
flex-wrap: wrap;
.item {
margin-right: .5em;
}
}
.hatchablePopover { .hatchablePopover {
width: 180px width: 180px
} }