Group Dialog

This commit is contained in:
Natsumi
2022-12-02 12:13:11 +13:00
parent e3c09f78cb
commit 7b42ef8afc
3 changed files with 525 additions and 15 deletions

View File

@@ -1694,6 +1694,19 @@ html
span.name(v-else) Avatar Info
.extra
avatar-info(:imageurl="userDialog.ref.currentAvatarImageUrl" :userid="userDialog.id")
.x-friend-item(style="width:100%;cursor:default")
.detail
span.name Represented Group
.extra(v-if="userDialog.representedGroup.id")
div(style="display:inline-block;flex:none;margin-right:5px")
el-popover(placement="right" width="500px" trigger="click")
img.x-link(slot="reference" v-lazy="userDialog.representedGroup.iconUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
img.x-link(v-lazy="userDialog.representedGroup.iconUrl" style="height:500px" @click="openExternalLink(userDialog.representedGroup.iconUrl)")
span(style="vertical-align:top;cursor:pointer" @click="showGroupDialog(userDialog.representedGroup.id)")
span(v-if="userDialog.representedGroup.ownerId === userDialog.id" style="margin-right:5px") 👑
span(v-text="userDialog.representedGroup.name" style="margin-right:5px")
span ({{ userDialog.representedGroup.memberCount }})
.extra(v-else) -
.x-friend-item(style="width:100%;cursor:default")
.detail
span.name Bio
@@ -1791,7 +1804,7 @@ html
template(v-if="userGroups.mutualGroups.length > 0")
span(style="font-weight:bold;font-size:16px") Mutual Groups
span(style="color:#909399;font-size:12px;margin-left:5px") {{ userGroups.mutualGroups.length }}
.x-friend-list(v-if="userGroups.mutualGroups.length > 0" style="margin-top:10px;margin-bottom:15px;min-height:60px")
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
.x-friend-item(v-for="group in userGroups.mutualGroups" :key="group.id" @click="showGroupDialog(group.id)" class="x-friend-item-border")
.avatar
img(v-lazy="group.iconUrl")
@@ -1801,7 +1814,7 @@ html
template(v-if="userGroups.remainingGroups.length > 0")
span(style="font-weight:bold;font-size:16px") Groups
span(style="color:#909399;font-size:12px;margin-left:5px") {{ userGroups.remainingGroups.length }}
.x-friend-list(v-if="userGroups.remainingGroups.length > 0" style="margin-top:10px;margin-bottom:15px;min-height:60px")
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
.x-friend-item(v-for="group in userGroups.remainingGroups" :key="group.id" @click="showGroupDialog(group.id)" class="x-friend-item-border")
.avatar
img(v-lazy="group.iconUrl")
@@ -2128,6 +2141,88 @@ html
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
span(v-if="!scope.data.children" v-text="scope.data.value")
//- dialog: group
el-dialog.x-dialog.x-world-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="groupDialog" :visible.sync="groupDialog.visible" :show-close="false" width="770px")
div(v-loading="groupDialog.loading")
div(style="display:flex")
el-popover(placement="right" width="500px" trigger="click")
img.x-link(slot="reference" v-lazy="groupDialog.ref.iconUrl" style="flex:none;width:120px;height:120px;border-radius:4px")
img.x-link(v-lazy="groupDialog.ref.iconUrl" style="width:500px;height:500px" @click="openExternalLink(groupDialog.ref.iconUrl)")
div(style="flex:1;display:flex;align-items:center;margin-left:15px")
div(style="flex:1")
div
span(v-if="groupDialog.ref.ownerId === API.currentUser.id" style="margin-right:5px") 👑
span.dialog-title(v-text="groupDialog.ref.name" style="margin-right:5px")
el-tooltip(v-for="item in groupDialog.ref.$languages" :key="item.key" placement="top")
template(#content)
span {{ item.value }} ({{ item.key }})
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
div(style="margin-top:5px")
span.x-link(v-text="groupDialog.ref.ownerId" @click="showUserDialog(groupDialog.ref.ownerId)" style="color:#909399;font-family:monospace")
//- display-name(:userid="groupDialog.ref.ownerId" style="color:#909399;font-family:monospace")
div(style="margin-top:5px")
span(v-show="groupDialog.ref.name !== groupDialog.ref.description" v-text="groupDialog.ref.description" style="font-size:12px")
div(style="flex:none;margin-left:10px")
el-tooltip(v-if="groupDialog.inGroup" placement="top" content="Leave Group" :disabled="hideTooltips")
el-button(type="default" icon="el-icon-star-on" circle @click="leaveGroup(groupDialog.id)" style="margin-left:5px")
el-tooltip(v-else-if="groupDialog.ref.membershipStatus === 'requested'" placement="top" content="Cancel join request" :disabled="hideTooltips")
el-button(type="default" icon="el-icon-close" circle @click="cancelGroupRequest(groupDialog.id)" style="margin-left:5px")
el-tooltip(v-else-if="groupDialog.ref.joinState === 'request'" placement="top" content="Request to join" :disabled="hideTooltips")
el-button(type="default" icon="el-icon-message" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
el-tooltip(v-else placement="top" content="Join Group" :disabled="hideTooltips")
el-button(type="default" icon="el-icon-star-off" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
el-dropdown(trigger="click" @command="groupDialogCommand" size="small" style="margin-left:5px")
el-button(type="default" icon="el-icon-more" circle)
el-dropdown-menu(#default="dropdown")
el-dropdown-item(icon="el-icon-refresh" command="Refresh") Refresh
el-tabs
el-tab-pane(label="Info")
.x-friend-list(style="max-height:none")
.x-friend-item(style="width:100%;cursor:default")
.detail
span.name Links
div(v-if="groupDialog.ref.links && groupDialog.ref.links.length > 0" style="margin-top:5px")
el-tooltip(v-if="link" v-for="(link, index) in groupDialog.ref.links" :key="index")
template(#content)
span(v-text="link")
img(:src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px;cursor:pointer" @click.stop="openExternalLink(link)")
.extra(v-else) -
.x-friend-item(style="width:100%;cursor:default")
.detail
span.name Rules
pre.extra(style="font-family:inherit;font-size:12px;white-space:pre-wrap;margin:0 0.5em 0 0") {{ groupDialog.ref.rules || '-' }}
.x-friend-item(style="width:350px;cursor:default")
.detail
span.name Group ID
span.extra {{ groupDialog.id }}
el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips")
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
el-button(type="default" icon="el-icon-s-order" size="mini" circle)
el-dropdown-menu(#default="dropdown")
el-dropdown-item(@click.native="copyGroupId(groupDialog.id)") Copy ID
el-dropdown-item(@click.native="copyGroupUrl(groupDialog.ref.$url)") Copy URL
template(v-if="groupDialog.ref.membershipStatus === 'member'")
div(style="width:100%;display:flex")
.x-friend-item(style="cursor:default")
.detail
span.name Joined At
span.extra {{ groupDialog.ref.myMember.joinedAt | formatDate('long') }}
.x-friend-item(style="cursor:default")
.detail
span.name Announcements
span.extra {{ groupDialog.ref.myMember.isSubscribedToAnnouncements }}
.x-friend-item(style="cursor:default")
.detail
span.name Visibility
span.extra {{ groupDialog.ref.myMember.visibility }}
el-tab-pane(label="JSON")
el-button(type="default" @click="refreshGroupDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
el-tree(:data="groupDialog.treeData" style="margin-top:5px;font-size:12px")
template(#default="scope")
span
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
span(v-if="!scope.data.children" v-text="scope.data.value")
//- dialog: favorite
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="favoriteDialog" :visible.sync="favoriteDialog.visible" title="Choose Group" width="300px")
div(v-if="favoriteDialog.visible" v-loading="favoriteDialog.loading")