Compare commits
No commits in common. "main" and "feat/update-gottesdienste" have entirely different histories.
main
...
feat/updat
@ -3,9 +3,6 @@ name: miniplan
|
|||||||
networks:
|
networks:
|
||||||
backend:
|
backend:
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres:
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
@ -16,8 +13,6 @@ services:
|
|||||||
- POSTGRES_DB=minis
|
- POSTGRES_DB=minis
|
||||||
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
|
||||||
|
|||||||
@ -9,7 +9,6 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dropzone-vue3": "^1.0.2",
|
"rxjs": "^7.8.1"
|
||||||
"rxjs": "^7.8.1",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
FROM gradle:7.5.1 as build_backend
|
FROM gradle:latest 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
|
||||||
|
|||||||
@ -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 "1.9.0"
|
kotlin("jvm") version "2.1.20"
|
||||||
id("io.ktor.plugin") version "2.3.3"
|
id("io.ktor.plugin") version "3.1.1"
|
||||||
kotlin("plugin.serialization") version "1.9.0"
|
kotlin("plugin.serialization") version "2.1.20"
|
||||||
id("com.palantir.docker") version "0.36.0"
|
id("com.palantir.docker") version "0.35.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "de.walamana"
|
group = "de.walamana"
|
||||||
@ -44,9 +44,6 @@ 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")
|
||||||
|
|||||||
Binary file not shown.
@ -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-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
44
private/minis-backend/gradlew
vendored
44
private/minis-backend/gradlew
vendored
@ -15,8 +15,6 @@
|
|||||||
# 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
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@ -57,7 +55,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/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/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/.
|
||||||
@ -82,12 +80,13 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# This is normally unused
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
# 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)
|
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
' "$PWD" ) || exit
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# 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
|
||||||
@ -134,29 +133,22 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
if ! command -v java >/dev/null 2>&1
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
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
|
||||||
@ -201,15 +193,11 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
# Collect all arguments for the java command:
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
# * 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" \
|
||||||
@ -217,12 +205,6 @@ 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.
|
||||||
|
|||||||
33
private/minis-backend/gradlew.bat
vendored
33
private/minis-backend/gradlew.bat
vendored
@ -13,8 +13,6 @@
|
|||||||
@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 ##########################################################################
|
||||||
@ -28,7 +26,6 @@ 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%
|
||||||
|
|
||||||
@ -43,13 +40,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% equ 0 goto execute
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@ -59,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@ -78,15 +75,13 @@ 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% equ 0 goto mainEnd
|
if "%ERRORLEVEL%"=="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!
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
exit /b 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
|
||||||
|
|||||||
@ -10,13 +10,9 @@ 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.
|
||||||
|
|||||||
@ -1,85 +0,0 @@
|
|||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -34,7 +34,6 @@ data class AuthenticationResult(
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class AuthenticationUpdateRequest(
|
data class AuthenticationUpdateRequest(
|
||||||
val username: String?,
|
|
||||||
val newPassword: String
|
val newPassword: String
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -71,11 +70,7 @@ fun Route.configureAuthenticationRoutes() {
|
|||||||
val principal = call.principal<JWTPrincipal>()!!
|
val principal = call.principal<JWTPrincipal>()!!
|
||||||
val request = call.receive<AuthenticationUpdateRequest>()
|
val request = call.receive<AuthenticationUpdateRequest>()
|
||||||
|
|
||||||
val username = if(request.username != null && principal.payload.username() == "admin") {
|
Security.setPassword(principal.payload.username(), request.newPassword)
|
||||||
request.username
|
|
||||||
} else principal.payload.username()
|
|
||||||
|
|
||||||
Security.setPassword(username, request.newPassword)
|
|
||||||
|
|
||||||
call.respond(hashMapOf("success" to true))
|
call.respond(hashMapOf("success" to true))
|
||||||
}
|
}
|
||||||
@ -97,6 +92,8 @@ fun Route.configureAuthenticationRoutes() {
|
|||||||
|
|
||||||
|
|
||||||
call.respond(hashMapOf("password" to newPassword))
|
call.respond(hashMapOf("password" to newPassword))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
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.*
|
||||||
@ -44,17 +43,5 @@ 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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
51
public/package-lock.json
generated
51
public/package-lock.json
generated
@ -8,7 +8,6 @@
|
|||||||
"name": "minis-new",
|
"name": "minis-new",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"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",
|
||||||
@ -394,12 +393,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
|
||||||
},
|
},
|
||||||
"node_modules/@swc/helpers": {
|
|
||||||
"version": "0.2.14",
|
|
||||||
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.2.14.tgz",
|
|
||||||
"integrity": "sha512-wpCQMhf5p5GhNg2MmGKXzUNwxe7zRiCsmqYsamez2beP7mKPCSiu+BjZcdN95yYSzO857kr0VfQewmGpS77nqA==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/@tsconfig/node18": {
|
"node_modules/@tsconfig/node18": {
|
||||||
"version": "18.2.0",
|
"version": "18.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.0.tgz",
|
||||||
@ -756,18 +749,6 @@
|
|||||||
"url": "https://github.com/sponsors/mesqueeb"
|
"url": "https://github.com/sponsors/mesqueeb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/core-js": {
|
|
||||||
"version": "3.41.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.41.0.tgz",
|
|
||||||
"integrity": "sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"peer": true,
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/core-js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "6.0.5",
|
"version": "6.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||||
@ -821,32 +802,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dropzone": {
|
|
||||||
"version": "6.0.0-beta.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/dropzone/-/dropzone-6.0.0-beta.2.tgz",
|
|
||||||
"integrity": "sha512-k44yLuFFhRk53M8zP71FaaNzJYIzr99SKmpbO/oZKNslDjNXQsBTdfLs+iONd0U0L94zzlFzRnFdqbLcs7h9fQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@swc/helpers": "^0.2.13",
|
|
||||||
"just-extend": "^5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dropzone-vue3": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/dropzone-vue3/-/dropzone-vue3-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-kP+bp7sgNZtO+tdsZv/Vjga8/ltLqXKyWTCbQ5IK9SxxjO8SDUGlnZDZMVhbwsZx+fmHMTxkEoTYlonOdMplGQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"dropzone": "^6.0.0-beta.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"core-js": "^3.21.1",
|
|
||||||
"vue": ">=3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/errno": {
|
"node_modules/errno": {
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||||
@ -1483,12 +1438,6 @@
|
|||||||
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/just-extend": {
|
|
||||||
"version": "5.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/just-extend/-/just-extend-5.1.1.tgz",
|
|
||||||
"integrity": "sha512-b+z6yF1d4EOyDgylzQo5IminlUmzSeqR1hs/bzjBNjuGras4FXq/6TrzjxfN0j+TmI0ltJzTNlqXUMCniciwKQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/less": {
|
"node_modules/less": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz",
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"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",
|
||||||
|
|||||||
@ -135,13 +135,11 @@ function dateToValueString(time) {
|
|||||||
<div class="bar">
|
<div class="bar">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button class="flat left" v-if="prev != null && prev <= groups.length - 1" @click="back">
|
<button class="flat left" v-if="prev != null && prev <= groups.length - 1" @click="back">
|
||||||
<i>arrow_left_alt</i>
|
<i>arrow_left_alt</i>{{ formatDateShort(get(prev).from) }} - {{ formatDateShort(get(prev).to) }}
|
||||||
<span class="hide-mobile">{{ formatDateShort(get(prev).from) }} - {{ formatDateShort(get(prev).to) }}</span>
|
|
||||||
</button>
|
</button>
|
||||||
<div class="width: 100%"/>
|
<div class="width: 100%"/>
|
||||||
<button class="flat right" v-if="next != null && next > 0" @click="forward">
|
<button class="flat right" v-if="next != null && next > 0" @click="forward">
|
||||||
<span class="hide-mobile">{{ formatDateShort(get(next).from) }} - {{ formatDateShort(get(next).to) }}</span>
|
{{ formatDateShort(get(next).from) }} - {{ formatDateShort(get(next).to) }}<i>arrow_right_alt</i>
|
||||||
<i>arrow_right_alt</i>
|
|
||||||
</button>
|
</button>
|
||||||
<button class="flat right" v-if="(next == null || next <= 0) && admin" style="margin-right: 20px"
|
<button class="flat right" v-if="(next == null || next <= 0) && admin" style="margin-right: 20px"
|
||||||
@click="$emit('new')">
|
@click="$emit('new')">
|
||||||
@ -149,7 +147,7 @@ function dateToValueString(time) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="groups.length > 0">
|
<template v-if="groups.length > 0">
|
||||||
<span style="z-index: 1"><span class="hide-mobile">Miniplan vom </span> {{ formatDate(get(cur).from) }} bis {{ formatDate(get(cur).to) }}</span>
|
<span style="z-index: 1">Miniplan vom {{ formatDate(get(cur).from) }} bis {{ formatDate(get(cur).to) }}</span>
|
||||||
<span v-if="admin" style="display: flex; align-items: center; z-index: 1">
|
<span v-if="admin" style="display: flex; align-items: center; z-index: 1">
|
||||||
<button class="icon flat" @click="$emit('delete', get(cur).id)"><i>delete</i></button>
|
<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>
|
<button class="icon flat" @click="$emit('edit', get(cur).id)"><i>edit</i></button>
|
||||||
@ -210,12 +208,5 @@ function dateToValueString(time) {
|
|||||||
margin: 0 10px
|
margin: 0 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(max-width: 800px) {
|
|
||||||
.hide-mobile {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const emit = defineEmits(["addPlan", "addGodi", "addMini", "importZelebrationsplan", "save"])
|
const emit = defineEmits(["addPlan", "addGodi", "addMini", "save"])
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
save: boolean,
|
save: boolean,
|
||||||
plan: boolean,
|
plan: boolean,
|
||||||
@ -12,7 +12,6 @@ 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>
|
||||||
|
|||||||
@ -7,7 +7,6 @@ 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),
|
||||||
@ -63,23 +62,6 @@ 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>
|
||||||
@ -93,9 +75,7 @@ async function updatePassword(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>
|
||||||
|
|||||||
@ -1,258 +0,0 @@
|
|||||||
<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>
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
<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>
|
|
||||||
@ -134,15 +134,6 @@ 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
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@ 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";
|
|
||||||
|
|
||||||
const MAX_WIDTH_MOBILE = 600;
|
const MAX_WIDTH_MOBILE = 600;
|
||||||
|
|
||||||
@ -280,18 +279,6 @@ 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>
|
||||||
@ -342,7 +329,6 @@ async function importZelebrationsplan() {
|
|||||||
@save="saveChanges()"
|
@save="saveChanges()"
|
||||||
@add-godi="createGottesdienst()"
|
@add-godi="createGottesdienst()"
|
||||||
@add-mini="createMinistrant()"
|
@add-mini="createMinistrant()"
|
||||||
@import-zelebrationsplan="importZelebrationsplan()"
|
|
||||||
v-if="editPlanAdmin"
|
v-if="editPlanAdmin"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user