Update to vue-components 0.4.2

Changings to shareDiv
#402
This commit is contained in:
dartcafe 2018-11-10 16:27:44 +01:00
Родитель c26564070c
Коммит d9bbf43f06
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CCE73CEF3035D3C8
6 изменённых файлов: 35 добавлений и 1359 удалений

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -101,7 +101,9 @@ class ApiController extends Controller {
if (!in_array($group->getGID(), $skipGroups)) {
$list[] = [
'id' => $group->getGID(),
'user' => $group->getGID(),
'type' => 'group',
'icon' => 'icon-group',
'displayName' => $group->getGID(),
'avatarURL' => ''
];
@ -114,7 +116,9 @@ class ApiController extends Controller {
if (!in_array($user->getUID(), $skipUsers)) {
$list[] = [
'id' => $user->getUID(),
'user' => $user->getUID(),
'type' => 'user',
'icon' => 'icon-user',
'displayName' => $user->getDisplayName(),
'avatarURL' => '',
'lastLogin' => $user->getLastLogin(),
@ -138,16 +142,22 @@ class ApiController extends Controller {
$user = $this->userManager->get(substr($item, 5));
$split = [
'id' => $user->getUID(),
'user' => $user->getUID(),
'type' => 'user',
'icon' => 'icon-user',
'displayName' => $user->getDisplayName(),
'avatarURL' => ''
'avatarURL' => '',
'lastLogin' => $user->getLastLogin(),
'cloudId' => $user->getCloudId()
];
} elseif (strpos($item, 'group_') === 0) {
$group = substr($item, 6);
$group = $this->groupManager->get($group);
$split = [
'id' => $group->getGID(),
'user' => $group->getGID(),
'type' => 'group',
'icon' => 'icon-group',
'displayName' => $group->getDisplayName(),
'avatarURL' => '',
];

Просмотреть файл

@ -25,7 +25,7 @@
"md5": "^2.2.1",
"moment": "^2.22.1",
"nextcloud-axios": "^0.1.2",
"nextcloud-vue": "^0.3.1",
"nextcloud-vue": "^0.4.2",
"v-tooltip": "^2.0.0-rc.33",
"velocity-animate": "^1.5.1",
"vue": "^2.5.16",

Просмотреть файл

@ -23,35 +23,30 @@
<template>
<div>
<h2> {{ t('polls', 'Share with') }}</h2>
<multiselect
v-model="shares"
:options="users"
:option-height=32
label="displayName"
track-by="user"
:multiple="true"
:close-on-select="false"
:user-select="true"
:tag-width="80"
:clear-on-select="false"
:preserve-search="true"
label="displayName"
track-by="id"
:options-limit="20"
id="ajax"
@search-change="loadUsersAsync"
@close="updateShares"
:loading="isLoading"
:internal-search="false"
:hide-selected="true"
:searchable="true"
:preselect-first="true"
:placeholder="placeholder">
<template slot="selection" slot-scope="{ values, search, isOpen }">
<span class="multiselect__single" v-if="values.length &amp;&amp; !isOpen">
{{ values.length }} users selected
</span>
</template>
<template slot="option" slot-scope="props">
<div class="option__desc">
<user-div :user-id="props.option.id" :display-name="props.option.displayName" :type="props.option.type"></user-div>
</div>
<span class="multiselect__single" v-if="values.length &amp;&amp; !isOpen">
{{ values.length }} users selected
</span>
</template>
</multiselect>
@ -59,7 +54,7 @@
<li v-for="(item, index) in sortedShares"
v-bind:key="item.displayName"
v-bind:data-index="index">
<user-div :user-id="item.id" :display-name="item.displayName" :type="item.type" :hide-names="hideNames"></user-div>
<user-div :user-id="item.user" :display-name="item.displayName" :type="item.type" :hide-names="hideNames"></user-div>
<div class="options">
<a @click="removeShare(index, item)" class="icon icon-delete svg delete-poll"></a>
</div>
@ -161,6 +156,10 @@
}
.multiselect {
width: 100% !important;
}
.multiselect7 {
width: 100%;
.multiselect__content-wrapper li > span {
height: unset;

Просмотреть файл

@ -208,7 +208,7 @@
!$isAnonymous &&
!$hideNames
) {
$displayName = $usr;
$displayName = \OC_User::getDisplayName($usr);
$avatarName = $usr;
} else {
if ($isAnonymous || $hideNames) {
@ -257,7 +257,7 @@
if (User::isLoggedIn()) {
print_unescaped(' <div class="avatar has-tooltip" title="' . ($userId) . '"></div>');
print_unescaped(' <div class="name">');
p($userId);
p(\OC_User::getDisplayName($userId));
} else {
print_unescaped(' <div class="avatar has-tooltip" title="?"></div>');
print_unescaped(' <div id="id_ac_detected" class="name external current-user"><input type="text" name="user_name" id="user_name" placeholder="' . $l->t('Your name here') . '" />');
@ -347,7 +347,7 @@
<div class="authorRow user-cell flex-row">
<div class="description leftLabel"><?php p($l->t('Owner')); ?></div>
<div class="avatar has-tooltip-bottom" title="<?php p($poll->getOwner())?>"></div>
<div class="author"><?php p($poll->getOwner()); ?></div>
<div class="author"><?php p(\OC_User::getDisplayName($poll->getOwner())); ?></div>
</div>
<div class="cloud">
@ -425,7 +425,7 @@
<?php if (User::isLoggedIn()) : ?>
<div class="authorRow user-cell flex-row">
<div class="avatar has-tooltip" title="<?php p($userId)?>"></div>
<div class="author"><?php p($userId) ?></div>
<div class="author"><?php p(\OC_User::getDisplayName($userId)) ?></div>
</div>
<?php else: ?>
<a href="<?php p($urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); ?>"><?php p($l->t('Login or ...')); ?></a>
@ -465,7 +465,7 @@
// Comment is from current user
// -> display user
$avatarName = $userId;
$displayName = $userId;
$displayName = \OC_User::getDisplayName($userId);
} else if (!$isAnonymous && !$hideNames) {
// comment is from another user,
@ -473,7 +473,7 @@
// users are not hidden
// -> display user
$avatarName = $comment->getUserId();
$displayName = $avatarName;
$displayName = \OC_User::getDisplayName($comment->getUserId());
} else {
// in all other cases
// -> make user anonymous

Просмотреть файл

@ -114,9 +114,7 @@
$commented_title = 'You did not comment';
$commented_count = count($comments);
if ($owner === $userId) {
$owner = $l->t('Yourself');
}
$owner = \OC_User::getDisplayName($owner);
$timestamp_style = '';
@ -205,7 +203,7 @@
<div class="wrapper group-2">
<div class="flex-column owner">
<div class="avatardiv" title="<?php p($poll->getOwner()); ?>" style="height: 32px; width: 32px;"></div>
<div class="name-cell"><?php p($owner); ?></div>
<div class="name-cell"><?php p(\OC_User::getDisplayName($owner)); ?></div>
</div>
<div class="wrapper group-2-1">
<div class="flex-column access"><?php p($l->t($poll->getAccess())); ?></div>
@ -257,14 +255,13 @@ function userHasAccess(OCA\Polls\Db\Event $poll, $userId) {
return false;
}
$access = $poll->getAccess();
$owner = $poll->getOwner();
if (!User::isLoggedIn()) {
return false;
}
if ($access === 'public' || $access === 'hidden' || $access === 'registered') {
return true;
}
if ($owner === $userId) {
if ($poll->getOwner() === $userId) {
return true;
}