Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-10-16 12:00:27 +0300
committerdartcafe <github@dartcafe.de>2021-10-16 12:00:27 +0300
commit63f10176112ece602ece87c38c65d6636f04ad58 (patch)
tree059855bdc59e36d61ed2efa1ec655676a90fa253
parent6760856dc5fcb52ab6a0eb9100175f8dc9313923 (diff)
init
Signed-off-by: dartcafe <github@dartcafe.de>
-rw-r--r--package-lock.json1
-rw-r--r--package.json1
-rw-r--r--src/js/components/Shares/SharesEffective.vue36
-rw-r--r--src/js/components/Shares/SharesPublic.vue22
-rw-r--r--src/js/components/Shares/SharesUnsent.vue23
-rw-r--r--src/js/components/User/UserItem.vue4
-rw-r--r--src/js/store/modules/shares.js2
7 files changed, 28 insertions, 61 deletions
diff --git a/package-lock.json b/package-lock.json
index b411757c..bcfd3549 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,6 +25,7 @@
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.3",
"vue-fragment": "^1.5.2",
+ "vue-material-design-icons": "^4.13.0",
"vue-router": "^3.5.2",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
diff --git a/package.json b/package.json
index a055191b..105f13fb 100644
--- a/package.json
+++ b/package.json
@@ -51,6 +51,7 @@
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.3",
"vue-fragment": "^1.5.2",
+ "vue-material-design-icons": "^4.13.0",
"vue-router": "^3.5.2",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
diff --git a/src/js/components/Shares/SharesEffective.vue b/src/js/components/Shares/SharesEffective.vue
index 3cc37dcd..5bd6b927 100644
--- a/src/js/components/Shares/SharesEffective.vue
+++ b/src/js/components/Shares/SharesEffective.vue
@@ -28,6 +28,14 @@
v-bind="share"
show-email
:icon="true">
+ <template #status>
+ <div v-if="hasVoted(share.userId)">
+ <VotedIcon class="vote-status voted" :title="t('polls', 'Has voted')" />
+ </div>
+ <div v-else>
+ <UnvotedIcon class="vote-status unvoted" :title="t('polls', 'Has not voted')" />
+ </div>
+ </template>
<Actions>
<ActionButton
v-if="share.emailAddress || share.type === 'group'"
@@ -59,6 +67,8 @@ import { showSuccess, showError } from '@nextcloud/dialogs'
import { Actions, ActionButton } from '@nextcloud/vue'
import ActionDelete from '../Actions/ActionDelete'
import ConfigBox from '../Base/ConfigBox'
+import VotedIcon from 'vue-material-design-icons/CheckboxMarked.vue'
+import UnvotedIcon from 'vue-material-design-icons/MinusBox.vue'
export default {
name: 'SharesEffective',
@@ -68,11 +78,15 @@ export default {
ActionButton,
ActionDelete,
ConfigBox,
+ VotedIcon,
+ UnvotedIcon,
},
computed: {
...mapGetters({
invitationShares: 'shares/invitation',
+ participants: 'poll/participantsVoted',
+ hasVoted: 'shares/hasVoted',
}),
},
@@ -114,24 +128,16 @@ export default {
</script>
<style lang="scss">
- .shared-list {
- display: flex;
- flex-flow: column wrap;
- justify-content: flex-start;
- padding-top: 8px;
+.vote-status {
+ margin-left: 8px;
- > li {
- display: flex;
- align-items: stretch;
- margin: 4px 0;
- }
+ &.voted {
+ color: var(--color-polls-foreground-yes)
}
- .share-item {
- display: flex;
- flex: 1;
- align-items: center;
- max-width: 100%;
+ &.unvoted {
+ color: var(--color-polls-foreground-no)
}
+}
</style>
diff --git a/src/js/components/Shares/SharesPublic.vue b/src/js/components/Shares/SharesPublic.vue
index 3acc5a9a..897cd2a6 100644
--- a/src/js/components/Shares/SharesPublic.vue
+++ b/src/js/components/Shares/SharesPublic.vue
@@ -105,25 +105,3 @@ export default {
},
}
</script>
-
-<style lang="scss">
- .shared-list {
- display: flex;
- flex-flow: column wrap;
- justify-content: flex-start;
- padding-top: 8px;
-
- > li {
- display: flex;
- align-items: stretch;
- margin: 4px 0;
- }
- }
-
- .share-item {
- display: flex;
- flex: 1;
- align-items: center;
- max-width: 100%;
- }
-</style>
diff --git a/src/js/components/Shares/SharesUnsent.vue b/src/js/components/Shares/SharesUnsent.vue
index d541127b..8e9e044d 100644
--- a/src/js/components/Shares/SharesUnsent.vue
+++ b/src/js/components/Shares/SharesUnsent.vue
@@ -109,26 +109,3 @@ export default {
},
}
</script>
-
-<style lang="scss">
- .shared-list {
- display: flex;
- flex-flow: column wrap;
- justify-content: flex-start;
- padding-top: 8px;
-
- > li {
- display: flex;
- align-items: stretch;
- margin: 4px 0;
- }
- }
-
- .share-item {
- display: flex;
- flex: 1;
- align-items: center;
- max-width: 100%;
- }
-
-</style>
diff --git a/src/js/components/User/UserItem.vue b/src/js/components/User/UserItem.vue
index 52894b9c..bfb2d941 100644
--- a/src/js/components/User/UserItem.vue
+++ b/src/js/components/User/UserItem.vue
@@ -35,6 +35,8 @@
<div v-if="icon" :class="['type-icon', iconClass]" />
+ <slot name="status" />
+
<div v-if="!hideNames" class="user-item__name">
<div class="name">
{{ name }}
@@ -43,7 +45,9 @@
{{ displayEmailAddress }}
</div>
</div>
+
<slot />
+
</div>
</template>
diff --git a/src/js/store/modules/shares.js b/src/js/store/modules/shares.js
index 6ff2fe00..ad037d37 100644
--- a/src/js/store/modules/shares.js
+++ b/src/js/store/modules/shares.js
@@ -67,7 +67,7 @@ const getters = {
unsentInvitations: (state) => state.list.filter((share) => (share.emailAddress || share.type === 'group' || share.type === 'contactGroup' || share.type === 'circle') && !share.invitationSent),
public: (state) => state.list.filter((share) => ['public'].includes(share.type)),
-
+ hasVoted: (state, getters, rootState, rootGetters) => (userId) => rootGetters['poll/participantsVoted'].find((participant) => participant.userId === userId),
}
const actions = {