Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/Controller/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public function __construct(
#[NoCSRFRequired]
#[ShareTokenRequired]
#[OpenAPI(OpenAPI::SCOPE_IGNORE)]
#[FrontpageRoute(verb: 'GET', url: '/s/{token}')]
#[FrontpageRoute(verb: 'GET', url: '/s/{token}', postfix: 'public')]
#[FrontpageRoute(verb: 'GET', url: '/s/{token}/register', postfix: 'register')]
public function votePage() {
Util::addScript(Application::APP_ID, AssetLoader::getScript('main'));
if ($this->userSession->getIsLoggedIn()) {
Expand Down Expand Up @@ -491,7 +492,7 @@ public function deleteEmailAddress(string $token): JSONResponse {
#[FrontpageRoute(verb: 'POST', url: '/s/{token}/register')]
public function register(string $token, string $displayName, string $emailAddress = '', string $timeZone = ''): JSONResponse {
return $this->response(fn () => [
'share' => $this->shareService->register($token, $displayName, $emailAddress, $timeZone),
'share' => $this->shareService->registerGuest($token, $displayName, $emailAddress, $timeZone),
], Http::STATUS_CREATED);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ShareApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get(string $token): DataResponse {
#[ApiRoute(verb: 'POST', url: 'api/v1.0/s/{token}/register')]
public function register(string $token, string $displayName, string $emailAddress = '', string $timeZone = ''): DataResponse {
return $this->response(fn () => [
'share' => $this->shareService->register($token, $displayName, $emailAddress, $timeZone),
'share' => $this->shareService->registerGuest($token, $displayName, $emailAddress, $timeZone),
], Http::STATUS_CREATED);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function getURL(): string {
);
} elseif ($this->token) {
return $this->urlGenerator->linkToRouteAbsolute(
Application::APP_ID . '.public.votePage',
Application::APP_ID . '.public.votePagepublic',
['token' => $this->token]
);
} else {
Expand Down
1 change: 0 additions & 1 deletion lib/Model/Settings/AppSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function getAppSettings(): array {
'finalPrivacyUrl' => '',
'finalImprintUrl' => '',
'useLogin' => true,
'useSiteLegalTerms' => true,
'useActivity' => false,
'navigationPollsInList' => false,
'updateType' => $this->getUpdateType(),
Expand Down
12 changes: 0 additions & 12 deletions lib/Service/ShareService.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,6 @@ private function convertDependingObjects(string $userId, string $replacementId,
$this->commentMapper->renameUserId($userId, $replacementId, $pollId);
}

/**
* @deprecated Use registerGuest() instead
*/
public function register(
string $publicShareToken,
string $displayName,
string $emailAddress = '',
string $timeZone = '',
): Share {
return $this->registerGuest($publicShareToken, $displayName, $emailAddress, $timeZone);
}

/**
* Delete or restore share by Token
* @param string $token Share of token to delete
Expand Down
10 changes: 7 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ onUnmounted(() => {
</template>

<style lang="scss">
.app-content {
display: flex;
flex-direction: column;
// remove public user menu from header
#public-page-user-menu {
display: none;
}

#body-public a {
font-weight: 600;
}
</style>
42 changes: 0 additions & 42 deletions src/assets/scss/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,6 @@
padding: 0 !important;
}

// global modal settings
.modal__content {
padding: 14px;
display: flex;
flex-direction: column;
color: var(--color-main-text);
}

.modal__buttons__spacer {
flex: 1;
}

.modal__buttons {
display: flex;
gap: 8px;
justify-content: flex-end;
flex-wrap: wrap-reverse;
align-items: center;
margin-top: 36px;

.left {
display: flex;
flex: 1;
gap: 8px;
}

.right {
display: flex;
flex: 0;
justify-content: flex-end;
gap: 8px;
}

.button {
margin-inline: 10px 0;
}
}

.modal__buttons__link {
text-decoration: underline;
}

.sortable {
* {
cursor: grab;
Expand Down
13 changes: 0 additions & 13 deletions src/assets/scss/hacks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,11 @@
height: var(--avatar-size);
}

// h2 in notecard gets a margin-top of -6px instead of 24px for better alignment
.notecard h2 {
margin-top: -6px;
}

// relative position to be able to get sticky toolbar
.app-content {
position: relative !important;
}

.app-sidebar {
top: 0 !important;
}

.action-item.action-item--single.app-navigation-toggle.undefined.has-tooltip {
top: 4px;
margin-inline-end: -50px;
Expand All @@ -56,7 +47,3 @@
display: inline !important;
}
}

.modal-wrapper .modal-container {
overflow: scroll !important;
}
3 changes: 3 additions & 0 deletions src/assets/scss/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
--cap-width: 49rem;
--shadow-height: 0.7rem;
--shadow-height-inverted: -0.7rem;
--scroll-fade-shadow: rgba(0, 0, 0, 0.1);
--color-polls-foreground-yes: #2d7b41;
--color-polls-foreground-no: #db0606;
--color-polls-foreground-maybe: #a37200;
Expand All @@ -26,6 +27,7 @@
--color-polls-background-no: #451c1c;
--color-polls-background-maybe: #2e2914;
--container-background-light: #14262e;
--scroll-fade-shadow: rgba(255, 255, 255, 0.15);
}
}

Expand All @@ -37,4 +39,5 @@
--color-polls-background-no: #451c1c;
--color-polls-background-maybe: #2e2914;
--container-background-light: #14262e;
--scroll-fade-shadow: rgba(255, 255, 255, 0.15);
}
37 changes: 0 additions & 37 deletions src/components/Actions/modules/ActionRegister.vue

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Actions/modules/ActionSendConfirmed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useRoute } from 'vue-router'
import { ref } from 'vue'
import { t, n } from '@nextcloud/l10n'

import NcModal from '@nextcloud/vue/components/NcModal'
import NcModal from '../../Base/modules/CustomNcModal.vue'
import NcButton from '@nextcloud/vue/components/NcButton'

import EmailCheckIcon from 'vue-material-design-icons/EmailCheckOutline.vue' // view-comfy-outline
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/modules/ButtonModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { t } from '@nextcloud/l10n'

import NcButton, { ButtonVariant } from '@nextcloud/vue/components/NcButton'
import NcModal from '@nextcloud/vue/components/NcModal'
import NcModal from '../../Base/modules/CustomNcModal.vue'

import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcAppNavigationNew from '@nextcloud/vue/components/NcAppNavigationNew'
Expand Down
66 changes: 66 additions & 0 deletions src/components/Base/modules/CustomNcModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->

<script setup lang="ts">
import NcModal from '@nextcloud/vue/components/NcModal'

defineOptions({ inheritAttrs: false })
</script>

<template>
<NcModal v-bind="$attrs" class="custom-nc-modal">
<template v-for="(_, name) in $slots" #[name]="slotProps">
<slot :name="name" v-bind="slotProps ?? {}" />
</template>
</NcModal>
</template>

<style lang="scss">
.modal-wrapper .modal-container {
overflow: scroll !important;
}

.custom-nc-modal {
.modal-container__content {
padding: 3rem 1.6rem 1rem;
}
.modal__content {
padding: 14px;
color: var(--color-main-text);
}
.modal__buttons__spacer {
flex: 1;
}
.modal__buttons {
display: flex;
gap: 8px;
justify-content: flex-end;
flex-wrap: wrap-reverse;
align-items: center;
margin-top: 1.5rem;

.left {
display: flex;
flex: 1;
gap: 8px;
}

.right {
display: flex;
flex: 0;
justify-content: flex-end;
gap: 8px;
}

.button {
margin-inline: 10px 0;
}
}

.modal__buttons__link {
text-decoration: underline;
}
}
</style>
40 changes: 0 additions & 40 deletions src/components/Cards/CardRegister.vue

This file was deleted.

14 changes: 0 additions & 14 deletions src/components/Cards/VoteInfoCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ import CardAddProposals from './CardAddProposals.vue'
import CardClosedPoll from './CardClosedPoll.vue'
import CardLimitedVotes from './CardLimitedVotes.vue'
import CardLocked from './CardLocked.vue'
import CardRegister from './CardRegister.vue'
import CardSendConfirmations from './CardSendConfirmations.vue'
import CardTimezone from './CardTimezone.vue'
import CardUnpublishedPoll from './CardUnpublishedPoll.vue'

import { usePollStore } from '../../stores/poll'
import { useOptionsStore } from '../../stores/options'
import { useSharesStore } from '../../stores/shares'
import { useSessionStore } from '../../stores/session'

const pollStore = usePollStore()
const optionsStore = useOptionsStore()
const sharesStore = useSharesStore()
const sessionStore = useSessionStore()

const showTimezoneHint = computed(
() =>
Expand Down Expand Up @@ -60,16 +57,6 @@ const showLimitCard = computed(
&& (pollStore.configuration.maxVotesPerOption
|| pollStore.configuration.maxVotesPerUser),
)
const showRegisterCard = computed(
() =>
sessionStore.route.name === 'publicVote'
&& ['public', 'email', 'contact'].includes(
pollStore.currentUserStatus.userRole,
)
&& !pollStore.isClosed
&& !pollStore.currentUserStatus.isLocked
&& !!pollStore.id,
)
</script>

<template>
Expand All @@ -81,7 +68,6 @@ const showRegisterCard = computed(
<CardLocked v-if="pollStore.currentUserStatus.isLocked" :key="5" />
<CardAddProposals v-if="showAddProposalsCard" :key="1" />
<CardSendConfirmations v-if="showSendConfirmationsCard" :key="4" />
<CardRegister v-if="showRegisterCard" :key="6" />
</TransitionGroup>
</template>

Expand Down
Loading
Loading