Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87812d02d3 | ||
|
|
1104280c0c | ||
|
|
2e829b281b | ||
|
|
7adeb41402 | ||
|
|
c7f3fb0e6e | ||
|
|
ccabdc580c | ||
|
|
0350b80cda | ||
|
|
2dac1598ff | ||
|
|
32109debfd | ||
|
|
e1928f7af9 | ||
|
|
cd7bc8427f | ||
|
|
1b248ad121 | ||
|
|
fa44d0d738 | ||
|
|
88f8f4241b | ||
|
|
cbe703d3d2 | ||
|
|
1a34535467 | ||
|
|
5e854e4341 | ||
|
|
a6044f3a83 | ||
|
|
3b6a87752b | ||
|
|
2396a927ab | ||
|
|
3beb92c300 | ||
|
|
924b443bdc | ||
|
|
fe121795a0 | ||
|
|
2ea6a67790 | ||
|
|
7d3d1587c4 | ||
|
|
2da6b33b36 | ||
|
|
edaa5fe94f | ||
|
|
7e5fa85a0a | ||
|
|
39929361a0 | ||
|
|
9e70dea85a | ||
|
|
a8c459d714 | ||
|
|
9a42d16f9e | ||
|
|
9d89f32374 | ||
|
|
ad29d0682e | ||
|
|
d8ca8d743c | ||
|
|
0efa7ed8d1 | ||
|
|
f5af3ede12 | ||
|
|
213065b86c | ||
|
|
a3e115824b | ||
|
|
f27a5121fe | ||
|
|
74f8c8a7ac | ||
|
|
ec16195a4f | ||
|
|
b9ff5e66fd | ||
|
|
6a335247ca | ||
|
|
67cbb650f0 | ||
|
|
06fba58f37 | ||
|
|
9eecde7a80 | ||
|
|
e4de1c62f8 | ||
|
|
7ca5503719 | ||
|
|
37b9bbc031 | ||
|
|
063aeeb50e | ||
|
|
b7f0568482 |
No files matched your search
@@ -2,3 +2,4 @@
|
|||||||
.idea
|
.idea
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
/.idea/
|
||||||
@@ -4,7 +4,7 @@ COPY --chown=gradle:gradle /private/minis-backend /home/gradle/src
|
|||||||
WORKDIR /home/gradle/src
|
WORKDIR /home/gradle/src
|
||||||
RUN gradle buildFatJar --no-daemon
|
RUN gradle buildFatJar --no-daemon
|
||||||
|
|
||||||
FROM node:18 as build_frontend
|
FROM node:24 as build_frontend
|
||||||
|
|
||||||
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
@@ -16,7 +16,7 @@ RUN npm install
|
|||||||
RUN npm run build-only
|
RUN npm run build-only
|
||||||
|
|
||||||
|
|
||||||
FROM openjdk:latest as miniplan
|
FROM amazoncorretto:18 as miniplan
|
||||||
LABEL authors="walamana"
|
LABEL authors="walamana"
|
||||||
|
|
||||||
RUN mkdir -p /app/public
|
RUN mkdir -p /app/public
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ name: miniplan
|
|||||||
networks:
|
networks:
|
||||||
backend:
|
backend:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
@@ -11,8 +14,12 @@ services:
|
|||||||
- POSTGRES_PASSWORD=minis
|
- POSTGRES_PASSWORD=minis
|
||||||
- POSTGRES_USER=minis
|
- POSTGRES_USER=minis
|
||||||
- POSTGRES_DB=minis
|
- POSTGRES_DB=minis
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
volumes:
|
||||||
|
- postgres:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
|
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
@@ -21,7 +28,7 @@ services:
|
|||||||
start_period: 80s
|
start_period: 80s
|
||||||
app:
|
app:
|
||||||
image: git.walamana.de/walamana/miniplan:latest
|
image: git.walamana.de/walamana/miniplan:latest
|
||||||
restart: no
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -8,7 +8,5 @@
|
|||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {}
|
||||||
"rxjs": "^7.8.1"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -11,3 +11,5 @@ DATABASE_PASSWORD=abc
|
|||||||
ADMIN_PASSWORD=123
|
ADMIN_PASSWORD=123
|
||||||
FRONTEND_PATH=./public
|
FRONTEND_PATH=./public
|
||||||
APPLICATION_NAME=Miniplan\ Hl.\ Familie
|
APPLICATION_NAME=Miniplan\ Hl.\ Familie
|
||||||
|
PORT=8080
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM gradle:latest as build_backend
|
FROM gradle:7.5.1 as build_backend
|
||||||
|
|
||||||
COPY --chownn=gradle:gradle . /home/gradle/src
|
COPY --chownn=gradle:gradle . /home/gradle/src
|
||||||
WORKDIR /home/gradle/src
|
WORKDIR /home/gradle/src
|
||||||
@@ -11,7 +11,7 @@ WORKDIR /home/node/app
|
|||||||
COPY --chown=node:node /pub
|
COPY --chown=node:node /pub
|
||||||
|
|
||||||
|
|
||||||
FROM openjdk:latest
|
FROM amazoncorretto:18
|
||||||
LABEL authors="walamana"
|
LABEL authors="walamana"
|
||||||
|
|
||||||
RUN mkdir /miniplan
|
RUN mkdir /miniplan
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ktor {
|
ktor {
|
||||||
development = true
|
development = true
|
||||||
deployment {
|
deployment {
|
||||||
port = "${PORT}"
|
port = ${PORT}
|
||||||
}
|
}
|
||||||
application {
|
application {
|
||||||
modules = [ de.walamana.ApplicationKt.module ]
|
modules = [ de.walamana.ApplicationKt.module ]
|
||||||
@@ -9,7 +9,7 @@ ktor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jwt {
|
jwt {
|
||||||
secret = "${SECRET}"
|
secret = ${SECRET}
|
||||||
issuer = "http://0.0.0.0:8080/"
|
issuer = "http://0.0.0.0:8080/"
|
||||||
audience = "http://0.0.0.0:8080/"
|
audience = "http://0.0.0.0:8080/"
|
||||||
realm = "mini-data"
|
realm = "mini-data"
|
||||||
@@ -21,5 +21,5 @@ database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
admin {
|
admin {
|
||||||
password = "${ADMIN}"
|
password = ${ADMIN}
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,10 @@ val logback_version: String by project
|
|||||||
val exposed_version: String by project
|
val exposed_version: String by project
|
||||||
val h2_version: String by project
|
val h2_version: String by project
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "2.1.20"
|
kotlin("jvm") version "1.9.0"
|
||||||
id("io.ktor.plugin") version "3.1.1"
|
id("io.ktor.plugin") version "2.3.3"
|
||||||
kotlin("plugin.serialization") version "2.1.20"
|
kotlin("plugin.serialization") version "1.9.0"
|
||||||
id("com.palantir.docker") version "0.35.0"
|
id("com.palantir.docker") version "0.36.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "de.walamana"
|
group = "de.walamana"
|
||||||
@@ -44,6 +44,9 @@ dependencies {
|
|||||||
|
|
||||||
implementation("io.github.cdimascio:dotenv-kotlin:6.4.1")
|
implementation("io.github.cdimascio:dotenv-kotlin:6.4.1")
|
||||||
implementation("at.favre.lib:bcrypt:0.10.2")
|
implementation("at.favre.lib:bcrypt:0.10.2")
|
||||||
|
implementation("org.apache.poi:poi:5.2.3") // Check for the latest version
|
||||||
|
implementation("org.apache.poi:poi-ooxml:5.2.3") // Check for the latest version
|
||||||
|
implementation("org.apache.xmlbeans:xmlbeans:5.0.2") // Check for the latest version
|
||||||
|
|
||||||
testImplementation("io.ktor:ktor-server-test-host")
|
testImplementation("io.ktor:ktor-server-test-host")
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,13 +82,12 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,22 +134,29 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
@@ -205,6 +217,12 @@ set -- \
|
|||||||
org.gradle.wrapper.GradleWrapperMain \
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
|||||||
@@ -13,8 +13,10 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -25,7 +27,8 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ data class Ministrant(
|
|||||||
val passwordHash: String? = "",
|
val passwordHash: String? = "",
|
||||||
val firstname: String,
|
val firstname: String,
|
||||||
val lastname: String,
|
val lastname: String,
|
||||||
val birthday: DateAsLong,
|
val birthday: DateAsLong? = null,
|
||||||
val privileges: CommaSeperatedStringList
|
val privileges: CommaSeperatedStringList
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ object Ministranten : Table() {
|
|||||||
val passwordHash = varchar("passwordHash", 1024)
|
val passwordHash = varchar("passwordHash", 1024)
|
||||||
val firstname = varchar("firstname", 128)
|
val firstname = varchar("firstname", 128)
|
||||||
val lastname = varchar("lastname", 128)
|
val lastname = varchar("lastname", 128)
|
||||||
val birthday = long("birthday")
|
val birthday = long("birthday").nullable()
|
||||||
val privileges = varchar("privileges", 1024)
|
val privileges = varchar("privileges", 1024)
|
||||||
|
|
||||||
override val primaryKey = PrimaryKey(id)
|
override val primaryKey = PrimaryKey(id)
|
||||||
@@ -51,7 +51,7 @@ object MinistrantenDao {
|
|||||||
if (showPasswordHash) row[Ministranten.passwordHash] else "",
|
if (showPasswordHash) row[Ministranten.passwordHash] else "",
|
||||||
row[Ministranten.firstname],
|
row[Ministranten.firstname],
|
||||||
row[Ministranten.lastname],
|
row[Ministranten.lastname],
|
||||||
Date(row[Ministranten.birthday]),
|
row[Ministranten.birthday]?.let(::Date),
|
||||||
row[Ministranten.privileges].split(",")
|
row[Ministranten.privileges].split(",")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ object MinistrantenDao {
|
|||||||
passwordHash: String,
|
passwordHash: String,
|
||||||
firstname: String,
|
firstname: String,
|
||||||
lastname: String,
|
lastname: String,
|
||||||
birthday: Date,
|
birthday: Date?,
|
||||||
privileges: List<String>
|
privileges: List<String>
|
||||||
) = dbQuery {
|
) = dbQuery {
|
||||||
val statement = Ministranten.insert {
|
val statement = Ministranten.insert {
|
||||||
@@ -104,7 +104,7 @@ object MinistrantenDao {
|
|||||||
it[Ministranten.passwordHash] = ""
|
it[Ministranten.passwordHash] = ""
|
||||||
it[Ministranten.firstname] = firstname
|
it[Ministranten.firstname] = firstname
|
||||||
it[Ministranten.lastname] = lastname
|
it[Ministranten.lastname] = lastname
|
||||||
it[Ministranten.birthday] = birthday.time
|
it[Ministranten.birthday] = birthday?.time
|
||||||
it[Ministranten.privileges] = privileges.joinToString(",")
|
it[Ministranten.privileges] = privileges.joinToString(",")
|
||||||
}
|
}
|
||||||
Security.setPassword(username, passwordHash)
|
Security.setPassword(username, passwordHash)
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ fun Application.configureDatabases() {
|
|||||||
SchemaUtils.create(GottesdienstGroups)
|
SchemaUtils.create(GottesdienstGroups)
|
||||||
SchemaUtils.create(Gottesdienste)
|
SchemaUtils.create(Gottesdienste)
|
||||||
SchemaUtils.create(Marks)
|
SchemaUtils.create(Marks)
|
||||||
|
// TODO Add proper versioning and migration for database
|
||||||
|
exec("ALTER TABLE MINISTRANTEN ALTER COLUMN birthday DROP NOT NULL;")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,13 @@ fun Application.configureHTTP() {
|
|||||||
allowMethod(HttpMethod.Put)
|
allowMethod(HttpMethod.Put)
|
||||||
allowMethod(HttpMethod.Delete)
|
allowMethod(HttpMethod.Delete)
|
||||||
allowMethod(HttpMethod.Patch)
|
allowMethod(HttpMethod.Patch)
|
||||||
|
allowMethod(HttpMethod.Post)
|
||||||
allowMethod(HttpMethod.Options)
|
allowMethod(HttpMethod.Options)
|
||||||
allowHeader(HttpHeaders.Authorization)
|
allowHeader(HttpHeaders.Authorization)
|
||||||
allowHeader(HttpHeaders.AccessControlAllowOrigin)
|
allowHeader(HttpHeaders.AccessControlAllowOrigin)
|
||||||
|
allowHeader(HttpHeaders.ContentType)
|
||||||
|
allowHeader(HttpHeaders.CacheControl)
|
||||||
|
allowHeader("x-requested-with")
|
||||||
allowNonSimpleContentTypes = true
|
allowNonSimpleContentTypes = true
|
||||||
// allowHeader("MyCustomHeader")
|
// allowHeader("MyCustomHeader")
|
||||||
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
anyHost() // @TODO: Don't do this in production if possible. Try to limit it.
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ fun Payload.mid() = getClaim("id").asInt()
|
|||||||
|
|
||||||
|
|
||||||
object Security {
|
object Security {
|
||||||
fun DEFAULT_EXPIRY() = Date(System.currentTimeMillis() + 1000 * 60 * 60);
|
fun DEFAULT_EXPIRY() = Date(System.currentTimeMillis() + 1000L * 60 * 60 * 24 * 40);
|
||||||
|
|
||||||
suspend fun authenticateUser(application: Application, username: String, password: String): Ministrant? {
|
suspend fun authenticateUser(application: Application, username: String, password: String): Ministrant? {
|
||||||
println("Username $username password $password")
|
println("Username $username password $password")
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package de.walamana.service
|
||||||
|
|
||||||
|
import de.walamana.models.Gottesdienst
|
||||||
|
import org.apache.poi.ss.usermodel.Row
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook
|
||||||
|
import java.io.File
|
||||||
|
import java.io.InputStream
|
||||||
|
import java.lang.Exception
|
||||||
|
import java.time.*
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
import kotlin.collections.HashMap
|
||||||
|
|
||||||
|
|
||||||
|
object ZelebrationsplanParser {
|
||||||
|
|
||||||
|
private val weekdays = listOf("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag")
|
||||||
|
|
||||||
|
fun parse(ins: InputStream, planId: Int): HashMap<String, ArrayList<Gottesdienst>> {
|
||||||
|
val workbook = XSSFWorkbook(ins)
|
||||||
|
val sheet = workbook.getSheetAt(0)
|
||||||
|
|
||||||
|
var currentDate: String? = null
|
||||||
|
val gottesdienste = hashMapOf<String, ArrayList<Gottesdienst>>()
|
||||||
|
|
||||||
|
for (row in sheet) {
|
||||||
|
val r = rowToArray(row)
|
||||||
|
val weekday = weekdays.firstOrNull { r[0]?.startsWith(it) == true }
|
||||||
|
if(weekday != null) {
|
||||||
|
currentDate = r[0]!!
|
||||||
|
}else if(r[0]?.isBlank() == true) {
|
||||||
|
println("Empty line")
|
||||||
|
}else if(r.all { it != null }){
|
||||||
|
try {
|
||||||
|
val time = formatTime(currentDate!!, r[1]!!)
|
||||||
|
val pfarrei = r[0]!!
|
||||||
|
val attendance = time - Duration.ofMinutes(30)
|
||||||
|
|
||||||
|
gottesdienste[pfarrei] = gottesdienste.getOrElse(pfarrei) { arrayListOf() }.apply {
|
||||||
|
add(Gottesdienst(
|
||||||
|
id = 0,
|
||||||
|
name = r[2]!!,
|
||||||
|
date = time.toDate(),
|
||||||
|
attendance = attendance.toDate(),
|
||||||
|
planId = planId
|
||||||
|
))
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return gottesdienste
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun formatTime(date: String, time: String): LocalDateTime {
|
||||||
|
try{
|
||||||
|
return LocalDateTime.parse("$date, $time", DateTimeFormatter.ofPattern("EEEE, d. MMMM yyyy, H.mm 'Uhr'", Locale.GERMANY))
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
|
||||||
|
try{
|
||||||
|
return LocalDateTime.parse("$date, $time", DateTimeFormatter.ofPattern("EEEE, d. MMMM yyyy, H:mm 'Uhr'", Locale.GERMANY))
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
|
||||||
|
try{
|
||||||
|
return LocalDateTime.parse("$date, $time", DateTimeFormatter.ofPattern("EEEE, d. MMMM yyyy, 'a. 'H.mm 'Uhr'", Locale.GERMANY))
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
|
||||||
|
return LocalDateTime.parse("$date, $time", DateTimeFormatter.ofPattern("EEEE, d. MMMM yyyy, 'a. 'H:mm 'Uhr'", Locale.GERMANY))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun rowToArray(row: Row): Array<String?> {
|
||||||
|
return arrayOf(row.getCell(0)?.stringCellValue, row.getCell(1)?.stringCellValue, row.getCell(2)?.stringCellValue, row.getCell(3)?.stringCellValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun LocalDateTime.toDate() = Date.from(this.atZone(ZoneId.of("Europe/Berlin")).toInstant())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
File("Zelebrationsplan Mai 2025.xlsx").inputStream().use {
|
||||||
|
ZelebrationsplanParser.parse(it, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package de.walamana.views
|
|||||||
import at.favre.lib.crypto.bcrypt.BCrypt
|
import at.favre.lib.crypto.bcrypt.BCrypt
|
||||||
import com.auth0.jwt.JWT
|
import com.auth0.jwt.JWT
|
||||||
import com.auth0.jwt.algorithms.Algorithm
|
import com.auth0.jwt.algorithms.Algorithm
|
||||||
|
import de.walamana.models.Ministrant
|
||||||
import de.walamana.models.MinistrantenDao
|
import de.walamana.models.MinistrantenDao
|
||||||
import de.walamana.plugins.Security
|
import de.walamana.plugins.Security
|
||||||
import de.walamana.plugins.getJWTEnvironment
|
import de.walamana.plugins.getJWTEnvironment
|
||||||
@@ -34,6 +35,7 @@ data class AuthenticationResult(
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class AuthenticationUpdateRequest(
|
data class AuthenticationUpdateRequest(
|
||||||
|
val username: String?,
|
||||||
val newPassword: String
|
val newPassword: String
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -70,7 +72,11 @@ fun Route.configureAuthenticationRoutes() {
|
|||||||
val principal = call.principal<JWTPrincipal>()!!
|
val principal = call.principal<JWTPrincipal>()!!
|
||||||
val request = call.receive<AuthenticationUpdateRequest>()
|
val request = call.receive<AuthenticationUpdateRequest>()
|
||||||
|
|
||||||
Security.setPassword(principal.payload.username(), request.newPassword)
|
val username = if(request.username != null && principal.payload.username() == "admin") {
|
||||||
|
request.username
|
||||||
|
} else principal.payload.username()
|
||||||
|
|
||||||
|
Security.setPassword(username, request.newPassword)
|
||||||
|
|
||||||
call.respond(hashMapOf("success" to true))
|
call.respond(hashMapOf("success" to true))
|
||||||
}
|
}
|
||||||
@@ -92,8 +98,28 @@ fun Route.configureAuthenticationRoutes() {
|
|||||||
|
|
||||||
|
|
||||||
call.respond(hashMapOf("password" to newPassword))
|
call.respond(hashMapOf("password" to newPassword))
|
||||||
|
}
|
||||||
|
post("refresh") {
|
||||||
|
val principal = call.principal<JWTPrincipal>()!!
|
||||||
|
val jwtEnv = application.getJWTEnvironment()
|
||||||
|
val username = principal.payload.username()
|
||||||
|
|
||||||
|
val ministrant = if (username == "admin") {
|
||||||
|
val allMinis = MinistrantenDao.allMinistranten().map { it.username }
|
||||||
|
Ministrant(0, "admin", "", "admin", "admin", null, allMinis)
|
||||||
|
} else {
|
||||||
|
MinistrantenDao.getMinistrant(username) ?: return@post
|
||||||
|
}
|
||||||
|
|
||||||
|
val newToken = Security.createToken(jwtEnv, ministrant)
|
||||||
|
val expiry = Security.DEFAULT_EXPIRY().toGMTString()
|
||||||
|
|
||||||
|
call.response.header(
|
||||||
|
"Set-Cookie",
|
||||||
|
"token=$newToken; HttpOnly; Expires=$expiry"
|
||||||
|
)
|
||||||
|
|
||||||
|
call.respond(AuthenticationResult(true, newToken, ministrant.privileges))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package de.walamana.views
|
package de.walamana.views
|
||||||
|
|
||||||
import de.walamana.models.Gottesdienst
|
import de.walamana.models.Gottesdienst
|
||||||
import de.walamana.models.Gottesdienste
|
|
||||||
import de.walamana.models.GottesdiensteDao
|
import de.walamana.models.GottesdiensteDao
|
||||||
|
import de.walamana.service.ZelebrationsplanParser
|
||||||
import io.ktor.http.*
|
import io.ktor.http.*
|
||||||
|
import io.ktor.http.content.*
|
||||||
import io.ktor.server.application.*
|
import io.ktor.server.application.*
|
||||||
import io.ktor.server.request.*
|
import io.ktor.server.request.*
|
||||||
import io.ktor.server.response.*
|
import io.ktor.server.response.*
|
||||||
@@ -43,5 +44,17 @@ fun Route.configureGottesdiensteRoutes() {
|
|||||||
GottesdiensteDao.deleteGottesdienst(id)
|
GottesdiensteDao.deleteGottesdienst(id)
|
||||||
call.respond(HttpStatusCode.OK)
|
call.respond(HttpStatusCode.OK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post("/parseZelebrationsplan") {
|
||||||
|
val id = call.parameters.getOrFail("id").toInt()
|
||||||
|
val multipartData = call.receiveMultipart()
|
||||||
|
multipartData.forEachPart { part ->
|
||||||
|
if(part is PartData.FileItem) {
|
||||||
|
val data = ZelebrationsplanParser.parse(part.streamProvider(), planId = id)
|
||||||
|
call.respond(data)
|
||||||
|
}
|
||||||
|
part.dispose()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package de.walamana.views
|
|||||||
import de.walamana.models.GottesdienstGroup
|
import de.walamana.models.GottesdienstGroup
|
||||||
import de.walamana.models.GottesdienstGroupDao
|
import de.walamana.models.GottesdienstGroupDao
|
||||||
import de.walamana.models.GottesdienstGroups
|
import de.walamana.models.GottesdienstGroups
|
||||||
|
import de.walamana.plugins.getJWTEnvironment
|
||||||
import de.walamana.service.PlanDao
|
import de.walamana.service.PlanDao
|
||||||
import io.ktor.server.application.*
|
import io.ktor.server.application.*
|
||||||
import io.ktor.server.auth.*
|
import io.ktor.server.auth.*
|
||||||
@@ -14,6 +15,7 @@ import io.ktor.server.util.*
|
|||||||
|
|
||||||
fun Route.configurePlanRoutes() {
|
fun Route.configurePlanRoutes() {
|
||||||
route("/plan") {
|
route("/plan") {
|
||||||
|
authenticate {
|
||||||
get {
|
get {
|
||||||
val principal = call.principal<JWTPrincipal>()
|
val principal = call.principal<JWTPrincipal>()
|
||||||
val isAnonymous = principal == null
|
val isAnonymous = principal == null
|
||||||
@@ -22,6 +24,7 @@ fun Route.configurePlanRoutes() {
|
|||||||
call.respond(plan)
|
call.respond(plan)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
route("/groups") {
|
route("/groups") {
|
||||||
get {
|
get {
|
||||||
val offset = call.parameters.get("offset")?.toLong() ?: 0
|
val offset = call.parameters.get("offset")?.toLong() ?: 0
|
||||||
|
|||||||
@@ -26,3 +26,4 @@ coverage
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
/dev-dist/
|
||||||
@@ -3,9 +3,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" href="/minis_logo.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="Miniplan">
|
||||||
<title>Miniplan App</title>
|
<title>Miniplan App</title>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"crypto-js": "^4.2.0",
|
||||||
|
"dropzone-vue3": "^1.0.2",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"underscore": "^1.13.7",
|
"underscore": "^1.13.7",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
@@ -18,12 +20,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node18": "^18.2.0",
|
"@tsconfig/node18": "^18.2.0",
|
||||||
"@types/node": "^18.17.0",
|
"@types/node": "^18.17.0",
|
||||||
|
"@vite-pwa/assets-generator": "^1.0.2",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
"@vue/tsconfig": "^0.4.0",
|
"@vue/tsconfig": "^0.4.0",
|
||||||
"less": "^4.2.0",
|
"less": "^4.2.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"typescript": "~5.1.6",
|
"typescript": "~5.1.6",
|
||||||
"vite": "^4.4.6",
|
"vite": "^5.4.0",
|
||||||
"vue-tsc": "^1.8.6"
|
"vite-plugin-pwa": "^1.3.0",
|
||||||
|
"vue-tsc": "^3.3.7",
|
||||||
|
"workbox-window": "^7.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 931 B |
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 4329 3848" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<path id="Vectorized" d="M1614.618,3355.781C1612.41,3362.264 1607.496,3375.663 1593.41,3408.077C1585.444,3426.407 1651.514,3431.144 1621.881,3487.463C1604.36,3520.76 1502.049,3579.731 1451.548,3612.589C1424.195,3630.386 1446.948,3582.248 1433.365,3526.951C1428.86,3508.61 1373.802,3408.892 1433.375,3377.27C1445.358,3370.91 1463.335,3381.252 1464.436,3371.959C1464.69,3369.811 1471.061,3328.483 1462.206,3337.925C1444.527,3356.775 1407.045,3430.974 1221.971,3404.028C1196.362,3400.299 1118.26,3388.928 945.022,3236.884C928.084,3222.019 723.137,3018.522 649.735,2888.897C604.051,2808.221 379.235,2352.906 424.362,1988.669C435.713,1897.044 434.653,1865.497 561.162,1682.933C587.065,1645.553 619.919,1640.653 608.973,1637.128C554.936,1619.726 552.75,1628.258 552.173,1632.778C541.593,1715.743 464.962,1674.146 427.85,1614.435C376.873,1532.416 308.309,1489.225 327.936,1489.701C332.734,1489.817 331.754,1493.629 387.656,1495.517C457.697,1497.883 499.62,1443.047 549.675,1459.998C578.456,1469.745 519.991,1416.036 520.24,1326.662C520.288,1309.452 554.736,1116.901 677.825,958.147C733.642,886.157 836.884,736.019 1194.772,483.054C1250.736,443.497 1696.421,179.524 1890.283,271.861C1996.741,322.567 1976.711,370.09 1989.257,361.785C1989.347,361.726 2006.221,296.217 1999.657,292.972C1999.323,292.807 1909.634,309.003 1941.856,225.343C1959.035,180.739 1994.72,167.146 2026.649,93.759C2041.368,59.928 2042.753,58.743 2045.328,60.395C2127.957,113.395 2256.446,322.813 2123.088,299.707C2122.281,299.567 2118.139,298.849 2113.396,298.438C2106.099,297.806 2097.379,297.901 2097.197,301.945C2096.713,312.675 2090.413,374.771 2103.414,356.622C2110.381,346.896 2122.003,336.045 2137.65,325.716C2185.561,294.087 2271.208,267.356 2376.484,292.842C2432.551,306.415 3091.946,487.891 3304.396,768.264C3354.38,834.228 3466.209,977.364 3462.167,1231.625C3460.695,1324.264 3393.886,1330.949 3402.987,1338.87C3406.108,1341.587 3406.419,1338.758 3453.679,1328.583C3473.276,1324.364 3421.521,1243.818 3527.579,1261.5C3585.416,1271.143 3578.27,1294.512 3710.735,1317.634C3738.612,1322.5 3681.487,1342.933 3634.159,1390.618C3603.015,1421.996 3604.631,1459.669 3576.605,1469.756C3524.841,1488.385 3634.618,1465.177 3699.749,1601.613C3787.04,1784.469 3790.202,2028.141 3790.693,2065.994C3791.545,2131.594 3791.088,2131.262 3800.779,2196.229L3800.779,2270.16C3777.038,2570.815 3790.637,2762.719 3663.9,2931.003C3594.986,3022.509 3532.628,3035.334 3422.191,3002.882C3406.064,2998.143 3405.703,3000.926 3406.217,3002.098C3407.574,3005.195 3422.32,3038.851 3433.005,3034.789C3451.133,3027.899 3513.61,2986.635 3543.965,3083.764C3556.409,3123.582 3534.297,3160.309 3585.551,3233.886C3603.361,3259.452 3615.008,3266.507 3601.784,3265.691C3556.253,3262.881 3507.048,3240.022 3408.284,3243.088C3322.339,3245.757 3355.493,3140.43 3352.245,3139.18C3336.025,3132.939 3358.19,3155.457 3322.048,3208.989C3229.954,3345.395 3205.467,3371.482 2960.534,3483.371C2754.478,3577.5 1994.184,3764.217 1747.5,3575.029C1626.613,3482.317 1625.605,3380.69 1623.979,3350.816C1623.426,3340.674 1622.803,3338.802 1617.393,3348.356C1616.367,3350.167 1616.115,3351.383 1614.618,3355.781ZM3479.139,1453.803C3475.78,1456.85 3471.528,1456.593 3475.27,1459.499C3477.211,1461.006 3477.889,1456.152 3505.935,1461.504C3521.912,1464.553 3513.539,1441.295 3497.892,1447.394C3496.415,1447.969 3488.541,1451.038 3479.139,1453.803ZM609.5,1519.486C589.445,1502.297 590.439,1500.984 588.179,1500.767C580.787,1500.054 584.92,1519.322 585.261,1520.915C585.831,1523.571 629.603,1535.826 609.5,1519.486ZM2154.702,344.895C2145.608,351.682 2138.449,359.025 2128.519,367.255C2078.268,429.939 2090.405,436.417 2090.463,516.931C2090.494,559.742 1977.961,599.783 1977.599,492.307C1977.455,449.782 2019.582,80.463 1349.246,422.88C1302.302,446.86 984.862,621.933 744.718,916.016C744.144,916.718 623.268,1038.194 559.601,1259.59C521.704,1391.369 583.675,1550.509 799.554,1557.862C829.886,1558.896 847.566,1600.416 834.876,1632.69C824.454,1659.196 793.55,1679.466 732.348,1665.954C618.164,1640.744 605.645,1656.993 512.53,1803.012C487.094,1842.901 387.925,1998.415 484.905,2393.724C488.783,2409.535 588.038,2782.924 730.654,2962.481C889.514,3162.492 1100.131,3365.794 1232.496,3379.619C1371.461,3394.133 1400.816,3379.284 1492.003,3265.631C1544.576,3200.105 1531.735,3126.431 1602.126,3130.89C1681.168,3135.897 1665.783,3195.435 1663.886,3202.776C1654.134,3240.514 1633.113,3260.439 1644.827,3339.758C1647.216,3355.935 1650.966,3374.582 1656.452,3396.355C1692.609,3539.87 1829.108,3770.815 2781.856,3520.944C2938.315,3479.911 3162.075,3362.147 3203.567,3318.806C3225.364,3296.039 3324.686,3177.87 3320.658,3146.746C3311.459,3075.673 3142.536,2979.005 3173.052,2925.37C3184.041,2906.056 3245.847,2855.472 3277.381,2879.994C3303.743,2900.494 3328.56,2926.648 3365.546,2949.079C3402.733,2971.633 3452.222,2990.422 3527.95,2995.917C3552.411,2997.691 3712.94,2929.13 3747.06,2636.386C3768.589,2451.677 3773.14,2324.485 3772.814,2244.602C3772.764,2232.411 3772.6,2221.322 3772.366,2211.299C3Line truncated
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 891 B |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 64 KiB |
@@ -5,6 +5,9 @@ import LoginPanel from "@/components/LoginPanel.vue";
|
|||||||
import {onMounted, ref} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
import {Auth} from "@/services/auth";
|
import {Auth} from "@/services/auth";
|
||||||
import DialogHost from "@/components/dialog/DialogHost.vue";
|
import DialogHost from "@/components/dialog/DialogHost.vue";
|
||||||
|
import {LoginService} from "@/services/LoginService";
|
||||||
|
import {Dialogs} from "@/services/DialogService";
|
||||||
|
import InstallPWADialog from "@/components/dialog/InstallPWADialog.vue";
|
||||||
|
|
||||||
let showPopup = ref(false)
|
let showPopup = ref(false)
|
||||||
let loggedIn = ref(false)
|
let loggedIn = ref(false)
|
||||||
@@ -21,8 +24,49 @@ function print(){
|
|||||||
window.print()
|
window.print()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
Auth.checkForToken()
|
Auth.checkForToken()
|
||||||
|
if (Auth.getToken()) {
|
||||||
|
await Auth.refreshToken()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
LoginService.subject.subscribe(() => {
|
||||||
|
showPopup.value = true
|
||||||
|
})
|
||||||
|
|
||||||
|
const installEvent = ref<Event>()
|
||||||
|
|
||||||
|
window.addEventListener('beforeinstallprompt', (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
console.log("beforeinstallprompt")
|
||||||
|
installEvent.value = e
|
||||||
|
scheduleInstallDialog()
|
||||||
|
})
|
||||||
|
|
||||||
|
function scheduleInstallDialog() {
|
||||||
|
if (isPwa()) return
|
||||||
|
if (localStorage.getItem('installPromptDismissed')) return
|
||||||
|
if (!installEvent.value) return
|
||||||
|
|
||||||
|
Dialogs.createDialog(InstallPWADialog, {
|
||||||
|
onPositive(dontShowAgain: boolean) {
|
||||||
|
if (dontShowAgain) localStorage.setItem('installPromptDismissed', 'true')
|
||||||
|
;(installEvent.value as any).prompt()
|
||||||
|
},
|
||||||
|
onNegative(dontShowAgain: boolean) {
|
||||||
|
if (dontShowAgain) localStorage.setItem('installPromptDismissed', 'true')
|
||||||
|
},
|
||||||
|
onDismiss() {}
|
||||||
|
}, {})
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPwa() {
|
||||||
|
return window.matchMedia('(display-mode: standalone)').matches
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('appinstalled', () => {
|
||||||
|
localStorage.setItem('installPromptDismissed', 'true')
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 4329 3848" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<path id="Vectorized" d="M1614.618,3355.781C1612.41,3362.264 1607.496,3375.663 1593.41,3408.077C1585.444,3426.407 1651.514,3431.144 1621.881,3487.463C1604.36,3520.76 1502.049,3579.731 1451.548,3612.589C1424.195,3630.386 1446.948,3582.248 1433.365,3526.951C1428.86,3508.61 1373.802,3408.892 1433.375,3377.27C1445.358,3370.91 1463.335,3381.252 1464.436,3371.959C1464.69,3369.811 1471.061,3328.483 1462.206,3337.925C1444.527,3356.775 1407.045,3430.974 1221.971,3404.028C1196.362,3400.299 1118.26,3388.928 945.022,3236.884C928.084,3222.019 723.137,3018.522 649.735,2888.897C604.051,2808.221 379.235,2352.906 424.362,1988.669C435.713,1897.044 434.653,1865.497 561.162,1682.933C587.065,1645.553 619.919,1640.653 608.973,1637.128C554.936,1619.726 552.75,1628.258 552.173,1632.778C541.593,1715.743 464.962,1674.146 427.85,1614.435C376.873,1532.416 308.309,1489.225 327.936,1489.701C332.734,1489.817 331.754,1493.629 387.656,1495.517C457.697,1497.883 499.62,1443.047 549.675,1459.998C578.456,1469.745 519.991,1416.036 520.24,1326.662C520.288,1309.452 554.736,1116.901 677.825,958.147C733.642,886.157 836.884,736.019 1194.772,483.054C1250.736,443.497 1696.421,179.524 1890.283,271.861C1996.741,322.567 1976.711,370.09 1989.257,361.785C1989.347,361.726 2006.221,296.217 1999.657,292.972C1999.323,292.807 1909.634,309.003 1941.856,225.343C1959.035,180.739 1994.72,167.146 2026.649,93.759C2041.368,59.928 2042.753,58.743 2045.328,60.395C2127.957,113.395 2256.446,322.813 2123.088,299.707C2122.281,299.567 2118.139,298.849 2113.396,298.438C2106.099,297.806 2097.379,297.901 2097.197,301.945C2096.713,312.675 2090.413,374.771 2103.414,356.622C2110.381,346.896 2122.003,336.045 2137.65,325.716C2185.561,294.087 2271.208,267.356 2376.484,292.842C2432.551,306.415 3091.946,487.891 3304.396,768.264C3354.38,834.228 3466.209,977.364 3462.167,1231.625C3460.695,1324.264 3393.886,1330.949 3402.987,1338.87C3406.108,1341.587 3406.419,1338.758 3453.679,1328.583C3473.276,1324.364 3421.521,1243.818 3527.579,1261.5C3585.416,1271.143 3578.27,1294.512 3710.735,1317.634C3738.612,1322.5 3681.487,1342.933 3634.159,1390.618C3603.015,1421.996 3604.631,1459.669 3576.605,1469.756C3524.841,1488.385 3634.618,1465.177 3699.749,1601.613C3787.04,1784.469 3790.202,2028.141 3790.693,2065.994C3791.545,2131.594 3791.088,2131.262 3800.779,2196.229L3800.779,2270.16C3777.038,2570.815 3790.637,2762.719 3663.9,2931.003C3594.986,3022.509 3532.628,3035.334 3422.191,3002.882C3406.064,2998.143 3405.703,3000.926 3406.217,3002.098C3407.574,3005.195 3422.32,3038.851 3433.005,3034.789C3451.133,3027.899 3513.61,2986.635 3543.965,3083.764C3556.409,3123.582 3534.297,3160.309 3585.551,3233.886C3603.361,3259.452 3615.008,3266.507 3601.784,3265.691C3556.253,3262.881 3507.048,3240.022 3408.284,3243.088C3322.339,3245.757 3355.493,3140.43 3352.245,3139.18C3336.025,3132.939 3358.19,3155.457 3322.048,3208.989C3229.954,3345.395 3205.467,3371.482 2960.534,3483.371C2754.478,3577.5 1994.184,3764.217 1747.5,3575.029C1626.613,3482.317 1625.605,3380.69 1623.979,3350.816C1623.426,3340.674 1622.803,3338.802 1617.393,3348.356C1616.367,3350.167 1616.115,3351.383 1614.618,3355.781ZM3479.139,1453.803C3475.78,1456.85 3471.528,1456.593 3475.27,1459.499C3477.211,1461.006 3477.889,1456.152 3505.935,1461.504C3521.912,1464.553 3513.539,1441.295 3497.892,1447.394C3496.415,1447.969 3488.541,1451.038 3479.139,1453.803ZM609.5,1519.486C589.445,1502.297 590.439,1500.984 588.179,1500.767C580.787,1500.054 584.92,1519.322 585.261,1520.915C585.831,1523.571 629.603,1535.826 609.5,1519.486ZM2154.702,344.895C2145.608,351.682 2138.449,359.025 2128.519,367.255C2078.268,429.939 2090.405,436.417 2090.463,516.931C2090.494,559.742 1977.961,599.783 1977.599,492.307C1977.455,449.782 2019.582,80.463 1349.246,422.88C1302.302,446.86 984.862,621.933 744.718,916.016C744.144,916.718 623.268,1038.194 559.601,1259.59C521.704,1391.369 583.675,1550.509 799.554,1557.862C829.886,1558.896 847.566,1600.416 834.876,1632.69C824.454,1659.196 793.55,1679.466 732.348,1665.954C618.164,1640.744 605.645,1656.993 512.53,1803.012C487.094,1842.901 387.925,1998.415 484.905,2393.724C488.783,2409.535 588.038,2782.924 730.654,2962.481C889.514,3162.492 1100.131,3365.794 1232.496,3379.619C1371.461,3394.133 1400.816,3379.284 1492.003,3265.631C1544.576,3200.105 1531.735,3126.431 1602.126,3130.89C1681.168,3135.897 1665.783,3195.435 1663.886,3202.776C1654.134,3240.514 1633.113,3260.439 1644.827,3339.758C1647.216,3355.935 1650.966,3374.582 1656.452,3396.355C1692.609,3539.87 1829.108,3770.815 2781.856,3520.944C2938.315,3479.911 3162.075,3362.147 3203.567,3318.806C3225.364,3296.039 3324.686,3177.87 3320.658,3146.746C3311.459,3075.673 3142.536,2979.005 3173.052,2925.37C3184.041,2906.056 3245.847,2855.472 3277.381,2879.994C3303.743,2900.494 3328.56,2926.648 3365.546,2949.079C3402.733,2971.633 3452.222,2990.422 3527.95,2995.917C3552.411,2997.691 3712.94,2929.13 3747.06,2636.386C3768.589,2451.677 3773.14,2324.485 3772.814,2244.602C3772.764,2232.411 3772.6,2221.322 3772.366,2211.299C3Line truncated
|
||||||
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 58 KiB |
@@ -0,0 +1,474 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type {Gottesdienst, Mark, SimplifiedMinistrant} from "@/models/models"
|
||||||
|
import {computed, ref} from "vue"
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
gottesdienst: Gottesdienst
|
||||||
|
ministranten: SimplifiedMinistrant[]
|
||||||
|
marks: Mark[]
|
||||||
|
editable: string[]
|
||||||
|
currentUsername: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
toggleMark: [gid: number, mid: number]
|
||||||
|
editGottesdienst: [id: number]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const isAdmin = computed(() => props.currentUsername === "admin")
|
||||||
|
const currentMini = computed(() => props.ministranten.find(m => m.username === props.currentUsername))
|
||||||
|
const showCheckbox = computed(() => !!currentMini.value && !isAdmin.value)
|
||||||
|
const expanded = ref(false)
|
||||||
|
|
||||||
|
const responseCount = computed(() =>
|
||||||
|
props.marks.filter(m => m.gid === props.gottesdienst.id && m.value !== 0).length
|
||||||
|
)
|
||||||
|
|
||||||
|
const comingMinistrants = computed(() => {
|
||||||
|
const miniMap = new Map(props.ministranten.map(m => [m.id, m]))
|
||||||
|
return props.marks
|
||||||
|
.filter(m => m.gid === props.gottesdienst.id && m.value === 1)
|
||||||
|
.map(m => miniMap.get(m.mid))
|
||||||
|
.filter((m): m is SimplifiedMinistrant => !!m)
|
||||||
|
})
|
||||||
|
|
||||||
|
const allMinistrants = computed(() => {
|
||||||
|
const miniMap = new Map(props.ministranten.map(m => [m.id, m]))
|
||||||
|
const marksMap = new Map(props.marks.filter(m => m.gid === props.gottesdienst.id).map(m => [m.mid, m]))
|
||||||
|
return props.ministranten
|
||||||
|
.map(mini => ({
|
||||||
|
ministrant: mini,
|
||||||
|
mark: marksMap.get(mini.id) ?? {gid: props.gottesdienst.id, mid: mini.id, value: 0} as Mark
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
function ministrantTotalMarks(miniId: number): number {
|
||||||
|
return props.marks.filter(m => m.mid === miniId && m.value === 1).length
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMark(gid: number, mid: number): Mark {
|
||||||
|
const mark = props.marks.find(m => m.mid === mid && m.gid === gid)
|
||||||
|
return mark ?? {gid, mid, value: 0}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getIconForMark(gid: number, mid: number): string {
|
||||||
|
const mark = getMark(gid, mid).value
|
||||||
|
switch (mark) {
|
||||||
|
case -1: return "remove"
|
||||||
|
case 0: return "question_mark"
|
||||||
|
case 1: return "close"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMarkClass(gid: number, mid: number): Record<string, boolean> {
|
||||||
|
const mark = getMark(gid, mid).value
|
||||||
|
return {
|
||||||
|
minus: mark === -1,
|
||||||
|
neutral: mark === 0,
|
||||||
|
cross: mark === 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getHintForMark(gid: number, mid: number): string {
|
||||||
|
const mark = getMark(gid, mid).value
|
||||||
|
switch (mark) {
|
||||||
|
case -1: return "Ich kann nicht"
|
||||||
|
case 0: return "Egal"
|
||||||
|
case 1: return "Ich komme"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function two(s: number): string {
|
||||||
|
return (s < 10 ? "0" : "") + s
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDay(time: number | Date): string {
|
||||||
|
const date = new Date(time)
|
||||||
|
return two(date.getDate()) + "." + two(date.getMonth() + 1) + "."
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatTime(time: number | Date): string {
|
||||||
|
const date = new Date(time)
|
||||||
|
return two(date.getHours()) + ":" + two(date.getMinutes())
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatWeekday(time: number | Date): string {
|
||||||
|
const date = new Date(time)
|
||||||
|
switch (date.getDay()) {
|
||||||
|
case 1: return "Montag"
|
||||||
|
case 2: return "Dienstag"
|
||||||
|
case 3: return "Mittwoch"
|
||||||
|
case 4: return "Donnerstag"
|
||||||
|
case 5: return "Freitag"
|
||||||
|
case 6: return "Samstag"
|
||||||
|
case 0: return "Sonntag"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleOwnMark() {
|
||||||
|
if (!currentMini.value) return
|
||||||
|
emit("toggleMark", props.gottesdienst.id, currentMini.value.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOwnMarkIcon(): string {
|
||||||
|
if (!currentMini.value) return ""
|
||||||
|
const mark = getMark(props.gottesdienst.id, currentMini.value.id).value
|
||||||
|
switch (mark) {
|
||||||
|
case -1: return "close"
|
||||||
|
case 0: return ""
|
||||||
|
case 1: return "check"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOwnMarkClass(): Record<string, boolean> {
|
||||||
|
if (!currentMini.value) return {}
|
||||||
|
const mark = getMark(props.gottesdienst.id, currentMini.value.id).value
|
||||||
|
return {
|
||||||
|
minus: mark === -1,
|
||||||
|
neutral: mark === 0,
|
||||||
|
cross: mark === 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOwnMarkHint(): string {
|
||||||
|
if (!currentMini.value) return ""
|
||||||
|
const mark = getMark(props.gottesdienst.id, currentMini.value.id).value
|
||||||
|
switch (mark) {
|
||||||
|
case -1: return "Ich kann nicht"
|
||||||
|
case 0: return "keine Angabe"
|
||||||
|
case 1: return "Ich komme"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="title-row">
|
||||||
|
<button
|
||||||
|
v-if="showCheckbox"
|
||||||
|
class="own-mark"
|
||||||
|
:class="getOwnMarkClass()"
|
||||||
|
@click="toggleOwnMark"
|
||||||
|
:title="getOwnMarkHint()"
|
||||||
|
>
|
||||||
|
<i v-if="getOwnMarkIcon()" class="icon">{{ getOwnMarkIcon() }}</i>
|
||||||
|
</button>
|
||||||
|
<span class="day">{{ formatWeekday(gottesdienst.date) }} {{ formatDay(gottesdienst.date) }}</span>
|
||||||
|
<button v-if="isAdmin" class="edit-godi-btn" @click="emit('editGottesdienst', gottesdienst.id)" title="Gottesdienst bearbeiten">
|
||||||
|
<i class="icon">edit</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="info">
|
||||||
|
<span class="name">{{ gottesdienst.name !== "" ? gottesdienst.name : "Gottesdienst" }}</span>
|
||||||
|
<span class="time">um {{ formatTime(gottesdienst.date) }} Uhr</span>
|
||||||
|
<span class="attendance">Anwesenheit: {{ formatTime(gottesdienst.attendance) }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body" v-if="allMinistrants.length > 0">
|
||||||
|
<div class="coming-summary" v-if="comingMinistrants.length > 0">
|
||||||
|
<span v-for="m in comingMinistrants" :key="m.id" class="coming-chip">
|
||||||
|
{{ m.firstname }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<button class="collapse-toggle" @click="expanded = !expanded">
|
||||||
|
<i class="icon">{{ expanded ? 'expand_less' : 'expand_more' }}</i>
|
||||||
|
{{ responseCount }} Rückmeldungen
|
||||||
|
</button>
|
||||||
|
<template v-if="expanded">
|
||||||
|
<div
|
||||||
|
v-for="{ministrant, mark} in allMinistrants"
|
||||||
|
:key="ministrant.id"
|
||||||
|
class="ministrant-row"
|
||||||
|
:class="getMarkClass(gottesdienst.id, ministrant.id)"
|
||||||
|
>
|
||||||
|
<span class="mini-name">{{ ministrant.firstname }} {{ ministrant.lastname }}</span>
|
||||||
|
<span class="mark-count">{{ ministrantTotalMarks(ministrant.id) }}</span>
|
||||||
|
<span
|
||||||
|
class="mark-badge"
|
||||||
|
:class="{ clickable: isAdmin }"
|
||||||
|
@click="isAdmin && emit('toggleMark', gottesdienst.id, ministrant.id)"
|
||||||
|
>
|
||||||
|
<i class="icon">{{ getIconForMark(gottesdienst.id, ministrant.id) }}</i>
|
||||||
|
<span class="hint">{{ getHintForMark(gottesdienst.id, ministrant.id) }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="card-body empty" v-else>
|
||||||
|
<span class="no-marks">Keine Ministranten</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.card {
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid #d7d5d5;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-bottom: 1px solid #e8e8e8;
|
||||||
|
|
||||||
|
.title-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 18px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit-godi-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: #aaa;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 100ms;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 20px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f0f0f0;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.own-mark {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
border: 2px solid #cecece;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: #ffffff;
|
||||||
|
cursor: pointer;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
transition: 100ms;
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: #919191;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.minus {
|
||||||
|
border-color: #690b0b;
|
||||||
|
background: #fdd5d5;
|
||||||
|
color: #690b0b;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.cross {
|
||||||
|
border-color: #045b04;
|
||||||
|
background: #d1fcd1;
|
||||||
|
color: #045b04;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.neutral {
|
||||||
|
border-color: #9f9f9f;
|
||||||
|
background: #f0f0f0;
|
||||||
|
color: #9f9f9f;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 20px;
|
||||||
|
font-variation-settings: "wght" 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
font-weight: 700;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #656565;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
padding: 8px 16px;
|
||||||
|
|
||||||
|
&.empty {
|
||||||
|
padding: 16px;
|
||||||
|
text-align: center;
|
||||||
|
color: #9f9f9f;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.coming-summary {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
.coming-chip {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
background: #d1fcd1;
|
||||||
|
color: #045b04;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-toggle {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 6px 0;
|
||||||
|
margin: 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #777;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ministrant-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 0 8px 0;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-name {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mark-count {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #aaa;
|
||||||
|
font-weight: 600;
|
||||||
|
min-width: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mark-badge {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
border-radius: 100%;
|
||||||
|
padding: 2px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
font-size: 13px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: 100ms;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(0,0,0,0.04);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.minus {
|
||||||
|
.mark-badge {
|
||||||
|
color: #690b0b;
|
||||||
|
|
||||||
|
i {
|
||||||
|
background: #fdd5d5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
color: #690b0b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.cross {
|
||||||
|
.mark-badge {
|
||||||
|
color: #045b04;
|
||||||
|
|
||||||
|
i {
|
||||||
|
background: #d1fcd1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
color: #045b04;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.neutral {
|
||||||
|
.mark-badge {
|
||||||
|
color: #9f9f9f;
|
||||||
|
|
||||||
|
i {
|
||||||
|
background: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
color: #9f9f9f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -133,29 +133,33 @@ function dateToValueString(time) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
<div class="controls">
|
<div class="top-row">
|
||||||
<button class="flat left" v-if="prev != null && prev <= groups.length - 1" @click="back">
|
<button class="flat arrow" v-if="prev != null && prev <= groups.length - 1" @click="back">
|
||||||
<i>arrow_left_alt</i>{{ formatDateShort(get(prev).from) }} - {{ formatDateShort(get(prev).to) }}
|
<i>arrow_left_alt</i>
|
||||||
|
<span class="date-label">{{ formatDateShort(get(prev).from) }} - {{ formatDateShort(get(prev).to) }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="width: 100%"/>
|
<div v-else></div>
|
||||||
<button class="flat right" v-if="next != null && next > 0" @click="forward">
|
|
||||||
{{ formatDateShort(get(next).from) }} - {{ formatDateShort(get(next).to) }}<i>arrow_right_alt</i>
|
<div class="title">
|
||||||
</button>
|
|
||||||
<button class="flat right" v-if="(next == null || next <= 0) && admin" style="margin-right: 20px"
|
|
||||||
@click="$emit('new')">
|
|
||||||
<i>add</i> Neuer plan
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<template v-if="groups.length > 0">
|
<template v-if="groups.length > 0">
|
||||||
<span style="z-index: 1">Miniplan vom {{ formatDate(get(cur).from) }} bis {{ formatDate(get(cur).to) }}</span>
|
<span class="prefix">Miniplan vom</span>
|
||||||
<span v-if="admin" style="display: flex; align-items: center; z-index: 1">
|
{{ formatDate(get(cur).from) }} – {{ formatDate(get(cur).to) }}
|
||||||
<button class="icon flat" @click="$emit('delete', get(cur).id)"><i>delete</i></button>
|
|
||||||
<button class="icon flat" @click="$emit('edit', get(cur).id)"><i>edit</i></button>
|
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
<span v-else>
|
<span v-else>Keine Gottesdienstgruppen vorhanden</span>
|
||||||
Keine Gottesdienstgruppen vorhanden
|
</div>
|
||||||
</span>
|
|
||||||
|
<button class="flat arrow" v-if="next != null && next > 0" @click="forward">
|
||||||
|
<span class="date-label">{{ formatDateShort(get(next).from) }} - {{ formatDateShort(get(next).to) }}</span>
|
||||||
|
<i>arrow_right_alt</i>
|
||||||
|
</button>
|
||||||
|
<div v-else></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="admin-row" v-if="admin && groups.length > 0">
|
||||||
|
<button class="flat" @click="$emit('new')"><i>add</i> Neuer Plan</button>
|
||||||
|
<button class="flat icon" @click="$emit('delete', get(cur).id)"><i>delete</i></button>
|
||||||
|
<button class="flat icon" @click="$emit('edit', get(cur).id)"><i>edit</i></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -163,49 +167,119 @@ function dateToValueString(time) {
|
|||||||
|
|
||||||
.bar {
|
.bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: calc(100% - 30px);
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
|
||||||
border-bottom: 1px solid #d7d5d5;
|
border-bottom: 1px solid #d7d5d5;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
padding: 15px;
|
padding: 8px 12px;
|
||||||
position: relative;
|
gap: 6px;
|
||||||
|
|
||||||
.controls {
|
.top-row {
|
||||||
|
display: grid;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
gap: 6px;
|
||||||
|
grid-template-columns: 60px 1fr 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
align-items: center;
|
||||||
position: absolute;
|
gap: 4px;
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: calc(100% - 10px);
|
|
||||||
height: calc(100% - 10px);
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left, .right{
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
padding: 6px 8px 6px 6px;
|
||||||
|
|
||||||
.left {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
i {
|
i {
|
||||||
margin-left: 10px;
|
font-size: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-label {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
.title {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
font-size: 14px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
min-width: 0;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
.prefix {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 4px;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
margin-right: 10px;
|
font-size: 13px;
|
||||||
|
padding: 4px 10px 4px 6px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
&.icon {
|
||||||
margin: 0 10px
|
padding: 4px 8px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(min-width: 800px) {
|
||||||
|
padding: 10px 16px;
|
||||||
|
gap: 0;
|
||||||
|
|
||||||
|
.top-row {
|
||||||
|
flex: 1;
|
||||||
|
gap: 10px;
|
||||||
|
grid-template-columns: 180px 1fr 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow {
|
||||||
|
padding: 6px 14px 6px 10px;
|
||||||
|
|
||||||
|
.date-label {
|
||||||
|
display: inline;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 16px;
|
||||||
|
white-space: normal;
|
||||||
|
|
||||||
|
.prefix {
|
||||||
|
display: inline;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-row {
|
||||||
|
width: auto;
|
||||||
|
border-top: none;
|
||||||
|
padding-top: 0;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,373 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import {ref, watch} from "vue"
|
||||||
|
import type {Gottesdienst, Mark, SimplifiedMinistrant} from "@/models/models"
|
||||||
|
import GottesdienstCard from "@/components/GottesdienstCard.vue"
|
||||||
|
|
||||||
|
const STORAGE_KEY = "miniplan_list_tutorial_seen"
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
gottesdienste: Gottesdienst[]
|
||||||
|
ministranten: SimplifiedMinistrant[]
|
||||||
|
marks: Mark[]
|
||||||
|
editable: string[]
|
||||||
|
currentUsername: string
|
||||||
|
admin: boolean
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
toggleMark: [gid: number, mid: number]
|
||||||
|
addGottesdienst: []
|
||||||
|
editGottesdienst: [id: number]
|
||||||
|
addMinistrant: []
|
||||||
|
editMinistrant: [id: number]
|
||||||
|
importZelebrationsplan: []
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const activeTab = ref<"gottesdienste" | "ministranten">("gottesdienste")
|
||||||
|
const showTutorial = ref(!localStorage.getItem(STORAGE_KEY))
|
||||||
|
|
||||||
|
function dismissTutorial() {
|
||||||
|
showTutorial.value = false
|
||||||
|
localStorage.setItem(STORAGE_KEY, "true")
|
||||||
|
}
|
||||||
|
|
||||||
|
function countXMarks(miniId: number): number {
|
||||||
|
return props.marks.filter(m => m.mid === miniId && m.value === 1).length
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="list-view">
|
||||||
|
<div class="tab-bar" v-if="admin">
|
||||||
|
<button
|
||||||
|
class="tab"
|
||||||
|
:class="{ active: activeTab === 'gottesdienste' }"
|
||||||
|
@click="activeTab = 'gottesdienste'"
|
||||||
|
><i class="icon">list</i> Gottesdienste</button>
|
||||||
|
<button
|
||||||
|
class="tab"
|
||||||
|
:class="{ active: activeTab === 'ministranten' }"
|
||||||
|
@click="activeTab = 'ministranten'"
|
||||||
|
><i class="icon">groups</i> Ministranten</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="activeTab === 'gottesdienste'">
|
||||||
|
<GottesdienstCard
|
||||||
|
v-for="godi in gottesdienste"
|
||||||
|
:key="godi.id"
|
||||||
|
:gottesdienst="godi"
|
||||||
|
:ministranten="ministranten"
|
||||||
|
:marks="marks"
|
||||||
|
:editable="editable"
|
||||||
|
:current-username="currentUsername"
|
||||||
|
@toggle-mark="(gid, mid) => emit('toggleMark', gid, mid)"
|
||||||
|
@edit-gottesdienst="(id) => emit('editGottesdienst', id)"
|
||||||
|
/>
|
||||||
|
<button v-if="admin" class="add-godi" @click="emit('addGottesdienst')">
|
||||||
|
<i class="icon">add</i> Gottesdienst
|
||||||
|
</button>
|
||||||
|
<button v-if="admin" class="import-btn" @click="emit('importZelebrationsplan')">
|
||||||
|
<i class="icon">upload</i> Zelebrationsplan importieren
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-if="admin && activeTab === 'ministranten'">
|
||||||
|
<div class="mini-list">
|
||||||
|
<div v-for="mini in ministranten" :key="mini.id" class="mini-row">
|
||||||
|
<span class="mini-name">{{ mini.firstname }} {{ mini.lastname }}</span>
|
||||||
|
<span class="mini-username">@{{ mini.username }}</span>
|
||||||
|
<span class="x-count">{{ countXMarks(mini.id) }}</span>
|
||||||
|
<button v-if="admin" class="edit-btn" @click="emit('editMinistrant', mini.id)">
|
||||||
|
<i class="icon">edit</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="ministranten.length === 0" class="empty-state">
|
||||||
|
Keine Ministranten
|
||||||
|
</div>
|
||||||
|
<button v-if="admin" class="add-mini" @click="emit('addMinistrant')">
|
||||||
|
<i class="icon">add</i> Ministrant
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div class="tutorial-overlay" v-if="showTutorial" @click.self="dismissTutorial">
|
||||||
|
<div class="tutorial-card">
|
||||||
|
<h3><i class="icon">info</i> Listenansicht</h3>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Gottesdienste</strong> sind als Karten dargestellt – jede Karte zeigt Datum, Uhrzeit und Rückmeldungen.</li>
|
||||||
|
<li>Klicke auf dein <strong>Kästchen</strong> in der Karte, um deine Teilnahme anzugeben: <span class="chip cross">✓</span> dabei, <span class="chip minus">✗</span> nicht dabei.</li>
|
||||||
|
<li>Die <strong>Rückmeldungen</strong> der anderen siehst du aufgeklappt unter „X Rückmeldungen".</li>
|
||||||
|
<li v-if="admin">Als Admin siehst du zusätzlich den <strong>Ministranten-Tab</strong> und kannst Markierungen direkt anklicken.</li>
|
||||||
|
</ul>
|
||||||
|
<button @click="dismissTutorial">Verstanden!</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.list-view {
|
||||||
|
padding: 12px;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
|
||||||
|
@media(min-width: 800px) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-bar {
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
background: #f0f0f0;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 3px;
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
border: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
background: transparent;
|
||||||
|
color: #777;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 100ms;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background: #ffffff;
|
||||||
|
color: #222;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.active):hover {
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-list {
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.mini-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-name {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-username {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #999;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-count {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #045b04;
|
||||||
|
background: #d1fcd1;
|
||||||
|
padding: 1px 8px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 0 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mini-row {
|
||||||
|
.edit-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: #aaa;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 100ms;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f0f0f0;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
padding: 24px;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-mini {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
justify-content: center;
|
||||||
|
background: #fafafa;
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
border-radius: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #777;
|
||||||
|
transition: 100ms;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 20px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f0f0f0;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-godi {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin: 16px 0;
|
||||||
|
padding: 12px;
|
||||||
|
font-size: 15px;
|
||||||
|
justify-content: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border: 1px dashed #c4c4c4;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #555;
|
||||||
|
transition: 100ms;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 22px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #eaeaea;
|
||||||
|
border-color: #999;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tutorial-overlay {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.35);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 1000;
|
||||||
|
padding: 16px;
|
||||||
|
|
||||||
|
.tutorial-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 28px 32px;
|
||||||
|
max-width: 440px;
|
||||||
|
width: 100%;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 0 0 16px;
|
||||||
|
font-size: 20px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0 0 20px;
|
||||||
|
padding: 0 0 0 18px;
|
||||||
|
line-height: 1.7;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
&.cross { background: #d1fcd1; color: #045b04; }
|
||||||
|
&.minus { background: #fdd5d5; color: #690b0b; }
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
display: flex;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.import-btn {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin: 16px 0;
|
||||||
|
padding: 12px;
|
||||||
|
font-size: 15px;
|
||||||
|
justify-content: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border: 1px dashed #c4c4c4;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #555;
|
||||||
|
transition: 100ms;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 22px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #eaeaea;
|
||||||
|
border-color: #999;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -45,7 +45,9 @@ async function attemptLogin() {
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<img src="./../assets/minis_logo.png" style="height: 80px"/>
|
||||||
<span class="title">Anmelden</span>
|
<span class="title">Anmelden</span>
|
||||||
|
<span class="subtitle">Um den Miniplan einsehen zu können, logge dich bitte ein.</span>
|
||||||
<Input class="input" v-model:value="username" label="Nutzername"/>
|
<Input class="input" v-model:value="username" label="Nutzername"/>
|
||||||
<Input class="input" v-model:value="password" label="Passwort" type="password"/>
|
<Input class="input" v-model:value="password" label="Passwort" type="password"/>
|
||||||
<span v-if="invalid" style="color: red; text-align: center; margin-bottom: 10px">Benutzername oder<br> Passwort falsch.</span>
|
<span v-if="invalid" style="color: red; text-align: center; margin-bottom: 10px">Benutzername oder<br> Passwort falsch.</span>
|
||||||
@@ -69,11 +71,22 @@ async function attemptLogin() {
|
|||||||
.title{
|
.title{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 8px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
max-width: 300px;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.5;
|
||||||
|
font-style: italic;
|
||||||
|
line-height: 1.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
button{
|
button{
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const emit = defineEmits(["addPlan", "addGodi", "addMini", "save"])
|
const emit = defineEmits(["addPlan", "addGodi", "addMini", "importZelebrationsplan", "save"])
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
save: boolean,
|
save: boolean,
|
||||||
plan: boolean,
|
plan: boolean,
|
||||||
@@ -12,6 +12,7 @@ const props = defineProps<{
|
|||||||
<div class="action-bar" :class="{save: true}">
|
<div class="action-bar" :class="{save: true}">
|
||||||
<div class="other-action">
|
<div class="other-action">
|
||||||
<button class="add-plan" :class="{show: props.plan}" @click="$emit('addPlan')"> <i class="icon">add_box</i> Neuer Plan</button>
|
<button class="add-plan" :class="{show: props.plan}" @click="$emit('addPlan')"> <i class="icon">add_box</i> Neuer Plan</button>
|
||||||
|
<button class="import-zelebrationsplan" :class="{show: props.godi}" @click="$emit('importZelebrationsplan')"> <i class="icon">upload</i> Zelebrationsplan importieren</button>
|
||||||
<button class="add-godi" :class="{show: props.godi}" @click="$emit('addGodi')"> <i class="icon">add</i> Gottesdienst</button>
|
<button class="add-godi" :class="{show: props.godi}" @click="$emit('addGodi')"> <i class="icon">add</i> Gottesdienst</button>
|
||||||
<button class="add-mini" :class="{show: props.godi}" @click="$emit('addMini')"> <i class="icon">add</i> Ministrant</button>
|
<button class="add-mini" :class="{show: props.godi}" @click="$emit('addMini')"> <i class="icon">add</i> Ministrant</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,17 +25,23 @@ const props = defineProps<{
|
|||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
||||||
.action-bar {
|
.action-bar {
|
||||||
width: calc(100% - 32px * 2);
|
width: calc(100% - 24px * 2);
|
||||||
border-top: 1px solid #d7d5d5;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px 32px;
|
padding: 6px 24px;
|
||||||
background: #ffffff;
|
background: #fafafa;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
border-bottom: 1px solid #e0e0e0;
|
||||||
|
|
||||||
.other-action{
|
.other-action{
|
||||||
transition: 200ms translate;
|
transition: 200ms translate;
|
||||||
translate: 220px;
|
translate: 220px;
|
||||||
transition-delay: 100ms;
|
transition-delay: 100ms;
|
||||||
|
display: flex;
|
||||||
|
gap: 6px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
&.save .other-action {
|
&.save .other-action {
|
||||||
@@ -44,21 +51,17 @@ const props = defineProps<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 4px 10px 4px 6px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
&:not(.show){
|
&:not(.show){
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
&.save{
|
|
||||||
&:not(.show){
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
width: 220px;
|
|
||||||
translate: 0 calc(100% + 20px);
|
|
||||||
transition: 200ms translate;
|
|
||||||
&.show {
|
|
||||||
translate: 0;
|
|
||||||
transition-delay: 100ms;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import {onKeyPress} from "@/composables/enter";
|
|||||||
interface CreateGottesdienstDialogProps extends DialogControls {
|
interface CreateGottesdienstDialogProps extends DialogControls {
|
||||||
onCreate: (arg0: Gottesdienst) => (Promise<any> | undefined),
|
onCreate: (arg0: Gottesdienst) => (Promise<any> | undefined),
|
||||||
gottesdienst?: Gottesdienst,
|
gottesdienst?: Gottesdienst,
|
||||||
planId: number
|
planId: number,
|
||||||
|
onDelete?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyPress("Enter", create)
|
onKeyPress("Enter", create)
|
||||||
@@ -70,10 +71,13 @@ async function create(){
|
|||||||
<Input class="input" v-model:value="date" date-format="string" type="date" label="Datum"/>
|
<Input class="input" v-model:value="date" date-format="string" type="date" label="Datum"/>
|
||||||
<Input class="input" v-model:value="time" date-format="string" type="time" label="Um"/>
|
<Input class="input" v-model:value="time" date-format="string" type="time" label="Um"/>
|
||||||
<Input class="input" v-model:value="godi.attendance" type="time" label="Anwesenheit"/>
|
<Input class="input" v-model:value="godi.attendance" type="time" label="Anwesenheit"/>
|
||||||
<div class="buttons" style="display: flex; justify-content: end; margin-top: 20px;">
|
<div class="buttons" style="display: flex; justify-content: space-between; margin-top: 20px;">
|
||||||
|
<button v-if="godi.id != -1 && onDelete" class="red" @click="onDelete(); onDismiss()"><i class="icon">delete</i> Löschen</button>
|
||||||
|
<div style="display: flex; gap: 8px; margin-left: auto;">
|
||||||
<button @click="onDismiss">Abbrechen</button>
|
<button @click="onDismiss">Abbrechen</button>
|
||||||
<button @click="create">{{ godi?.id == -1 ? "Erstellen" : "Speichern"}}</button>
|
<button @click="create">{{ godi?.id == -1 ? "Erstellen" : "Speichern"}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {ref, toRaw} from "vue";
|
|||||||
import {onKeyPress} from "@/composables/enter";
|
import {onKeyPress} from "@/composables/enter";
|
||||||
import {API} from "@/services/api";
|
import {API} from "@/services/api";
|
||||||
import {Dialogs} from "@/services/DialogService";
|
import {Dialogs} from "@/services/DialogService";
|
||||||
|
import UpdatePasswordDialog from "@/components/dialog/UpdatePasswordDialog.vue";
|
||||||
interface CreateMinistrantDialogProps extends DialogControls {
|
interface CreateMinistrantDialogProps extends DialogControls {
|
||||||
onCreate: (any) => (Promise<any> | undefined),
|
onCreate: (any) => (Promise<any> | undefined),
|
||||||
onDelete: (id) => (Promise<any> | undefined),
|
onDelete: (id) => (Promise<any> | undefined),
|
||||||
@@ -62,6 +63,23 @@ async function resetPassword(username: string) {
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function updatePassword(username: string) {
|
||||||
|
Dialogs.createDialog(
|
||||||
|
UpdatePasswordDialog,
|
||||||
|
{
|
||||||
|
onDismiss(){},
|
||||||
|
onNegative(){},
|
||||||
|
onPositive(){},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
async onUpdated(newPassword: string){
|
||||||
|
await API.updatePassword(username, newPassword)
|
||||||
|
},
|
||||||
|
username
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -75,7 +93,9 @@ async function resetPassword(username: string) {
|
|||||||
<Input class="input" v-model:value="ministrant.privileges" label="Privilegien"/>
|
<Input class="input" v-model:value="ministrant.privileges" label="Privilegien"/>
|
||||||
|
|
||||||
<div class="actions" v-if="ministrant.id != -1">
|
<div class="actions" v-if="ministrant.id != -1">
|
||||||
<button @click="resetPassword(ministrant.username)"><i>lock_reset</i>Passwort zurücksetzen
|
<!-- <button @click="resetPassword(ministrant.username)"><i>lock_reset</i>Passwort zurücksetzen-->
|
||||||
|
<!-- </button>-->
|
||||||
|
<button @click="updatePassword(ministrant.username)"><i>lock_reset</i>Passwort ändern
|
||||||
</button>
|
</button>
|
||||||
<button class="red" @click="deleteMinistrant()"><i>delete</i>Entfernen</button>
|
<button class="red" @click="deleteMinistrant()"><i>delete</i>Entfernen</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,258 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import Dialog from "@/components/dialog/Dialog.vue";
|
||||||
|
import type {DialogControls} from "@/components/dialog/dialog";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import {API} from "@/services/api";
|
||||||
|
import vueDropzone from "dropzone-vue3"
|
||||||
|
import type {Gottesdienst} from "@/models/models";
|
||||||
|
|
||||||
|
interface ImportZelebrationsplanProps extends DialogControls {
|
||||||
|
onImport(gottesdienste: Gottesdienst[])
|
||||||
|
planId: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<ImportZelebrationsplanProps>()
|
||||||
|
|
||||||
|
const gottesdienste = ref<(Gottesdienst & {checked: boolean, pfarrei: string})[]>([])
|
||||||
|
const pfarreien = ref<string[]>([])
|
||||||
|
|
||||||
|
const filter = ref("Pfarrei wählen")
|
||||||
|
|
||||||
|
const importing = ref(false)
|
||||||
|
const progress = ref(0)
|
||||||
|
|
||||||
|
const dropzoneOptions = {
|
||||||
|
url: API.getZelebrationsplanParsingUrl(props.planId),
|
||||||
|
parallelUploads: 1,
|
||||||
|
acceptedFiles: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||||
|
disablePreviews: true,
|
||||||
|
init: function() {
|
||||||
|
this.on("complete", file => {
|
||||||
|
console.log("File", file)
|
||||||
|
let response = JSON.parse(file.xhr?.responseText)
|
||||||
|
gottesdienste.value = Object.keys(response).reduce((acc, next) => {
|
||||||
|
return acc.concat(response[next].map((it: any) => ({
|
||||||
|
...it,
|
||||||
|
checked: false,
|
||||||
|
pfarrei: next
|
||||||
|
})));
|
||||||
|
}, []);
|
||||||
|
pfarreien.value = Object.keys(response)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function importZelebrationsplan() {
|
||||||
|
const godis = gottesdienste.value.filter(it => it.checked)
|
||||||
|
importing.value = true
|
||||||
|
|
||||||
|
for(let godi of godis) {
|
||||||
|
const id = await API.addGottesdienstNew({
|
||||||
|
...godi,
|
||||||
|
date: new Date(godi.date),
|
||||||
|
attendance: new Date(godi.attendance)
|
||||||
|
})
|
||||||
|
progress.value += 1
|
||||||
|
godi.id = id
|
||||||
|
}
|
||||||
|
props.onImport(godis)
|
||||||
|
props.onDismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
function canImport() {
|
||||||
|
return gottesdienste.value.filter(it => it.checked).length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function amountChecked() {
|
||||||
|
return gottesdienste.value.filter(it => it.checked).length
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectAll() {
|
||||||
|
return gottesdienste.value.forEach(it => {
|
||||||
|
if(it.pfarrei == filter.value) {
|
||||||
|
it.checked = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function deselectAll() {
|
||||||
|
return gottesdienste.value.forEach(it => it.checked = false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function two(s) {
|
||||||
|
return (s < 10 ? "0" : "") + s
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDay(time) {
|
||||||
|
let date = new Date(time)
|
||||||
|
return two(date.getDate()) + "." + two(date.getMonth() + 1) + "."
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatTime(time) {
|
||||||
|
let date = new Date(time)
|
||||||
|
return two(date.getHours()) + ":" + two(date.getMinutes())
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatWeekday(time) {
|
||||||
|
let date = new Date(time)
|
||||||
|
switch (date.getDay()) {
|
||||||
|
case 1:
|
||||||
|
return "Mo";
|
||||||
|
case 2:
|
||||||
|
return "Di";
|
||||||
|
case 3:
|
||||||
|
return "Mi";
|
||||||
|
case 4:
|
||||||
|
return "Do";
|
||||||
|
case 5:
|
||||||
|
return "Fr";
|
||||||
|
case 6:
|
||||||
|
return "Sa";
|
||||||
|
case 0:
|
||||||
|
return "So"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGottesdienste() {
|
||||||
|
return gottesdienste.value.filter(it => it["pfarrei"] == filter.value || it.checked)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<Dialog class="dialog">
|
||||||
|
<h3>Zelebrationsplan importieren</h3>
|
||||||
|
|
||||||
|
<vue-dropzone v-if="gottesdienste.length == 0" id="dropzone" :options="dropzoneOptions"/>
|
||||||
|
|
||||||
|
<div class="select" v-if="gottesdienste.length > 0 && !importing">
|
||||||
|
<span>Gottesdienste ausgewählt: <strong>{{amountChecked()}} / {{getGottesdienste().length}}</strong></span>
|
||||||
|
<div style="margin: 10px 0; display: flex; align-items: center">
|
||||||
|
<select v-model="filter">
|
||||||
|
<option disabled selected>Pfarrei wählen</option>
|
||||||
|
<option v-for="pfarrei in pfarreien">{{pfarrei}}</option>
|
||||||
|
</select>
|
||||||
|
<template v-if="filter">
|
||||||
|
<button class="flat" @click="selectAll"><i class="icon">select_all</i>Alle auswählen</button>
|
||||||
|
<button class="flat" @click="deselectAll"><i class="icon">deselect</i>Alle abwählen</button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="list">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>Titel</td>
|
||||||
|
<td></td>
|
||||||
|
<td>Datum</td>
|
||||||
|
<td>Uhrzeit</td>
|
||||||
|
<td>Anwesenheit</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="godi in getGottesdienste()" @click.stop="godi.checked = !godi.checked">
|
||||||
|
<td><input type="checkbox" v-model="godi.checked"/></td>
|
||||||
|
<td style="width: 100%">{{godi.name}}</td>
|
||||||
|
<td>{{formatWeekday(godi.date)}}</td>
|
||||||
|
<td>{{formatDay(godi.date)}}</td>
|
||||||
|
<td>{{formatTime(godi.date)}}</td>
|
||||||
|
<td>{{formatTime(godi.attendance)}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="importing" style="display: flex; align-items: center; justify-content: center; padding: 100px; flex-direction: column; gap: 10px">
|
||||||
|
<p>Gottesdienste werden importiert...</p>
|
||||||
|
<p style="font-size: 3rem"><strong>{{progress}} / {{amountChecked()}}</strong></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="buttons" style="display: flex; justify-content: end; margin-top: 20px;">
|
||||||
|
<button @click="onDismiss">Abbrechen</button>
|
||||||
|
<button v-if="canImport()" @click="importZelebrationsplan">Importieren</button>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: min(90vw, 700px);
|
||||||
|
|
||||||
|
h3{
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 60px 100px;
|
||||||
|
border: 1px solid #e1e1e1;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
transition: background 200ms;
|
||||||
|
.icon {
|
||||||
|
font-size: 50px;
|
||||||
|
color: #989898;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
margin-top: 20px;
|
||||||
|
color: #bdbdbd;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #f9f9f9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
max-height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: 1px solid #f1f1f1;
|
||||||
|
border-radius: 4px;
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-spacing: 0;
|
||||||
|
|
||||||
|
thead {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr td{
|
||||||
|
padding: 12px 10px;
|
||||||
|
border-bottom: 1px solid #e1e1e1;
|
||||||
|
transition: background 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:hover td {
|
||||||
|
cursor: pointer;
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
tbody tr:last-child td{
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import {ref} from "vue";
|
||||||
|
import Dialog from "@/components/dialog/Dialog.vue";
|
||||||
|
import type {DialogControls} from "@/components/dialog/dialog";
|
||||||
|
|
||||||
|
interface InstallPWADialogProps extends DialogControls {
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<InstallPWADialogProps>()
|
||||||
|
|
||||||
|
const dontShowAgain = ref<boolean>(false)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<Dialog class="dialog">
|
||||||
|
<h3 style="margin-bottom: 10px; display: flex; gap: 1rem; align-items: center">
|
||||||
|
Zum Startbildschirm hinzufügen
|
||||||
|
</h3>
|
||||||
|
<p style="line-height: 1.7rem">
|
||||||
|
Dein Miniplan kann jetzt auf Ihrem Gerät installiert werden, um schnell und einfach darauf zuzugreifen.
|
||||||
|
</p>
|
||||||
|
<label class="checkbox">
|
||||||
|
<input type="checkbox" v-model="dontShowAgain" />
|
||||||
|
Nicht mehr anzeigen
|
||||||
|
</label>
|
||||||
|
<div class="buttons">
|
||||||
|
<button @click="onNegative(dontShowAgain)" class="dismiss">Später</button>
|
||||||
|
<button @click="onPositive(dontShowAgain)" ><i>browser_updated</i>Jetzt hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
width: 500px
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
margin-top: 20px;
|
||||||
|
|
||||||
|
.dismiss {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type {DialogControls} from "@/components/dialog/dialog";
|
||||||
|
import Dialog from "@/components/dialog/Dialog.vue";
|
||||||
|
import Input from "@/components/Input.vue";
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
|
interface UpdatePasswordDialogProps extends DialogControls {
|
||||||
|
username: string,
|
||||||
|
onUpdated: (newPassword: string) => (Promise<any> | undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<UpdatePasswordDialogProps>()
|
||||||
|
|
||||||
|
const newPassword = ref("")
|
||||||
|
const newPasswordCheck = ref("")
|
||||||
|
|
||||||
|
function updatePassword() {
|
||||||
|
if(newPassword.value !== newPasswordCheck.value) {
|
||||||
|
alert("Beide Passwörter müssen gleich sein!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
props.onUpdated(newPassword.value)
|
||||||
|
props.onPositive()
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Dialog class="dialog">
|
||||||
|
|
||||||
|
<h3>Passwort zurücksetzen</h3>
|
||||||
|
|
||||||
|
<Input class="input" v-model:value="newPassword" type="password" label="Neues Passwort"/>
|
||||||
|
<Input class="input" v-model:value="newPasswordCheck" type="password" label="Wiederholen"/>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="buttons" style="display: flex; justify-content: end; margin-top: 20px;">
|
||||||
|
<button @click="onDismiss">Abbrechen</button>
|
||||||
|
<button @click="updatePassword">Passwort speichern</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 500px;
|
||||||
|
|
||||||
|
h3{
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,6 +4,19 @@ import { createApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
|
import { registerSW } from 'virtual:pwa-register'
|
||||||
|
|
||||||
|
registerSW({
|
||||||
|
onNeedRefresh() {
|
||||||
|
if (confirm('New content available. Reload?')) {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onOfflineReady() {
|
||||||
|
console.log('App ready to work offline')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import {Subject} from "rxjs";
|
||||||
|
|
||||||
|
export namespace LoginService {
|
||||||
|
export const subject = new Subject<void>();
|
||||||
|
|
||||||
|
export function showLoginPopup() {
|
||||||
|
subject.next()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ import {Auth} from "@/services/auth";
|
|||||||
|
|
||||||
|
|
||||||
const API_ENDPOINT = import.meta.env.MODE == "development"
|
const API_ENDPOINT = import.meta.env.MODE == "development"
|
||||||
? "http://0.0.0.0:8080/api"
|
? "http://localhost:8080/api"
|
||||||
: window.location.origin + "/api"
|
: window.location.origin + "/api"
|
||||||
|
|
||||||
|
|
||||||
@@ -30,11 +30,21 @@ function getToken(): string | null {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class UnauthorizedError extends Error {
|
||||||
|
constructor() {
|
||||||
|
super("UnauthorizedError");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export namespace API {
|
export namespace API {
|
||||||
|
|
||||||
export async function getPlan(id: number) {
|
export async function getPlan(id: number) {
|
||||||
return api(`/plan?id=${id}`).then(res => res.json())
|
return api(`/plan?id=${id}`).then(res => {
|
||||||
.then(data => {
|
if(res.status == 401) {
|
||||||
|
throw new UnauthorizedError()
|
||||||
|
}
|
||||||
|
return res.json()
|
||||||
|
}).then(data => {
|
||||||
return {
|
return {
|
||||||
gottesdienste: data.gottesdienste,
|
gottesdienste: data.gottesdienste,
|
||||||
ministranten: data.ministranten,
|
ministranten: data.ministranten,
|
||||||
@@ -134,6 +144,15 @@ export namespace API {
|
|||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function updatePassword(username: String, newPassword: string): Promise<any> {
|
||||||
|
return api("/auth/update", "PUT", { username, newPassword })
|
||||||
|
.then(res => res.json())
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getZelebrationsplanParsingUrl(planId: number) {
|
||||||
|
return API_ENDPOINT + "/gottesdienste/parseZelebrationsplan?id=" + planId
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -71,6 +71,30 @@ export namespace Auth {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function refreshToken(): Promise<boolean> {
|
||||||
|
const token = getToken()
|
||||||
|
if (!token) return false
|
||||||
|
|
||||||
|
return api("/auth/refresh", "POST").then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
return res.json().then(data => {
|
||||||
|
if (data.success) {
|
||||||
|
setToken(data.token ?? "")
|
||||||
|
const payload = parseJwt(data.token)
|
||||||
|
loggedIn = true
|
||||||
|
user = payload.username
|
||||||
|
privileges = payload.privileges
|
||||||
|
privileges.push(user)
|
||||||
|
loggedInSubject.next(true)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}).catch(() => false)
|
||||||
|
}
|
||||||
|
|
||||||
function parseJwt (token) {
|
function parseJwt (token) {
|
||||||
var base64Url = token.split('.')[1];
|
var base64Url = token.split('.')[1];
|
||||||
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
import {computed, onMounted, reactive, ref, toRaw, watch} from "vue";
|
import {computed, onMounted, reactive, ref, toRaw, watch} from "vue";
|
||||||
import TablePlan from "@/components/TablePlan.vue";
|
import TablePlan from "@/components/TablePlan.vue";
|
||||||
import {API} from "@/services/api";
|
import {API, UnauthorizedError} from "@/services/api";
|
||||||
import type {Gottesdienst, GottesdienstGroup, Mark, SimplifiedMinistrant} from "@/models/models";
|
import type {Gottesdienst, GottesdienstGroup, Mark, SimplifiedMinistrant} from "@/models/models";
|
||||||
import MobilePlan from "@/components/MobilePlan.vue";
|
import MobilePlan from "@/components/MobilePlan.vue";
|
||||||
|
import ListView from "@/components/ListView.vue";
|
||||||
import PlanActionBar from "@/components/PlanActionBar.vue";
|
import PlanActionBar from "@/components/PlanActionBar.vue";
|
||||||
import {Auth} from "@/services/auth";
|
import {Auth} from "@/services/auth";
|
||||||
import GroupView from "@/components/GroupView.vue";
|
import GroupView from "@/components/GroupView.vue";
|
||||||
@@ -16,6 +17,8 @@ import CreateMinistrantDialog from "@/components/dialog/CreateMinistrantDialog.v
|
|||||||
import {useRoute, useRouter} from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import debounce from "underscore/modules/debounce.js"
|
import debounce from "underscore/modules/debounce.js"
|
||||||
import SavingIndicator from "@/components/SavingIndicator.vue";
|
import SavingIndicator from "@/components/SavingIndicator.vue";
|
||||||
|
import ImportZelebrationsplanDialog from "@/components/dialog/ImportZelebrationsplanDialog.vue";
|
||||||
|
import {LoginService} from "@/services/LoginService";
|
||||||
|
|
||||||
const MAX_WIDTH_MOBILE = 600;
|
const MAX_WIDTH_MOBILE = 600;
|
||||||
|
|
||||||
@@ -36,6 +39,8 @@ const plan = reactive<{
|
|||||||
groups: []
|
groups: []
|
||||||
})
|
})
|
||||||
const mobile = ref(window.innerWidth <= MAX_WIDTH_MOBILE)
|
const mobile = ref(window.innerWidth <= MAX_WIDTH_MOBILE)
|
||||||
|
const viewMode = ref<"table" | "list">("table")
|
||||||
|
const currentUsername = ref("")
|
||||||
const editedMarks = reactive<Mark[]>([]);
|
const editedMarks = reactive<Mark[]>([]);
|
||||||
const editPlanAdmin = ref(false)
|
const editPlanAdmin = ref(false)
|
||||||
const planId = ref(parseInt(route.params.id as string))
|
const planId = ref(parseInt(route.params.id as string))
|
||||||
@@ -55,16 +60,29 @@ watch(() => route.params.id, async (value, oldValue) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function loadPlan() {
|
async function loadPlan() {
|
||||||
|
try {
|
||||||
const { ministranten, gottesdienste, marks} = await API.getPlan(planId.value)
|
const { ministranten, gottesdienste, marks} = await API.getPlan(planId.value)
|
||||||
plan.ministranten = ministranten
|
plan.ministranten = ministranten
|
||||||
plan.gottesdienste = gottesdienste
|
plan.gottesdienste = gottesdienste
|
||||||
plan.marks = marks
|
plan.marks = marks
|
||||||
Auth.checkForToken()
|
Auth.checkForToken()
|
||||||
|
} catch (e: any) {
|
||||||
|
if(e instanceof UnauthorizedError) {
|
||||||
|
LoginService.showLoginPopup()
|
||||||
|
let subscription = Auth.loggedInSubject.subscribe((loggedIn) => {
|
||||||
|
subscription.unsubscribe()
|
||||||
|
if(loggedIn) {
|
||||||
|
loadPlan()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Auth.loggedInSubject.subscribe(async (loggedIn) => {
|
Auth.loggedInSubject.subscribe(async (loggedIn) => {
|
||||||
console.log("logged in " + loggedIn)
|
console.log("logged in " + loggedIn)
|
||||||
if (loggedIn) {
|
if (loggedIn) {
|
||||||
|
currentUsername.value = Auth.getUser()
|
||||||
plan.editable = Auth.getPrivileges()
|
plan.editable = Auth.getPrivileges()
|
||||||
if (Auth.getUser() == "admin") {
|
if (Auth.getUser() == "admin") {
|
||||||
editPlanAdmin.value = true
|
editPlanAdmin.value = true
|
||||||
@@ -72,6 +90,7 @@ Auth.loggedInSubject.subscribe(async (loggedIn) => {
|
|||||||
console.log("Plan", plan.ministranten)
|
console.log("Plan", plan.ministranten)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
currentUsername.value = ""
|
||||||
editPlanAdmin.value = false
|
editPlanAdmin.value = false
|
||||||
plan.editable = []
|
plan.editable = []
|
||||||
}
|
}
|
||||||
@@ -109,7 +128,8 @@ async function createGottesdienst(gottesdienstId?: number){
|
|||||||
plan.gottesdienste.splice(index, 1)
|
plan.gottesdienste.splice(index, 1)
|
||||||
plan.gottesdienste.push(godi)
|
plan.gottesdienste.push(godi)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
onDelete: gottesdienst ? () => deleteGottedienst(gottesdienst.id) : undefined
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,6 +299,18 @@ async function createMinistrant(ministrantId?: number) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function importZelebrationsplan() {
|
||||||
|
Dialogs.createDialog(ImportZelebrationsplanDialog, {
|
||||||
|
onPositive() {},
|
||||||
|
onNegative() {},
|
||||||
|
onDismiss() {}
|
||||||
|
}, {
|
||||||
|
planId: planId.value,
|
||||||
|
async onImport(godis: Gottesdienst[]) {
|
||||||
|
plan.gottesdienste.push(...godis)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -286,10 +318,46 @@ async function createMinistrant(ministrantId?: number) {
|
|||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container" :class="{
|
||||||
|
'mobile-view': mobile && viewMode === 'table'
|
||||||
|
}">
|
||||||
|
|
||||||
<GroupView :groups="plan.groups" :admin="editPlanAdmin"
|
<GroupView :groups="plan.groups" :admin="editPlanAdmin"
|
||||||
@new="createNewPlan" @delete="deletePlan" @edit="editPlan" class="no-print"/>
|
@new="createNewPlan" @delete="deletePlan" @edit="editPlan" class="no-print"/>
|
||||||
|
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
:gottesdienste="sortedGottesdienste"
|
||||||
|
:ministranten="plan.ministranten"
|
||||||
|
:marks="getMarks()"
|
||||||
|
:editable="plan.editable"
|
||||||
|
:current-username="currentUsername"
|
||||||
|
:admin="editPlanAdmin"
|
||||||
|
@toggle-mark="toggleMark"
|
||||||
|
@add-gottesdienst="createGottesdienst()"
|
||||||
|
@add-ministrant="createMinistrant()"
|
||||||
|
@edit-ministrant="(id) => createMinistrant(id)"
|
||||||
|
@edit-gottesdienst="(id) => createGottesdienst(id)"
|
||||||
|
@import-zelebrationsplan="importZelebrationsplan()"
|
||||||
|
class="plan list"
|
||||||
|
v-if="viewMode === 'list'">
|
||||||
|
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<template v-if="viewMode === 'table'">
|
||||||
|
|
||||||
|
<PlanActionBar
|
||||||
|
class="action-bar no-print"
|
||||||
|
:save="getDif().length > 0"
|
||||||
|
:plan="false"
|
||||||
|
:godi="true"
|
||||||
|
@save="saveChanges()"
|
||||||
|
@add-godi="createGottesdienst()"
|
||||||
|
@add-mini="createMinistrant()"
|
||||||
|
@import-zelebrationsplan="importZelebrationsplan()"
|
||||||
|
v-if="editPlanAdmin"
|
||||||
|
/>
|
||||||
|
|
||||||
<TablePlan
|
<TablePlan
|
||||||
:gottesdienste="sortedGottesdienste"
|
:gottesdienste="sortedGottesdienste"
|
||||||
:ministranten="plan.ministranten"
|
:ministranten="plan.ministranten"
|
||||||
@@ -320,18 +388,20 @@ async function createMinistrant(ministrantId?: number) {
|
|||||||
v-else>
|
v-else>
|
||||||
|
|
||||||
</MobilePlan>
|
</MobilePlan>
|
||||||
|
</template>
|
||||||
|
|
||||||
<PlanActionBar
|
<div class="view-toggle no-print" v-if="plan.gottesdienste.length > 0">
|
||||||
class="action-bar no-print"
|
<button
|
||||||
:save="getDif().length > 0"
|
class="flat"
|
||||||
:plan="false"
|
:class="{ active: viewMode === 'table' }"
|
||||||
:godi="true"
|
@click="viewMode = 'table'"
|
||||||
@save="saveChanges()"
|
><i>table_rows</i> Tabelle</button>
|
||||||
@add-godi="createGottesdienst()"
|
<button
|
||||||
@add-mini="createMinistrant()"
|
class="flat"
|
||||||
v-if="editPlanAdmin"
|
:class="{ active: viewMode === 'list' }"
|
||||||
/>
|
@click="viewMode = 'list'"
|
||||||
|
><i>list</i> Liste</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<SavingIndicator :visible="isSaving"/>
|
<SavingIndicator :visible="isSaving"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -351,16 +421,45 @@ async function createMinistrant(ministrantId?: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.plan {
|
.plan {
|
||||||
padding-bottom: 100px;
|
padding-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plan.table {
|
.plan.table {
|
||||||
//width: 100%;
|
//width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container .view-toggle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 6px 14px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background: #e0e0e0;
|
||||||
|
border-color: #c4c4c4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container.mobile-view {
|
||||||
|
.plan.list {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.action-bar {
|
.action-bar {
|
||||||
position: fixed;
|
position: sticky;
|
||||||
bottom: 0;
|
top: 0;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,16 +1,81 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import {fileURLToPath, URL} from 'node:url'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import {defineConfig} from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import {VitePWA} from 'vite-plugin-pwa'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
export default defineConfig(({mode}) => (
|
||||||
export default defineConfig({
|
{
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
|
VitePWA({
|
||||||
|
registerType: 'autoUpdate',
|
||||||
|
includeAssets: ['favicon.ico', 'minis_logo.png'],
|
||||||
|
manifest: {
|
||||||
|
name: 'Miniplan App',
|
||||||
|
short_name: 'Miniplan',
|
||||||
|
description: 'Lade deinen Miniplan direkt auf dein Handy. So hast du den Miniplan jederzeit und schnell erreichbar.',
|
||||||
|
theme_color: '#ffffff',
|
||||||
|
background_color: '#ffffff',
|
||||||
|
display: 'standalone',
|
||||||
|
scope: '/',
|
||||||
|
start_url: '/',
|
||||||
|
screenshots: [
|
||||||
|
{
|
||||||
|
src: 'screenshot1.png',
|
||||||
|
sizes: '505x710',
|
||||||
|
type: 'image/png',
|
||||||
|
form_factor: "narrow",
|
||||||
|
label: "Miniplan Liste"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'screenshot2.png',
|
||||||
|
sizes: '505x711',
|
||||||
|
type: 'image/png',
|
||||||
|
form_factor: "narrow",
|
||||||
|
label: "Miniplan Tabelle"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "screenshot3.png",
|
||||||
|
sizes: '1003x709',
|
||||||
|
type: 'image/png',
|
||||||
|
form_factor: "wide",
|
||||||
|
label: "Miniplan Tabelle"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: "pwa-64x64.png",
|
||||||
|
sizes: "64x64",
|
||||||
|
type: "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "pwa-192x192.png",
|
||||||
|
sizes: "192x192",
|
||||||
|
type: "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "pwa-512x512.png",
|
||||||
|
sizes: "512x512",
|
||||||
|
type: "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "maskable-icon-512x512.png",
|
||||||
|
sizes: "512x512",
|
||||||
|
type: "image/png",
|
||||||
|
purpose: "maskable"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
devOptions: {
|
||||||
|
enabled: mode === "development"
|
||||||
|
}
|
||||||
|
})
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
)
|
||||||