Compare commits

..

3 commits

Author SHA1 Message Date
903c2f7560 Import und Export der Datenbank 2024-10-26 20:31:07 +02:00
c657b36292 Import started 2024-10-18 09:37:31 +02:00
anton
115b2937e5 Export/Import database in settings 2024-10-17 17:47:50 +02:00
336 changed files with 5030 additions and 22778 deletions

View file

@ -1,5 +0,0 @@
# NodeJs
node_modules/
dist/
.git/
.env

View file

@ -1,5 +1 @@
VITE_SERVER_ADDRESS = backend_url #ohne pfad
VITE_APP_NAME_OVERWRITE = Mitgliederverwaltung # overwrites FF Admin
VITE_IMPRINT_LINK = https://mywebsite-imprint-url
VITE_PRIVACY_LINK = https://mywebsite-privacy-url
VITE_CUSTOM_LOGIN_MESSAGE = betrieben von xy
SERVER_ADDRESS = serveradress

View file

@ -1,5 +0,0 @@
VITE_SERVER_ADDRESS = __SERVERADDRESS__
VITE_APP_NAME_OVERWRITE = __APPNAMEOVERWRITE__
VITE_IMPRINT_LINK = __IMPRINTLINK__
VITE_PRIVACY_LINK = __PRIVACYLINK__
VITE_CUSTOM_LOGIN_MESSAGE = __CUSTOMLOGINMESSAGE__

View file

@ -1,25 +0,0 @@
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . /app
RUN npm run build-only
FROM nginx:stable-alpine AS prod
WORKDIR /app
COPY --from=build /app/dist /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
COPY ./entrypoint.sh /entrypoint.sh
RUN apk add --no-cache dos2unix
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

183
LICENSE
View file

@ -1,68 +1,71 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
“This License” refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
A “covered work” means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
@ -77,159 +80,153 @@ You may charge any price or no price for each copy that you convey, and you may
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
ff-admin
Copyright (C) 2025 FF Admin by JK Effects
member-administration-ui
Copyright (C) 2024 Ehrenamt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.
member-administration-ui Copyright (C) 2024 Ehrenamt
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -1,81 +1,22 @@
# FF Admin
# member-administration-ui
Administration für Feuerwehren und Vereine.
## Einleitung
Dieses Repository dient hauptsächlich zur Verwaltung der Mitgliederdaten, aber auch zur Verwaltung weiterer Daten der Feuerwehr oder eines Vereins. Es ist ein Frontend-Client, der auf die Daten des [ff-admin-server Backends](https://forgejo.jk-effects.cloud/Ehrenamt/ff-admin-server) zugreift. Die Webapp bietet eine Möglichkeit Mitgliederdaten zu verwalten, Protokolle zu schreiben und Kaledereinträge zu erstellen. Benutzer können eingeladen und Rollen zugewiesen werden.
Eine Demo dieser Seite finden Sie unter [https://admin-demo.ff-admin.de](https://admin-demo.ff-admin.de).
Für die Verwendung muss ein TOTP-Code eingegeben werden.
Die Zugangsdaten (Lesebeschränkt) sind:\
EMAIL: demo-besucher\
TOTP: ![alt text](demo-totp-qrcode.png)\
TOTP-Code: FBMDAJKFOYQXM2DNH47GWWBGJ5KWOUCW
Memberadministration
## Installation
### Docker Compose Setup
### Requirements
Um den Container hochzufahren, erstellen Sie eine `docker-compose.yml` Datei mit folgendem Inhalt:
1. Access to the internet
```yaml
version: "3"
### Configuration
services:
ff-admin-app:
image: docker.registry.jk-effects.cloud/ehrenamt/ff-admin/app:latest
container_name: ff_admin
restart: unless-stopped
1. Copy the .env.example file to .env and fill in the required information
2. Install all packages via `npm install`
3. Start the backend application
4. Start the application
5. Run `npm run dev` to run inside dev-environment
#environment:
# - SERVERADDRESS=<backend_url (https://... | http://...)> # wichtig: ohne Pfad
# - APPNAMEOVERWRITE=<appname> # ersetzt den Namen FF-Admin auf der Login-Seite und sonstigen Positionen in der Oberfläche
# - IMPRINTLINK=<imprint link>
# - PRIVACYLINK=<privacy link>
# - CUSTOMLOGINMESSAGE=betrieben von xy
#volumes:
# - <volume|local path>/favicon.ico:/usr/share/nginx/html/favicon.ico # 48x48 px Auflösung
# - <volume|local path>/favicon.png:/usr/share/nginx/html/favicon.png # 512x512 px Auflösung - wird als pwa Icon genutzt
# - <volume|local path>/Logo.png:/usr/share/nginx/html/Logo.png
```
### Usage
Wenn keine Server-Adresse angegeben wird, wird versucht das Backend unter der URL des Frontends zu erreichen. Dazu muss das Backend auf der gleichen URL wie das Frontend laufen. Zur Unterscheidung von Frontend und Backend bei gleicher URL müssen alle Anfragen mit dem PathPrefix `/api` an das Backend weitergeleitet werden.
Führen Sie dann den folgenden Befehl im Verzeichnis der compose-Datei aus, um den Container zu starten:
```sh
docker-compose up -d
```
### Manuelle Installation
Klonen Sie dieses Repository und installieren Sie die Abhängigkeiten:
```sh
git clone https://forgejo.jk-effects.cloud/Ehrenamt/ff-admin.git
cd ff-admin
npm install
npm run build
npm run start
```
### Konfiguration
Ein eigenes Favicon und Logo kann über das verwenden Volume ausgetauscht werden. Es dürfen jedoch nur einzelne Dateien ausgetauscht werden.
## Einrichtung
1. **Admin Benutzer erstellen**: Erstellen Sie einen Admin Benutzer unter dem Pfad /setup, um auf die Mitgliederverwaltung Zugriff zu erhalten. Nach der Erstellung des ersten Benutzers wird der Pfad automatisch geblockt.
2. **Rollen und Berechtigungen**: Unter `Benutzer > Rollen` können die Rollen und Berechtigungen für die Benutzer erstellt und angepasst werden.
3. **Nutzer einladen**: Unter `Benutzer > Benutzer` können weitere Nutzer eingeladen werden. Diese erhalten dann eine E-Mail mit einem Link, um ein TOTP zu erhalten.
## Fragen und Wünsche
Bei Fragen, Anregungen oder Wünschen können Sie sich gerne melden.\
Wir freuen uns über Ihr Feedback und helfen Ihnen gerne weiter.\
Schreiben Sie dafür eine Mail an julian.krauser@jk-effects.com.
1. Open the browser and navigate to `http://localhost:5173` or the URL you specified in the server configuration
2. Go to route `/setup` to create the first user (this path is disabled after the first user is created)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -1,26 +0,0 @@
# Kalender
Der Kalender bietet eine Möglichkeit der Organisation von Terminen in unterschiedlichen Kategorien.
Die Kategorien können in den Einstellungen gesetzt werden. Dabei gibt es folgende Einstellungsmöglichkeiten:
- Bezeichnung
- Farbe
- Standard Kalender Auslieferung
- Passphrase
Die Standard Kalender Auslieferung gibt immer Termine dieser Art in der Öffentlichen Ansicht, als auch in der externen Kalendern an, sofern der Link nicht weiter spezifiziert ist.
Die Passphrase kann zugangsbeschränkend für Termintypen angewandt werden.
## öffentlicher Kalender
Der öffentliche Kalender ist unter dem Pfad `/public/calendar` erreichbar. Dieser Kalender zeigt immer alle Termine an, welche einem Typ mit Standard-Auslieferung zugewiesen sind.
## WebCal
Der Kalender kann auch in den Kalender von zum Beispiel Google, Apple und co eingebunden werden, damit die Termine auch direkt im Kalender des Smartphones oder Outlook... verfügbar sind.
Hierfür kann der Link konfiguriert werden. Der Link kann dann so eingestellt werden, dass passwort-geschützte oder nicht standard Typen ausgeliefert werden. Zusätzlich können unter diesen Links auch die Standard-Typen hinzugefügt werden.
Genutzt werden kann das zum Beispiel, dass Vorstands-Interne Termine oder Mitglieds-Spezifische Termine über einen personalisierten Link ausgegeben werden können.
Wird der erstellte Link in einem Browser geöffnet, sollte automatisch eine ICS-Datei mit den Terminen heruntergeladen werden, oder die Möglichkeit vorgeschlagen werden, den Link in einen Kalender zu integrieren.

View file

@ -1,28 +0,0 @@
# FF Admin
## FF Admin ist eine Verwaltungsoberfläche für die Feuerwehr oder andere Vereine:
FF Admin bietet folgende Module:
- Mitgliederverwaltung
- Kalender
- Newsletter-Versand
- Protokolle
- Datenabfrage
- Templating-Engine
- Benutzerverwaltung
- Rollenverwaltung
<br>
-------
<br>
## Struktur
FF Admin ist in Verein, Wehr, Einstellungen und Nutzerverwaltung getrennt.
Die den Modulen zugrunde liegenden Daten können in den Einstellungen gesetzt werden.
Fast alle Daten lassen sich einstellen, damit es keine Einschränkungen in der Auswahl von Werten... gibt. Diese Modularität muss allerdings bei einigen Modulen gesondert eingestellt werden.
## Verwendung
Damit FF Admin auch für andere Vereine genutzt werden kann, muss keine erweiterte Konfiguration vorgenommen werden. Am besten ist es alle nicht benötigten Module in der Berechtigungsverwaltung zu deaktivieren. So wird normalerweise der Abschnitt Wehr nicht außerhalb der Feuerwehr benötigt. So müssen hier lediglich keine Berechtigungen vergeben werden und das Modul ist außer für Administratoren oder Owner nicht sichtbar.

View file

@ -1,51 +0,0 @@
# Mitgliederverwaltung
Die Mitgliederverwaltung bietet eine Startansicht, in welcher alle Mitglieder durch Pagination angezeigt werden. Die Suche ermöglicht eine Full-Text-Suche nach Vor- und Nachnamen.
Ist ein Mitglied ausgewählt, lassen sich innerhalb dessen alle Daten zu einem Mitglied verwalten.
- Allgemeine Daten des Mitglieds
- Mitgliedschaft
- Adressen bzw. Kommunikationswege
- Auszeichnungen
- Qualifikationen
- Vereinsämter
Jedes dieser Verwaltungsmöglichkeiten benötigt vorher eingestellte Werte, welche dann einem Mitglied hinzugefügt werden können.
## Allgemeine Daten des Mitglieds
Die allgemeinen Daten des Mitglieds umfassen die interne Id, Anrede, Vorname, Nachname, Nameaffix und das Geburtsdatum. Diese Daten können über den Stift oben rechts im Eck geändert werden.
Weiterhin zeigt die Übersicht des Mitglieds auch Informationen zu den Einträgen der übrigen Kategorien.
## Mitgliedschaft
Die auswählbaren Mitgliedsarten können in den Einstellungen gesetzt werden.
Im Mitglied können dann Zeiträume einer bestimmten Mitgliedschafts-Art angelegt werden. Wird ein neuer Zeitraum hinzugefügt, wird ein aktuell laufender Zeitraum mit dem Vortag des neuen Startdatums beendet.
Weiterhin kann bei manuellem setzen des Enddatums ein Grund angegeben werden.
## Adressen bzw. Kommunikationswege
Die auswählbaren Kommunikationsarten können in den Einstellungen erstellt werden. Hierfür muss zu jeder Kommunikationsart ausgewählt werden, welche Felder ausgefüllt werden sollen.
Im Miglied kann dann bei jedem kommunikationstyp gesetzt werden, ob dieser bevorzugt wird, und ob der Newsletter dorthin versandt werden soll.
Ist eine Telefonnummer in der Auswahl enthalten, besteht zusätzlich die Möglichkeit, diesen Kommunikationsweg für den Versand der SMS Alarmierung auszuwählen.
## Auszeichnungen
Die auswählbaren Auszeichnungen können in den Einstellungen erstellt werden.
Im Mitglied können Auszeichnungen mit dem Vergabedatum hinzugefügt werden. Wird eine Annahme verweigert oder Ausgabe verwehrt, kann ein Grund hierfür angegeben werden.
## Qualifikation
Die auswählbaren Qualifikationen können in den Einstellungen erstellt werden.
Im Mitglied können Qualifikationen mit einem Start und Enddatum hinzugefügt werden. Eine Notiz kann auch hinzugefügt werden. Zusätzlich zum Enddatum kann ein Grund für das Ende gesetzt werden.
## Vereinsämter
Die auswählbaren Vereinsämter können in den Einstellungen erstellt werden.
Im Mitglied können Qualifikationen mit einem Start und Enddatum hinzugefügt werden. Eine Notiz kann auch hinzugefügt werden.

View file

@ -1,143 +0,0 @@
# Newsletter
Das Newsletter erlaubt den Druck und Versand von Inhalten zum Verein. Zu einem Newsletter können öffentliche Kalendereinträge hinzugefügt werden.
## Newsletter erstellen
Ein Newsletter besteht aus Titel und Zusammenfassung, um einen schnelleren Überblick in der Pagination zu erhalten.
Im Newsletter können Überschrift, Einleitung/Text und Signatur hinzugefügt werden.
Es können Daten ausgewählt werden, welche dann automatisch nach dem Text und vor der Signatur im Standard-Template angezeigt.
Und es können Empfänger über eine Vordefinierte Datenabfrage oder manuelles hinzufügen festgelegt werden.
Im Tab Druck und Versand wird eine Datei mit allen Hinzugefügten Kalendereinträgen angezeigt, wie auch alle erstellten pdfs wie auch eine pdf, die alle anderen pdfs enthält.
## Versand
In den Einstellungen kann festgelegt werden, welcher Kommunikationstyp wie versandt werden soll. Dies wird zusätzlich nochmals vor dem finalen Versand geprüft.
Es wird beim Druck unterschieden in Ausgaben mit und ohne Adresse. In der Fußzeile wird dann entweder nur der Name oder auch mit Adresse gedruckt.
Die Auswahl des Typs Mail versendet nur den Hauptteil des pdfs mit einer ics-Datei im Anhang.
## Template
Über die Templating-Engine können für den Newsletter abweichende Kopf- und Fußzeilen und ein abweichender Hauptteil festgelegt werden.
Ein Newsletter-Template erhält folgende Daten:
``` ts
// interface:
{
title: string;
description: string;
newsletterTitle: string;
newsletterText: string;
newsletterSignatur: string;
dates: Array<
{
title: string; // enthält alternativen Titel bzw. Titel des Kalendereintrags
content: string; // enthält alternative Beschreibung bzw. Beschreibung des Kalendereintrags
starttime: string;
endtime: string;
location: string;
formattedStarttime: string;
formattedFullStarttime: string;
formattedEndtime: string;
formattedFullEndtime: string;
}
>;
recipient: {
firstname: string;
lastname: string;
salutation: Salutation; // (sir | madam | divers | none)
nameaffix: string;
street: string;
streetNumber: string;
streetNumberAdd: string
};
}
// beispieldaten
{
title: "Beispiel Newsletter Daten",
description: "Zusammenfassung der Demodaten.",
newsletterTitle: "<h1>Sehr geehrtes Feuerwehrmitglied</h1>",
newsletterText: "<p>zu folgenden Terminen möchten wir recht herzlich zur Teilnahme einladen:</p>",
newsletterSignatur: "<p>Mit freundlichen Grüßen</p><p>...</p>",
dates: [
{
title: "Termin 1",
content: "<p>Beschreibung eines Termins</p>",
starttime: new Date(),
formattedStarttime: "Montag 20. Januar",
formattedFullStarttime: "Montag 20. Januar um 19:00",
endtime: new Date(),
formattedEndtime: "Montag 20. Januar",
formattedFullEndtime: "Montag 20. Januar um 21:00",
location: "Feuerwehrhaus",
},
],
recipient: {
firstname: "Julian",
lastname: "Krauser",
salutation: "sir",
nameaffix: "",
street: "Straße",
streetNumber: "Hausnummer",
streetNumberAdd: "Adresszusatz",
},
}
```
Das Template ist als HTML definiert und beinhaltet Platzhalter, welche durch `handlebarsjs` ausgetauscht werden.
``` html
<!-- Standard-Template -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Newsletter</title>
</head>
<body>
<h1>{{{newsletterTitle}}}</h1>
<p>{{{newsletterText}}}</p>
<br />
{{#each dates}}
<div>
<h2><b>{{this.formattedStarttime}}: {{this.title}}</b></h2>
<span>{{{this.content}}}</span>
</div>
<br />
{{/each}}
<br />
<br />
<p>{{{newsletterSignatur}}}</p>
</body>
<style>
h2,
h3,
p,
span,
ul,
li {
padding: 0;
margin: 0;
}
h1,
h2 {
color: #990b00;
}
h2 {
margin-bottom: 5px;
}
</style>
</html>
<!--Footer Template-->
<div style="font-size: 10pt; width: 100%; margin: 0 20px; padding-top: 5px; color: #888; border-top: 0.5px solid black">
{{recipient.lastname}}, {{recipient.firstname}}{{#if recipient.street}},{{/if}} {{recipient.street}}
{{recipient.streetNumber}} {{recipient.streetNumberAdd}}
</div>
```

View file

@ -1 +0,0 @@
# Protokoll

View file

@ -1 +0,0 @@
# Query Builder & Query Store

View file

@ -1 +0,0 @@
# Rollenverwaltung

View file

@ -1 +0,0 @@
# Templating Engine

View file

@ -1 +0,0 @@
# Benutzerverwaltung

View file

@ -1,27 +0,0 @@
#!/bin/sh
keys="SERVERADDRESS APPNAMEOVERWRITE IMPRINTLINK PRIVACYLINK CUSTOMLOGINMESSAGE"
files="/usr/share/nginx/html/assets/config-*.js /usr/share/nginx/html/manifest.webmanifest"
# Replace env vars in files served by NGINX
for file in $files
do
echo "Processing $file ...";
for key in $keys
do
# Get environment variable
value=$(eval echo "\$$key")
# Set default value for APPNAMEOVERWRITE if empty
if [ "$key" = "APPNAMEOVERWRITE" ] && [ -z "$value" ]; then
value="FF Admin"
fi
echo "replace $key by $value"
# replace __[variable_name]__ value with environment variable
sed -i 's|__'"$key"'__|'"$value"'|g' $file
done
done
nginx -g 'daemon off;'

View file

@ -2,8 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="icon" type="image/svg" href="/FW-Wappen.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mitgliederverwaltung</title>
</head>
<body>
<div id="app"></div>

View file

@ -1,16 +0,0 @@
worker_processes 4;
events { worker_connections 1024; }
http {
include mime.types;
server {
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}

8913
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{
"name": "ff-admin",
"version": "1.4.1",
"description": "Feuerwehr/Verein Mitgliederverwaltung UI",
"name": "fireportal-ui",
"version": "0.0.2",
"description": "Feuerwehr AlarmPortal UI",
"type": "module",
"scripts": {
"dev": "vite",
@ -12,82 +12,61 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"bnp": "npm run build-only && npm run preview",
"generate-pwa-assets": "pwa-assets-generator --preset minimal-2023 public/fw-wappen.png"
"generate-pwa-assets": "pwa-assets-generator --preset minimal-2023 public/CM.svg"
},
"repository": {
"type": "git",
"url": "https://forgejo.jk-effects.cloud/Ehrenamt/ff-admin.git"
"url": "https://forgejo.jk-effects.cloud/Ehrenamt/fireportal-ui.git"
},
"keywords": [
"Feuerwehr"
],
"author": "JK Effects",
"license": "AGPL-3.0-only",
"license": "GPL-3.0-only",
"dependencies": {
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/list": "^6.1.17",
"@fullcalendar/timegrid": "^6.1.15",
"@fullcalendar/vue3": "^6.1.15",
"@headlessui/vue": "^1.7.23",
"@headlessui/vue": "^1.7.13",
"@heroicons/vue": "^2.1.5",
"@tailwindcss/vite": "^4.1.3",
"@vueup/vue-quill": "^1.2.0",
"axios": "^1.7.9",
"event-source-polyfill": "^1.0.31",
"grapesjs": "^0.22.4",
"grapesjs-preset-newsletter": "^1.0.2",
"highlight.js": "^11.11.1",
"axios": "^0.26.1",
"jwt-decode": "^4.0.0",
"lodash.clonedeep": "^4.5.0",
"lodash.difference": "^4.5.0",
"lodash.differencewith": "^4.5.0",
"lodash.isequal": "^4.5.0",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",
"markdown-it-prism": "^3.0.0",
"nprogress": "^0.2.0",
"pdf-dist": "^1.0.0",
"pinia": "^3.0.2",
"pinia": "^2.1.7",
"qrcode": "^1.5.3",
"qs": "^6.11.2",
"socket.io-client": "^4.5.0",
"unplugin-vue-markdown": "^28.3.1",
"uuid": "^11.1.0",
"uuid": "^9.0.0",
"vue": "^3.4.29",
"vue-router": "^4.3.3"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.8.0",
"@tailwindcss/postcss": "^4.1.3",
"@tsconfig/node20": "^20.1.4",
"@types/eslint": "~9.6.0",
"@types/event-source-polyfill": "^1.0.5",
"@types/lodash.clonedeep": "^4.5.9",
"@types/lodash.difference": "^4.5.9",
"@types/lodash.differencewith": "^4.5.9",
"@types/lodash.isequal": "^4.5.8",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.14.0",
"@types/node": "^20.14.5",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.5",
"@types/qs": "^6.9.11",
"@types/uuid": "^10.0.0",
"@vite-pwa/assets-generator": "^1.0.0",
"@types/uuid": "^9.0.3",
"@vite-pwa/assets-generator": "^0.2.2",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.5.0",
"@vue/tsconfig": "^0.7.0",
"eslint": "^9.24.0",
"eslint-plugin-vue": "^10.0.0",
"npm-run-all2": "^7.0.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.23.0",
"npm-run-all2": "^6.2.0",
"postcss": "^8.4.41",
"prettier": "^3.2.5",
"tailwindcss": "^4.1.3",
"typescript": "^5.8.3",
"vite": "^6.2.6",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-vue-devtools": "^7.6.8",
"tailwindcss": "^3.4.10",
"typescript": "~5.4.0",
"vite": "^5.3.1",
"vite-plugin-pwa": "^0.17.4",
"vite-plugin-vue-devtools": "^7.3.1",
"vue-tsc": "^2.0.21"
}
}

6
postcss.config.js Normal file
View file

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

File diff suppressed because it is too large Load diff

1
public/FFW-Logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
public/FW-Wappen.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
public/FW-Wappen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 KiB

1
public/FW-Wappen.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -7,7 +7,6 @@
<RouterView />
</div>
<Footer @contextmenu.prevent />
<Notification />
</template>
<script setup lang="ts">
@ -17,10 +16,9 @@ import Header from "./components/Header.vue";
import Footer from "./components/Footer.vue";
import { mapState } from "pinia";
import { useAuthStore } from "./stores/auth";
import { isAuthenticatedPromise } from "./router/authGuard";
import { isAuthenticatedPromise } from "./router/authGuards";
import ContextMenu from "./components/ContextMenu.vue";
import Modal from "./components/Modal.vue";
import Notification from "./components/Notification.vue";
</script>
<script lang="ts">

View file

@ -1,181 +0,0 @@
<template>
<div class="flex flex-col w-full h-full gap-2 justify-between overflow-hidden">
<div
class="flex flex-row gap-2 justify-between max-sm:justify-center"
:class="smallStyling ? 'max-lg:flex-wrap' : 'max-xl:flex-wrap'"
>
<div class="flex flex-row" :class="smallStyling ? 'max-lg:order-2' : 'max-xl:order-2'">
<button
:primary="view == 'dayGridMonth'"
:primary-outline="view != 'dayGridMonth'"
class="rounded-r-none!"
@click="setView('dayGridMonth')"
>
Monat
</button>
<button
:primary="view == 'timeGridWeek'"
:primary-outline="view != 'timeGridWeek'"
class="rounded-none! border-x-0!"
@click="setView('timeGridWeek')"
>
Woche
</button>
<button
:primary="view == 'listMonth'"
:primary-outline="view != 'listMonth'"
class="rounded-l-none!"
@click="setView('listMonth')"
>
Liste
</button>
</div>
<p class="text-3xl w-full text-center" :class="smallStyling ? 'max-lg:order-1' : 'max-xl:order-1'">
{{ currentTitle }}
</p>
<div class="flex flex-row" :class="smallStyling ? 'max-lg:order-3' : 'max-xl:order-3'">
<button primary-outline class="rounded-r-none!" @click="navigateView('prev')">
<ChevronLeftIcon />
</button>
<button
:primary="containsToday"
:primary-outline="!containsToday"
class="rounded-none! border-x-0!"
@click="
calendarApi?.today();
containsToday = true;
"
>
heute
</button>
<button primary-outline class="rounded-l-none!" @click="navigateView('next')">
<ChevronRightIcon />
</button>
</div>
</div>
<div class="flex flex-col w-full grow overflow-hidden">
<FullCalendar ref="fullCalendar" :options="calendarOptions" class="max-h-full h-full" />
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import FullCalendar from "@fullcalendar/vue3";
import deLocale from "@fullcalendar/core/locales/de";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import listPlugin from "@fullcalendar/list";
import interactionPlugin from "@fullcalendar/interaction";
import { ChevronLeftIcon, ChevronRightIcon } from "@heroicons/vue/24/outline";
import type { CalendarOptions } from "@fullcalendar/core/index.js";
</script>
<script lang="ts">
export default defineComponent({
props: {
items: {
type: Array as PropType<
{
id: string;
title: string;
start: string;
end: string;
backgroundColor: string;
}[]
>,
default: [],
},
allowInteraction: {
type: Boolean,
default: true,
},
smallStyling: {
type: Boolean,
default: false,
},
},
emits: {
dateSelect: ({ start, end, allDay }: { start: string; end: string; allDay: boolean }) => {
return typeof start == "string" && typeof end == "string" && typeof allDay === "boolean";
},
eventSelect: (id: string) => {
return typeof id == "string";
},
},
data() {
return {
view: "dayGridMonth" as "dayGridMonth" | "timeGridWeek" | "listMonth",
calendarApi: null as null | typeof FullCalendar,
currentTitle: "" as string,
containsToday: false as boolean,
};
},
computed: {
calendarOptions() {
return {
timeZone: "local",
locale: deLocale,
plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
initialView: "dayGridMonth",
eventDisplay: "block",
headerToolbar: false,
weekends: true,
editable: this.allowInteraction,
selectable: this.allowInteraction,
selectMirror: false,
dayMaxEvents: true,
weekNumbers: true,
displayEventTime: true,
nowIndicator: true,
weekText: "KW",
allDaySlot: false,
events: this.items,
select: this.select,
eventClick: this.eventClick,
} as CalendarOptions;
},
},
mounted() {
this.calendarApi = (this.$refs.fullCalendar as typeof FullCalendar).getApi();
this.setTitle();
this.setContainsToday();
},
methods: {
setTitle() {
this.currentTitle = this.calendarApi?.view.title ?? "";
},
setView(view: "dayGridMonth" | "timeGridWeek" | "listMonth") {
this.calendarApi?.changeView(view);
this.view = view;
this.setTitle();
this.setContainsToday();
},
navigateView(change: "prev" | "next") {
if (change == "prev") {
this.calendarApi?.prev();
} else {
this.calendarApi?.next();
}
this.setTitle();
this.setContainsToday();
},
setContainsToday() {
const start = this.calendarApi?.view.currentStart;
const end = this.calendarApi?.view.currentEnd;
const today = new Date();
this.containsToday = today >= start && today < end;
},
select(e: any) {
this.$emit("dateSelect", {
start: e?.startStr ?? new Date().toISOString(),
end: e?.endStr ?? new Date().toISOString(),
allDay: e?.allDay ?? false,
});
},
eventClick(e: any) {
this.$emit("eventSelect", e.event.id);
},
},
});
</script>

View file

@ -1,29 +1,15 @@
<template>
<footer
v-if="authCheck && (routeName.includes('admin-') || routeName.includes('account-') || routeName.includes('docs-'))"
class="md:hidden flex flex-row h-16 min-h-16 justify-center md:justify-normal p-1 bg-white"
v-if="authCheck && routeName.includes('admin')"
class="md:hidden flex flex-row h-16 justify-center md:justify-normal p-1 bg-white"
>
<div class="w-full flex flex-row gap-2 h-full align-middle">
<TopLevelLink
v-if="routeName == 'admin' || routeName.includes('admin-')"
v-for="item in topLevel"
:key="item.key"
:link="item"
:disableSubLink="true"
/>
<TopLevelLink
v-else-if="
routeName == 'account' || routeName.includes('account-') || routeName == 'docs' || routeName.includes('docs-')
"
:link="{ key: 'club', title: 'Zur Admin Oberfläche', levelDefault: '' }"
:disableSubLink="true"
/>
<TopLevelLink v-for="item in topLevel" :key="item.key" :link="item" :disableSubLink="true" />
</div>
</footer>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState } from "pinia";
import { useAuthStore } from "@/stores/auth";
import { useNavigationStore } from "@/stores/admin/navigation";
@ -31,6 +17,7 @@ import TopLevelLink from "./admin/TopLevelLink.vue";
</script>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
computed: {
...mapState(useAuthStore, ["authCheck"]),

View file

@ -1,18 +0,0 @@
<template>
<div class="flex flex-col text-gray-400 text-sm mt-4 items-center">
<div class="flex flex-row gap-2 justify-center">
<a v-if="config.imprint_link" :href="config.imprint_link" target="_blank">Datenschutz</a>
<a v-if="config.privacy_link" :href="config.privacy_link" target="_blank">Impressum</a>
</div>
<p v-if="config.custom_login_message">{{ config.custom_login_message }}</p>
<p>
<a href="https://ff-admin.de/admin" target="_blank">FF Admin</a>
entwickelt von
<a href="https://jk-effects.com" target="_blank">JK Effects</a>
</p>
</div>
</template>
<script setup lang="ts">
import { config } from "@/config";
</script>

View file

@ -1,29 +1,12 @@
<template>
<header class="flex flex-row h-16 min-h-16 justify-between p-3 md:px-5 bg-white shadow-xs">
<header class="flex flex-row h-16 justify-between p-3 md:px-5 bg-white shadow-sm">
<RouterLink to="/" class="flex flex-row gap-2 align-bottom w-fit h-full">
<img src="/Logo.png" alt="LOGO" class="h-full w-auto" />
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">
{{ config.app_name_overwrite || "FF Admin" }}
</h1>
<img src="/FFW-Logo.svg" alt="LOGO" class="h-full w-auto" />
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">Mitgliederverwaltung</h1>
</RouterLink>
<div class="flex flex-row gap-2 items-center">
<div v-if="authCheck" class="hidden md:flex flex-row gap-2 h-full align-middle">
<TopLevelLink
v-if="routeName == 'admin' || routeName.includes('admin-')"
v-for="item in topLevel"
:key="item.key"
:link="item"
/>
<TopLevelLink
v-else-if="
routeName == 'account' ||
routeName.includes('account-') ||
routeName == 'docs' ||
routeName.includes('docs-')
"
:link="{ key: 'club', title: 'Zur Admin Oberfläche', levelDefault: '' }"
:disable-sub-link="true"
/>
<div v-if="authCheck && routeName.includes('admin')" class="hidden md:flex flex-row gap-2 h-full align-middle">
<TopLevelLink v-for="item in topLevel" :key="item.key" :link="item" />
</div>
<UserMenu v-if="authCheck" />
</div>
@ -37,7 +20,6 @@ import { useAuthStore } from "@/stores/auth";
import { useNavigationStore } from "@/stores/admin/navigation";
import TopLevelLink from "./admin/TopLevelLink.vue";
import UserMenu from "./UserMenu.vue";
import { config } from "@/config";
</script>
<script lang="ts">

View file

@ -6,12 +6,7 @@
@contextmenu.prevent
>
<!-- @click="closeModal" -->
<component
:is="component_ref"
:data="data"
@click.stop
class="p-4 bg-white rounded-lg max-h-[95%] overflow-y-auto"
/>
<component :is="component_ref" :data="data" @click.stop class="p-4 bg-white rounded-lg" />
</div>
</template>

View file

@ -1,130 +0,0 @@
<template>
<div
class="fixed right-0 flex flex-col gap-4 p-2 w-full md:w-80 z-50"
:class="position == 'bottom' ? 'bottom-0' : 'top-0'"
>
<TransitionGroup
:enter-active-class="notifications.length > 1 ? [props.enter, props.moveDelay].join(' ') : props.enter"
:enter-from-class="props.enterFrom"
:enter-to-class="props.enterTo"
:leave-active-class="props.leave"
:leave-from-class="props.leaveFrom"
:leave-to-class="props.leaveTo"
:move-class="props.move"
>
<div
v-for="notification in sortedNotifications"
:key="notification.id"
class="relative p-2 bg-white flex flex-row gap-2 w-full overflow-hidden rounded-lg shadow-md"
:class="[
notification.type == 'error' ? 'border border-red-400' : '',
notification.type == 'warning' ? 'border border-red-400' : '',
notification.type == 'info' ? 'border border-gray-400' : '',
]"
>
<!-- @mouseover="hovering(notification.id, true)"
@mouseleave="hovering(notification.id, false)" -->
<ExclamationCircleIcon
v-if="notification.type == 'error'"
class="flex items-center justify-center min-w-12 w-12 h-12 bg-red-500 rounded-lg text-white p-1"
/>
<ExclamationTriangleIcon
v-if="notification.type == 'warning'"
class="flex items-center justify-center min-w-12 w-12 h-12 bg-red-500 rounded-lg text-white p-1"
/>
<InformationCircleIcon
v-if="notification.type == 'info'"
class="flex items-center justify-center min-w-12 w-12 h-12 bg-gray-500 rounded-lg text-white p-1"
/>
<div class="flex flex-col">
<span
class="font-semibold"
:class="[
notification.type == 'error' ? 'text-red-500' : '',
notification.type == 'warning' ? 'text-red-500' : '',
notification.type == 'info' ? 'text-gray-700' : '',
]"
>{{ notification.title }}</span
>
<p class="text-sm text-gray-600">{{ notification.text }}</p>
</div>
<XMarkIcon
@click="close(notification.id)"
class="absolute top-2 right-2 w-6 h-6 cursor-pointer text-gray-500"
/>
<div
class="absolute left-0 bottom-0 h-1 bg-gray-500 transition-[width] duration-[4900ms] ease-linear"
:class="notification.indicator ? 'w-0' : 'w-full'"
></div>
</div>
</TransitionGroup>
</div>
</template>
<script setup lang="ts">
import { defineComponent, TransitionGroup } from "vue";
import { mapState, mapActions } from "pinia";
import { useNotificationStore } from "@/stores/notification";
import {
ExclamationTriangleIcon,
ExclamationCircleIcon,
InformationCircleIcon,
XMarkIcon,
} from "@heroicons/vue/24/outline";
export interface Props {
maxNotifications?: number;
enter?: string;
enterFrom?: string;
enterTo?: string;
leave?: string;
leaveFrom?: string;
leaveTo?: string;
move?: string;
moveDelay?: string;
position?: string;
}
const props = withDefaults(defineProps<Props>(), {
maxNotifications: 10,
enter: "transform ease-out duration-300 transition",
enterFrom: "translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-4",
enterTo: "translate-y-0 opacity-100 sm:translate-x-0",
leave: "transition ease-in duration-500",
leaveFrom: "opacity-100",
leaveTo: "opacity-0",
move: "transition duration-500",
moveDelay: "delay-300",
position: "bottom",
});
</script>
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useNotificationStore, ["notifications", "timeouts"]),
sortedNotifications() {
if (this.position === "bottom") {
return [...this.notifications];
}
return [...this.notifications].reverse();
},
},
methods: {
...mapActions(useNotificationStore, ["revoke"]),
close(id: string) {
this.revoke(id);
},
hovering(id: string, value: boolean, timeout?: number) {
if (value) {
clearTimeout(this.timeouts[id]);
} else {
this.timeouts[id] = setTimeout(() => {
this.revoke(id);
}, timeout);
}
},
},
});
</script>

View file

@ -1,266 +0,0 @@
<template>
<div class="grow flex flex-col gap-2 overflow-hidden">
<div v-if="useSearch" class="relative self-end flex flex-row items-center gap-2">
<Spinner v-if="deferingSearch" />
<input
type="text"
class="max-w-64! w-64! rounded-md shadow-xs relative block px-3 py-2 pr-5 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
placeholder="Suche"
v-model="searchString"
/>
<XMarkIcon
class="absolute h-4 stroke-2 right-2 top-1/2 -translate-y-1/2 cursor-pointer z-10"
@click="searchString = ''"
/>
</div>
<div class="flex flex-col w-full grow gap-2 pr-2 overflow-y-scroll">
<div v-if="indicateLoading" class="flex flex-row justify-center items-center w-full p-1">
<Spinner />
</div>
<p v-if="visibleRows.length == 0" class="flex flex-row w-full gap-2 p-1">Kein Inhalt</p>
<slot
v-else
name="pageRow"
v-for="(item, index) in visibleRows"
:key="index"
:row="item"
@click="$emit('clickRow', item)"
>
<p>{{ item }}</p>
</slot>
</div>
<div class="flex flex-row w-full justify-between select-none">
<p class="text-sm font-normal text-gray-500">
Elemente <span class="font-semibold text-gray-900">{{ showingText }}</span> von
<span class="font-semibold text-gray-900">{{ entryCount }}</span>
</p>
<ul class="flex flex-row text-sm h-8">
<li
class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 first:rounded-s-lg last:rounded-e-lg"
:class="[currentPage > 0 ? 'cursor-pointer hover:bg-gray-100 hover:text-gray-700' : 'opacity-50']"
@click="loadPage(currentPage - 1)"
>
<ChevronLeftIcon class="h-4" />
</li>
<li
v-for="page in displayedPagesNumbers"
:key="page"
class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 first:rounded-s-lg last:rounded-e-lg"
:class="[currentPage == page ? 'font-bold border-primary' : '', page != '.' ? ' cursor-pointer' : '']"
@click="loadPage(page)"
>
{{ typeof page == "number" ? page + 1 : "..." }}
</li>
<li
class="flex h-8 w-8 items-center justify-center text-gray-500 bg-white border border-gray-300 first:rounded-s-lg last:rounded-e-lg"
:class="[
currentPage + 1 < countOfPages ? 'cursor-pointer hover:bg-gray-100 hover:text-gray-700' : 'opacity-50',
]"
@click="loadPage(currentPage + 1)"
>
<ChevronRightIcon class="h-4" />
</li>
</ul>
</div>
</div>
</template>
<script setup lang="ts" generic="T extends { id: FieldType }">
import { computed, ref, watch } from "vue";
import { ChevronRightIcon, ChevronLeftIcon, XMarkIcon } from "@heroicons/vue/20/solid";
import Spinner from "./Spinner.vue";
import type { FieldType } from "@/types/dynamicQueries";
const props = defineProps({
items: { type: Array<T>, default: [] },
maxEntriesPerPage: { type: Number, default: 25 },
totalCount: { type: Number, default: null },
config: { type: Array<{ key: string }>, default: [] },
useSearch: { type: Boolean, default: false },
enablePreSearch: { type: Boolean, default: false },
indicateLoading: { type: Boolean, default: false },
});
const slots = defineSlots<{
pageRow(props: { row: T; key: number }): void;
}>();
const timer = ref(undefined) as undefined | any;
const currentPage = ref(0);
const searchString = ref("");
const deferingSearch = ref(false);
watch(searchString, async () => {
deferingSearch.value = true;
clearTimeout(timer.value);
timer.value = setTimeout(() => {
currentPage.value = 0;
deferingSearch.value = false;
emit("search", searchString.value);
}, 600);
});
watch(
() => props.totalCount,
async () => {
currentPage.value = 0;
}
);
const emit = defineEmits({
submit(id: number) {
return typeof id == "number";
},
loadData(offset: number, count: number, searchString: string) {
return typeof offset == "number" && typeof offset == "number" && typeof searchString == "number";
},
search(search: string) {
return typeof search == "string";
},
clickRow(elem: T) {
return true;
},
});
const entryCount = computed(() => props.totalCount ?? props.items.length);
const showingStart = computed(() => currentPage.value * props.maxEntriesPerPage);
const showingEnd = computed(() => {
let max = currentPage.value * props.maxEntriesPerPage + props.maxEntriesPerPage;
if (max > entryCount.value) max = entryCount.value;
return max;
});
const showingText = computed(() => `${entryCount.value != 0 ? showingStart.value + 1 : 0} - ${showingEnd.value}`);
const countOfPages = computed(() => Math.ceil(entryCount.value / props.maxEntriesPerPage));
const displayedPagesNumbers = computed(() => {
let stateOfPush = false;
return [...new Array(countOfPages.value)].reduce((acc, curr, index) => {
if (
index <= 1 ||
index >= countOfPages.value - 2 ||
(currentPage.value - 1 <= index && index <= currentPage.value + 1)
) {
acc.push(index);
stateOfPush = false;
return acc;
}
if (stateOfPush == true) return acc;
acc.push(".");
stateOfPush = true;
return acc;
}, []);
});
const visibleRows = computed(() => filterData(props.items, searchString.value, showingStart.value, showingEnd.value));
const loadPage = (newPage: number | ".") => {
if (newPage == ".") return;
if (newPage < 0 || newPage >= countOfPages.value) return;
let pageStart = newPage * props.maxEntriesPerPage;
let pageEnd = newPage * props.maxEntriesPerPage + props.maxEntriesPerPage;
if (pageEnd > entryCount.value) pageEnd = entryCount.value;
let loadedElementCount = filterData(props.items, searchString.value, pageStart, pageEnd).length;
if (loadedElementCount < props.maxEntriesPerPage && (pageEnd != props.totalCount || loadedElementCount == 0))
emit("loadData", pageStart, props.maxEntriesPerPage, searchString.value);
currentPage.value = newPage;
};
const filterData = (array: Array<any>, searchString: string, start: number, end: number): Array<any> => {
return array
.filter(
(elem) =>
!props.enablePreSearch ||
searchString.trim() == "" ||
props.config.some(
(col) =>
typeof elem?.[col.key] == "string" &&
elem[col.key].toLowerCase().includes(searchString.trim().toLowerCase())
)
)
.filter((elem, index) => (elem?.tab_pos ?? index) >= start && (elem?.tab_pos ?? index) < end);
};
</script>
<!--
<script lang="ts">
export default defineComponent({
computed: {
entryCount() {
return this.totalCount ?? this.items.length;
},
showingStart() {
return this.currentPage * this.maxEntriesPerPage;
},
showingEnd() {
let max = this.currentPage * this.maxEntriesPerPage + this.maxEntriesPerPage;
if (max > this.entryCount) max = this.entryCount;
return max;
},
showingText() {
return `${this.entryCount != 0 ? this.showingStart + 1 : 0} - ${this.showingEnd}`;
},
countOfPages() {
return Math.ceil(this.entryCount / this.maxEntriesPerPage);
},
displayedPagesNumbers(): Array<number | "."> {
//indicate if "." or page number gets pushed
let stateOfPush = false;
return [...new Array(this.countOfPages)].reduce((acc, curr, index) => {
if (
// always display first 2 pages
index <= 1 ||
// always display last 2 pages
index >= this.countOfPages - 2 ||
// always display 1 pages around current page
(this.currentPage - 1 <= index && index <= this.currentPage + 1)
) {
acc.push(index);
stateOfPush = false;
return acc;
}
// abort if placeholder already added to array
if (stateOfPush == true) return acc;
// show placeholder if pagenumber is not actively rendered
acc.push(".");
stateOfPush = true;
return acc;
}, []);
},
visibleRows() {
return this.filterData(this.items, this.searchString, this.showingStart, this.showingEnd);
},
},
methods: {
loadPage(newPage: number | ".") {
if (newPage == ".") return;
if (newPage < 0 || newPage >= this.countOfPages) return;
let pageStart = newPage * this.maxEntriesPerPage;
let pageEnd = newPage * this.maxEntriesPerPage + this.maxEntriesPerPage;
if (pageEnd > this.entryCount) pageEnd = this.entryCount;
let loadedElementCount = this.filterData(this.items, this.searchString, pageStart, pageEnd).length;
if (loadedElementCount < this.maxEntriesPerPage)
this.$emit("loadData", { offset: pageStart, count: this.maxEntriesPerPage, search: this.searchString });
this.currentPage = newPage;
},
filterData(array: Array<any>, searchString: string, start: number, end: number): Array<any> {
return array
.filter(
(elem) =>
!this.enablePreSearch ||
searchString.trim() == "" ||
this.config.some((col) => typeof elem?.[col.key] == "string" && elem[col.key].includes(searchString.trim()))
)
.filter((elem, index) => (elem?.tab_pos ?? index) >= start && (elem?.tab_pos ?? index) < end);
},
},
});
</script> -->

View file

@ -1,44 +0,0 @@
<template>
<div class="flex relative">
<input type="text" :value="copyText" />
<ClipboardIcon
class="w-5 h-5 p-2 box-content absolute right-1 top-1/2 -translate-y-1/2 bg-white cursor-pointer"
@click="copyToClipboard"
/>
<div v-if="copySuccess" class="absolute w-5 h-5 right-3 top-[10px]">
<SuccessCheckmark />
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import { ClipboardIcon } from "@heroicons/vue/24/outline";
</script>
<script lang="ts">
export default defineComponent({
props: {
copyText: {
type: String,
default: "",
},
},
data() {
return {
timeoutCopy: undefined as any,
copySuccess: false,
};
},
methods: {
copyToClipboard() {
navigator.clipboard.writeText(this.copyText ?? "");
this.copySuccess = true;
this.timeoutCopy = setTimeout(() => {
this.copySuccess = false;
}, 2000);
},
},
});
</script>

View file

@ -13,7 +13,7 @@
leave-to-class="transform scale-95 opacity-0"
>
<MenuItems
class="absolute right-0 mt-2 w-56 z-20 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg drop-shadow-lg border border-gray-300 focus:outline-hidden"
class="absolute right-0 mt-2 w-56 z-10 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<div class="px-3 py-1 pt-2">
<p class="text-xs">Angemeldet als</p>
@ -21,19 +21,12 @@
</div>
<div class="px-1 py-1 w-full flex flex-col gap-2">
<MenuItem v-slot="{ close }">
<RouterLink to="/account/me">
<RouterLink to="/account">
<button button primary @click="close">Mein Account</button>
</RouterLink>
</MenuItem>
<MenuItem v-slot="{ close }">
<RouterLink to="/docs" target="_blank">
<button button primary @click="close">Dokumentation</button>
</RouterLink>
</MenuItem>
<MenuItem>
<span>
<button primary-outline @click="logoutAccount">ausloggen</button>
</span>
<button primary-outline @click="logoutAccount">ausloggen</button>
</MenuItem>
</div>
</MenuItems>

View file

@ -1,182 +0,0 @@
<template>
<div class="w-full">
<Combobox v-model="selected" :disabled="disabled" multiple>
<ComboboxLabel>{{ title }}</ComboboxLabel>
<div class="relative mt-1">
<ComboboxInput
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
@input="query = $event.target.value"
/>
<ComboboxButton class="absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</ComboboxButton>
<TransitionRoot
leave="transition ease-in duration-100"
leaveFrom="opacity-100"
leaveTo="opacity-0"
@after-leave="query = ''"
>
<ComboboxOptions
class="absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-md ring-1 ring-black/5 focus:outline-hidden sm:text-sm"
>
<ComboboxOption v-if="loading || deferingSearch" as="template" disabled>
<li class="flex flex-row gap-2 text-text relative cursor-default select-none py-2 pl-3 pr-4">
<Spinner />
<span class="font-normal block truncate">suche</span>
</li>
</ComboboxOption>
<ComboboxOption v-else-if="filtered.length === 0 && query == ''" as="template" disabled>
<li class="text-text relative cursor-default select-none py-2 pl-3 pr-4">
<span class="font-normal block truncate">tippe, um zu suchen...</span>
</li>
</ComboboxOption>
<ComboboxOption v-else-if="filtered.length === 0" as="template" disabled>
<li class="text-text relative cursor-default select-none py-2 pl-3 pr-4">
<span class="font-normal block truncate">Keine Auswahl gefunden.</span>
</li>
</ComboboxOption>
<ComboboxOption
v-if="!(loading || deferingSearch)"
v-for="member in filtered"
as="template"
:key="member.id"
:value="member.id"
v-slot="{ selected, active }"
>
<li
class="relative cursor-default select-none py-2 pl-10 pr-4"
:class="{
'bg-primary text-white': active,
'text-gray-900': !active,
}"
>
<span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }">
{{ member.firstname }} {{ member.lastname }} {{ member.nameaffix }}
</span>
<span
v-if="selected"
class="absolute inset-y-0 left-0 flex items-center pl-3"
:class="{ 'text-white': active, 'text-primary': !active }"
>
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>
</li>
</ComboboxOption>
</ComboboxOptions>
</TransitionRoot>
</div>
</Combobox>
</div>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import {
Combobox,
ComboboxLabel,
ComboboxInput,
ComboboxButton,
ComboboxOptions,
ComboboxOption,
TransitionRoot,
} from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMemberStore } from "@/stores/admin/club/member/member";
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
import difference from "lodash.difference";
import Spinner from "../Spinner.vue";
</script>
<script lang="ts">
export default defineComponent({
props: {
modelValue: {
type: Array as PropType<Array<string>>,
default: [],
},
title: String,
disabled: {
type: Boolean,
default: false,
},
},
emits: ["update:model-value", "add:difference", "remove:difference", "add:member", "add:memberByArray"],
watch: {
modelValue() {
if (this.initialLoaded) return;
this.initialLoaded = true;
this.loadMembersInitial();
},
query() {
this.deferingSearch = true;
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.deferingSearch = false;
this.search();
}, 600);
},
},
data() {
return {
initialLoaded: false as boolean,
loading: false as boolean,
deferingSearch: false as boolean,
timer: undefined as any,
query: "" as string,
filtered: [] as Array<MemberViewModel>,
};
},
computed: {
selected: {
get() {
return this.modelValue;
},
set(val: Array<string>) {
this.$emit("update:model-value", val);
if (this.modelValue.length < val.length) {
let diff = difference(val, this.modelValue);
if (diff.length != 1) return;
this.$emit("add:difference", diff[0]);
this.$emit("add:member", this.getMemberFromSearch(diff[0]));
} else {
let diff = difference(this.modelValue, val);
if (diff.length != 1) return;
this.$emit("remove:difference", diff[0]);
}
},
},
},
mounted() {
this.loadMembersInitial();
},
methods: {
...mapActions(useMemberStore, ["searchMembers", "getMembersByIds"]),
search() {
this.filtered = [];
if (this.query == "") return;
this.loading = true;
this.searchMembers(this.query)
.then((res) => {
this.filtered = res.data;
})
.catch((err) => {})
.finally(() => {
this.loading = false;
});
},
getMemberFromSearch(id: string) {
return this.filtered.find((f) => f.id == id);
},
loadMembersInitial() {
if (this.modelValue.length == 0) return;
this.getMembersByIds(this.modelValue)
.then((res) => {
this.$emit("add:memberByArray", res.data);
})
.catch(() => {});
},
},
});
</script>

View file

@ -1,8 +1,5 @@
<template>
<div
class="flex flex-col gap-2 max-w-2xl mx-auto w-full select-none"
:class="disableEdit ? ' pointer-events-none opacity-60 bg-gray-100/50' : ''"
>
<div class="flex flex-col gap-2 max-w-2xl mx-auto w-full select-none">
<div class="flex flex-row gap-2 h-fit w-full border border-gray-300 rounded-md p-2">
<input type="checkbox" name="admin" id="admin" class="cursor-pointer" :checked="isAdmin" @change="toggleAdmin" />
<label for="admin" class="cursor-pointer">Administratorrecht</label>
@ -11,7 +8,7 @@
v-for="section in sections"
:key="section"
class="flex flex-col gap-2 h-fit w-full border border-primary rounded-md"
:class="isAdmin && !disableEdit ? ' pointer-events-none opacity-60 bg-gray-100' : ''"
:class="isAdmin ? ' pointer-events-none opacity-60 bg-gray-100' : ''"
>
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<p>Abschnitt: {{ section }}</p>
@ -68,9 +65,9 @@
</div>
</div>
</div>
<div v-if="!disableEdit" class="flex flex-row gap-2 self-end pt-4">
<button primary-outline class="w-fit!" @click="reset" :disabled="canSaveOrReset">verwerfen</button>
<button primary class="w-fit!" @click="submit" :disabled="status == 'loading' || canSaveOrReset">
<div class="flex flex-row gap-2 self-end pt-4">
<button primary-outline class="!w-fit" @click="reset" :disabled="canSaveOrReset">verwerfen</button>
<button primary class="!w-fit" @click="submit" :disabled="status == 'loading' || canSaveOrReset">
speichern
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
@ -95,7 +92,7 @@ import { mapState, mapActions } from "pinia";
import { EyeIcon, PencilIcon, PlusIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useAbilityStore } from "@/stores/ability";
import cloneDeep from "lodash.clonedeep";
import isEqual from "lodash.isequal";
import isEqual from "lodash.isEqual";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
@ -112,10 +109,6 @@ export default defineComponent({
type: [Object, String, null] as PropType<null | "loading" | { status: "success" | "failed"; message?: string }>,
default: null,
},
disableEdit: {
type: Boolean,
default: false,
},
},
watch: {
permissions() {
@ -178,12 +171,12 @@ export default defineComponent({
if (!this.permissionUpdate[section]) {
this.permissionUpdate[section] = {};
}
this.permissionUpdate[section]!.all = permissions;
this.permissionUpdate[section].all = permissions;
} else {
if (!this.permissionUpdate[section]) {
this.permissionUpdate[section] = {};
}
this.permissionUpdate[section]![modul] = permissions;
this.permissionUpdate[section][modul] = permissions;
}
},
reset() {

View file

@ -1,36 +1,35 @@
<template>
<RouterLink v-if="link" :to="link">
<RouterLink v-if="link" :to="{ name: `admin-${activeNavigation}-${link.key}` }">
<p
class="cursor-pointer w-full px-2 py-3"
:class="active ? 'rounded-r-lg bg-red-200 border-l-4 border-l-primary' : 'pl-3 hover:bg-red-200 rounded-lg'"
:class="
activeLink == link.key
? 'rounded-r-lg bg-red-200 border-l-4 border-l-primary'
: 'pl-3 hover:bg-red-200 rounded-lg'
"
>
{{ title }}
{{ link.title }}
</p>
</RouterLink>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
import { mapState, mapActions } from "pinia";
import { useNavigationStore, type navigationLinkModel } from "@/stores/admin/navigation";
</script>
<script lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
export default defineComponent({
props: {
title: {
type: String,
default: "LINK",
},
link: {
type: Object as PropType<string | { name: string, params?:{[key:string]:string} }>,
default: "/",
},
active: {
type: Boolean,
default: false,
type: Object as PropType<navigationLinkModel>,
default: null,
},
},
computed: {
...mapState(useNavigationStore, ["activeLink", "activeNavigation"]),
},
});
</script>

View file

@ -18,13 +18,13 @@
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
import { useNavigationStore, type topLevelNavigationModel } from "@/stores/admin/navigation";
import { mapState } from "pinia";
</script>
<script lang="ts">
import { defineComponent, type PropType } from "vue";
import { RouterLink } from "vue-router";
export default defineComponent({
props: {
link: {

View file

@ -1,143 +0,0 @@
<template>
<div class="relative w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Kalenderlink</p>
</div>
<br />
<div class="flex flex-col gap-2">
<div>
<Listbox v-model="selectedTypes" name="type" multiple>
<ListboxLabel>Typen zur Anzeige auswählen</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
selectedTypes.length != 0
? selectedTypes?.map((t) => t.type).join(", ")
: "Standard-Typen werden ausgeliefert"
}}
</span>
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</span>
</ListboxButton>
<transition
leave-active-class="transition duration-100 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="calendarTypes.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
<span :class="['font-normal', 'block truncate']">keine Auswahl vorhanden</span>
</li>
</ListboxOption>
<ListboxOption
v-slot="{ active, selected }"
v-for="type in calendarTypes"
:key="type.id"
:value="type"
as="template"
>
<li
:class="[
active ? 'bg-red-200 text-amber-900' : 'text-gray-900',
'relative cursor-default select-none py-2 pl-10 pr-4',
]"
>
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">
{{ type.type }}
<small v-if="type.passphrase">(passwortgeschützt)</small>
<small v-if="type.nscdr">(standard-Auslieferung)</small>
</span>
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>
</li>
</ListboxOption>
</ListboxOptions>
</transition>
</div>
</Listbox>
</div>
<p class="flex flex-row text-sm">
<InformationCircleIcon class="text-gray-500 h-5 w-5" /> Wenn kein Typ ausgewählt ist, werden die Standard-Typen
zur Verfügung gestellt: <br />
-> {{ defaultTypes }}
</p>
<br />
<TextCopy :copyText="generatedLink" />
<div v-if="selectedTypes.length != 0" class="flex flex-row gap-2 items-center">
<input type="checkbox" id="nscdr" v-model="provideNSCDR" />
<label for="nscdr">Standard-Typen trotz Auswahl ausliefern</label>
</div>
<br />
</div>
<RouterLink
:to="{ name: 'public-calendar' }"
title="Zur öffentlichen Kalender Anzeige"
class="absolute top-3 right-3"
target="_blank"
>
<CalendarDaysIcon class="text-gray-500 h-5 w-5" />
</RouterLink>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">schließen</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { RouterLink } from "vue-router";
import { useModalStore } from "@/stores/modal";
import { useCalendarTypeStore } from "@/stores/admin/configuration/calendarType";
import type { CalendarTypeViewModel } from "@/viewmodels/admin/configuration/calendarType.models";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import TextCopy from "@/components/TextCopy.vue";
import { CalendarDaysIcon, InformationCircleIcon } from "@heroicons/vue/24/outline";
import { host } from "@/serverCom";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
selectedTypes: [] as Array<CalendarTypeViewModel>,
provideNSCDR: false as boolean,
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useCalendarTypeStore, ["calendarTypes"]),
defaultTypes() {
return this.calendarTypes
.filter((t) => t.nscdr)
.map((t) => t.type)
.join(", ");
},
generatedLink() {
let extend = this.selectedTypes.map((t) => [t.type, t.passphrase].filter((at) => at).join(":"));
return `webcal://${host || window.location.host}/api/public/calendar${extend.length == 0 ? "" : "?types=" + extend.join("&types=")}${this.provideNSCDR && extend.length != 0 ? "&nscdr=true" : ""}`;
},
},
mounted() {
this.fetchCalendarTypes();
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCalendarTypeStore, ["fetchCalendarTypes"]),
},
});
</script>

View file

@ -1,259 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Termin erstellen</p>
</div>
<br />
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<Listbox v-model="selectedType" name="type">
<ListboxLabel>Termintyp</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
calendarTypes.length != 0 ? (selectedType?.type ?? "bitte auswählen") : "keine Auswahl vorhanden"
}}</span
>
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</span>
</ListboxButton>
<transition
leave-active-class="transition duration-100 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="calendarTypes.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
<span :class="['font-normal', 'block truncate']">keine Auswahl vorhanden</span>
</li>
</ListboxOption>
<ListboxOption
v-slot="{ active, selected }"
v-for="type in calendarTypes"
:key="type.id"
:value="type"
as="template"
>
<li
:class="[
active ? 'bg-red-200 text-amber-900' : 'text-gray-900',
'relative cursor-default select-none py-2 pl-10 pr-4',
]"
>
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{ type.type }}</span>
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>
</li>
</ListboxOption>
</ListboxOptions>
</transition>
</div>
</Listbox>
</div>
<div>
<label for="title">Titel</label>
<input type="text" id="title" required />
</div>
<div>
<label for="content">Beschreibung (optional)</label>
<textarea id="content" class="h-18"></textarea>
</div>
<div class="flex flex-row gap-2 items-center">
<input
type="checkbox"
id="allDay"
:checked="data.allDay"
@change="(e) => (allDay = (e.target as HTMLInputElement).checked)"
/>
<label for="allDay">ganztägig</label>
</div>
<div v-if="!allDay" class="flex flex-col sm:flex-row gap-2">
<div class="w-full">
<label for="starttime">Startzeit</label>
<input
type="datetime-local"
id="starttime"
required
:value="formatForDateTimeLocalInput(data.start)"
@change="
($event) => {
($refs.endtime as HTMLInputElement).min = formatForDateTimeLocalInput(
($event.target as HTMLInputElement).value
);
}
"
/>
</div>
<div class="w-full">
<label for="endtime">Endzeit</label>
<input
ref="endtime"
type="datetime-local"
id="endtime"
required
:value="formatForDateTimeLocalInput(data.end)"
:min="formatForDateTimeLocalInput(data.start)"
/>
</div>
</div>
<div v-else class="flex flex-col sm:flex-row gap-2">
<div class="w-full">
<label for="startdate">Startdatum</label>
<input
type="date"
id="startdate"
required
:value="formatForDateInput(data.start)"
@change="
($event) => {
($refs.enddate as HTMLInputElement).min = formatForDateInput(($event.target as HTMLInputElement).value);
}
"
/>
</div>
<div class="w-full">
<label for="enddate">Enddatum</label>
<input
ref="enddate"
type="date"
id="enddate"
required
:value="decrementEndDate(data.end)"
:min="formatForDateInput(data.start)"
/>
</div>
</div>
<div>
<label for="location">Ort (optional)</label>
<input type="text" id="location" />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCalendarStore } from "@/stores/admin/club/calendar";
import type { CreateCalendarViewModel } from "@/viewmodels/admin/club/calendar.models";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useCalendarTypeStore } from "@/stores/admin/configuration/calendarType";
import type { CalendarTypeViewModel } from "@/viewmodels/admin/configuration/calendarType.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
allDay: false,
selectedType: undefined as undefined | CalendarTypeViewModel,
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useCalendarTypeStore, ["calendarTypes"]),
},
mounted() {
this.allDay = this.data.allDay;
this.fetchCalendarTypes();
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCalendarStore, ["createCalendar"]),
...mapActions(useCalendarTypeStore, ["fetchCalendarTypes"]),
triggerCreate(e: any) {
if (!this.selectedType) return;
let formData = e.target.elements;
let createCalendar: CreateCalendarViewModel = {
typeId: this.selectedType.id,
starttime: this.allDay
? new Date(new Date(formData.startdate.value).setHours(0, 0, 0, 0)).toISOString()
: new Date(formData.starttime.value).toISOString(),
endtime: this.allDay
? new Date(new Date(formData.enddate.value).setHours(23, 59, 59, 999)).toISOString()
: new Date(formData.endtime.value).toISOString(),
title: formData.title.value,
content: formData.content.value,
location: formData.location.value,
allDay: this.allDay,
};
this.status = "loading";
this.createCalendar(createCalendar)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
decrementEndDate(utcDateString: string) {
const localDate = new Date(utcDateString);
const year = localDate.getFullYear();
const month = String(localDate.getMonth() + 1).padStart(2, "0");
const day = String(localDate.getDate() - 1).padStart(2, "0");
return `${year}-${month}-${day}`;
},
formatForDateTimeLocalInput(utcDateString: string) {
const localDate = new Date(utcDateString);
const year = localDate.getFullYear();
const month = String(localDate.getMonth() + 1).padStart(2, "0");
const day = String(localDate.getDate()).padStart(2, "0");
const hours = String(localDate.getHours()).padStart(2, "0");
const minutes = String(localDate.getMinutes()).padStart(2, "0");
return `${year}-${month}-${day}T${hours}:${minutes}`;
},
formatForDateInput(utcDateString: string) {
const localDate = new Date(utcDateString);
const year = localDate.getFullYear();
const month = String(localDate.getMonth() + 1).padStart(2, "0");
const day = String(localDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
},
},
});
</script>

View file

@ -1,97 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Termin {{ calendar?.title }} löschen?</p>
</div>
<br />
<p class="text-center">
{{
new Date(calendar?.starttime ?? "").toLocaleString("de-De", {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
})
}}
bis
{{
new Date(calendar?.endtime ?? "").toLocaleString("de-De", {
day: "2-digit",
month: "2-digit",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
})
}}
</p>
<br />
<div class="flex flex-row gap-2">
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDelete">
unwiederuflich löschen
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCalendarStore } from "@/stores/admin/club/calendar";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useCalendarStore, ["calendars"]),
calendar() {
return this.calendars.find((r) => r.id == this.data);
},
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCalendarStore, ["deleteCalendar"]),
triggerDelete() {
this.status = "loading";
this.deleteCalendar(this.data)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,307 +0,0 @@
<template>
<div class="relative w-full md:max-w-md">
<TrashIcon
v-if="can('delete', 'club', 'calendar')"
class="absolute top-3 right-3 w-5 h-5 cursor-pointer"
@click="deleteCalendar"
/>
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Termin erstellen</p>
</div>
<br />
<Spinner v-if="loading == 'loading'" class="mx-auto" />
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
<form v-else-if="calendar != null" class="flex flex-col gap-4 py-2" @submit.prevent="triggerUpdate">
<div>
<Listbox v-model="calendar.type" name="type">
<ListboxLabel>Termintyp</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
calendarTypes.length != 0 ? (calendar.type?.type ?? "bitte auswählen") : "keine Auswahl vorhanden"
}}</span
>
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</span>
</ListboxButton>
<transition
leave-active-class="transition duration-100 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="calendarTypes.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
<span :class="['font-normal', 'block truncate']">keine Auswahl vorhanden</span>
</li>
</ListboxOption>
<ListboxOption
v-slot="{ active, selected }"
v-for="type in calendarTypes"
:key="type.id"
:value="type"
as="template"
>
<li
:class="[
active ? 'bg-red-200 text-amber-900' : 'text-gray-900',
'relative cursor-default select-none py-2 pl-10 pr-4',
]"
>
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{ type.type }}</span>
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>
</li>
</ListboxOption>
</ListboxOptions>
</transition>
</div>
</Listbox>
</div>
<div>
<label for="title">Titel</label>
<input type="text" id="title" required v-model="calendar.title" />
</div>
<div>
<label for="content">Beschreibung (optional)</label>
<textarea id="content" class="h-18" v-model="calendar.content"></textarea>
</div>
<div class="flex flex-row gap-2 items-center">
<input type="checkbox" id="allDay" v-model="calendar.allDay" />
<label for="allDay">ganztägig</label>
</div>
<div v-if="!calendar.allDay" class="flex flex-col sm:flex-row gap-2">
<div class="w-full">
<label for="starttime">Startzeit</label>
<input
type="datetime-local"
id="starttime"
required
:value="formatForDateTimeLocalInput(calendar.starttime)"
@change="
($event) => {
calendar!.starttime = new Date(($event.target as HTMLInputElement).value).toISOString();
($refs.endtime as HTMLInputElement).min = formatForDateTimeLocalInput(
($event.target as HTMLInputElement).value
);
}
"
/>
</div>
<div class="w-full">
<label for="endtime">Endzeit</label>
<input
ref="endtime"
type="datetime-local"
id="endtime"
required
:value="formatForDateTimeLocalInput(calendar.endtime)"
:min="formatForDateTimeLocalInput(calendar.starttime)"
@change="
($event) => {
calendar!.endtime = new Date(($event.target as HTMLInputElement).value).toISOString();
}
"
/>
</div>
</div>
<div v-else class="flex flex-col sm:flex-row gap-2">
<div class="w-full">
<label for="startdate">Startdatum</label>
<input
type="date"
id="startdate"
required
:value="formatForDateInput(calendar.starttime)"
@change="
($event) => {
calendar!.starttime = new Date(($event.target as HTMLInputElement).value).toISOString();
($refs.enddate as HTMLInputElement).min = formatForDateInput(($event.target as HTMLInputElement).value);
}
"
/>
</div>
<div class="w-full">
<label for="enddate">Enddatum</label>
<input
ref="enddate"
type="date"
id="enddate"
required
:min="formatForDateInput(calendar.starttime)"
:value="formatForDateInput(calendar.endtime)"
@change="
($event) => {
calendar!.endtime = new Date(($event.target as HTMLInputElement).value).toISOString();
}
"
/>
</div>
</div>
<div>
<label for="location">Ort (optional)</label>
<input type="text" id="location" v-model="calendar.location" />
</div>
<div class="flex flex-row gap-2">
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
verwerfen
</button>
<button primary type="submit" class="w-fit!" :disabled="status == 'loading' || canSaveOrReset">
speichern
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen / schließen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCalendarStore } from "@/stores/admin/club/calendar";
import type {
CalendarViewModel,
CreateCalendarViewModel,
UpdateCalendarViewModel,
} from "@/viewmodels/admin/club/calendar.models";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon, TrashIcon } from "@heroicons/vue/20/solid";
import { useCalendarTypeStore } from "@/stores/admin/configuration/calendarType";
import type { CalendarTypeViewModel } from "@/viewmodels/admin/configuration/calendarType.models";
import cloneDeep from "lodash.clonedeep";
import isEqual from "lodash.isequal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
loading: "loading" as "loading" | "fetched" | "failed",
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
origin: null as null | CalendarViewModel,
calendar: null as null | CalendarViewModel,
timeout: undefined as any,
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useCalendarStore, ["calendars"]),
...mapState(useCalendarTypeStore, ["calendarTypes"]),
...mapState(useAbilityStore, ["can"]),
canSaveOrReset(): boolean {
return isEqual(this.origin, this.calendar);
},
},
mounted() {
this.fetchCalendarTypes();
this.fetchItem();
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal", "openModal"]),
...mapActions(useCalendarStore, ["updateCalendar", "fetchCalendarById"]),
...mapActions(useCalendarTypeStore, ["fetchCalendarTypes"]),
resetForm() {
this.calendar = cloneDeep(this.origin);
},
fetchItem() {
this.fetchCalendarById(this.data ?? "")
.then((result) => {
this.calendar = result.data;
this.origin = cloneDeep(result.data);
this.loading = "fetched";
})
.catch((err) => {
this.loading = "failed";
});
},
triggerUpdate(e: any) {
if (this.calendar == null) return;
let formData = e.target.elements;
let updateCalendar: UpdateCalendarViewModel = {
id: this.calendar.id,
typeId: this.calendar.type.id,
starttime: this.calendar.allDay
? new Date(new Date(formData.startdate.value).setHours(0, 0, 0, 0)).toISOString()
: new Date(formData.starttime.value).toISOString(),
endtime: this.calendar.allDay
? new Date(new Date(formData.enddate.value).setHours(23, 59, 59, 999)).toISOString()
: new Date(formData.endtime.value).toISOString(),
title: formData.title.value,
content: formData.content.value,
location: formData.location.value,
allDay: this.calendar.allDay,
};
this.status = "loading";
this.updateCalendar(updateCalendar)
.then(() => {
this.fetchItem();
this.status = { status: "success" };
})
.catch(() => {
this.status = { status: "failed" };
})
.finally(() => {
this.timeout = setTimeout(() => {
this.status = null;
}, 2000);
});
},
deleteCalendar() {
if (this.origin == null) return;
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/calendar/DeleteCalendarModal.vue"))),
this.origin.id
);
},
formatForDateTimeLocalInput(utcDateString: string) {
const localDate = new Date(utcDateString);
const year = localDate.getFullYear();
const month = String(localDate.getMonth() + 1).padStart(2, "0");
const day = String(localDate.getDate()).padStart(2, "0");
const hours = String(localDate.getHours()).padStart(2, "0");
const minutes = String(localDate.getMinutes()).padStart(2, "0");
return `${year}-${month}-${day}T${hours}:${minutes}`;
},
formatForDateInput(utcDateString: string) {
const localDate = new Date(utcDateString);
const year = localDate.getFullYear();
const month = String(localDate.getMonth() + 1).padStart(2, "0");
const day = String(localDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
},
},
});
</script>

View file

@ -6,13 +6,13 @@
<br />
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<Listbox v-model="selectedSalutation" name="salutation" by="id">
<Listbox v-model="selectedSalutation" name="salutation">
<ListboxLabel>Anrede</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start"> {{ selectedSalutation?.salutation }}</span>
<span class="block truncate w-full text-start"> {{ selectedSalutation }}</span>
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</span>
@ -24,12 +24,12 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption
v-slot="{ active, selected }"
v-for="salutation in salutations"
:key="salutation.id"
:key="salutation"
:value="salutation"
as="template"
>
@ -39,9 +39,7 @@
'relative cursor-default select-none py-2 pl-10 pr-4',
]"
>
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{
salutation.salutation
}}</span>
<span :class="[selected ? 'font-medium' : 'font-normal', 'block truncate']">{{ salutation }}</span>
<span v-if="selected" class="absolute inset-y-0 left-0 flex items-center pl-3 text-primary">
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>
@ -68,10 +66,6 @@
<label for="birthdate">Geburtsdatum</label>
<input type="date" id="birthdate" required />
</div>
<div>
<label for="internalId">Interne ID (optional)</label>
<input type="text" id="internalId" />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
@ -99,10 +93,9 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMemberStore } from "@/stores/admin/club/member/member";
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
import { useSalutationStore } from "../../../../stores/admin/configuration/salutation";
import type { SalutationViewModel } from "../../../../viewmodels/admin/configuration/salutation.models";
import { Salutation } from "@/enums/salutation";
import { useMemberStore } from "@/stores/admin/member";
import type { CreateMemberViewModel } from "@/viewmodels/admin/member.models";
</script>
<script lang="ts">
@ -111,14 +104,12 @@ export default defineComponent({
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
selectedSalutation: null as null | SalutationViewModel,
salutations: [] as Array<string>,
selectedSalutation: Salutation.none as Salutation,
};
},
computed: {
...mapState(useSalutationStore, ["salutations"]),
},
mounted() {
this.fetchSalutations();
this.salutations = Object.values(Salutation);
},
beforeUnmount() {
try {
@ -128,19 +119,15 @@ export default defineComponent({
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberStore, ["createMember"]),
...mapActions(useSalutationStore, ["fetchSalutations"]),
triggerCreate(e: any) {
if (!this.selectedSalutation) return;
let formData = e.target.elements;
let createMember: CreateMemberViewModel = {
salutationId: this.selectedSalutation.id,
salutation: this.selectedSalutation,
firstname: formData.firstname.value,
lastname: formData.lastname.value,
nameaffix: formData.nameaffix.value,
birthdate: formData.birthdate.value,
internalId: formData.internalId.value,
};
this.status = "loading";
this.createMember(createMember)
.then(() => {
this.status = { status: "success" };

View file

@ -41,8 +41,11 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useMemberStore } from "@/stores/admin/club/member/member";
import type { CreateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { Salutation } from "@/enums/salutation";
import { useMemberStore } from "@/stores/admin/member";
import type { CreateMemberViewModel } from "@/viewmodels/admin/member.models";
</script>
<script lang="ts">
@ -69,7 +72,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberStore, ["deleteMember"]),
triggerDelete() {
this.status = "loading";
this.deleteMember(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -10,7 +10,7 @@
<ListboxLabel>Auszeichnung</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{ awards.length != 0 ? (selectedAward?.award ?? "bitte auswählen") : "keine Auswahl vorhanden" }}</span
@ -26,7 +26,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="awards.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -97,14 +97,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMembershipStatusStore } from "@/stores/admin/configuration/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/configuration/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/club/member/membership.models";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import { useAwardStore } from "@/stores/admin/configuration/award";
import type { AwardViewModel } from "@/viewmodels/admin/configuration/award.models";
import type { CreateMemberAwardViewModel } from "@/viewmodels/admin/club/member/memberAward.models";
import { useMemberAwardStore } from "@/stores/admin/club/member/memberAward";
import { useMembershipStatusStore } from "@/stores/admin/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/membership.models";
import { useMembershipStore } from "@/stores/admin/membership";
import { useAwardStore } from "@/stores/admin/award";
import type { AwardViewModel } from "@/viewmodels/admin/award.models";
import type { CreateMemberAwardViewModel } from "@/viewmodels/admin/memberAward.models";
import { useMemberAwardStore } from "@/stores/admin/memberAward";
</script>
<script lang="ts">
@ -140,7 +140,6 @@ export default defineComponent({
given: formData.given.checked,
awardId: this.selectedAward.id,
};
this.status = "loading";
this.createMemberAward(createMemberAward)
.then(() => {
this.status = { status: "success" };

View file

@ -38,7 +38,7 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useMemberAwardStore } from "@/stores/admin/club/member/memberAward";
import { useMemberAwardStore } from "@/stores/admin/memberAward";
</script>
<script lang="ts">
@ -65,7 +65,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberAwardStore, ["deleteMemberAward"]),
triggerDelete() {
this.status = "loading";
this.deleteMemberAward(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -12,7 +12,7 @@
<ListboxLabel>Auszeichnung</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{ awards.length != 0 ? (selectedAward ?? "bitte auswählen") : "keine Auswahl vorhanden" }}</span
@ -28,7 +28,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="awards.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -83,9 +83,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
schließen
</button>
<button primary-outline @click="closeModal" :disabled="status != null">schließen</button>
</div>
</div>
</div>
@ -100,14 +98,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useAwardStore } from "@/stores/admin/configuration/award";
import { useAwardStore } from "@/stores/admin/award";
import type {
CreateMemberAwardViewModel,
MemberAwardViewModel,
UpdateMemberAwardViewModel,
} from "@/viewmodels/admin/club/member/memberAward.models";
import { useMemberAwardStore } from "@/stores/admin/club/member/memberAward";
import isEqual from "lodash.isequal";
} from "@/viewmodels/admin/memberAward.models";
import { useMemberAwardStore } from "@/stores/admin/memberAward";
import isEqual from "lodash.isEqual";
import cloneDeep from "lodash.clonedeep";
</script>
@ -169,7 +167,6 @@ export default defineComponent({
given: formData.given.checked,
awardId: this.memberAward.awardId,
};
this.status = "loading";
this.updateMemberAward(updateMemberAward)
.then(() => {
this.fetchItem();

View file

@ -2,8 +2,8 @@
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<div class="bg-primary p-2 text-white flex flex-row gap-2 justify-between items-center">
<p class="grow">{{ award.award }}</p>
<PencilIcon v-if="can('update', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon v-if="can('delete', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
<PencilIcon class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
<div class="p-2">
<p>erhalten am: {{ award.date }}</p>
@ -16,10 +16,9 @@
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { MemberAwardViewModel } from "@/viewmodels/admin/club/member/memberAward.models";
import type { MemberAwardViewModel } from "@/viewmodels/admin/memberAward.models";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
@ -30,9 +29,6 @@ export default defineComponent({
default: {},
},
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openEditModal() {

View file

@ -10,7 +10,7 @@
<ListboxLabel>Kommunikationsart</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="communicationTypes.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -69,10 +69,6 @@
<label for="email">Mail-Adresse</label>
<input type="text" id="email" required />
</div>
<div v-if="selectedCommunicationType?.fields.includes('postalCode')">
<label for="postalCode">Postleitzahl</label>
<input type="text" id="postalCode" required />
</div>
<div v-if="selectedCommunicationType?.fields.includes('city')">
<label for="city">Stadt</label>
<input type="text" id="city" required />
@ -97,10 +93,6 @@
<input type="checkbox" id="isNewsletterMain" />
<label for="isNewsletterMain">Newsletter hier hin versenden?</label>
</div>
<div v-if="selectedCommunicationType?.fields.includes('mobile')" class="flex flex-row items-center gap-2">
<input type="checkbox" id="isSMSAlarming" />
<label for="isSMSAlarming">SMS-Alarmierung hier hin versenden?</label>
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
@ -129,10 +121,10 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useCommunicationStore } from "@/stores/admin/club/member/communication";
import type { CreateCommunicationViewModel } from "@/viewmodels/admin/club/member/communication.models";
import { useCommunicationTypeStore } from "@/stores/admin/configuration/communicationType";
import type { CommunicationTypeViewModel } from "@/viewmodels/admin/configuration/communicationType.models";
import { useCommunicationStore } from "@/stores/admin/communication";
import type { CreateCommunicationViewModel } from "@/viewmodels/admin/communication.models";
import { useCommunicationTypeStore } from "@/stores/admin/communicationType";
import type { CommunicationTypeViewModel } from "@/viewmodels/admin/communicationType.models";
</script>
<script lang="ts">
@ -166,16 +158,13 @@ export default defineComponent({
preferred: formData.preferred.checked,
mobile: formData.mobile?.value,
email: formData.email?.value,
postalCode: formData.postalCode?.value,
city: formData.city?.value,
street: formData.street?.value,
streetNumber: formData.streetNumber?.value,
streetNumberAddition: formData.streetNumberAddition?.value,
isNewsletterMain: formData.isNewsletterMain.checked,
isSMSAlarming: formData.isSMSAlarming?.checked,
typeId: this.selectedCommunicationType.id,
};
this.status = "loading";
this.createCommunication(createCommunication)
.then(() => {
this.status = { status: "success" };

View file

@ -41,7 +41,7 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCommunicationStore } from "@/stores/admin/club/member/communication";
import { useCommunicationStore } from "@/stores/admin/communication";
</script>
<script lang="ts">
@ -68,7 +68,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCommunicationStore, ["deleteCommunication"]),
triggerDelete() {
this.status = "loading";
this.deleteCommunication(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -6,7 +6,7 @@
<br />
<Spinner v-if="loading == 'loading'" class="mx-auto" />
<p v-else-if="loading == 'failed'" @click="fetchItem" class="cursor-pointer">&#8634; laden fehlgeschlagen</p>
<form v-else-if="communication != null" class="flex flex-col gap-4 py-2" @submit.prevent="triggerUpdate">
<form v-else-if="communication != null" class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<p>Type: {{ communication.type.type }}</p>
</div>
@ -18,10 +18,6 @@
<label for="email">Mail-Adresse</label>
<input type="text" id="email" required v-model="communication.email" />
</div>
<div v-if="communication.type.fields.includes('postalCode')">
<label for="postalCode">Postleitzahl</label>
<input type="text" id="postalCode" required v-model="communication.postalCode" />
</div>
<div v-if="communication.type.fields.includes('city')">
<label for="city">Stadt</label>
<input type="text" id="city" required v-model="communication.city" />
@ -46,10 +42,6 @@
<input type="checkbox" id="isNewsletterMain" v-model="communication.isNewsletterMain" />
<label for="isNewsletterMain">Newsletter hier hin versenden?</label>
</div>
<div v-if="communication.type.fields.includes('mobile')" class="flex flex-row items-center gap-2">
<input type="checkbox" id="isSMSAlarming" v-model="communication.isSMSAlarming" />
<label for="isSMSAlarming">SMS-Alarmierung hier hin versenden?</label>
</div>
<div class="flex flex-row gap-2">
<button primary-outline type="reset" :disabled="canSaveOrReset" @click="resetForm">verwerfen</button>
@ -62,9 +54,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
schließen
</button>
<button primary-outline @click="closeModal" :disabled="status != null">schließen</button>
</div>
</div>
</div>
@ -77,13 +67,13 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCommunicationStore } from "@/stores/admin/club/member/communication";
import { useCommunicationStore } from "@/stores/admin/communication";
import type {
CreateCommunicationViewModel,
CommunicationViewModel,
UpdateCommunicationViewModel,
} from "@/viewmodels/admin/club/member/communication.models";
import isEqual from "lodash.isequal";
} from "@/viewmodels/admin/communication.models";
import isEqual from "lodash.isEqual";
import cloneDeep from "lodash.clonedeep";
</script>
@ -130,7 +120,7 @@ export default defineComponent({
this.loading = "failed";
});
},
triggerUpdate(e: any) {
triggerCreate(e: any) {
if (this.communication == null) return;
let formData = e.target.elements;
let updateCommunication: UpdateCommunicationViewModel = {
@ -138,15 +128,12 @@ export default defineComponent({
preferred: formData.preferred.checked,
mobile: formData.mobile?.value,
email: formData.email?.value,
postalCode: formData.postalCode?.value,
city: formData.city?.value,
street: formData.street?.value,
streetNumber: formData.streetNumber?.value,
streetNumberAddition: formData.streetNumberAddition?.value,
isNewsletterMain: formData.isNewsletterMain.checked,
isSMSAlarming: formData.isSMSAlarming?.checked,
};
this.status = "loading";
this.updateCommunication(updateCommunication)
.then(() => {
this.fetchItem();

View file

@ -1,11 +1,10 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<div class="bg-primary p-2 text-white flex flex-row gap-2 justify-between items-center">
<FireIcon class="h-5 w-5 pr-1 box-content" v-if="communication.isSMSAlarming" />
<EnvelopeIcon class="h-5 w-5 pr-1 box-content" v-if="communication.isNewsletterMain" />
<p class="grow">{{ communication.type.type }} {{ communication.preferred ? "(bevorzugt)" : "" }}</p>
<PencilIcon v-if="can('update', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon v-if="can('delete', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
<PencilIcon class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
<div class="p-2">
<p v-for="field in communication.type.fields" :key="field">{{ field }}: {{ communication[field] || "--" }}</p>
@ -16,10 +15,9 @@
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { CommunicationViewModel } from "@/viewmodels/admin/club/member/communication.models";
import { EnvelopeIcon, PencilIcon, TrashIcon, FireIcon } from "@heroicons/vue/24/outline";
import type { CommunicationViewModel } from "@/viewmodels/admin/communication.models";
import { EnvelopeIcon, PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
@ -30,9 +28,6 @@ export default defineComponent({
default: {},
},
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openEditModal() {

View file

@ -10,7 +10,7 @@
<ListboxLabel>Qualifikation</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="executivePositions.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -99,14 +99,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMembershipStatusStore } from "@/stores/admin/configuration/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/configuration/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/club/member/membership.models";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import { useExecutivePositionStore } from "@/stores/admin/configuration/executivePosition";
import type { ExecutivePositionViewModel } from "@/viewmodels/admin/configuration/executivePosition.models";
import type { CreateMemberExecutivePositionViewModel } from "@/viewmodels/admin/club/member/memberExecutivePosition.models";
import { useMemberExecutivePositionStore } from "@/stores/admin/club/member/memberExecutivePosition";
import { useMembershipStatusStore } from "@/stores/admin/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/membership.models";
import { useMembershipStore } from "@/stores/admin/membership";
import { useExecutivePositionStore } from "@/stores/admin/executivePosition";
import type { ExecutivePositionViewModel } from "@/viewmodels/admin/executivePosition.models";
import type { CreateMemberExecutivePositionViewModel } from "@/viewmodels/admin/memberExecutivePosition.models";
import { useMemberExecutivePositionStore } from "@/stores/admin/memberExecutivePosition";
</script>
<script lang="ts">
@ -141,7 +141,6 @@ export default defineComponent({
note: formData.note.value,
executivePositionId: this.selectedExecutivePosition.id,
};
this.status = "loading";
this.createMemberExecutivePosition(createMemberExecutivePosition)
.then(() => {
this.status = { status: "success" };

View file

@ -38,7 +38,7 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useMemberExecutivePositionStore } from "@/stores/admin/club/member/memberExecutivePosition";
import { useMemberExecutivePositionStore } from "@/stores/admin/memberExecutivePosition";
</script>
<script lang="ts">
@ -65,7 +65,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberExecutivePositionStore, ["deleteMemberExecutivePosition"]),
triggerDelete() {
this.status = "loading";
this.deleteMemberExecutivePosition(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -12,7 +12,7 @@
<ListboxLabel>Auszeichnung</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -32,7 +32,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="executivePositions.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -89,9 +89,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
schließen
</button>
<button primary-outline @click="closeModal" :disabled="status != null">schließen</button>
</div>
</div>
</div>
@ -106,14 +104,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useExecutivePositionStore } from "@/stores/admin/configuration/executivePosition";
import { useExecutivePositionStore } from "@/stores/admin/executivePosition";
import type {
CreateMemberExecutivePositionViewModel,
MemberExecutivePositionViewModel,
UpdateMemberExecutivePositionViewModel,
} from "@/viewmodels/admin/club/member/memberExecutivePosition.models";
import { useMemberExecutivePositionStore } from "@/stores/admin/club/member/memberExecutivePosition";
import isEqual from "lodash.isequal";
} from "@/viewmodels/admin/memberExecutivePosition.models";
import { useMemberExecutivePositionStore } from "@/stores/admin/memberExecutivePosition";
import isEqual from "lodash.isEqual";
import cloneDeep from "lodash.clonedeep";
</script>
@ -178,7 +176,6 @@ export default defineComponent({
note: formData.note.value,
executivePositionId: this.memberExecutivePosition.executivePositionId,
};
this.status = "loading";
this.updateMemberExecutivePosition(updateMemberExecutivePosition)
.then(() => {
this.fetchItem();

View file

@ -2,8 +2,8 @@
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<div class="bg-primary p-2 text-white flex flex-row gap-2 justify-between items-center">
<p class="grow">{{ position.executivePosition }} von {{ position.start }} bis {{ position.end ?? "heute" }}</p>
<PencilIcon v-if="can('update', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon v-if="can('delete', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
<PencilIcon class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
<div v-if="position.note" class="p-2">
<p v-if="position.note">Notiz: {{ position.note }}</p>
@ -14,10 +14,9 @@
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { MemberExecutivePositionViewModel } from "@/viewmodels/admin/club/member/memberExecutivePosition.models";
import type { MemberExecutivePositionViewModel } from "@/viewmodels/admin/memberExecutivePosition.models";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
@ -28,9 +27,6 @@ export default defineComponent({
default: {},
},
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openEditModal() {

View file

@ -1,26 +1,42 @@
<template>
<RouterLink
:to="{ name: 'admin-club-member-overview', params: { memberId: member.id } }"
class="flex flex-col h-fit w-full border border-primary rounded-md"
>
<div
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<RouterLink
:to="{ name: 'admin-club-member-overview', params: { memberId: member.id } }"
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
>
<p>{{ member.lastname }}, {{ member.firstname }} {{ member.nameaffix ? `- ${member.nameaffix}` : "" }}</p>
</div>
<div v-if="false" class="flex flex-row">
<RouterLink
v-if="can('read', 'club', 'member')"
:to="{ name: 'admin-club-member-overview', params: { memberId: member.id } }"
>
<CircleStackIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</RouterLink>
<RouterLink
v-if="can('update', 'club', 'member')"
:to="{ name: 'admin-club-member-edit', params: { id: member.id } }"
>
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</RouterLink>
<div v-if="can('delete', 'club', 'member')" @click="openDeleteModal">
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
</div>
</RouterLink>
<div class="p-2">
<p v-if="member.internalId">Interne ID: {{ member.internalId }}</p>
<p>beigetreten: {{ member.firstMembershipEntry?.start }}</p>
<p v-if="member.lastMembershipEntry?.end">ausgetreten: {{ member.lastMembershipEntry?.end }}, da {{member.lastMembershipEntry?.terminationReason ?? '- kein Grund angegeben'}}</p>
<p v-if="member.lastMembershipEntry?.end">ausgetreten: {{ member.lastMembershipEntry?.end }}</p>
</div>
</RouterLink>
</div>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import { PencilIcon, TrashIcon, CircleStackIcon } from "@heroicons/vue/24/outline";
import { useAbilityStore } from "@/stores/ability";
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
import { useModalStore } from "@/stores/modal";
import type { MemberViewModel } from "@/viewmodels/admin/member.models";
</script>
<script lang="ts">
@ -31,5 +47,14 @@ export default defineComponent({
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
// this.openModal(
// markRaw(defineAsyncComponent(() => import("@/components/admin/.vue"))),
// this.member.id
// );
},
},
});
</script>

View file

@ -1,63 +0,0 @@
<template>
<div class="w-full h-full flex flex-col gap-2">
<Spinner v-if="status == 'loading'" />
<div class="grow">
<iframe ref="viewer" class="w-full h-full" />
</div>
<div class="flex flex-row gap-2 justify-end">
<a ref="download" button primary class="w-fit!">download</a>
<button primary-outline class="w-fit!" @click="closeModal">schließen</button>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import type { AxiosResponse } from "axios";
import { useMemberStore } from "@/stores/admin/club/member/member";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useMemberStore, ["activeMemberObj"]),
},
mounted() {
this.fetchItem();
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberStore, ["printMemberByActiveId"]),
fetchItem() {
this.status = "loading";
this.printMemberByActiveId()
.then((response) => {
this.status = { status: "success" };
const blob = new Blob([response.data], { type: "application/pdf" });
(this.$refs.viewer as HTMLIFrameElement).src = window.URL.createObjectURL(blob);
const fileURL = window.URL.createObjectURL(new Blob([response.data]));
const fileLink = this.$refs.download as HTMLAnchorElement;
fileLink.href = fileURL;
fileLink.setAttribute(
"download",
`Mitglied-Ausdruck ${this.activeMemberObj?.firstname}_${this.activeMemberObj?.lastname}.pdf`
);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -10,7 +10,7 @@
<ListboxLabel>Qualifikation</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="qualifications.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -106,14 +106,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMembershipStatusStore } from "@/stores/admin/configuration/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/configuration/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/club/member/membership.models";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import { useQualificationStore } from "@/stores/admin/configuration/qualification";
import type { QualificationViewModel } from "@/viewmodels/admin/configuration/qualification.models";
import type { CreateMemberQualificationViewModel } from "@/viewmodels/admin/club/member/memberQualification.models";
import { useMemberQualificationStore } from "@/stores/admin/club/member/memberQualification";
import { useMembershipStatusStore } from "@/stores/admin/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/membership.models";
import { useMembershipStore } from "@/stores/admin/membership";
import { useQualificationStore } from "@/stores/admin/qualification";
import type { QualificationViewModel } from "@/viewmodels/admin/qualification.models";
import type { CreateMemberQualificationViewModel } from "@/viewmodels/admin/memberQualification.models";
import { useMemberQualificationStore } from "@/stores/admin/memberQualification";
</script>
<script lang="ts">
@ -148,7 +148,6 @@ export default defineComponent({
note: formData.note.value,
qualificationId: this.selectedQualification.id,
};
this.status = "loading";
this.createMemberQualification(createMemberQualification)
.then(() => {
this.status = { status: "success" };

View file

@ -41,8 +41,8 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useQualificationStore } from "@/stores/admin/configuration/qualification";
import { useMemberQualificationStore } from "@/stores/admin/club/member/memberQualification";
import { useQualificationStore } from "@/stores/admin/qualification";
import { useMemberQualificationStore } from "@/stores/admin/memberQualification";
</script>
<script lang="ts">
@ -69,7 +69,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMemberQualificationStore, ["deleteMemberQualification"]),
triggerDelete() {
this.status = "loading";
this.deleteMemberQualification(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -12,7 +12,7 @@
<ListboxLabel>Qualifikation</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="qualifications.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -90,9 +90,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
schließen
</button>
<button primary-outline @click="closeModal" :disabled="status != null">schließen</button>
</div>
</div>
</div>
@ -107,14 +105,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useQualificationStore } from "@/stores/admin/configuration/qualification";
import { useQualificationStore } from "@/stores/admin/qualification";
import type {
CreateMemberQualificationViewModel,
MemberQualificationViewModel,
UpdateMemberQualificationViewModel,
} from "@/viewmodels/admin/club/member/memberQualification.models";
import { useMemberQualificationStore } from "@/stores/admin/club/member/memberQualification";
import isEqual from "lodash.isequal";
} from "@/viewmodels/admin/memberQualification.models";
import { useMemberQualificationStore } from "@/stores/admin/memberQualification";
import isEqual from "lodash.isEqual";
import cloneDeep from "lodash.clonedeep";
</script>
@ -177,7 +175,6 @@ export default defineComponent({
terminationReason: formData.terminationReason.value,
qualificationId: this.memberQualification.qualificationId,
};
this.status = "loading";
this.updateMemberQualification(updateMemberQualification)
.then(() => {
this.fetchItem();

View file

@ -4,8 +4,8 @@
<p class="grow">
{{ qualification.qualification }} von {{ qualification.start }} bis {{ qualification.end ?? "heute" }}
</p>
<PencilIcon v-if="can('update', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon v-if="can('delete', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
<PencilIcon class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
<div v-if="qualification.note || qualification.terminationReason" class="p-2">
<p v-if="qualification.note">Notiz: {{ qualification.note }}</p>
@ -17,10 +17,9 @@
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { MemberQualificationViewModel } from "@/viewmodels/admin/club/member/memberQualification.models";
import type { MemberQualificationViewModel } from "@/viewmodels/admin/memberQualification.models";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
@ -31,9 +30,6 @@ export default defineComponent({
default: {},
},
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openEditModal() {

View file

@ -10,7 +10,7 @@
<ListboxLabel>Status</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="membershipStatus.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -63,6 +63,10 @@
</div>
</Listbox>
</div>
<div>
<label for="internalId">Interne ID (optional)</label>
<input type="text" id="internalId" />
</div>
<div>
<label for="start">Startdatum</label>
<input type="date" id="start" required />
@ -94,10 +98,10 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMembershipStatusStore } from "@/stores/admin/configuration/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/configuration/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/club/member/membership.models";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import { useMembershipStatusStore } from "@/stores/admin/membershipStatus";
import type { MembershipStatusViewModel } from "@/viewmodels/admin/membershipStatus.models";
import type { CreateMembershipViewModel } from "@/viewmodels/admin/membership.models";
import { useMembershipStore } from "@/stores/admin/membership";
</script>
<script lang="ts">
@ -128,10 +132,10 @@ export default defineComponent({
if (this.selectedStatus == undefined) return;
let formData = e.target.elements;
let createMember: CreateMembershipViewModel = {
internalId: formData.internalId.value,
start: formData.start.value,
statusId: this.selectedStatus.id,
};
this.status = "loading";
this.createMembership(createMember)
.then(() => {
this.status = { status: "success" };

View file

@ -40,7 +40,7 @@ import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import { useMembershipStore } from "@/stores/admin/membership";
</script>
<script lang="ts">
@ -67,7 +67,6 @@ export default defineComponent({
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useMembershipStore, ["deleteMembership"]),
triggerDelete() {
this.status = "loading";
this.deleteMembership(this.data)
.then(() => {
this.status = { status: "success" };

View file

@ -12,7 +12,7 @@
<ListboxLabel>Status</ListboxLabel>
<div class="relative mt-1">
<ListboxButton
class="rounded-md shadow-xs relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-hidden focus:ring-0 focus:z-10 sm:text-sm resize-none"
class="rounded-md shadow-sm relative block w-full px-3 py-2 border border-gray-300 focus:border-primary placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-0 focus:z-10 sm:text-sm resize-none"
>
<span class="block truncate w-full text-start">
{{
@ -30,7 +30,7 @@
leave-to-class="opacity-0"
>
<ListboxOptions
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm h-32 overflow-y-auto"
class="absolute mt-1 max-h-60 z-20 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm h-32 overflow-y-auto"
>
<ListboxOption v-if="membershipStatus.length == 0" disabled as="template">
<li :class="['relative cursor-default select-none py-2 pl-10 pr-4']">
@ -63,6 +63,10 @@
</div>
</Listbox>
</div>
<div>
<label for="internalId">Interne ID (optional)</label>
<input type="text" id="internalId" v-model="membership.internalId" />
</div>
<div>
<label for="start">Startdatum</label>
<input type="date" id="start" required v-model="membership.start" />
@ -86,9 +90,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
schließen
</button>
<button primary-outline @click="closeModal" :disabled="status != null">schließen</button>
</div>
</div>
</div>
@ -103,14 +105,14 @@ import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { useMembershipStatusStore } from "@/stores/admin/configuration/membershipStatus";
import { useMembershipStatusStore } from "@/stores/admin/membershipStatus";
import type {
CreateMembershipViewModel,
MembershipViewModel,
UpdateMembershipViewModel,
} from "@/viewmodels/admin/club/member/membership.models";
import { useMembershipStore } from "@/stores/admin/club/member/membership";
import isEqual from "lodash.isequal";
} from "@/viewmodels/admin/membership.models";
import { useMembershipStore } from "@/stores/admin/membership";
import isEqual from "lodash.isEqual";
import cloneDeep from "lodash.clonedeep";
</script>
@ -167,12 +169,12 @@ export default defineComponent({
let formData = e.target.elements;
let updateMembership: UpdateMembershipViewModel = {
id: this.membership.id,
internalId: formData.internalId.value,
start: formData.start.value,
end: formData.end.value,
terminationReason: formData.terminationReason.value,
statusId: this.membership.statusId,
};
this.status = "loading";
this.updateMembership(updateMembership)
.then(() => {
this.fetchItem();

View file

@ -5,11 +5,12 @@
{{ membership.start }} bis {{ membership.end ?? "heute" }}:
{{ membership.status }}
</p>
<PencilIcon v-if="can('update', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon v-if="can('delete', 'club', 'member')" class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
<PencilIcon class="w-5 h-5 cursor-pointer" @click="openEditModal" />
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
<div v-if="membership.terminationReason" class="p-2">
<p v-if="membership.terminationReason">Grund: {{ membership.terminationReason }}</p>
<div v-if="membership.terminationReason || membership.internalId" class="p-2">
<p v-if="membership.internalId">Interne ID: {{ membership.internalId }}</p>
<p v-if="membership.terminationReason">beendet, weil: {{ membership.terminationReason }}</p>
</div>
</div>
</template>
@ -17,10 +18,9 @@
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { MembershipViewModel } from "@/viewmodels/admin/club/member/membership.models";
import type { MembershipViewModel } from "@/viewmodels/admin/membership.models";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
@ -31,9 +31,6 @@ export default defineComponent({
default: {},
},
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openEditModal() {

View file

@ -1,79 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter erstellen</p>
</div>
<br />
<form ref="form" class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<label for="title">Titel</label>
<input type="text" id="title" required autocomplete="false" />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useProtocolStore } from "@/stores/admin/club/protocol/protocol";
import type { CreateProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
import { useNewsletterStore } from "../../../../stores/admin/club/newsletter/newsletter";
import type { CreateNewsletterViewModel } from "../../../../viewmodels/admin/club/newsletter/newsletter.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useNewsletterStore, ["createNewsletter"]),
triggerCreate(e: any) {
let formData = e.target.elements;
let createNewsletter: CreateNewsletterViewModel = {
title: formData.title.value,
};
this.status = "loading";
this.createNewsletter(createNewsletter)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
(this.$refs.form as HTMLFormElement).reset();
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,26 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter wird noch synchronisiert</p>
</div>
<br />
<p>Es gibt noch Daten, welche synchronisiert werden müssen.</p>
<p>Dieses PopUp entfernt sich von selbst nach erfolgreicher Synchronisierung.</p>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useProtocolStore } from "@/stores/admin/club/protocol/protocol";
import type { CreateProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
</script>
<script lang="ts">
export default defineComponent({});
</script>

View file

@ -1,29 +0,0 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<RouterLink
:to="{ name: 'admin-club-newsletter-overview', params: { newsletterId: newsletter.id } }"
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
>
<p>{{ newsletter.title }}</p>
<PaperAirplaneIcon v-if="newsletter.isSent" class="w-5 h-5" />
</RouterLink>
<div class="p-2 max-h-48 overflow-y-auto">
<p v-html="newsletter.description"></p>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { NewsletterViewModel } from "@/viewmodels/admin/club/newsletter/newsletter.models";
import { PaperAirplaneIcon } from "@heroicons/vue/24/outline";
</script>
<script lang="ts">
export default defineComponent({
props: {
newsletter: { type: Object as PropType<NewsletterViewModel>, default: {} },
},
});
</script>

View file

@ -1,50 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter Mail-Versand Logs</p>
</div>
<br />
<div class="flex flex-col gap-2 h-96 overflow-y-scroll">
<div
v-for="entry in mailSourceMessages"
class="flex flex-row gap-2 border border-gray-200 rounded-md p-1 items-center"
>
<SuccessCheckmark v-if="entry.factor == 'success'" class="w-5 h-5" />
<InformationCircleIcon v-else-if="entry.factor == 'info'" class="w-5 h-5 min-h-5 min-w-5 text-gray-500" />
<FailureXMark v-else-if="entry.factor == 'failed'" class="w-5 h-5" />
<p>{{ entry.iteration }}/{{ entry.total }}: {{ entry.msg }}</p>
</div>
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">schließen</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import { useNewsletterPrintoutStore } from "@/stores/admin/club/newsletter/newsletterPrintout";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import { InformationCircleIcon } from "@heroicons/vue/24/solid";
import FailureXMark from "@/components/FailureXMark.vue";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {};
},
computed: {
...mapState(useNewsletterPrintoutStore, ["mailSourceMessages"]),
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
},
});
</script>

View file

@ -1,68 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter Mail Empfänger</p>
</div>
<br />
<p v-if="receivers.length == 0">keine Empfänger gefunden</p>
<p v-else>{{ receivers.length }} Empfänger gefunden</p>
<div class="flex flex-col gap-2 h-96 overflow-y-scroll">
<p
v-for="rec in receivers"
:key="rec.id"
class="bg-primary p-2 text-white flex flex-row justify-between items-center rounded-md"
>
{{ rec.lastname }}, {{ rec.firstname }}
</p>
</div>
<div class="flex flex-row gap-4 py-2 w-full">
<button primary @click="start">Versand starten</button>
<button primary-outline @click="closeModal">Versand abbrechen</button>
</div>
</div>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import { useNewsletterPrintoutStore } from "@/stores/admin/club/newsletter/newsletterPrintout";
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
receivers: [] as Array<MemberViewModel>,
error: null as null | string,
};
},
mounted() {
this.fetchNewsletterMailReceivers()
.then((res) => {
this.receivers = res.data;
})
.catch((err) => {
this.error = "Fehler beim Laden der Empfänger";
});
},
methods: {
...mapActions(useNewsletterPrintoutStore, ["fetchNewsletterMailReceivers", "createNewsletterSend"]),
...mapActions(useModalStore, ["openModal", "closeModal"]),
start() {
this.createNewsletterSend();
this.openMailLogs();
},
openMailLogs() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/club/newsletter/NewsletterMailProgressModal.vue"))
)
);
},
},
});
</script>

View file

@ -1,57 +0,0 @@
<template>
<div class="w-full h-full flex flex-col gap-2">
<Spinner v-if="status == 'loading'" />
<div class="grow">
<iframe ref="viewer" class="w-full h-full" />
</div>
<button primary-outline class="w-fit! self-end" @click="closeModal">schließen</button>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import type { AxiosResponse } from "axios";
import { useNewsletterPrintoutStore } from "@/stores/admin/club/newsletter/newsletterPrintout";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
};
},
computed: {
...mapState(useModalStore, ["data"]),
},
mounted() {
this.fetchItem();
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useNewsletterPrintoutStore, ["fetchNewsletterPrintoutPreview", "fetchNewsletterPrintoutById"]),
fetchItem() {
this.status = "loading";
let query: Promise<AxiosResponse<any, any>>;
if (this.data) {
query = this.fetchNewsletterPrintoutById(this.data);
} else {
query = this.fetchNewsletterPrintoutPreview();
}
query
.then((response) => {
this.status = { status: "success" };
const blob = new Blob([response.data], { type: "application/pdf" });
(this.$refs.viewer as HTMLIFrameElement).src = window.URL.createObjectURL(blob);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,50 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter Druck-Prozess Logs</p>
</div>
<br />
<div class="flex flex-col gap-2 h-96 overflow-y-scroll">
<div
v-for="entry in pdfSourceMessages"
class="flex flex-row gap-2 border border-gray-200 rounded-md p-1 items-center"
>
<SuccessCheckmark v-if="entry.factor == 'success'" class="w-5 h-5" />
<InformationCircleIcon v-else-if="entry.factor == 'info'" class="w-5 h-5 min-h-5 min-w-5 text-gray-500" />
<FailureXMark v-else-if="entry.factor == 'failed'" class="w-5 h-5" />
<p>{{ entry.iteration }}/{{ entry.total }}: {{ entry.msg }}</p>
</div>
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">schließen</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import { useNewsletterPrintoutStore } from "@/stores/admin/club/newsletter/newsletterPrintout";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import { InformationCircleIcon } from "@heroicons/vue/24/solid";
import FailureXMark from "@/components/FailureXMark.vue";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {};
},
computed: {
...mapState(useNewsletterPrintoutStore, ["pdfSourceMessages"]),
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
},
});
</script>

View file

@ -1,68 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Newsletter Druck Empfänger</p>
</div>
<br />
<p v-if="receivers.length == 0">keine Empfänger gefunden</p>
<p v-else>{{ receivers.length }} Empfänger gefunden</p>
<div class="flex flex-col gap-2 h-96 overflow-y-scroll">
<p
v-for="rec in receivers"
:key="rec.id"
class="bg-primary p-2 text-white flex flex-row justify-between items-center rounded-md"
>
{{ rec.lastname }}, {{ rec.firstname }}
</p>
</div>
<div class="flex flex-row gap-4 py-2 w-full">
<button primary @click="start">Druck starten</button>
<button primary-outline @click="closeModal">Druck abbrechen</button>
</div>
</div>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import { useNewsletterPrintoutStore } from "@/stores/admin/club/newsletter/newsletterPrintout";
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
receivers: [] as Array<MemberViewModel>,
error: null as null | string,
};
},
mounted() {
this.fetchNewsletterPrintReceivers()
.then((res) => {
this.receivers = res.data;
})
.catch((err) => {
this.error = "Fehler beim Laden der Empfänger";
});
},
methods: {
...mapActions(useNewsletterPrintoutStore, ["fetchNewsletterPrintReceivers", "createNewsletterPrintout"]),
...mapActions(useModalStore, ["openModal", "closeModal"]),
start() {
this.createNewsletterPrintout();
this.openPdfLogs();
},
openPdfLogs() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/club/newsletter/NewsletterPrintingProgressModal.vue"))
)
);
},
},
});
</script>

View file

@ -1,123 +0,0 @@
<template>
<CloudIcon v-if="syncing == 'synced'" class="w-5 h-5" />
<CloudArrowUpIcon
v-else-if="syncing == 'detectedChanges'"
class="w-5 h-5 cursor-pointer animate-bounce"
@click="syncAll"
/>
<ArrowPathIcon v-else-if="syncing == 'syncing'" class="w-5 h-5 animate-spin" />
<ExclamationTriangleIcon
v-else
class="w-5 h-5 animate-[ping_1s_ease-in-out_3] text-red-500 cursor-pointer"
@click="syncAll"
/>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useNewsletterStore } from "@/stores/admin/club/newsletter/newsletter";
import { ArrowPathIcon, CloudArrowUpIcon, CloudIcon, ExclamationTriangleIcon } from "@heroicons/vue/24/outline";
import { useNewsletterDatesStore } from "@/stores/admin/club/newsletter/newsletterDates";
import { useNewsletterRecipientsStore } from "@/stores/admin/club/newsletter/newsletterRecipients";
</script>
<script lang="ts">
export default defineComponent({
props: ["executeSyncAll"],
watch: {
executeSyncAll() {
this.syncAll();
},
syncing() {
this.$emit("syncState", this.syncing);
},
detectedChangeNewsletter() {
clearTimeout(this.newsletterTimer);
this.setNewsletterSyncingState("synced");
if (this.detectedChangeNewsletter == false) {
return;
}
this.setNewsletterSyncingState("detectedChanges");
this.newsletterTimer = setTimeout(() => {
this.synchronizeActiveNewsletter();
}, 10000);
},
detectedChangeNewsletterDates() {
clearTimeout(this.newsletterDatesTimer);
if (this.detectedChangeNewsletterDates == false) {
this.setNewsletterDatesSyncingState("synced");
return;
}
this.setNewsletterDatesSyncingState("detectedChanges");
this.newsletterDatesTimer = setTimeout(() => {
this.synchronizeActiveNewsletterDates();
}, 10000);
},
detectedChangeNewsletterRecipients() {
clearTimeout(this.newsletterRecipientsTimer);
this.setNewsletterRecipientsSyncingState("synced");
if (this.detectedChangeNewsletterRecipients == false) {
return;
}
this.setNewsletterRecipientsSyncingState("detectedChanges");
this.newsletterRecipientsTimer = setTimeout(() => {
this.synchronizeActiveNewsletterRecipients();
}, 10000);
},
},
emits: {
syncState(state: "synced" | "syncing" | "detectedChanges" | "failed") {
return typeof state == "string";
},
},
data() {
return {
newsletterTimer: undefined as undefined | any,
newsletterDatesTimer: undefined as undefined | any,
newsletterRecipientsTimer: undefined as undefined | any,
};
},
mounted() {
this.$emit("syncState", this.syncing);
},
beforeUnmount() {
if (!this.newsletterTimer) clearTimeout(this.newsletterTimer);
if (!this.newsletterDatesTimer) clearTimeout(this.newsletterDatesTimer);
if (!this.newsletterRecipientsTimer) clearTimeout(this.newsletterRecipientsTimer);
},
computed: {
...mapState(useNewsletterStore, ["syncingNewsletter", "detectedChangeNewsletter"]),
...mapState(useNewsletterDatesStore, ["syncingNewsletterDates", "detectedChangeNewsletterDates"]),
...mapState(useNewsletterRecipientsStore, ["syncingNewsletterRecipients", "detectedChangeNewsletterRecipients"]),
syncing(): "synced" | "syncing" | "detectedChanges" | "failed" {
let states = [
this.syncingNewsletter,
this.syncingNewsletterDates,
this.syncingNewsletterRecipients,
];
if (states.includes("failed")) return "failed";
else if (states.includes("syncing")) return "syncing";
else if (states.includes("detectedChanges")) return "detectedChanges";
else return "synced";
},
},
methods: {
...mapActions(useNewsletterStore, ["synchronizeActiveNewsletter", "setNewsletterSyncingState"]),
...mapActions(useNewsletterDatesStore, ["synchronizeActiveNewsletterDates", "setNewsletterDatesSyncingState"]),
...mapActions(useNewsletterRecipientsStore, ["synchronizeActiveNewsletterRecipients", "setNewsletterRecipientsSyncingState"]),
syncAll() {
if (!this.newsletterTimer) clearTimeout(this.newsletterTimer);
if (!this.newsletterDatesTimer) clearTimeout(this.newsletterDatesTimer);
if (!this.newsletterRecipientsTimer) clearTimeout(this.newsletterRecipientsTimer);
this.synchronizeActiveNewsletter();
this.synchronizeActiveNewsletterDates();
this.synchronizeActiveNewsletterRecipients();
},
},
});
</script>

View file

@ -1,82 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Protokoll erstellen</p>
</div>
<br />
<form ref="form" class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<label for="title">Titel</label>
<input type="text" id="title" required autocomplete="false" />
</div>
<div>
<label for="date">Datum</label>
<input type="date" id="date" required />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useProtocolStore } from "@/stores/admin/club/protocol/protocol";
import type { CreateProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useProtocolStore, ["createProtocol"]),
triggerCreate(e: any) {
let formData = e.target.elements;
let createProtocol: CreateProtocolViewModel = {
title: formData.title.value,
date: formData.date.value,
};
this.status = "loading";
this.createProtocol(createProtocol)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
(this.$refs.form as HTMLFormElement).reset();
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,26 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Protokoll wird noch synchronisiert</p>
</div>
<br />
<p>Es gibt noch Daten, welche synchronisiert werden müssen.</p>
<p>Dieses PopUp entfernt sich von selbst nach erfolgreicher Synchronisierung.</p>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useProtocolStore } from "@/stores/admin/club/protocol/protocol";
import type { CreateProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
</script>
<script lang="ts">
export default defineComponent({});
</script>

View file

@ -1,27 +0,0 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<RouterLink
:to="{ name: 'admin-club-protocol-overview', params: { protocolId: protocol.id } }"
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
>
<p>{{ protocol.title }} - {{ protocol.date }}</p>
</RouterLink>
<div class="p-2 max-h-48 overflow-y-auto">
<p v-html="protocol.summary"></p>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import type { ProtocolViewModel } from "@/viewmodels/admin/club/protocol/protocol.models";
</script>
<script lang="ts">
export default defineComponent({
props: {
protocol: { type: Object as PropType<ProtocolViewModel>, default: {} },
},
});
</script>

View file

@ -1,40 +0,0 @@
<template>
<div class="w-full h-full flex flex-col gap-2">
<div class="grow">
<iframe ref="viewer" class="w-full h-full" />
</div>
<button primary-outline class="w-fit! self-end" @click="closeModal">schließen</button>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import { useProtocolPrintoutStore } from "@/stores/admin/club/protocol/protocolPrintout";
</script>
<script lang="ts">
export default defineComponent({
computed: {
...mapState(useModalStore, ["data"]),
},
mounted() {
this.fetchItem();
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useProtocolPrintoutStore, ["fetchProtocolPrintoutById"]),
fetchItem() {
this.fetchProtocolPrintoutById(this.data)
.then((response) => {
const blob = new Blob([response.data], { type: "application/pdf" });
(this.$refs.viewer as HTMLIFrameElement).src = window.URL.createObjectURL(blob);
})
.catch(() => {});
},
},
});
</script>

View file

@ -1,161 +0,0 @@
<template>
<CloudIcon v-if="syncing == 'synced'" class="w-5 h-5" />
<CloudArrowUpIcon
v-else-if="syncing == 'detectedChanges'"
class="w-5 h-5 cursor-pointer animate-bounce"
@click="syncAll"
/>
<ArrowPathIcon v-else-if="syncing == 'syncing'" class="w-5 h-5 animate-spin" />
<ExclamationTriangleIcon
v-else
class="w-5 h-5 animate-[ping_1s_ease-in-out_3] text-red-500 cursor-pointer"
@click="syncAll"
/>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useProtocolStore } from "@/stores/admin/club/protocol/protocol";
import { ArrowPathIcon, CloudArrowUpIcon, CloudIcon, ExclamationTriangleIcon } from "@heroicons/vue/24/outline";
import { useProtocolAgendaStore } from "@/stores/admin/club/protocol/protocolAgenda";
import { useProtocolPresenceStore } from "@/stores/admin/club/protocol/protocolPresence";
import { useProtocolDecisionStore } from "@/stores/admin/club/protocol/protocolDecision";
import { useProtocolVotingStore } from "@/stores/admin/club/protocol/protocolVoting";
</script>
<script lang="ts">
export default defineComponent({
props: ["executeSyncAll"],
watch: {
executeSyncAll() {
this.syncAll();
},
syncing() {
this.$emit("syncState", this.syncing);
},
detectedChangeProtocol() {
clearTimeout(this.protocolTimer);
this.setProtocolSyncingState("synced");
if (this.detectedChangeProtocol == false) {
return;
}
this.setProtocolSyncingState("detectedChanges");
this.protocolTimer = setTimeout(() => {
this.synchronizeActiveProtocol();
}, 10000);
},
detectedChangeProtocolAgenda() {
clearTimeout(this.protocolAgendaTimer);
if (this.detectedChangeProtocolAgenda == false) {
this.setProtocolAgendaSyncingState("synced");
return;
}
this.setProtocolAgendaSyncingState("detectedChanges");
this.protocolAgendaTimer = setTimeout(() => {
this.synchronizeActiveProtocolAgenda();
}, 10000);
},
detectedChangeProtocolPresence() {
clearTimeout(this.protocolPresenceTimer);
this.setProtocolPresenceSyncingState("synced");
if (this.detectedChangeProtocolPresence == false) {
return;
}
this.setProtocolPresenceSyncingState("detectedChanges");
this.protocolPresenceTimer = setTimeout(() => {
this.synchronizeActiveProtocolPresence();
}, 10000);
},
detectedChangeProtocolDecision() {
clearTimeout(this.protocolDecisionTimer);
this.setProtocolDecisionSyncingState("synced");
if (this.detectedChangeProtocolDecision == false) {
return;
}
this.setProtocolDecisionSyncingState("detectedChanges");
this.protocolDecisionTimer = setTimeout(() => {
this.synchronizeActiveProtocolDecision();
}, 10000);
},
detectedChangeProtocolVoting() {
clearTimeout(this.protocolVotingTimer);
this.setProtocolVotingSyncingState("synced");
if (this.detectedChangeProtocolVoting == false) {
return;
}
this.setProtocolVotingSyncingState("detectedChanges");
this.protocolVotingTimer = setTimeout(() => {
this.synchronizeActiveProtocolVoting();
}, 10000);
},
},
emits: {
syncState(state: "synced" | "syncing" | "detectedChanges" | "failed") {
return typeof state == "string";
},
},
data() {
return {
protocolTimer: undefined as undefined | any,
protocolAgendaTimer: undefined as undefined | any,
protocolPresenceTimer: undefined as undefined | any,
protocolDecisionTimer: undefined as undefined | any,
protocolVotingTimer: undefined as undefined | any,
};
},
mounted() {
this.$emit("syncState", this.syncing);
},
beforeUnmount() {
if (!this.protocolTimer) clearTimeout(this.protocolTimer);
if (!this.protocolAgendaTimer) clearTimeout(this.protocolAgendaTimer);
if (!this.protocolPresenceTimer) clearTimeout(this.protocolPresenceTimer);
if (!this.protocolDecisionTimer) clearTimeout(this.protocolDecisionTimer);
if (!this.protocolVotingTimer) clearTimeout(this.protocolVotingTimer);
},
computed: {
...mapState(useProtocolStore, ["syncingProtocol", "detectedChangeProtocol"]),
...mapState(useProtocolAgendaStore, ["syncingProtocolAgenda", "detectedChangeProtocolAgenda"]),
...mapState(useProtocolPresenceStore, ["syncingProtocolPresence", "detectedChangeProtocolPresence"]),
...mapState(useProtocolDecisionStore, ["syncingProtocolDecision", "detectedChangeProtocolDecision"]),
...mapState(useProtocolVotingStore, ["syncingProtocolVoting", "detectedChangeProtocolVoting"]),
syncing(): "synced" | "syncing" | "detectedChanges" | "failed" {
let states = [
this.syncingProtocol,
this.syncingProtocolAgenda,
this.syncingProtocolPresence,
this.syncingProtocolDecision,
this.syncingProtocolVoting,
];
if (states.includes("failed")) return "failed";
else if (states.includes("syncing")) return "syncing";
else if (states.includes("detectedChanges")) return "detectedChanges";
else return "synced";
},
},
methods: {
...mapActions(useProtocolStore, ["synchronizeActiveProtocol", "setProtocolSyncingState"]),
...mapActions(useProtocolAgendaStore, ["synchronizeActiveProtocolAgenda", "setProtocolAgendaSyncingState"]),
...mapActions(useProtocolPresenceStore, ["synchronizeActiveProtocolPresence", "setProtocolPresenceSyncingState"]),
...mapActions(useProtocolDecisionStore, ["synchronizeActiveProtocolDecision", "setProtocolDecisionSyncingState"]),
...mapActions(useProtocolVotingStore, ["synchronizeActiveProtocolVoting", "setProtocolVotingSyncingState"]),
syncAll() {
if (!this.protocolTimer) clearTimeout(this.protocolTimer);
if (!this.protocolAgendaTimer) clearTimeout(this.protocolAgendaTimer);
if (!this.protocolPresenceTimer) clearTimeout(this.protocolPresenceTimer);
if (!this.protocolDecisionTimer) clearTimeout(this.protocolDecisionTimer);
if (!this.protocolVotingTimer) clearTimeout(this.protocolVotingTimer);
this.synchronizeActiveProtocol();
this.synchronizeActiveProtocolAgenda();
this.synchronizeActiveProtocolPresence();
this.synchronizeActiveProtocolDecision();
this.synchronizeActiveProtocolVoting();
},
},
});
</script>

View file

@ -1,58 +0,0 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md overflow-hidden">
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<div class="flex flex-row items-center gap-2">
<div class="rounded-md h-5 w-5" :style="'background-color:' + calendarType.color">
<EyeIcon v-if="calendarType.nscdr" class="w-5 h-5" />
</div>
<p>{{ calendarType.type }}</p>
<small v-if="calendarType.passphrase">(passwortgeschützt)</small>
<small v-if="calendarType.nscdr">(standard-Auslieferung)</small>
</div>
<div class="flex flex-row">
<RouterLink
v-if="can('update', 'configuration', 'calendar_type')"
:to="{ name: 'admin-configuration-calendar_type-edit', params: { id: calendarType.id } }"
>
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</RouterLink>
<div v-if="can('delete', 'configuration', 'calendar_type')" @click="openDeleteModal">
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import { PencilIcon, TrashIcon, EyeIcon } from "@heroicons/vue/24/outline";
import { useAbilityStore } from "@/stores/ability";
import { useModalStore } from "@/stores/modal";
import type { CalendarTypeViewModel } from "@/viewmodels/admin/configuration/calendarType.models";
</script>
<script lang="ts">
export default defineComponent({
props: {
calendarType: { type: Object as PropType<CalendarTypeViewModel>, default: {} },
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(
defineAsyncComponent(
() => import("@/components/admin/configuration/calendarType/DeleteCalendarTypeModal.vue")
)
),
this.calendarType.id
);
},
},
});
</script>

View file

@ -1,93 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Termintyp erstellen</p>
</div>
<br />
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<label for="type">Bezeichnung</label>
<input type="text" id="type" required />
</div>
<div class="flex flex-row items-center gap-2">
<input type="color" id="color" required class="px-1! py-0! w-10!" />
<label for="color">Farbe</label>
</div>
<div class="flex flex-row items-center gap-2">
<input type="checkbox" id="nscdr" v-model="nscdr" />
<label for="nscdr">Standard Kalender Auslieferung (optional)</label>
</div>
<div v-if="!nscdr">
<label for="passphrase">Passphrase (optional)</label>
<input type="text" id="passphrase" />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCalendarTypeStore } from "@/stores/admin/configuration/calendarType";
import type { CreateCalendarTypeViewModel } from "@/viewmodels/admin/configuration/calendarType.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
nscdr: false as boolean,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCalendarTypeStore, ["createCalendarType"]),
triggerCreate(e: any) {
let formData = e.target.elements;
let createCalendarType: CreateCalendarTypeViewModel = {
type: formData.type.value,
color: formData.color.value,
nscdr: formData.nscdr.checked,
passphrase: formData.passphrase?.value,
};
this.status = "loading";
this.createCalendarType(createCalendarType)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,75 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Termintyp {{ calendarType?.type }} löschen?</p>
</div>
<br />
<div class="flex flex-row gap-2">
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDelete">
unwiederuflich löschen
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useCalendarTypeStore } from "@/stores/admin/configuration/calendarType";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useCalendarTypeStore, ["calendarTypes"]),
calendarType() {
return this.calendarTypes.find((r) => r.id == this.data);
},
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useCalendarTypeStore, ["deleteCalendarType"]),
triggerDelete() {
this.status = "loading";
this.deleteCalendarType(this.data)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,105 +0,0 @@
<template>
<form ref="form" class="flex flex-col h-fit w-full border border-primary rounded-md" @submit.prevent="updateUsage">
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<p>Newsletter bei Type "{{ comType.type }}" versenden/exportieren als</p>
<div v-if="can('create', 'configuration', 'newsletter_config')" class="flex flex-row justify-end w-16">
<button v-if="status == null" type="submit" class="p-0! h-fit! w-fit!" title="speichern">
<ArchiveBoxArrowDownIcon class="w-5 h-5 p-1 box-content pointer-events-none" />
</button>
<Spinner v-else-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
<button type="button" class="p-0! h-fit! w-fit!" title="zurücksetzen" @click="resetForm">
<ArchiveBoxXMarkIcon class="w-5 h-5 p-1 box-content pointer-events-none" />
</button>
</div>
</div>
<div class="flex flex-col p-2 gap-2">
<div class="flex flex-row gap-2 items-center">
<select ref="config" id="config" :value="newsletterConfig?.config ?? 'def'">
<option value="def">Standard (pdf nur mit Name)</option>
<option v-for="config in configs" :key="config" :value="config">
{{ config == "pdf" ? "pdf mit Adresse" : config }}
</option>
</select>
</div>
</div>
</form>
</template>
<script setup lang="ts">
import { defineComponent, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import { ArchiveBoxArrowDownIcon, ArchiveBoxXMarkIcon } from "@heroicons/vue/24/outline";
import { useNewsletterConfigStore } from "@/stores/admin/configuration/newsletterConfig";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useModalStore } from "@/stores/modal";
import { NewsletterConfigType } from "@/enums/newsletterConfigType";
import type { AxiosResponse } from "axios";
import type { CommunicationTypeViewModel } from "@/viewmodels/admin/configuration/communicationType.models";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
export default defineComponent({
props: {
comType: { type: Object as PropType<CommunicationTypeViewModel>, default: {} },
},
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
configs: [] as Array<string>,
};
},
computed: {
...mapState(useNewsletterConfigStore, ["config"]),
...mapState(useAbilityStore, ["can"]),
newsletterConfig() {
return this.config.find((c) => c.comTypeId == this.comType.id);
},
},
mounted() {
this.configs = Object.values(NewsletterConfigType);
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["openModal"]),
...mapActions(useNewsletterConfigStore, ["setNewsletterConfig", "deleteNewsletterConfig"]),
updateUsage(e: any) {
const fromData = e.target.elements;
const config = fromData.config.value === "def" ? null : fromData.config.value;
this.status = "loading";
let request: Promise<AxiosResponse<any, any>>;
if (config) {
request = this.setNewsletterConfig({
comTypeId: this.comType.id,
config: config,
});
} else {
request = this.deleteNewsletterConfig(this.comType.id);
}
request
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.status = null;
}, 2000);
})
.catch(() => {
this.status = { status: "failed" };
});
},
resetForm() {
(this.$refs.config as HTMLSelectElement).value = String(this.newsletterConfig?.config ?? "def");
},
},
});
</script>

View file

@ -1,81 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Abfrage abspeichern</p>
</div>
<br />
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<label for="title">Titel</label>
<input type="text" id="title" required />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useQueryStoreStore } from "@/stores/admin/configuration/queryStore";
import type { CreateQueryViewModel } from "@/viewmodels/admin/configuration/query.models";
import { useQueryBuilderStore } from "@/stores/admin/club/queryBuilder";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
computed: {
...mapState(useQueryBuilderStore, ["query"]),
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useQueryStoreStore, ["createQueryStore"]),
triggerCreate(e: any) {
let formData = e.target.elements;
let createAward: CreateQueryViewModel = {
title: formData.title.value,
query: this.query ?? "",
};
this.status = "loading";
this.createQueryStore(createAward)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,75 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Auszeichnung {{ query?.title }} löschen?</p>
</div>
<br />
<div class="flex flex-row gap-2">
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDelete">
unwiederuflich löschen
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useQueryStoreStore } from "@/stores/admin/configuration/queryStore";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useQueryStoreStore, ["queries"]),
query() {
return this.queries.find((t) => t.id == this.data);
},
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useQueryStoreStore, ["deleteQueryStore"]),
triggerDelete() {
this.status = "loading";
this.deleteQueryStore(this.data)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,56 +0,0 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<p>{{ queryItem.title }}</p>
<div class="flex flex-row">
<div @click="loadUpdate">
<EyeIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
<div v-if="can('update', 'configuration', 'query_store')" @click="loadUpdate">
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
<div v-if="can('delete', 'configuration', 'query_store')" @click="openDeleteModal">
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions, mapWritableState } from "pinia";
import { EyeIcon, PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useAbilityStore } from "@/stores/ability";
import { useModalStore } from "@/stores/modal";
import type { QueryViewModel } from "@/viewmodels/admin/configuration/query.models";
import { useQueryBuilderStore } from "@/stores/admin/club/queryBuilder";
</script>
<script lang="ts">
export default defineComponent({
props: {
queryItem: { type: Object as PropType<QueryViewModel>, default: {} },
},
computed: {
...mapState(useAbilityStore, ["can"]),
...mapWritableState(useQueryBuilderStore, ["query", "activeQueryId"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
loadUpdate() {
this.activeQueryId = this.queryItem.id;
this.query = this.queryItem.query;
this.$router.push({ name: "admin-club-query_builder" });
},
openDeleteModal() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/configuration/queryStore/DeleteQueryStoreModal.vue"))
),
this.queryItem.id
);
},
},
});
</script>

View file

@ -1,94 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Abfrage aktualisieren</p>
</div>
<br />
<div class="flex flex-col gap-4 py-2">
<p>Abfrage mit dem Titel: "{{ activeQuery?.title }}" überschreiben</p>
<div class="flex flex-row gap-2">
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="changeToCreate">
neu speichern
</button>
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerUpdate">
überschreiben
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useQueryStoreStore } from "@/stores/admin/configuration/queryStore";
import type { CreateQueryViewModel, UpdateQueryViewModel } from "@/viewmodels/admin/configuration/query.models";
import { useQueryBuilderStore } from "@/stores/admin/club/queryBuilder";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useQueryBuilderStore, ["query"]),
...mapState(useQueryStoreStore, ["queries"]),
activeQuery() {
return this.queries.find((t) => t.id == this.data);
},
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal", "openModal"]),
...mapActions(useQueryStoreStore, ["updateActiveQueryStore"]),
changeToCreate() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/configuration/queryStore/CreateQueryStoreModal.vue"))
)
);
},
triggerUpdate() {
let updateQuery: UpdateQueryViewModel = {
id: this.data,
query: this.query ?? "",
};
this.status = "loading";
this.updateActiveQueryStore(updateQuery)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,76 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Anrede erstellen</p>
</div>
<br />
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreate">
<div>
<label for="salutation">Anrede</label>
<input type="text" id="salutation" required />
</div>
<div class="flex flex-row gap-2">
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
</form>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useSalutationStore } from "@/stores/admin/configuration/salutation";
import type { CreateSalutationViewModel } from "@/viewmodels/admin/configuration/salutation.models";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useSalutationStore, ["createSalutation"]),
triggerCreate(e: any) {
let formData = e.target.elements;
let createSalutation: CreateSalutationViewModel = {
salutation: formData.salutation.value,
};
this.status = "loading";
this.createSalutation(createSalutation)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,76 +0,0 @@
<template>
<div class="w-full md:max-w-md">
<div class="flex flex-col items-center">
<p class="text-xl font-medium">Anrede {{ salutation?.salutation }} löschen?</p>
</div>
<br />
<div class="flex flex-row gap-2">
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDelete">
unwiederuflich löschen
</button>
<Spinner v-if="status == 'loading'" class="my-auto" />
<SuccessCheckmark v-else-if="status?.status == 'success'" />
<FailureXMark v-else-if="status?.status == 'failed'" />
</div>
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
abbrechen
</button>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import { useModalStore } from "@/stores/modal";
import Spinner from "@/components/Spinner.vue";
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
import FailureXMark from "@/components/FailureXMark.vue";
import { useRoleStore } from "@/stores/admin/management/role";
import { useSalutationStore } from "@/stores/admin/configuration/salutation";
</script>
<script lang="ts">
export default defineComponent({
data() {
return {
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
timeout: undefined as any,
};
},
beforeUnmount() {
try {
clearTimeout(this.timeout);
} catch (error) {}
},
computed: {
...mapState(useModalStore, ["data"]),
...mapState(useSalutationStore, ["salutations"]),
salutation() {
return this.salutations.find((r) => r.id == this.data);
},
},
methods: {
...mapActions(useModalStore, ["closeModal"]),
...mapActions(useSalutationStore, ["deleteSalutation"]),
triggerDelete() {
this.status = "loading";
this.deleteSalutation(this.data)
.then(() => {
this.status = { status: "success" };
this.timeout = setTimeout(() => {
this.closeModal();
}, 1500);
})
.catch(() => {
this.status = { status: "failed" };
});
},
},
});
</script>

View file

@ -1,49 +0,0 @@
<template>
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
<p>{{ salutation.salutation }}</p>
<div class="flex flex-row">
<RouterLink
v-if="can('update', 'configuration', 'salutation')"
:to="{ name: 'admin-configuration-salutation-edit', params: { id: salutation.id } }"
>
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</RouterLink>
<div v-if="can('delete', 'configuration', 'salutation')" @click="openDeleteModal">
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
import { mapState, mapActions } from "pinia";
import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { useAbilityStore } from "@/stores/ability";
import { useModalStore } from "@/stores/modal";
import type { SalutationViewModel } from "@/viewmodels/admin/configuration/salutation.models";
</script>
<script lang="ts">
export default defineComponent({
props: {
salutation: { type: Object as PropType<SalutationViewModel>, default: {} },
},
computed: {
...mapState(useAbilityStore, ["can"]),
},
methods: {
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/configuration/salutation/DeleteSalutationModal.vue"))
),
this.salutation.id
);
},
},
});
</script>

Some files were not shown because too many files have changed in this diff Show more