66 Commits

Author SHA1 Message Date
7d379bbe62 popups for selection 2023-07-04 17:54:18 +02:00
f9fb42e90b add iecrasher + work on user facing seat plan ui 2023-07-03 20:22:20 +02:00
e9681e57cf adjust seat plan components for user facing ui 2023-07-03 17:25:03 +02:00
a5aae2c54f user facing seat plan 2023-07-02 15:43:10 +02:00
e57c13341b add right click menu + more features for sp editor 2023-07-02 13:21:59 +02:00
c810f439ba seat plan editor now rejects users if no loc sel 2023-07-01 19:29:39 +02:00
fc030bd56e lots of progress 2023-07-01 15:11:58 +02:00
a06a3ade22 lots of seat plan editor optimisations 2023-07-01 11:42:28 +02:00
5ae2be0541 add notes + cart + get seat count 2023-06-30 20:27:21 +02:00
39eefd6b0c add small message to event analytics page 2023-06-30 18:59:53 +02:00
0f8633ede4 remove obsolete file + start new event details 2023-06-28 20:05:33 +02:00
f1f36b135c finish popup engine, settings module tweak 2023-06-28 17:53:04 +02:00
a22305f814 work on popups 2023-06-27 19:49:27 +02:00
janis
89008df6cc work on popups 2023-06-26 17:04:41 +02:00
c05bd545b4 popups, fixes, location editing 2023-06-25 15:26:46 +02:00
aed1ca4712 optimise dark mode setting saving 2023-06-24 09:39:23 +02:00
2d5308b140 work on purchase view 2023-06-24 09:17:33 +02:00
f97d8ab0ec some styling of event settings 2023-06-23 18:28:54 +02:00
ea547fa6ef fix zoom, notifications, add notes 2023-06-23 17:52:33 +02:00
644891c5af notifications, settings, editor, event view fixes 2023-06-22 19:34:29 +02:00
janis
dee06e4eef add exporting of ticket editor template 2023-06-22 13:45:31 +02:00
8fe3a9a003 make admin panel mobile-compatible 2023-06-21 19:23:46 +02:00
janis
30c1b0fa2e nav hiding for small screens, incomplete 2023-06-21 08:30:55 +02:00
janis
ee4ecd4aa8 do some event details styling 2023-06-19 16:59:05 +02:00
janis
9098e509e8 fix notifications being delayed 2023-06-19 16:16:05 +02:00
b98fc4f37f tweak docs, update ticket editor 2023-06-19 08:44:19 +02:00
e3df40067c add pdfme for ticket template editing, unfinished 2023-06-18 20:55:13 +02:00
2412674cb8 complete notifications handling component 2023-06-18 19:55:14 +02:00
a47bf22050 intermediate save for notifications component 2023-06-18 18:04:50 +02:00
6c3434c05c add save indicator 2023-06-18 13:51:06 +02:00
5ecd2d3f17 standing seatplan component 2023-06-18 12:51:50 +02:00
4bbe9fbec9 setup changes, almost complete seatplan 2023-06-17 20:01:41 +02:00
4729384fc8 update docs website 2023-06-17 16:13:43 +02:00
2d6911b324 fix navbar & path highlighting 2023-06-17 15:04:57 +02:00
1b794e0742 add some compiled html files 2023-06-17 14:12:31 +02:00
00a7aaa08f website build script almost complete 2023-06-17 12:41:17 +02:00
b6fb8ef294 build script + editor + other things 2023-06-16 19:20:44 +02:00
15c33ce2c5 fixes and progress on stages 2023-06-13 17:20:01 +02:00
janis
f56b00c641 work on seatplan 2023-06-13 13:19:08 +02:00
janis
4bb78c3991 fix setup progress 2023-06-12 15:30:59 +02:00
f517786655 improve seatplan editor significantly 2023-06-10 11:39:59 +02:00
62b5b33b88 fix bug in trapezoid seatplan 2023-06-08 09:13:58 +02:00
7140b78786 add coloris.js color picker & work on settings 2023-06-05 14:27:00 +02:00
879c5374ca various fixes 2023-06-03 14:57:17 +02:00
abe181db87 settings & fixes 2023-06-03 12:10:54 +02:00
49d785f2d7 add more documentation & move setting to comp 2023-06-02 17:16:00 +02:00
8fcd65c153 small bugfixes 2023-05-30 20:54:26 +02:00
516dd1b690 new color of logo on website & better about 2023-05-29 19:51:12 +02:00
5cad71ef79 add more badges 2023-05-29 18:43:11 +02:00
Janis Hutz
b1b7ea994b Merge pull request #2 from simplePCBuilding/dev-V1-new
add more code from dev branch
2023-05-29 16:19:05 +00:00
5c88280fd2 move to new logo 2023-05-29 18:18:08 +02:00
Janis Hutz
3da6119955 Merge pull request #1 from simplePCBuilding/dev-V1-new
Merge development version into main branch
2023-05-29 15:58:35 +00:00
e324c52a81 move to new, correct name 2023-05-29 17:56:57 +02:00
b4083c369d add settings toggles 2023-05-29 13:19:24 +02:00
7de7546371 finished seats of seatplan editor 2023-05-29 11:22:40 +02:00
84567f14d4 add origin mod to properties & fix bugs 2023-05-27 10:18:05 +02:00
da48045280 add circular seatplan component 2023-05-23 21:14:43 +02:00
6e527795d5 more features for editor 2023-05-22 08:52:58 +02:00
1f4bbe691f size normalisation of editor 2023-05-20 13:10:14 +02:00
48a5f99293 slowly start updating the name 2023-05-19 07:58:00 +02:00
c2a7a11aaf properties on editor & credits in files 2023-05-14 11:14:00 +02:00
beb837cc8d first code for history for editor 2023-05-12 19:30:06 +02:00
janis
ad5ebf798f add styling & test 2023-05-12 12:46:41 +02:00
a246b89bfa progress on editor for seating plan 2023-05-11 20:58:09 +02:00
19807f729c seatplan prep + lang prep 2023-05-11 18:00:23 +02:00
Janis Hutz
408739caad Create LICENSE 2023-02-26 09:36:53 +00:00
153 changed files with 7902 additions and 510 deletions

View File

@@ -1,5 +1,5 @@
/*
* myevent - .eslintrc.js
* libreevent - .eslintrc.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com

2
.gitignore vendored
View File

@@ -1,5 +1,5 @@
#
# myevent - .gitignore
# libreevent - .gitignore
#
# Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
# https://janishutz.com, development@janishutz.com

674
LICENSE Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 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
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,
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.
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.
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.
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.
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
0. Definitions.
"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.
"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.
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 "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.
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.
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 "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.
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.
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.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
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.
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.
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.
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.
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.
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.
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.
"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).
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.
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
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
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
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.
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).
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.
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.
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.
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.
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'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.
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.
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.
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.
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.
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.
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.
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
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 General Public License for more details.
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 the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
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/licenses/why-not-lgpl.html>.

View File

@@ -1,22 +1,30 @@
<div id="title" align="center">
<img src="./assets/logo.png" width="300">
<h1>myevent</h1>
<h1>libreevent</h1>
</div>
<div id="badges" align="center">
<img src="https://img.shields.io/github/release/simplePCBuilding/myevent.svg">
<img src="https://img.shields.io/github/license/simplePCBuilding/myevent.svg">
<img src="https://img.shields.io/github/repo-size/simplePCBuilding/myevent.svg">
<img src="https://img.shields.io/tokei/lines/github/simplePCBuilding/myevent">
<img src="https://img.shields.io/github/issues-pr-raw/simplePCBuilding/myevent">
<img src="https://img.shields.io/github/languages/top/simplePCBuilding/myevent">
<img src="https://img.shields.io/github/directory-file-count/simplePCBuilding/myevent.svg">
<img src="https://img.shields.io/github/package-json/v/simplePCBuilding/myevent.svg">
<img alt="Project License" src="https://img.shields.io/github/license/simplePCBuilding/libreevent.svg">
<img alt="GitHub Repo size" src="https://img.shields.io/github/repo-size/simplePCBuilding/libreevent.svg">
<img alt="Project code lines count" src="https://img.shields.io/tokei/lines/github/simplePCBuilding/libreevent">
<img alt="GitHub Repo issues" src="https://img.shields.io/github/issues-pr-raw/simplePCBuilding/libreevent">
<img alt="Top Languages" src="https://img.shields.io/github/languages/top/simplePCBuilding/libreevent">
<img alt="GitHub Repo filecount" src="https://img.shields.io/github/directory-file-count/simplePCBuilding/libreevent.svg">
<br>
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/simplePCBuilding/libreevent">
<img alt="GitHub watchers" src="https://img.shields.io/github/watchers/simplePCBuilding/libreevent">
<img alt="GitHub forks" src="https://img.shields.io/github/forks/simplePCBuilding/libreevent">
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/simplePCBuilding/libreevent">
<br>
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/simplePCBuilding/libreevent/total?label=Downloads (total)">
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/downloads/simplePCBuilding/libreevent/latest/total?label=Downloads (latest)">
<img alt="Latest release" src="https://img.shields.io/github/release/simplePCBuilding/libreevent.svg">
<img alt="App Version" src="https://img.shields.io/github/package-json/v/simplePCBuilding/libreevent.svg?label=Development Version">
</div>
A fully featured, fully free and open source event management solution you can host yourself, to manage your event and sell tickets. All you need is a webserver that can run node.js!
Visit our [website](https://myevent.janishutz.com)
Visit our [website](https://libreevent.janishutz.com)
# System requirements
- node.js V16.0+
@@ -26,14 +34,14 @@ Visit our [website](https://myevent.janishutz.com)
- Any operating system that can run node.js
# Download
You may download this project using the GitHub releases page or the direct links on the [myevent website](https://myevent.janishutz.com/download) as this only downloads the ready-to-distribute version, not the development version.
Alternatively, you may download the project directly from GitHub (by cloning it or downloading the code) but you'll have to compile and package the project [manually](https://myevent.janishutz.com/docs/contributing/packaging).
You may download this project using the GitHub releases page or the direct links on the [libreevent website](https://libreevent.janishutz.com/download) as this only downloads the ready-to-distribute version, not the development version.
Alternatively, you may download the project directly from GitHub (by cloning it or downloading the code) but you'll have to compile and package the project [manually](https://libreevent.janishutz.com/docs/contributing/packaging).
# Contributing
If you want to contribute to this project, please read more [here](https://myevent.janishutz.com/docs/contributing). Until the end of October 2023, no contributions can be accepted into master.
If you want to contribute to this project, please read more [here](https://libreevent.janishutz.com/docs/contributing). Until the end of October 2023, no contributions can be accepted into master.
# Supporting the project
If you like this project and it helped you save money, please consider donating to help fund the continuous development. If you are a company, please contact me [here](https://myevent.janishutz.com/docs/sponsoring) if you want to sponsor the project and become an official partner.
If you like this project and it helped you save money, please consider donating to help fund the continuous development. If you are a company, please contact me [here](https://libreevent.janishutz.com/docs/sponsoring) if you want to sponsor the project and become an official partner.
# Repository structure
- [assets/](/assets/): contains the logo (as png and GIMP file), also iOS and Android marketing materials, just global assets (images / videos)
@@ -52,7 +60,7 @@ You may notice some additional folders appearing after running
```
npm run package
```
This is to shrink the repository size. Distribution ready files can be found in the releases or on our [website](https://myevent.janishutz.com/download).
This is to shrink the repository size. Distribution ready files can be found in the releases or on our [website](https://libreevent.janishutz.com/download).
## This project is currently NOT ready to be used!
Development of this project is currently ongoing and no stable version is available yet.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

View File

@@ -0,0 +1,8 @@
/*
* libreevent - package.js
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/

View File

@@ -1,5 +1,5 @@
{
"name": "myevent",
"name": "libreevent",
"version": "1.0.0",
"description": "A free and open source event management solution",
"main": "/dist/app.js",
@@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/simplePCBuilding/myevent.git"
"url": "git+https://github.com/simplePCBuilding/libreevent.git"
},
"keywords": [
"eventmanager",
@@ -18,7 +18,7 @@
"author": "Janis Hutz",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/simplePCBuilding/myevent/issues"
"url": "https://github.com/simplePCBuilding/libreevent/issues"
},
"homepage": "https://myevent.janishutz.com"
"homepage": "https://libreevent.janishutz.com"
}

View File

@@ -1,5 +1,5 @@
/*
* myevent - pwdmanager.js
* libreevent - pwdmanager.js
*
* Created by Janis Hutz 03/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com

View File

@@ -1,5 +1,5 @@
/*
* myevent - routes.js (admin)
* libreevent - routes.js (admin)
*
* Created by Janis Hutz 03/11/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com

View File

@@ -1,5 +1,5 @@
/*
* myevent - app.js
* libreevent - app.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com

View File

@@ -1,5 +1,5 @@
/*
* myevent - db.js
* libreevent - db.js
*
* Created by Janis Hutz 03/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com

View File

@@ -1,11 +1,11 @@
{
"name": "myevent",
"name": "libreevent",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "myevent",
"name": "libreevent",
"version": "1.0.0",
"license": "GPL-3.0-or-later",
"dependencies": {

View File

@@ -1,5 +1,5 @@
{
"name": "myevent",
"name": "libreevent",
"version": "1.0.0",
"description": "Free & Open source event management solution",
"main": "app.js",
@@ -54,7 +54,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/simplePCBuilding/myevent.git"
"url": "git+https://github.com/simplePCBuilding/libreevent.git"
},
"keywords": [
"event",
@@ -64,7 +64,7 @@
"author": "Janis Hutz",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/simplePCBuilding/myevent/issues"
"url": "https://github.com/simplePCBuilding/libreevent/issues"
},
"homepage": "https://myevent.janishutz.com"
"homepage": "https://libreevent.janishutz.com"
}

View File

@@ -1,4 +1,4 @@
# myevent
# libreevent
## Project setup
```

14
src/webapp/notes.md Normal file
View File

@@ -0,0 +1,14 @@
# Account view:
- set page title based on settings
- make pricing groups changeable in UI (event categories)
- Fix text field overflow (text too big for box)
- Other optimisation for seat plan editor
- Implement Permission system
- add webpack to project website to decrease file size

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{
"name": "myevent",
"name": "libreevent",
"version": "0.1.0",
"private": true,
"scripts": {
@@ -7,10 +7,13 @@
"build": "vue-cli-service build"
},
"dependencies": {
"@pdfme/generator": "^1.2.3",
"@pdfme/ui": "^1.2.3",
"core-js": "^3.8.3",
"pinia": "^2.0.34",
"vue": "^3.2.13",
"vue-router": "^4.0.3"
"vue-router": "^4.0.3",
"vue3-draggable-resizable": "^1.6.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0",

1
src/webapp/public/coloris.min.css vendored Normal file

File diff suppressed because one or more lines are too long

6
src/webapp/public/coloris.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
<html><head>
<style type="text/css">
#a {
margin:0 10px 10px;
}
#b {
width:100%;
}
</style>
<title>IE Crasher</title>
</head>
<body>
<table><tr><td>
<div id="a">
<form id="b">
<input type="text" name="test"/>
</div>
</td><td width="1"></td></tr></table>
</body></html>

View File

@@ -5,12 +5,15 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
<script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<link rel="stylesheet" href="/coloris.min.css">
<script defer src="/coloris.min.js"></script>
</head>
<body>

View File

@@ -1,9 +1,18 @@
<!--
* libreevent - App.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<nav>
<router-link to="/">Home</router-link> |
<router-link to="/tickets">Tickets</router-link> |
<router-link to="/cart">Cart</router-link> |
<router-link to="/login">Account</router-link> |
<router-link to="/account">Account</router-link> |
<button @click="changeTheme();" v-html="theme" id="themeSelector"></button>
</nav>
<router-view v-slot="{ Component, route }">
@@ -14,52 +23,60 @@
</template>
<style>
:root, :root.light {
:root, :root.light {
--primary-color: #2c3e50;
--accent-background: rgb(30, 30, 82);
--secondary-color: white;
--background-color: white;
--popup-color: rgb(224, 224, 224);
--accent-color: #42b983;
--hover-color: rgb(165, 165, 165);
--accent-background-hover: #4380a8;
--overlay-color: rgba(37, 37, 37, 0.575);
--accent-background-hover: rgb(124, 140, 236);
--overlay-color: rgba(0, 0, 0, 0.7);
--inactive-color: rgb(100, 100, 100);
--highlight-backdrop: rgb(143, 134, 192);
}
--hint-color: rgb(174, 210, 221);
--PI: 3.14159265358979;
}
:root.dark {
:root.dark {
--primary-color: white;
--accent-background: rgb(100, 100, 190);
--secondary-color: black;
--accent-background: rgb(56, 56, 112);
--secondary-color: white;
--background-color: rgb(32, 32, 32);
--popup-color: rgb(58, 58, 58);
--accent-color: #42b983;
--hover-color: rgb(83, 83, 83);
--accent-background-hover: #4380a8;
--overlay-color: rgba(104, 104, 104, 0.575);
--inactive-color: rgb(190, 190, 190);
--highlight-backdrop: rgb(85, 63, 207);
}
--hint-color: rgb(88, 91, 110);
}
@media ( prefers-color-scheme: dark ) {
@media ( prefers-color-scheme: dark ) {
:root {
--primary-color: white;
--accent-background: rgb(100, 100, 190);
--secondary-color: black;
--accent-background: rgb(56, 56, 112);
--secondary-color: white;
--background-color: rgb(32, 32, 32);
--popup-color: rgb(58, 58, 58);
--accent-color: #42b983;
--hover-color: rgb(83, 83, 83);
--accent-background-hover: #4380a8;
--overlay-color: rgba(104, 104, 104, 0.575);
--inactive-color: rgb(190, 190, 190);
--highlight-backdrop: rgb(85, 63, 207);
--hint-color: rgb(88, 91, 110);
}
}
}
::selection {
::selection {
background-color: var( --highlight-backdrop );
}
color: var( --secondary-color );
}
#themeSelector {
#themeSelector {
background-color: rgba( 0, 0, 0, 0 );
color: var( --primary-color );
font-size: 130%;
@@ -67,17 +84,17 @@
margin: 0;
border: none;
cursor: pointer;
}
}
html,
body {
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
}
#app {
#app {
transition: 0.5s;
background-color: var( --background-color );
font-family: Avenir, Helvetica, Arial, sans-serif;
@@ -88,49 +105,53 @@ body {
height: 100%;
display: flex;
flex-direction: column;
}
}
nav {
nav {
padding: 30px;
}
}
nav a {
nav a {
font-weight: bold;
color: var( --primary-color );
}
}
nav a.router-link-exact-active {
nav a.router-link-exact-active {
color: #42b983;
}
}
.scale-enter-active,
.scale-leave-active {
.scale-enter-active,
.scale-leave-active {
transition: all 0.5s ease;
}
}
.scale-enter-from,
.scale-leave-to {
.scale-enter-from,
.scale-leave-to {
opacity: 0;
transform: scale(0.9);
}
}
.fade-enter-active,
.fade-leave-active {
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.4s ease;
}
}
.fade-enter-from,
.fade-leave-to {
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
}
.material-symbols-outlined {
.material-symbols-outlined {
font-variation-settings:
'FILL' 0,
'wght' 400,
'GRAD' 0,
'opsz' 48
}
}
.clr-open {
border: black solid 1px !important;
}
</style>
<script>
@@ -146,18 +167,18 @@ export default {
if ( this.theme === '&#9788;' ) {
document.documentElement.classList.remove( 'dark' );
document.documentElement.classList.add( 'light' );
sessionStorage.setItem( 'theme', '&#9789;' );
localStorage.setItem( 'theme', '&#9789;' );
this.theme = '&#9789;';
} else if ( this.theme === '&#9789;' ) {
document.documentElement.classList.remove( 'light' );
document.documentElement.classList.add( 'dark' );
sessionStorage.setItem( 'theme', '&#9788;' );
localStorage.setItem( 'theme', '&#9788;' );
this.theme = '&#9788;';
}
}
},
created () {
this.theme = sessionStorage.getItem( 'theme' ) ? sessionStorage.getItem( 'theme' ) : '';
this.theme = localStorage.getItem( 'theme' ) ? localStorage.getItem( 'theme' ) : '';
if ( window.matchMedia( '(prefers-color-scheme: dark)' ).matches || this.theme === '&#9788;' ) {
document.documentElement.classList.add( 'dark' );
this.theme = '&#9788;';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -2,8 +2,8 @@
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<div>
<h1>Welcome to myevent!</h1>
<p>Let's start the setup by entering the setup key below! You may define a setup key in the config file of myevent. See <a href="https://myevent.janishutz.com/docs/setup/setup" target="_blank">here</a> for more instructions</p>
<h1>Welcome to libreǝvent!</h1>
<p>Let's start the setup by entering the setup key below! You may define a setup key in the config file of libreevent. See <a href="https://libreevent.janishutz.com/docs/setup/setup" target="_blank">here</a> for more instructions</p>
<form>
<label for="key">Your setup key</label><br>
<input type="text" v-model="formData[ 'key' ]" required name="key" id="key">

View File

@@ -17,23 +17,16 @@
<h3>Total: {{ eventInfo[ 'currency' ] }} {{ total }}</h3>
<router-link to="/cart">To cart</router-link>
</div>
<div class="seatingPlan">
<div class="noseatplan">
<h3>Available tickets</h3>
<div class="wrapper">
<div v-for="ticket in tickets">
{{ ticket.name }} ({{ eventInfo[ 'categories' ][ ticket.category ][ 'name' ] }}) - {{ eventInfo.currency }} {{ eventInfo.categories[ ticket.category ][ 'price' ][ '1' ] }} <span class="material-symbols-outlined">add</span> Selected <span class="material-symbols-outlined">remove</span>
{{ eventInfo[ 'categories' ][ ticket.category ][ 'name' ] }}<br>
<div v-for="ticketOption in eventInfo[ 'ageGroups' ]" class="ticket">
<div>
{{ ticketOption.name }} <div style="display: inline" v-if="ticketOption.age">({{ ticketOption.age }})</div> {{ eventInfo.currency }} {{ eventInfo[ 'categories' ][ ticket.category ][ 'price' ][ ticketOption.id ] }} <span class="material-symbols-outlined">add</span> Selected <span class="material-symbols-outlined">remove</span>
</div>
</div>
<div class="overlay" id="placeNotAvailable">
<div class="popup">
<div class="popup-content">
<div class="close-container">
<span class="material-symbols-outlined close-button" @click="closePlaceNotAvailablePopup()">close</span>
</div>
<div class="popup-content-wrapper">
<h3>One or more seat(s) you have previously selected is/are no longer available!</h3>
<p>Please select another one!</p>
<button class="button" @click="closePlaceNotAvailablePopup()">Ok</button>
</div>
</div>
</div>
</div>
@@ -49,7 +42,7 @@ export default {
data () {
return {
tickets: { 'ticket1': { 'name': 'Ticket 1', 'id': 'ticket1', 'category': 1 }, 'ticket2': { 'name': 'Ticket 2', 'id': 'ticket2', 'category': 2 } },
eventInfo: { 'name': 'TestEvent', 'location': 'TestLocation', 'date': 'TestDate', 'RoomName': 'TestRoom', 'currency': 'CHF', 'categories': { '1': { 'price': { '1':25, '2':35 }, 'bg': 'black', 'fg': 'white', 'name': 'Category 1' }, '2': { 'price': { '1':15, '2':20 }, 'bg': 'green', 'fg': 'white', 'name': 'Category 2' } }, 'ageGroups': { '1':{ 'id': 1, 'name':'Child', 'age':'0 - 15.99' }, '2':{ 'id': 2, 'name': 'Adult', 'age': null } }, 'ageGroupCount':2, 'stage': true },
eventInfo: { 'name': 'TestEvent', 'location': 'TestLocation', 'date': 'TestDate', 'RoomName': 'TestRoom', 'currency': 'CHF', 'categories': { '1': { 'price': { '1':25, '2':35 }, 'bg': 'black', 'fg': 'white', 'name': 'Category 1' }, '2': { 'price': { '1':15, '2':20 }, 'bg': 'green', 'fg': 'white', 'name': 'Category 2' } }, 'ageGroups': { '1':{ 'id': 1, 'name':'Child', 'age':'0 - 15.99 years' }, '2':{ 'id': 2, 'name': 'Adult', 'age': null } }, 'ageGroupCount':2, 'stage': true },
selectedSeats: {},
pricingCurrentlySelected: {},
total: 0,
@@ -79,10 +72,7 @@ export default {
}
if ( showError ) {
setTimeout( function () {
$( '#placeNotAvailable' ).show( 200 );
console.log( 'showing error message' );
}, 500 );
// TODO: Show popup that no more tickets in a category are available
}
@@ -126,9 +116,6 @@ export default {
sessionStorage.setItem( 'cart', JSON.stringify( cart ) );
}
},
closePlaceNotAvailablePopup () {
$( '#placeNotAvailable' ).hide( 300 );
},
selectSeat( placeID, rowID ) {
/*
This function allows the user to select a seat and deselect it, if it has previously
@@ -228,7 +215,7 @@ export default {
overflow: scroll;
}
.seatingPlan {
.noseatplan {
grid-area: main;
display: flex;
flex-direction: column;
@@ -237,13 +224,21 @@ export default {
overflow: scroll;
}
.active {
cursor: pointer;
.wrapper {
width: 30%;
display: flex;
flex-direction: column;
align-items: justify;
justify-content: justify;
text-align: justify;
}
.occupied {
background-color: var( --hover-color );
padding: 0.4%;
.ticket {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.overlay {
@@ -299,28 +294,6 @@ export default {
margin-top: 3vh;
}
.option {
list-style: none;
padding: 7px 15px;
border-radius: 10px;
border-color: var( --primary-color );
border-style: solid;
border-width: 1px;
margin: 3px 0px;
cursor: pointer;
}
.stage {
border-color: var( --primary-color );
border-style: solid;
width: 80%;
height: 7%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.button {
background-color: var( --accent-background );
color: var( --secondary-color );

View File

@@ -0,0 +1,208 @@
<template>
<div id="notifications" @click="handleNotifications();">
<div class="message-box" :class="location">
<div class="message-container" :class="messageType">
<span class="material-symbols-outlined types hide" v-if="messageType == 'hide'">question_mark</span>
<span class="material-symbols-outlined types" v-else-if="messageType == 'ok'" style="background-color: green;">done</span>
<span class="material-symbols-outlined types" v-else-if="messageType == 'error'" style="background-color: red;">close</span>
<span class="material-symbols-outlined types progress-spinner" v-else-if="messageType == 'progress'" style="background-color: blue;">progress_activity</span>
<span class="material-symbols-outlined types" v-else-if="messageType == 'info'" style="background-color: lightblue;">info</span>
<span class="material-symbols-outlined types" v-else-if="messageType == 'warning'" style="background-color: orangered;">warning</span>
<p class="message">{{ message }}</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'notifications',
props: {
location: {
type: String,
'default': 'topleft',
}
},
data () {
return {
notifications: {},
queue: [],
message: '',
messageType: 'hide',
notificationDisplayTime: 0,
notificationPriority: 'normal',
currentlyDisplayedNotificationID: 0,
currentID: { 'critical': 0, 'medium': 1000, 'low': 100000 },
displayTimeCurrentNotification: 0,
notificationScheduler: null,
}
},
methods: {
createNotification( message, showDuration, messageType, priority ) {
/*
Takes a notification options array that contains: message, showDuration (in seconds), messageType (ok, error, progress, info) and priority (low, normal, critical).
Returns a notification ID which can be used to cancel the notification. The component will throttle notifications and display
one at a time and prioritize messages with higher priority. Use vue refs to access these methods.
*/
let id = 0;
if ( priority === 'critical' ) {
this.currentID[ 'critical' ] += 1;
id = this.currentID[ 'critical' ];
} else if ( priority === 'normal' ) {
this.currentID[ 'medium' ] += 1;
id = this.currentID[ 'medium' ];
} else if ( priority === 'low' ) {
this.currentID[ 'low' ] += 1;
id = this.currentID[ 'low' ];
}
this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority, 'id': id };
this.queue.push( id );
console.log( 'scheduled notification: ' + id + ' (' + message + ')' );
if ( this.displayTimeCurrentNotification >= this.notificationDisplayTime ) {
this.handleNotifications();
}
return id;
},
cancelNotification ( id ) {
/*
This method deletes a notification and, in case the notification is being displayed, hides it.
*/
try {
delete notifications[ id ];
delete this.queue[ this.queue.findIndex( id ) ];
} catch ( error ) {
console.log( 'notification to be deleted is nonexistent or currently being displayed' );
}
if ( this.currentlyDisplayedNotificationID == id ) {
this.handleNotifications();
}
},
handleNotifications () {
/*
This methods should NOT be called in any other component than this one!
*/
this.displayTimeCurrentNotification = 0;
this.notificationDisplayTime = 0;
this.message = '';
this.queue.sort();
if ( this.queue.length > 0 ) {
this.message = this.notifications[ this.queue[ 0 ] ][ 'message' ];
this.messageType = this.notifications[ this.queue[ 0 ] ][ 'messageType' ];
this.priority = this.notifications[ this.queue[ 0 ] ][ 'priority' ];
this.currentlyDisplayedNotificationID = this.notifications[ this.queue[ 0 ] ][ 'id' ];
this.notificationDisplayTime = this.notifications[ this.queue[ 0 ] ][ 'showDuration' ];
this.queue.reverse();
this.queue.pop();
} else {
this.messageType = 'hide';
}
}
},
created () {
this.notificationScheduler = setInterval( () => {
if ( this.displayTimeCurrentNotification >= this.notificationDisplayTime ) {
this.handleNotifications();
} else {
this.displayTimeCurrentNotification += 0.5;
}
}, 500 );
},
unmounted ( ) {
clearInterval( this.notificationScheduler );
}
}
</script>
<style scoped>
.message-box {
position: fixed;
z-index: 10;
color: white;
height: 10vh;
width: 15vw;
transition: all 0.5s;
}
.topleft {
top: 3vh;
left: 0.5vw;
}
.topright {
top: 3vh;
right: 0.5vw;
}
.bottomright {
bottom: 3vh;
right: 0.5vw;
}
.bottomleft {
top: 3vh;
right: 0.5vw;
}
.message-container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
opacity: 1;
transition: all 0.5s;
cursor: default;
}
.types {
color: white;
border-radius: 100%;
margin-right: auto;
margin-left: 5%;
padding: 1.5%;
font-size: 200%;
}
.message {
margin-right: 5%;
text-align: end;
}
.ok {
background-color: rgb(1, 71, 1);
}
.error {
background-color: rgb(114, 1, 1);
}
.info {
background-color: rgb(44, 112, 151);
}
.warning {
background-color: orange;
}
.hide {
opacity: 0;
}
.progress {
background-color: rgb(0, 0, 99);
}
.progress-spinner {
animation: spin 2s infinite linear;
}
@keyframes spin {
from {
transform: rotate( 0deg );
}
to {
transform: rotate( 720deg );
}
}
</style>

View File

@@ -0,0 +1,180 @@
<template>
<div id="popup-backdrop">
<div class="popup-container">
<div class="popup" :class="size">
<div class="close-wrapper"><span class="material-symbols-outlined close-button" @click="closePopup( 'cancel' );" title="Close this popup">close</span></div>
<div class="message-container">
<div v-if="contentType === 'string'" class="options">
<h3>{{ data.message }}</h3>
<div style="width: 100%; margin-top: 3%;">
<button @click="closePopup( 'ok' )" title="Close popup">Ok</button>
</div>
</div>
<div v-else-if="contentType === 'html'" v-html="data.message" class="options"></div>
<div v-else-if="contentType === 'settings'" class="options">
<h3>{{ data.message }}</h3>
<settings v-model:settings="data.options"></settings>
<div style="width: 100%; margin-top: 3%;">
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
</div>
</div>
<div v-else-if="contentType === 'confirm'" class="confirm options">
<h3>{{ data.message }}</h3>
<div style="width: 100%; margin-top: 3%;">
<button @click="closePopup( 'ok' )" title="Confirm operation">Ok</button>
<button @click="closePopup( 'cancel' )" title="Cancel operation">Cancel</button>
</div>
</div>
<div v-else-if="contentType === 'dropdown'" class="options">
<h3>{{ data.message }}</h3>
<select id="select" v-model="data.selected">
<option v-for="selectOption in data.options" :value="selectOption.value">{{ selectOption.displayName }}</option>
</select>
<div style="width: 100%; margin-top: 3%;">
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<!-- Options to be passed in: html, settings (for settings component), strings, confirm, dropdowns, selection -->
<script>
import settings from '@/components/settings/settings.vue';
export default {
name: 'popups',
components: {
settings,
},
props: {
size: {
type: String,
'default': 'normal',
},
},
data () {
return {
contentType: 'dropdown',
data: {}
}
},
methods: {
closePopup( message ) {
$( '#popup-backdrop' ).fadeOut( 300 );
if ( message ) {
this.$emit( 'status', message );
this.$emit( 'data', this.data );
}
},
openPopup ( message, options, dataType, selected ) {
let data = { 'message': message ? message : 'No message defined on method call!!', 'options': options ? options : { '1': { 'value': 'undefined', 'displayName': 'No options specified in call' } }, 'selected': selected ? selected : '' };
this.data = data;
this.contentType = dataType ? dataType : 'string';
$( '#popup-backdrop' ).fadeIn( 300 );
}
},
}
</script>
<style scoped>
#popup-backdrop {
position: fixed;
top: 0;
left: 0;
z-index: 10;
width: 100vw;
height: 100vh;
background-color: var( --overlay-color );
display: none;
}
.popup-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.close-wrapper {
width: 100%;
height: 5%;
display: flex;
justify-content: center;
align-items: flex-end;
flex-direction: column;
}
.close-button {
margin-right: 1vw;
margin-top: 2vw;
font-size: 200%;
cursor: pointer;
}
.popup {
border: none;
border-radius: 20px;
background-color: var( --popup-color );
}
.small {
width: 40%;
height: 40%;
}
.normal {
width: 50%;
height: 50%;
}
.big {
width: 60%;
height: 60%;
}
.bigger {
width: 70%;
height: 70%;
}
.huge {
width: 80%;
height: 80%;
}
.message-container {
height: 90%;
width: 90%;
margin-left: 5%;
overflow: scroll;
}
.options {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
overflow: visible;
min-height: 100%;
width: 100%;
}
.options button {
padding: 1% 2%;
display: inline-block;
background-color: var( --accent-background );
color: var( --secondary-color );
cursor: pointer;
}
.options button:hover {
background-color: var( --accent-background-hover );
}
</style>

View File

@@ -0,0 +1,337 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="properties">
<h2>Properties</h2>
<h3>General settings</h3>
<table>
<tr>
<td>Zoom Factor:</td>
<td>
{{ Math.round( zoomFactor * 1000 ) / 1000 }}x
</td>
</tr>
<tr>
<td>Row naming scheme</td>
<td>
<select v-model="generalSettings[ 'namingScheme' ]">
<option value="numeric">Numeric</option>
<option value="alphabetic">Alphabetic</option>
<option value="roman">Roman numerals</option>
</select>
</td>
</tr>
</table>
<h3>Component settings</h3>
<table v-if="active">
<!-- H/W/Y/X for rendering -->
<tr>
<td>Position X:</td>
<td>
<input type="number" min="20" v-model="internal[ active ].x" @change="resubmit()">
</td>
</tr>
<tr>
<td>Position Y:</td>
<td>
<input type="number" min="20" v-model="internal[ active ].y" @change="resubmit()">
</td>
</tr>
<tr>
<td>Width:</td>
<td>
<input type="number" min="20" v-model="internal[ active ].w" @change="resubmit()">
</td>
</tr>
<tr>
<td>Height:</td>
<td>
<input type="number" min="20" v-model="internal[ active ].h" @change="resubmit()">
</td>
</tr>
<!-- Starting row for row counting and rendering -->
<tr v-if="internal[ active ].type == 'seat'">
<td>Starting row:</td>
<td>
<input type="number" min="1" max="20" v-model="internal[ active ].startingRow" @change="resubmit()">
</td>
</tr>
<!-- ORIGIN of component for rendering -->
<tr>
<td>Origin:</td>
<td>
<input type="number" min="1" max="4" v-model="internal[ active ].origin" @change="resubmit()">
</td>
</tr>
<!-- TEXT Settings -->
<tr v-if="internal[ active ].type == 'text'">
<td>Text:</td>
<td>
<input type="text" v-model="internal[ active ].text.text" @change="resubmit()">
</td>
</tr>
<tr v-if="internal[ active ].type == 'text'">
<td>Text Size:</td>
<td>
<input type="number" min="1" max="100" v-model="internal[ active ].text.textSize" @change="resubmit()">
</td>
</tr>
<tr v-if="internal[ active ].type == 'text'">
<td>Text colour:</td>
<td>
<input type="text" data-coloris v-model="internal[ active ].text.colour" onkeydown="return false;">
</td>
</tr>
<!-- CATEGORY -->
<tr v-if="internal[ active ].type == 'seat' || internal[ active ].type == 'stand'">
<td>Category:</td>
<td>
<select v-model="internal[ active ].seatCountingStartingPoint" @change="resubmit()">
<option v-for="category in categories" :value="category.value">{{ category.name }}</option>
</select>
</td>
</tr>
<!-- SECTOR -->
<tr v-if="internal[ active ].type == 'seat' || internal[ active ].type == 'stand'">
<td>Sector:</td>
<td>
<input type="text" min="1" max="4" v-model="internal[ active ].sector" @change="resubmit()">
</td>
</tr>
<!-- TICKET COUNT -->
<tr v-if="internal[ active ].type == 'stand'">
<td>Ticket count:</td>
<td>
<input type="number" min="1" max="4" v-model="internal[ active ].ticketCount" @change="resubmit()">
</td>
</tr>
<!-- SEAT NUMBERING for seats -->
<tr v-if="internal[ active ].type == 'seat'">
<td>Component number:
<div class="info-container" @mouseenter="showInfo( 'componentNumber' )" @mouseleave="hideInfo( 'componentNumber' )">
<span class="material-symbols-outlined info-icon">info</span>
<div class="info-box" id="componentNumber">
<div class="info-box-container">
<div>
With this you can change what the order of the components is which is used to determine the seat numbering. Read more <a href="https://libreevent.janishutz.com/docs/admin-panel/seatplan-editor#component-number-property">here</a>
</div>
</div>
</div>
</div>
</td>
<td>
<input type="number" min="1" max="4" v-model="internal[ active ].seatNumberingPosition" @change="resubmit()">
</td>
</tr>
<!-- SEAT NUMBERING direction -->
<tr v-if="internal[ active ].type == 'seat'">
<td>Numbering direction:</td>
<td>
<select min="20" v-model="internal[ active ].numberingDirection" @change="resubmit()">
<option value="left">Left to right</option>
<option value="right">Right to left</option>
</select>
</td>
</tr>
<!-- Component type selector -->
<tr>
<td>Type:</td>
<td>
<select min="20" v-model="internal[ active ].type" @change="resubmit()">
<option value="seat">Seat</option>
<option value="stand">Stand</option>
<option value="stage">Stage</option>
<option value="text">Text</option>
</select>
</td>
</tr>
<!-- SHAPE of component if not a text element -->
<tr v-if="internal[ active ].type != 'text'">
<td>Shape:</td>
<td>
<select min="20" v-model="internal[ active ].shape" @change="resubmit()">
<option value="rectangular">Rectangular</option>
<option value="trapezoid">Trapezoid</option>
<option value="circular">Circular</option>
</select>
</td>
</tr>
</table>
<div v-else class="no-select">
<b>No component selected</b><br>
Please select one to view details here.
</div>
</div>
</template>
<script>
export default {
name: 'propertiesSeatplan',
props: {
draggables: {
type: Object,
"default": {}
},
scaleFactor: {
type: Number,
"default": 1,
},
generalSettings: {
type: Object,
"default": {},
},
zoomFactor: {
type: Number,
"default": 1
},
active: {
type: Number,
"default": 1,
},
historyPos: {
type: Number,
"default": 0,
}
},
data () {
return {
internal: {},
categories: { '1':{} },
}
},
methods: {
// TODO: Load categories from server
loadInternal () {
for ( let value in this.draggables ) {
this.internal[ value ] = {};
for ( let info in this.draggables[ value ] ) {
if ( info === 'w' || info === 'h' || info === 'x' || info === 'y' ) {
this.internal[ value ][ info ] = Math.round( ( this.draggables[ value ][ info ] / this.scaleFactor ) * 1000 ) / 1000;
} else {
this.internal[ value ][ info ] = this.draggables[ value ][ info ];
}
}
}
},
resubmit () {
let ret = {};
for ( let value in this.internal ) {
ret[ value ] = {};
for ( let info in this.internal[ value ] ) {
if ( info === 'w' || info === 'h' || info === 'x' || info === 'y' ) {
ret[ value ][ info ] = this.internal[ value ][ info ] * this.scaleFactor;
} else {
ret[ value ][ info ] = this.internal[ value ][ info ];
}
}
}
this.$emit( 'updated', ret );
},
showInfo ( box ) {
$( '#' + box ).stop();
$( '#' + box ).fadeIn( 300 );
},
hideInfo ( box ) {
$( '#' + box ).stop();
$( '#' + box ).fadeOut( 300 );
}
},
watch: {
draggables ( value ) {
this.loadInternal();
},
active ( value ) {
this.loadInternal();
},
scaleFactor ( value ) {
this.loadInternal();
},
historyPos ( value ) {
this.loadInternal();
}
},
created () {
this.loadInternal();
}
}
</script>
<style scoped>
.info-container {
display: inline;
position: relative;
}
.info-icon {
font-size: 100%;
cursor: default;
}
.info-box {
color: var( --primary-color );
text-align: center;
display: none;
position: absolute;
z-index: 10;
width: 20vw;
height: 20vh;
background-color: var( --hint-color );
border-radius: 20px;
top: 125%;
right: -9.3vw;
}
.info-box::before {
content: " ";
position: absolute;
bottom: 100%; /* At the bottom of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 10px;
border-style: solid;
border-color: transparent transparent var( --hint-color ) transparent;
}
.info-box-container {
display: flex;
width: 80%;
height: 80%;
padding: 10%;
padding-top: 5%;
align-items: center;
justify-content: center;
}
</style>

View File

@@ -0,0 +1,397 @@
<!--
* libreevent - window.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="window">
<!-- TODO: Add additional div with v-if to check if a location has been selected and warn if not so. -->
<properties class="properties" v-model:draggables="draggables" @updated="handleUpdate" :scale-factor="scaleFactor" :active="active" :history-pos="historyPos" :zoom-factor="zoomFactor" v-model:general-settings="generalSettings"></properties>
<div class="parent" id="parent">
<div class="content-parent">
<Vue3DraggableResizable v-for="draggable in draggables" :initW="draggable.w" :initH="draggable.h" v-model:x="draggable.x" v-model:y="draggable.y" v-model:w="draggable.w" v-model:h="draggable.h"
v-model:active="draggable.active" v-model:draggable="draggable.draggable" :resizable="draggable.resizable" :parent="true" @activated="activateComponent( draggable.id );"
@drag-end="saveHistory();" @resize-end="saveHistory();" @contextmenu="( e ) => { e.preventDefault(); }" class="draggable-box">
<circularSeatplanComponent v-if="draggable.shape == 'circular' && draggable.type == 'seat'" :scale-factor="scaleFactor" :w="draggable.w" :h="draggable.h" :origin="draggable.origin" :starting-row="draggable.startingRow" :id="draggable.id" @seatingInfo="( info ) => { handleSeatCountInfo( info ); }"></circularSeatplanComponent>
<trapezoidSeatplanComponent v-else-if="draggable.shape == 'trapezoid' && draggable.type == 'seat'" :scale-factor="scaleFactor" :w="draggable.w" :h="draggable.h" :origin="draggable.origin" :starting-row="draggable.startingRow" :id="draggable.id" @seatingInfo="( info ) => { handleSeatCountInfo( info ); }"></trapezoidSeatplanComponent>
<rectangularSeatplanComponent v-else-if="draggable.shape == 'rectangular' && draggable.type == 'seat'" :scale-factor="scaleFactor" :w="draggable.w" :h="draggable.h" :origin="draggable.origin" :id="draggable.id" @seatingInfo="( info ) => { handleSeatCountInfo( info ); }"></rectangularSeatplanComponent>
<stagesSeatplanComponent v-else-if="draggable.type == 'stage'" :origin="draggable.origin" :shape="draggable.shape"></stagesSeatplanComponent>
<standingSeatplanComponent v-else-if="draggable.type == 'stand'" :origin="draggable.origin" :shape="draggable.shape"></standingSeatplanComponent>
<textFieldSeatplanComponent v-else-if="draggable.type == 'text'" :text="draggable.text.text" :text-size="draggable.text.textSize" :colour="draggable.text.colour" :origin="draggable.origin" :scale-factor="scaleFactor"></textFieldSeatplanComponent>
</Vue3DraggableResizable>
</div>
</div>
<div class="toolbar">
<button title="Go back to location settings" @click="this.$router.push( '/admin/locations' )"><span class="material-symbols-outlined">arrow_back</span></button>
<button title="Undo [Ctrl + Z]" v-if="available.undo" @click="historyOp( 'undo' )"><span class="material-symbols-outlined">undo</span></button>
<button title="Undo (unavailable)" v-else disabled><span class="material-symbols-outlined">undo</span></button>
<button title="Redo [Ctrl + Y]" v-if="available.redo" @click="historyOp( 'redo' )"><span class="material-symbols-outlined">redo</span></button>
<button title="Redo (unavailable)" v-else disabled><span class="material-symbols-outlined">redo</span></button>
<button title="Zoom in [+]" @click="zoom( 0.2 )"><span class="material-symbols-outlined">zoom_in</span></button>
<button title="Reset zoom [=]" @click="zoom( 1 );"><span class="material-symbols-outlined">center_focus_strong</span></button>
<button title="Zoom out [-]" @click="zoom( -0.2 )"><span class="material-symbols-outlined">zoom_out</span></button>
<button title="Add component [Ctrl + I]" @click="addNewElement()"><span class="material-symbols-outlined">add</span></button>
<button title="Remove selected component [Delete]" @click="deleteSelected()"><span class="material-symbols-outlined">delete</span></button>
<button title="Save this seatplan as a draft [Ctrl + S]" @click="saveDraft()"><span class="material-symbols-outlined">save</span></button>
<button title="Deploy this seatplan (save it for use)" @click="deploy()"><span class="material-symbols-outlined">system_update_alt</span></button>
</div>
<notifications ref="notification" location="topleft"></notifications>
</div>
</template>
<script>
import Vue3DraggableResizable from 'vue3-draggable-resizable';
import properties from '@/components/seatplan/editor/properties.vue';
import circularSeatplanComponent from '@/components/seatplan/seatplanComponents/seats/circular.vue';
import rectangularSeatplanComponent from '@/components/seatplan/seatplanComponents/seats/rectangular.vue';
import trapezoidSeatplanComponent from '@/components/seatplan/seatplanComponents/seats/trapezoid.vue';
import stagesSeatplanComponent from '@/components/seatplan/seatplanComponents/stages.vue';
import standingSeatplanComponent from '@/components/seatplan/seatplanComponents/standing.vue';
import textFieldSeatplanComponent from '@/components/seatplan/seatplanComponents/textField.vue';
import notifications from '@/components/notifications/notifications.vue';
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css';
export default {
'name': 'window',
components: {
Vue3DraggableResizable,
properties,
circularSeatplanComponent,
rectangularSeatplanComponent,
trapezoidSeatplanComponent,
stagesSeatplanComponent,
standingSeatplanComponent,
textFieldSeatplanComponent,
notifications,
},
data() {
return {
active: 0,
draggables: { 1: { 'x': 100, 'y':100, 'h': 100, 'w': 250, 'active': false, 'draggable': true, 'resizable': true, 'id': 1, 'origin': 1, 'shape':'rectangular', 'type': 'seat', 'startingRow': 1, 'seatNumberingPosition': 1, 'sector': 'A', 'text': { 'text': 'TestText', 'textSize': 20, 'colour': '#20FFFF' }, 'numberingDirection': 'left' } },
available: { 'redo': false, 'undo': false },
scaleFactor: 1,
sizePoll: null,
prevSize: { 'h': window.innerHeight, 'w': window.innerWidth },
zoomFactor: 1,
historyPos: 0,
generalSettings: { 'namingScheme': 'numeric' },
seatCountInfo: { 'data': {}, 'count': 0 },
}
},
methods: {
/*
Coords are from top left corner of box.
The below function is executed as the init hook (created hook)
of vue.js, so whenever this particular page is loaded.
It loads previous data (if available) and starts the event listeners
for keyevents (like delete) and also check if the user uses a desktop
browser that meets all the requirements for being able to use the editor
reliably according to testing done.
*/
runHook () {
let self = this;
this.zoomFactor = sessionStorage.getItem( 'zoom' ) ? parseFloat( sessionStorage.getItem( 'zoom' ) ) : 1;
/*
Keybinds:
- Delete: delete selected object
- Ctrl + S: Save
- Ctrl + Z: Undo
- Ctrl + Y: Redo
*/
document.onkeydown = function ( event ) {
if ( event.key === 'Delete' ) {
event.preventDefault();
self.deleteSelected();
} else if ( event.ctrlKey && event.key === 's' ) {
event.preventDefault();
self.saveDraft();
} else if ( ( event.ctrlKey && event.key === 'y' ) ) {
event.preventDefault();
self.historyOp( 'redo' );
} else if ( event.ctrlKey && event.key === 'z' ) {
event.preventDefault();
self.historyOp( 'undo' );
} else if ( event.ctrlKey && event.key === 'i' ) {
event.preventDefault();
self.addNewElement();
} else if ( event.key === '+' ) {
self.zoom( 0.2 );
} else if ( event.key === '-' ) {
self.zoom( -0.2 );
} else if ( event.key === '=' ) {
self.zoom( 1 );
}
};
this.loadSeatplan();
if ( !sessionStorage.getItem( 'seatplan-history' ) ) {
sessionStorage.setItem( 'seatplan-history', JSON.stringify( { '1': this.scaleDown( this.draggables ) } ) );
}
let history = sessionStorage.getItem( 'seatplan-history' ) ? JSON.parse( sessionStorage.getItem( 'seatplan-history' ) ) : {};
let count = parseInt( Object.keys( history ).length );
if ( count > parseInt( sessionStorage.getItem( 'historyPos' ) ) ) {
this.available.redo = true;
}
if ( parseInt( sessionStorage.getItem( 'historyPos' ) ) > 0 ) {
this.available.undo = true;
}
let supportedBrowser = [];
this.save();
// TODO: Add warning for untested browsers & suboptimal window sizes!
},
eventHandler ( e ) {
if ( this.prevSize.h != window.innerHeight || this.prevSize.w != window.innerWidth ) {
this.prevSize = { 'h': window.innerHeight, 'w': window.innerWidth };
this.loadSeatplan();
}
},
loadSeatplan () {
/*
Calculate scale factor (this adds support for differently sized screens)
900px is the "default" height
*/
let height = $( document ).height() * 0.8;
this.scaleFactor = ( height / 900 ) * this.zoomFactor;
/*
Load seatplan
*/
// TODO: load from server
if ( sessionStorage.getItem( 'seatplan' ) ) {
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
}
for ( let element in this.draggables ) {
if ( this.draggables[ element ].active ) {
this.draggables[ element ].active = false;
}
}
},
scaleDown ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ]
let returnArray = {};
for ( let entry in valueArray ) {
returnArray[ entry ] = {};
for ( let attributes in valueArray[ entry ] ) {
if ( allowedAttributes.includes( attributes ) ) {
returnArray[ entry ][ attributes ] = Math.round( ( valueArray[ entry ][ attributes ] / this.scaleFactor ) * 1000 ) / 1000;
} else {
returnArray[ entry ][ attributes ] = valueArray[ entry ][ attributes ];
}
}
}
return returnArray;
},
scaleUp ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ]
let returnArray = {};
for ( let entry in valueArray ) {
returnArray[ entry ] = {};
for ( let attributes in valueArray[ entry ] ) {
if ( allowedAttributes.includes( attributes ) ) {
returnArray[ entry ][ attributes ] = Math.round( ( valueArray[ entry ][ attributes ] * this.scaleFactor ) * 1000 ) / 1000;
} else {
returnArray[ entry ][ attributes ] = valueArray[ entry ][ attributes ];
}
}
}
return returnArray;
},
activateComponent ( id ) {
this.active = id;
},
saveHistory () {
let history = sessionStorage.getItem( 'seatplan-history' ) ? JSON.parse( sessionStorage.getItem( 'seatplan-history' ) ) : {};
let count = parseInt( Object.keys( history ).length + 1 );
this.historyPos = count;
if ( count - 1 > parseInt( sessionStorage.getItem( 'historyPos' ) ) ) {
for ( let i = parseInt( sessionStorage.getItem( 'historyPos' ) ) + 1; i < count; i++ ) {
delete history[ i ];
this.available.redo = false;
}
}
count = parseInt( Object.keys( history ).length + 1 );
sessionStorage.setItem( 'historyPos', count );
history[ count ] = this.scaleDown( this.draggables );
sessionStorage.setItem( 'seatplan-history', JSON.stringify( history ) );
if ( parseInt( sessionStorage.getItem( 'historyPos' ) ) > 1 ) {
this.available.undo = true;
}
this.save();
},
historyOp ( action ) {
if ( action === 'undo' ) {
if ( parseInt( sessionStorage.getItem( 'historyPos' ) ) > 1 ) {
sessionStorage.setItem( 'historyPos', parseInt( sessionStorage.getItem( 'historyPos' ) ) - 1 );
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan-history' ) )[ sessionStorage.getItem( 'historyPos' ) ] );
this.available.redo = true;
if ( parseInt( sessionStorage.getItem( 'historyPos' ) ) < 2 ) {
this.available.undo = false;
}
} else {
this.available.undo = false;
}
} else if ( action === 'redo' ) {
if ( parseInt( Object.keys( JSON.parse( sessionStorage.getItem( 'seatplan-history' ) ) ).length ) > parseInt( sessionStorage.getItem( 'historyPos' ) ) ) {
sessionStorage.setItem( 'historyPos', parseInt( sessionStorage.getItem( 'historyPos' ) ) + 1 );
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan-history' ) )[ sessionStorage.getItem( 'historyPos' ) ] );
this.available.undo = true;
if ( parseInt( Object.keys( JSON.parse( sessionStorage.getItem( 'seatplan-history' ) ) ).length ) < parseInt( sessionStorage.getItem( 'historyPos' ) ) + 1 ) {
this.available.redo = false;
}
} else {
this.available.redo = false;
}
}
this.historyPos = sessionStorage.getItem( 'historyPos' );
},
save () {
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
},
saveDraft () {
// TODO: Save seat count and seat config to server as well
let progressNotification = this.$refs.notification.createNotification( 'Saving as draft', 5, 'progress', 'normal' );
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
this.$refs.notification.createNotification( 'Saved as draft', 5, 'ok', 'normal' );
// TODO: Save to server and add warning if no component has a seat start point if any component is a seat component
},
deploy () {
// TODO: Save to server
this.$refs.notification.createNotification( 'Deploying...', 5, 'progress', 'normal' );
this.$refs.notification.createNotification( 'Deployed successfully', 5, 'ok', 'normal' );
},
addNewElement () {
// TODO: Check that this algorithm actually works in practice. If not, replace with one that
// searches for the first available ID or uses a var to determine ID.
this.draggables[ Object.keys( this.draggables ).length + 1 ] = { 'x': 100, 'y':100, 'h': 100, 'w': 250, 'active': false, 'draggable': true, 'resizable': true, 'id': Object.keys( this.draggables ).length + 1, 'origin': 1, 'shape':'rectangular', 'type': 'seat', 'startingRow': 1, 'seatNumberingPosition': Object.keys( this.draggables ).length + 1, 'sector': 'A', 'text': { 'text': 'TestText', 'textSize': 20, 'colour': '#20FFFF' }, 'ticketCount': 1, 'numberingDirection': 'left' };
this.saveHistory();
document.getElementById( 'parent' ).scrollTop = 0;
document.getElementById( 'parent' ).scrollLeft = 0;
this.$refs.notification.createNotification( 'New component added successfully', 5, 'ok', 'normal' );
},
deleteSelected () {
if ( this.active ) {
this.draggables[ this.active ].active = true;
if ( confirm( 'Do you really want to delete the selected item?' ) ) {
delete this.draggables[ this.active ];
this.saveHistory();
this.active = 0;
this.$refs.notification.createNotification( 'Successfully deleted component', 5, 'ok', 'normal' );
}
} else {
this.$refs.notification.createNotification( 'Please select a seat first!', 5, 'error', 'normal' );
}
},
handleUpdate ( value ) {
this.draggables = value;
this.selectedObject = value;
this.saveHistory();
},
zoom ( scale ) {
if ( scale == 1 ) {
this.zoomFactor = 1;
sessionStorage.setItem( 'zoom', this.zoomFactor );
this.loadSeatplan();
} else {
if ( ( this.zoomFactor < 0.3 && scale < 0 ) || ( this.zoomFactor > 2.9 && scale > 0 ) ) {
if ( this.zoomFactor < 0.3 ) {
this.$refs.notification.createNotification( 'Minimum zoom factor reached', 5, 'warning', 'normal' );
} else {
this.$refs.notification.createNotification( 'Maximum zoom factor reached', 5, 'warning', 'normal' );
}
} else {
this.zoomFactor += scale;
}
sessionStorage.setItem( 'zoom', this.zoomFactor );
this.loadSeatplan();
}
},
handleSeatCountInfo ( info ) {
this.seatCountInfo[ 'data' ][ info.id ] = info.data;
},
getSeatCount () {
this.seatCountInfo[ 'count' ] = document.getElementsByClassName( 'seats' ).length;
},
},
created () {
this.runHook();
this.sizePoll = setInterval( this.eventHandler, 250 );
},
unmounted() {
clearInterval( this.sizePoll );
},
}
</script>
<style scoped>
.parent {
height: 90vh;
aspect-ratio: 16 / 9;
top: 7.5vh;
left: 3vw;
position: absolute;
border: black 1px solid;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
overflow: scroll;
}
.draggable-box {
cursor: all-scroll;
}
.properties {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
z-index: 1;
background-color: var( --accent-background );
color: var( --secondary-color );
width: 20vw;
height: 90vh;
top: 7.5vh;
right: 0.5vw;
overflow: scroll;
}
.content-parent {
aspect-ratio: 16 / 9;
height: 400%;
}
.toolbar {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
top: 7.5vh;
left: 0.5vw;
height: 90vh;
}
.toolbar button {
margin-top: 10%;
cursor: pointer;
}
.toolbar button:disabled {
cursor: default;
}
</style>

View File

@@ -1,17 +0,0 @@
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -0,0 +1,119 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="circularSeatplan">
<div v-for="row in seats">
<span class="material-symbols-outlined seats" v-for="seat in row" :style="seat.style">living</span>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'circularSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
startingRow: {
type: Number,
"default": 1,
},
id: {
type: Number,
"default": 1
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.round( this.w / this.scaleFactor );
let h = Math.round( this.h / this.scaleFactor );
const size = 33;
let count = Math.min( Math.floor( w / size ), Math.floor( h / size ) );
this.seats = {};
let details = { 'data': {}, 'id': this.id };
for ( let row = this.startingRow; row < count; row++ ) {
let nn = row * ( Math.PI / 2 );
details.data[ row ] = Math.floor( nn );
let r = row * size;
this.seats[ row ] = {};
for ( let n = 0; n < nn; n++ ) {
let phi = n * size / ( row * size );
if ( this.origin === 1 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ r * Math.cos( phi ) * this.scaleFactor }px; left: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ phi }rad` };
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ r * Math.cos( phi ) * this.scaleFactor }px; right: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ Math.PI * 2 - phi }rad` };
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ r * Math.cos( phi ) * this.scaleFactor }px; right: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ phi + Math.PI }rad` };
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ r * Math.cos( phi ) * this.scaleFactor }px; left: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ Math.PI - phi }rad` };
}
}
}
this.$emit( 'seatingInfo', details );
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
},
startingRow() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,107 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="rectangularSeatplan">
<div v-for="row in seats" class="rows">
<span class="material-symbols-outlined seats" v-for="seat in row" :style="seat.style">living</span>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'rectangularSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
id: {
type: Number,
"default": 1
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.floor( this.w / this.scaleFactor );
let h = Math.floor( this.h / this.scaleFactor );
const size = 33;
this.seats = {};
let details = { 'data': { '0': Math.floor( w / size ) }, 'id': this.id };
for ( let row = 0; row < Math.floor( h / size ); row++ ) {
this.seats[ row ] = {};
for ( let n = 0; n < Math.floor( w / size ); n++ ) {
if ( this.origin === 1 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ row * size * this.scaleFactor }px; left: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;` };
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ row * size * this.scaleFactor }px; right: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;` };
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ row * size * this.scaleFactor }px; right: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;` };
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ row * size * this.scaleFactor }px; left: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;` };
}
}
}
this.$emit( 'seatingInfo', details );
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,122 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="trapezoidSeatplan">
<div v-for="row in seats">
<span class="material-symbols-outlined seats" v-for="seat in row" :style="seat.style">living</span>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'trapezoidSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
startingRow: {
type: Number,
"default": 1,
},
id: {
type: Number,
"default": 1
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.round( this.w / this.scaleFactor );
let h = Math.round( this.h / this.scaleFactor );
const size = 33;
let side = Math.min( w, h ) + 20;
let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) )
let sideOffset = size / Math.sqrt( 2 );
let count = Math.floor( heightTriangle / ( sideOffset * 2 ) );
const angle = Math.PI / 4;
this.seats = {};
let details = { 'data': {}, 'id': this.id };
for ( let row = this.startingRow; row < count; row++ ) {
let nn = 2 + ( row - 1 ) * 2;
this.seats[ row ] = {};
details.data[ row ] = Math.floor( nn );
for ( let n = 0; n < nn; n++ ) {
let side = n * sideOffset;
if ( this.origin === 1 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ ( side + 5 ) * this.scaleFactor }px; left: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ angle }rad` };
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; bottom: ${ ( side + 5 ) * this.scaleFactor }px; right: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ Math.PI * 2 - angle }rad` };
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ ( side + 5 ) * this.scaleFactor }px; right: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ angle + Math.PI }rad` };
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ] = { 'style': `font-size: ${this.scaleFactor * 200}%; top: ${ ( side + 5 ) * this.scaleFactor }px; left: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ Math.PI - angle }rad` };
}
}
}
this.$emit( 'seatingInfo', details );
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
},
startingRow() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,110 @@
<!--
* libreevent - stages.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="stages" class="stages">
<div id="rectangular" v-if="shape == 'rectangular'" class="stages" :style="style"></div>
<div id="trapezoid" v-else-if="shape == 'trapezoid'" class="stages"><div id="trapezoid-ingredient" :style="trapezoidStyle"><div id="trapezoid-line"></div></div></div>
<div id="circular" v-else-if="shape == 'circular'" class="stages"><div id="circular-ingredient" :style="circularStyle"></div></div>
</div>
</template>
<style scoped>
.stages {
height: 100%;
width: 100%;
}
#rectangular {
border-color: black;
border-width: 2px;
background-color: var( --popup-color );
}
#circular, #trapezoid {
overflow: hidden;
}
#trapezoid-ingredient {
display: flex;
justify-content: center;
align-items: flex-end;
height: 200%;
width: 200%;
position: relative;
bottom: 50%;
right: 50%;
}
#trapezoid-line {
border: black solid 1px;
height: 50%;
width: 100%;
display: block;
background-color: var( --popup-color );
}
#circular-ingredient {
border: solid black 2px;
border-radius: 100%;
height: 199%;
width: 199%;
position: relative;
background-color: var( --popup-color );
}
</style>
<script>
export default {
name: 'stagesSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
shape: {
type: String,
"default": "rectangular",
},
},
data() {
return {
style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg',
}
},
methods: {
updateOrigin () {
if ( this.origin === 1 ) {
this.style = 'border-style: none none solid none';
this.circularStyle = 'top: 0; right: 100%;';
} else if ( this.origin === 2 ) {
this.style = 'border-style: none solid none none';
this.circularStyle = 'top: 0; right: 0;';
} else if ( this.origin === 3 ) {
this.style = 'border-style: solid none none none';
this.circularStyle = 'top: -100%; right: 0;';
} else if ( this.origin === 4 ) {
this.style = 'border-style: none none none solid';
this.circularStyle = 'top: -100%; right: 100%;';
}
}
},
watch: {
origin ( value ) {
this.updateOrigin();
}
},
created() {
this.updateOrigin();
}
}
</script>

View File

@@ -0,0 +1,109 @@
<!--
* libreevent - standing.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="stages" class="stages">
<div id="rectangular" v-if="shape == 'rectangular'" class="stages" :style="style"></div>
<div id="trapezoid" v-else-if="shape == 'trapezoid'" class="stages"><div id="trapezoid-ingredient" :style="trapezoidStyle"><div id="trapezoid-line"></div></div></div>
<div id="circular" v-else-if="shape == 'circular'" class="stages"><div id="circular-ingredient" :style="circularStyle"></div></div>
</div>
</template>
<style scoped>
.stages {
height: 100%;
width: 100%;
}
#rectangular {
border-color: black;
border-width: 2px;
}
#circular, #trapezoid {
overflow: hidden;
}
#trapezoid-ingredient {
display: flex;
justify-content: center;
align-items: center;
height: 200%;
width: 200%;
position: relative;
bottom: 50%;
right: 50%;
}
#trapezoid-line {
border: black solid 1px;
height: 50%;
width: 100%;
display: block;
background-color: var( --popup-color );
}
#circular-ingredient {
border: solid black 2px;
border-radius: 100%;
height: 199%;
width: 199%;
position: relative;
background-color: var( --popup-color );
}
</style>
<script>
export default {
name: 'stagesSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
shape: {
type: String,
"default": "rectangular",
},
},
data() {
return {
style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg',
}
},
methods: {
updateOrigin () {
if ( this.origin === 1 ) {
this.style = 'border-style: none none solid none';
this.circularStyle = 'top: 0; right: 100%;';
} else if ( this.origin === 2 ) {
this.style = 'border-style: none solid none none';
this.circularStyle = 'top: 0; right: 0;';
} else if ( this.origin === 3 ) {
this.style = 'border-style: solid none none none';
this.circularStyle = 'top: -100%; right: 0;';
} else if ( this.origin === 4 ) {
this.style = 'border-style: none none none solid';
this.circularStyle = 'top: -100%; right: 100%;';
}
}
},
watch: {
origin ( value ) {
this.updateOrigin();
}
},
created() {
this.updateOrigin();
}
}
</script>

View File

@@ -0,0 +1,69 @@
<!--
* libreevent - textField.vue
*
* Created by Janis Hutz 07/01/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="textFields">
<p :style="style">{{ text }}</p>
</div>
</template>
<script>
export default {
name: 'textFieldSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
text: {
type: String,
"default": "Untitled",
},
textSize: {
type: Number,
"default": 20,
},
scaleFactor: {
type: Number,
"default": 1,
},
colour: {
type: String,
"default": '#000000',
}
},
data() {
return {
style: 'font-size: 20pt; rotate: 0deg; color: #000000',
}
},
methods: {
updateStyle () {
this.style = `font-size: ${ this.scaleFactor * this.textSize }pt; rotate: ${ 90 * this.origin - 90 }deg; color: ${this.colour}`;
}
},
watch: {
origin ( value ) {
this.updateStyle();
},
scaleFactor ( value ) {
this.updateStyle();
},
colour ( value ) {
this.updateStyle();
},
textSize ( value ) {
this.updateStyle();
}
},
created() {
this.updateStyle();
}
}
</script>

View File

@@ -0,0 +1,128 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="circularSeatplan">
<div v-for="row in seats">
<div class="seats" v-for="seat in row" :style="seat.style" :id="seat.id">
<span class="material-symbols-outlined" :style="seat.scaling" @click="selectSeat( seat.row, seat.seat )" v-if="seat.status == 'av'"
:title="seat.displayName + ', Available'">living</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'nav'"
:title="seat.displayName + ', Unavailable'">close</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'sel'"
:title="seat.displayName + ', Selected'">done</span>
</div>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'circularSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
startingRow: {
type: Number,
"default": 1,
},
data: {
type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': true } }
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.round( this.w / this.scaleFactor );
let h = Math.round( this.h / this.scaleFactor );
const size = 33;
let count = Math.min( Math.floor( w / size ), Math.floor( h / size ) );
this.seats = {};
for ( let row = this.startingRow; row < count; row++ ) {
let nn = row * ( Math.PI / 2 );
let r = row * size;
this.seats[ row ] = {};
for ( let n = 0; n < nn; n++ ) {
this.seats[ row ][ n ] = { 'style': '', 'id': 'sec' + this.data.sector + 'r' + row + 's' + n, 'displayName': ( this.data.sectorCount > 1 ? 'Sector ' + this.data.sector + ', ' : '' ) + 'Row ' + ( row + 1 ) + ', Seat ' + ( n + 1 ), 'status': 'av', 'row': row, 'seat': n };
let phi = n * size / ( row * size );
if ( this.origin === 1 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ r * Math.cos( phi ) * this.scaleFactor }px; left: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ phi }rad`;
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ r * Math.cos( phi ) * this.scaleFactor }px; right: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ Math.PI * 2 - phi }rad`;
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ r * Math.cos( phi ) * this.scaleFactor }px; right: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ phi + Math.PI }rad`;
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ r * Math.cos( phi ) * this.scaleFactor }px; left: ${ r * Math.sin( phi ) * this.scaleFactor }px; rotate: ${ Math.PI - phi }rad`;
}
this.seats[ row ][ n ][ 'scaling' ] = `font-size: ${this.scaleFactor * 200}%; `;
}
}
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
},
selectSeat ( row, seat ) {
console.log( row + ' ' + seat );
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
},
startingRow() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,133 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="rectangularSeatplan">
<div v-for="row in seats" class="rows">
<div class="seats" v-for="seat in row" :style="seat.style" :id="seat.id">
<span class="material-symbols-outlined" :style="seat.scaling" @click="selectSeat( seat.row, seat.seat )" v-if="seat.status == 'av'"
:title="seat.displayName + ', Available'">living</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'nav'"
:title="seat.displayName + ', Unavailable'">disabled_by_default</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'sel'"
:title="seat.displayName + ', Selected'" @click="deselectSeat( seat.row, seat.seat )">check_box</span>
</div>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'rectangularSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
data: {
type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': true } }
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.floor( this.w / this.scaleFactor );
let h = Math.floor( this.h / this.scaleFactor );
const size = 33;
this.seats = {};
for ( let row = 0; row < Math.floor( h / size ); row++ ) {
this.seats[ row ] = {};
for ( let n = 0; n < Math.floor( w / size ); n++ ) {
this.seats[ row ][ n ] = { 'style': '', 'id': 'sec' + this.data.sector + 'r' + row + 's' + n, 'displayName': ( this.data.sectorCount > 1 ? 'Sector ' + this.data.sector + ', ' : '' ) + 'Row ' + ( row + 1 ) + ', Seat ' + ( n + 1 ), 'status': 'av', 'row': row, 'seat': n };
// TODO: apply style of category
if ( this.origin === 1 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ row * size * this.scaleFactor }px; left: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;`;
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ row * size * this.scaleFactor }px; right: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;`;
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ row * size * this.scaleFactor }px; right: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;`;
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ row * size * this.scaleFactor }px; left: ${ n * size * this.scaleFactor }px; rotate: ${ this.origin / 4 - 0.25 }turn;`;
}
this.seats[ row ][ n ][ 'scaling' ] = `font-size: ${this.scaleFactor * 200}%; `;
if ( this.data.unavailableSeats ) {
if ( this.data.unavailableSeats[ this.seats[ row ][ n ][ 'id' ] ] ) {
this.seats[ row ][ n ][ 'status' ] = 'nav';
}
}
}
}
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
},
selectSeat ( row, seat ) {
this.$emit( 'seatSelected', this.seats[ row ][ seat ] );
},
deselectSeat( row, seat ) {
this.$emit( 'seatDeselected', this.seats[ row ][ seat ] );
this.seats[ seatObject[ 'row' ] ][ seatObject[ 'seat' ] ][ 'status' ] = 'av';
// TODO: Make server call to deselect ticket
},
validateSeatSelection( seatObject, selectedTicketOption ) {
this.seats[ seatObject[ 'row' ] ][ seatObject[ 'seat' ] ][ 'status' ] = 'sel';
this.seats[ seatObject[ 'row' ] ][ seatObject[ 'seat' ] ][ 'ticketOption' ] = selectedTicketOption;
// TODO: Make server call to reserve ticket
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,131 @@
<!--
* libreevent - properties.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="trapezoidSeatplan">
<div v-for="row in seats">
<div class="seats" v-for="seat in row" :style="seat.style" :id="seat.id">
<span class="material-symbols-outlined" :style="seat.scaling" @click="selectSeat( seat.row, seat.seat )" v-if="seat.status == 'av'"
:title="seat.displayName + ', Available'">living</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'nav'"
:title="seat.displayName + ', Unavailable'">close</span>
<span class="material-symbols-outlined" :style="seat.scaling" v-else-if="seat.status == 'sel'"
:title="seat.displayName + ', Selected'">done</span>
</div>
</div>
</div>
</template>
<style scoped>
.seats {
position: absolute;
}
</style>
<script>
export default {
name: 'trapezoidSeatplanComponent',
props: {
h: {
type: Number,
"default": 100,
},
w: {
type: Number,
"default": 200,
},
scaleFactor: {
type: Number,
"default": 1,
},
origin: {
type: Number,
"default": 1,
},
startingRow: {
type: Number,
"default": 1,
},
data: {
type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': true } }
}
},
data () {
return {
seats: {},
}
},
methods: {
calculateChairs () {
// Size of seat at scale 1 is 32px
// w & h are normalised
let w = Math.round( this.w / this.scaleFactor );
let h = Math.round( this.h / this.scaleFactor );
const size = 33;
let side = Math.min( w, h ) + 20;
let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) )
let sideOffset = size / Math.sqrt( 2 );
let count = Math.floor( heightTriangle / ( sideOffset * 2 ) );
const angle = Math.PI / 4;
this.seats = {};
for ( let row = this.startingRow; row < count; row++ ) {
let nn = 2 + ( row - 1 ) * 2;
this.seats[ row ] = {};
for ( let n = 0; n < nn; n++ ) {
this.seats[ row ][ n ] = { 'style': '', 'id': 'sec' + this.data.sector + 'r' + row + 's' + n, 'displayName': ( this.data.sectorCount > 1 ? 'Sector ' + this.data.sector + ', ' : '' ) + 'Row ' + ( row + 1 ) + ', Seat ' + ( n + 1 ), 'status': 'av', 'row': row, 'seat': n };
let side = n * sideOffset;
if ( this.origin === 1 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ ( side + 5 ) * this.scaleFactor }px; left: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ angle }rad`;
} else if ( this.origin === 2 ) {
this.seats[ row ][ n ][ 'style' ] = `bottom: ${ ( side + 5 ) * this.scaleFactor }px; right: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ Math.PI * 2 - angle }rad`;
} else if ( this.origin === 3 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ ( side + 5 ) * this.scaleFactor }px; right: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ angle + Math.PI }rad`;
} else if ( this.origin === 4 ) {
this.seats[ row ][ n ][ 'style' ] = `top: ${ ( side + 5 ) * this.scaleFactor }px; left: ${ ( row * sideOffset * 2 - side ) * this.scaleFactor }px; rotate: ${ Math.PI - angle }rad`;
}
this.seats[ row ][ n ][ 'scaling' ] = `font-size: ${this.scaleFactor * 200}%; `;
}
}
},
setScaleFactor () {
for ( let row in this.seats ) {
for ( let seat in this.seats[ row ] ) {
let styles = this.seats[ row ][ seat ].style.substring( this.seats[ row ][ seat ].style.indexOf( ';' ) + 1 );
this.seats[ row ][ seat ].style = `font-size: ${this.scaleFactor * 200}%;` + styles;
}
}
},
selectSeat ( row, seat ) {
console.log( row + ' ' + seat );
}
},
watch: {
scaleFactor() {
this.setScaleFactor();
},
h() {
this.calculateChairs();
},
w() {
this.calculateChairs();
},
origin() {
this.calculateChairs();
},
startingRow() {
this.calculateChairs();
}
},
created() {
this.calculateChairs();
}
}
</script>

View File

@@ -0,0 +1,110 @@
<!--
* libreevent - stages.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="stages" class="stages">
<div id="rectangular" v-if="shape == 'rectangular'" class="stages" :style="style"></div>
<div id="trapezoid" v-else-if="shape == 'trapezoid'" class="stages"><div id="trapezoid-ingredient" :style="trapezoidStyle"><div id="trapezoid-line"></div></div></div>
<div id="circular" v-else-if="shape == 'circular'" class="stages"><div id="circular-ingredient" :style="circularStyle"></div></div>
</div>
</template>
<style scoped>
.stages {
height: 100%;
width: 100%;
}
#rectangular {
border-color: black;
border-width: 2px;
background-color: var( --popup-color );
}
#circular, #trapezoid {
overflow: hidden;
}
#trapezoid-ingredient {
display: flex;
justify-content: center;
align-items: flex-end;
height: 200%;
width: 200%;
position: relative;
bottom: 50%;
right: 50%;
}
#trapezoid-line {
border: black solid 1px;
height: 50%;
width: 100%;
display: block;
background-color: var( --popup-color );
}
#circular-ingredient {
border: solid black 2px;
border-radius: 100%;
height: 199%;
width: 199%;
position: relative;
background-color: var( --popup-color );
}
</style>
<script>
export default {
name: 'stagesSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
shape: {
type: String,
"default": "rectangular",
},
},
data() {
return {
style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg',
}
},
methods: {
updateOrigin () {
if ( this.origin === 1 ) {
this.style = 'border-style: none none solid none';
this.circularStyle = 'top: 0; right: 100%;';
} else if ( this.origin === 2 ) {
this.style = 'border-style: none solid none none';
this.circularStyle = 'top: 0; right: 0;';
} else if ( this.origin === 3 ) {
this.style = 'border-style: solid none none none';
this.circularStyle = 'top: -100%; right: 0;';
} else if ( this.origin === 4 ) {
this.style = 'border-style: none none none solid';
this.circularStyle = 'top: -100%; right: 100%;';
}
}
},
watch: {
origin ( value ) {
this.updateOrigin();
}
},
created() {
this.updateOrigin();
}
}
</script>

View File

@@ -0,0 +1,109 @@
<!--
* libreevent - standing.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="stages" class="stages">
<div id="rectangular" v-if="shape == 'rectangular'" class="stages" :style="style"></div>
<div id="trapezoid" v-else-if="shape == 'trapezoid'" class="stages"><div id="trapezoid-ingredient" :style="trapezoidStyle"><div id="trapezoid-line"></div></div></div>
<div id="circular" v-else-if="shape == 'circular'" class="stages"><div id="circular-ingredient" :style="circularStyle"></div></div>
</div>
</template>
<style scoped>
.stages {
height: 100%;
width: 100%;
}
#rectangular {
border-color: black;
border-width: 2px;
}
#circular, #trapezoid {
overflow: hidden;
}
#trapezoid-ingredient {
display: flex;
justify-content: center;
align-items: center;
height: 200%;
width: 200%;
position: relative;
bottom: 50%;
right: 50%;
}
#trapezoid-line {
border: black solid 1px;
height: 50%;
width: 100%;
display: block;
background-color: var( --popup-color );
}
#circular-ingredient {
border: solid black 2px;
border-radius: 100%;
height: 199%;
width: 199%;
position: relative;
background-color: var( --popup-color );
}
</style>
<script>
export default {
name: 'stagesSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
shape: {
type: String,
"default": "rectangular",
},
},
data() {
return {
style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg',
}
},
methods: {
updateOrigin () {
if ( this.origin === 1 ) {
this.style = 'border-style: none none solid none';
this.circularStyle = 'top: 0; right: 100%;';
} else if ( this.origin === 2 ) {
this.style = 'border-style: none solid none none';
this.circularStyle = 'top: 0; right: 0;';
} else if ( this.origin === 3 ) {
this.style = 'border-style: solid none none none';
this.circularStyle = 'top: -100%; right: 0;';
} else if ( this.origin === 4 ) {
this.style = 'border-style: none none none solid';
this.circularStyle = 'top: -100%; right: 100%;';
}
}
},
watch: {
origin ( value ) {
this.updateOrigin();
}
},
created() {
this.updateOrigin();
}
}
</script>

View File

@@ -0,0 +1,69 @@
<!--
* libreevent - textField.vue
*
* Created by Janis Hutz 07/01/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="textFields">
<p :style="style">{{ text }}</p>
</div>
</template>
<script>
export default {
name: 'textFieldSeatplanComponent',
props: {
origin: {
type: Number,
"default": 1,
},
text: {
type: String,
"default": "Untitled",
},
textSize: {
type: Number,
"default": 20,
},
scaleFactor: {
type: Number,
"default": 1,
},
colour: {
type: String,
"default": '#000000',
}
},
data() {
return {
style: 'font-size: 20pt; rotate: 0deg; color: #000000',
}
},
methods: {
updateStyle () {
this.style = `font-size: ${ this.scaleFactor * this.textSize }pt; rotate: ${ 90 * this.origin - 90 }deg; color: ${this.colour}`;
}
},
watch: {
origin ( value ) {
this.updateStyle();
},
scaleFactor ( value ) {
this.updateStyle();
},
colour ( value ) {
this.updateStyle();
},
textSize ( value ) {
this.updateStyle();
}
},
created() {
this.updateStyle();
}
}
</script>

View File

@@ -0,0 +1,9 @@
<!--
* libreevent - sidebar.vue
*
* Created by Janis Hutz 07/03/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->

View File

@@ -0,0 +1,312 @@
<!--
* libreevent - window.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div id="window">
<h2>Seat plan: {{ event.name }}</h2>
<div class="parent" id="parent" @wheel="( e ) => { handleScroll( e ); }" @mousemove="( e ) => { handleDrag( e ); }" @mousedown="( e ) => { setOffset( e ); }">
<div class="content-parent">
<Vue3DraggableResizable v-for="draggable in draggables" :initW="draggable.w" :initH="draggable.h" :x="draggable.x" :y="draggable.y" :w="draggable.w" :h="draggable.h"
:active="false" :draggable="false" :resizable="false" :parent="true" class="draggable-box">
<circularSeatplanComponent v-if="draggable.shape == 'circular' && draggable.type == 'seat'" :scale-factor="scaleFactor"
:w="draggable.w" :h="draggable.h" :origin="draggable.origin" :starting-row="draggable.startingRow"
@seatSelected="( seat ) => { seatSelected( seat ) }"></circularSeatplanComponent>
<trapezoidSeatplanComponent v-else-if="draggable.shape == 'trapezoid' && draggable.type == 'seat'" :scale-factor="scaleFactor"
:w="draggable.w" :h="draggable.h" :origin="draggable.origin" :starting-row="draggable.startingRow"
@seatSelected="( seat ) => { seatSelected( seat ) }"></trapezoidSeatplanComponent>
<rectangularSeatplanComponent v-else-if="draggable.shape == 'rectangular' && draggable.type == 'seat'" :scale-factor="scaleFactor"
:w="draggable.w" :h="draggable.h" :origin="draggable.origin"
@seatSelected="( seat ) => { seatSelected( seat ) }" @seatDeselected="( seat ) => { seatDeselected( seat ) }"></rectangularSeatplanComponent>
<stagesSeatplanComponent v-else-if="draggable.type == 'stage'" :origin="draggable.origin" :shape="draggable.shape"></stagesSeatplanComponent>
<standingSeatplanComponent v-else-if="draggable.type == 'stand'" :origin="draggable.origin" :shape="draggable.shape"></standingSeatplanComponent>
<textFieldSeatplanComponent v-else-if="draggable.type == 'text'" :text="draggable.text.text" :text-size="draggable.text.textSize" :colour="draggable.text.colour" :origin="draggable.origin" :scale-factor="scaleFactor"></textFieldSeatplanComponent>
</Vue3DraggableResizable>
</div>
</div>
<div class="toolbar">
<button title="Zoom in [+]" @click="zoom( 0.2 )"><span class="material-symbols-outlined">zoom_in</span></button>
<button title="Reset zoom [=]" @click="zoom( 1 );"><span class="material-symbols-outlined">center_focus_strong</span></button>
<button title="Zoom out [-]" @click="zoom( -0.2 )"><span class="material-symbols-outlined">zoom_out</span></button>
</div>
<notifications ref="notification" location="topleft"></notifications>
<popups ref="popups" size="big"></popups>
</div>
</template>
<script>
import Vue3DraggableResizable from 'vue3-draggable-resizable';
import circularSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/seats/circular.vue';
import rectangularSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/seats/rectangular.vue';
import trapezoidSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/seats/trapezoid.vue';
import stagesSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/stages.vue';
import standingSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/standing.vue';
import textFieldSeatplanComponent from '@/components/seatplan/userApp/seatplanComponents/textField.vue';
import notifications from '@/components/notifications/notifications.vue';
import popups from '@/components/notifications/popups.vue';
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css';
export default {
'name': 'window',
components: {
Vue3DraggableResizable,
circularSeatplanComponent,
rectangularSeatplanComponent,
trapezoidSeatplanComponent,
stagesSeatplanComponent,
standingSeatplanComponent,
textFieldSeatplanComponent,
notifications,
popups,
},
data() {
return {
active: 0,
draggables: { 1: { 'x': 100, 'y':100, 'h': 100, 'w': 250, 'active': false, 'draggable': true, 'resizable': true, 'id': 1, 'origin': 1, 'shape':'rectangular', 'type': 'seat', 'startingRow': 1, 'seatCountingStartingPoint': 1, 'sector': 'A', 'text': { 'text': 'TestText', 'textSize': 20, 'colour': '#20FFFF' } }, 'ticketCount': 1 },
event: { 'name': 'TestEvent2', 'location': 'TestLocation2', 'date': '2023-07-15', 'RoomName': 'TestRoom2', 'currency': 'CHF', 'categories': { '1': { 'price': { '1':25, '2':35 }, 'bg': 'black', 'fg': 'white', 'name': 'Category 1' }, '2': { 'price': { '1':15, '2':20 }, 'bg': 'green', 'fg': 'white', 'name': 'Category 2' } }, 'ageGroups': { '1':{ 'id': 1, 'name':'Child', 'age':'0 - 15.99' }, '2':{ 'id': 2, 'name': 'Adult', 'age': null } }, 'ageGroupCount': 2, 'maxTickets': 2 },
available: { 'redo': false, 'undo': false },
scaleFactor: 1,
sizePoll: null,
prevSize: { 'h': window.innerHeight, 'w': window.innerWidth },
zoomFactor: 1,
standardDeviation: { 'currentTop': 0, 'currentLeft': 0 },
movePos: { 'top': 0, 'left': 0, 'isMoving': false, 'isSet': false },
generalSettings: { 'namingScheme': 'numeric' },
}
},
methods: {
/*
Coords are from top left corner of box.
The below function is executed as the init hook (created hook)
of vue.js, so whenever this particular page is loaded.
It loads previous data (if available) and starts the event listeners
for keyevents (like delete) and also check if the user uses a desktop
browser that meets all the requirements for being able to use the editor
reliably according to testing done.
*/
runHook () {
let self = this;
this.zoomFactor = sessionStorage.getItem( 'zoom' ) ? parseFloat( sessionStorage.getItem( 'zoom' ) ) : 1;
/*
Keybinds:
- Delete: delete selected object
- Ctrl + S: Save
- Ctrl + Z: Undo
- Ctrl + Y: Redo
*/
document.onkeydown = function ( event ) {
if ( event.key === '+' ) {
self.zoom( 0.2 );
} else if ( event.key === '-' ) {
self.zoom( -0.2 );
} else if ( event.key === '=' ) {
self.zoom( 1 );
}
};
this.loadSeatplan();
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
// TODO: remove scaleDown function again once backend is up
// TODO: Optimise for odd screen sizes and aspect ratios
},
eventHandler ( e ) {
if ( this.prevSize.h != window.innerHeight || this.prevSize.w != window.innerWidth ) {
this.prevSize = { 'h': window.innerHeight, 'w': window.innerWidth };
this.loadSeatplan();
}
},
handleScroll ( e ) {
e.preventDefault();
if ( e.deltaY > 0 ) {
this.zoom( 0.2 );
} else {
this.zoom( -0.2 );
}
},
setOffset( e ) {
this.standardDeviation.currentLeft = e.clientX;
this.standardDeviation.currentTop = e.clientY;
},
handleDrag ( e ) {
if ( e.buttons === 1 ) {
let parent = document.getElementById( 'parent' );
if ( !this.movePos.isSet ) {
this.movePos.left = parent.scrollWidth - parent.scrollLeft;
this.movePos.top = parent.scrollHeight - parent.scrollTop;
this.movePos.isSet = true;
}
this.movePos.isMoving = true;
e.preventDefault();
let valueTop = parent.scrollHeight - ( e.clientY - this.standardDeviation.currentTop + this.movePos.top );
let valueLeft = parent.scrollWidth - ( e.clientX - this.standardDeviation.currentLeft + this.movePos.left );
parent.scrollTop = valueTop > 0 ? valueTop : 0;
parent.scrollLeft = valueLeft > 0 ? valueLeft : 0;
} else {
if ( this.movePos.isMoving ) {
let parent = document.getElementById( 'parent' );
this.movePos.left = parent.scrollWidth - parent.scrollLeft;
this.movePos.top = parent.scrollHeight - parent.scrollTop;
this.movePos.isMoving = false;
}
};
},
scaleDown ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ]
let returnArray = {};
for ( let entry in valueArray ) {
returnArray[ entry ] = {};
for ( let attributes in valueArray[ entry ] ) {
if ( allowedAttributes.includes( attributes ) ) {
returnArray[ entry ][ attributes ] = Math.round( ( valueArray[ entry ][ attributes ] / this.scaleFactor ) * 1000 ) / 1000;
} else {
returnArray[ entry ][ attributes ] = valueArray[ entry ][ attributes ];
}
}
}
return returnArray;
},
loadSeatplan () {
/*
Calculate scale factor (this adds support for differently sized screens)
900px is the "default" height
*/
let height = $( document ).height() * 0.8;
this.scaleFactor = ( height / 900 ) * this.zoomFactor;
/*
Load seatplan
*/
// TODO: load from server
if ( sessionStorage.getItem( 'seatplan' ) ) {
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
}
for ( let element in this.draggables ) {
if ( this.draggables[ element ].active ) {
this.draggables[ element ].active = false;
}
}
// Check if all seats are available
// TODO: delay call
let allSeatsAvailable = false;
let self = this;
setTimeout( () => {
if ( !allSeatsAvailable ) {
self.$refs.popups.openPopup( 'We are sorry to tell you that since the last time the seat plan was refreshed, one or more of the seats you have selected has/have been taken.', {}, 'string' );
}
}, 500 );
},
scaleUp ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
let returnArray = {};
for ( let entry in valueArray ) {
returnArray[ entry ] = {};
for ( let attributes in valueArray[ entry ] ) {
if ( allowedAttributes.includes( attributes ) ) {
returnArray[ entry ][ attributes ] = Math.round( ( valueArray[ entry ][ attributes ] * this.scaleFactor ) * 1000 ) / 1000;
} else {
returnArray[ entry ][ attributes ] = valueArray[ entry ][ attributes ];
}
}
}
return returnArray;
},
zoom ( scale ) {
if ( scale == 1 ) {
this.zoomFactor = 1;
sessionStorage.setItem( 'zoom', this.zoomFactor );
this.loadSeatplan();
} else {
if ( ( this.zoomFactor < 0.3 && scale < 0 ) || ( this.zoomFactor > 2.9 && scale > 0 ) ) {
} else {
this.zoomFactor += scale;
}
sessionStorage.setItem( 'zoom', this.zoomFactor );
this.loadSeatplan();
}
},
seatSelected ( seat ) {
console.log( seat );
this.$refs.popups.openPopup( 'Please choose a ticket option', seat.option, 'dropdown' );
// Make call to server to reserve ticket.
},
seatDeselected ( seat ) {
}
},
created () {
this.runHook();
this.sizePoll = setInterval( this.eventHandler, 250 );
},
unmounted() {
clearInterval( this.sizePoll );
},
}
</script>
<style scoped>
.parent {
height: 80vh;
aspect-ratio: 16 / 9;
-webkit-aspect-ratio: 16 / 9;
top: 17vh;
left: 10vw;
position: absolute;
border: black 1px solid;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
overflow: scroll;
}
.draggable-box {
cursor: default;
}
.properties {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
z-index: 1;
background-color: var( --accent-background );
color: var( --secondary-color );
width: 20vw;
height: 90vh;
top: 7.5vh;
right: 0.5vw;
overflow: scroll;
}
.content-parent {
aspect-ratio: 16 / 9;
height: 400%;
}
.toolbar {
display: flex;
position: fixed;
top: 17vh;
left: 10.5vw;
}
.toolbar button {
margin-top: 10%;
cursor: pointer;
}
.toolbar button:disabled {
cursor: default;
}
</style>

View File

@@ -0,0 +1,95 @@
<!--
* libreevent - rightClickMenu.vue
*
* Created by Janis Hutz 07/02/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<div class="right-click-menu" id="right-click-menu">
<ul>
<li v-for="option in options" @click="executeCommand( option.command )"><span class="material-symbols-outlined right-click-symbols">{{ option.symbol }}</span>{{ option.display }}</li>
</ul>
</div>
<div class="right-click-menu-disable" @click="closeRightClickMenu()" id="right-click-menu-disable"></div>
</div>
</template>
<script>
export default {
name: 'rightClickMenu',
data() {
return {
options: {},
}
},
methods: {
openRightClickMenu( event, options ) {
$( '#right-click-menu' ).show( 100 );
// Get cursor position
$( '#right-click-menu' ).css( 'top', event.clientY + 'px' );
$( '#right-click-menu' ).css( 'left', event.clientX + 'px' );
this.options = options;
$( '#right-click-menu-disable' ).show();
},
closeRightClickMenu() {
$( '#right-click-menu' ).hide( 100 );
$( '#right-click-menu-disable' ).hide();
},
executeCommand ( command ) {
this.closeRightClickMenu();
this.$emit( 'command', command );
}
}
}
</script>
<style scoped>
/* Right click menu */
.right-click-symbols {
margin-right: 2%;
font-size: 100%;
}
.right-click-menu {
text-align: justify;
display: none;
z-index: 10;
width: 10vw;
position: fixed;
background-color: var( --overlay-color );
color: var( --secondary-color );
padding: 0.5%;
}
.right-click-menu ul {
list-style: none;
padding: 0;
margin: 0;
}
.right-click-menu ul li {
cursor: pointer;
width: 90%;
padding: 5% 5%;
}
.right-click-menu ul li:hover {
background-color: var( --hover-color );
}
.right-click-menu-disable {
position: fixed;
display: none;
opacity: 0;
height: 100vh;
width: 100vw;
top: 0;
left: 0;
}
</style>

View File

@@ -0,0 +1,195 @@
<!--
* libreevent - settings.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="settings-wrapper">
<table class="settings-toggles">
<tr class="settings-option" v-for="setting in settings">
<td class="info-wrapper">
{{ setting.display }}
<div class="info-container" @mouseenter="showInfo( setting.id )" @mouseleave="hideInfo( setting.id )">
<span class="material-symbols-outlined info-icon">info</span>
<div class="info-box" :id="setting.id">
<div class="info-box-container" v-html="setting.tooltip">
</div>
</div>
</div>
</td>
<td v-if="setting.type == 'toggle'">
<label class="switch">
<input type="checkbox" v-model="setting.value">
<span class="slider round"></span>
</label>
</td>
<td v-else-if="setting.type == 'select'">
<select v-model="setting.value">
<option v-for="option in setting.restrictions" :value="option.value">{{ option.displayName }}</option>
</select>
</td>
<td v-else-if="setting.type == 'number'">
<input type="number" v-model="setting.value" :min="setting.restrictions.min" :max="setting.restrictions.max">
</td>
<td v-else-if="setting.type == 'text'">
<input type="text" v-model="setting.value">
</td>
<td v-else-if="setting.type == 'textbox'">
<textarea v-model="setting.value"></textarea>
</td>
<td v-else-if="setting.type == 'date'">
<input type="date" v-model="setting.value">
</td>
<td v-else-if="setting.type == 'link'">
<router-link :to="setting.restrictions.to">{{ setting.restrictions.displayName }}</router-link>
</td>
</tr>
</table>
</div>
</template>
<script>
export default {
props: {
settings: Object,
},
methods: {
showInfo ( box ) {
$( '#' + box ).stop();
$( '#' + box ).fadeIn( 300 );
},
hideInfo ( box ) {
$( '#' + box ).stop();
$( '#' + box ).fadeOut( 300 );
}
}
};
</script>
<style scoped>
.settings-wrapper {
width: 100%;
display: flex;
text-align: justify;
align-items: center;
justify-content: center;
flex-direction: column;
}
.settings-toggles {
width: 70%;
}
.info-wrapper {
display: inline;
}
.info-container {
display: inline;
position: relative;
}
.info-icon {
font-size: 100%;
cursor: default;
}
.info-box {
text-align: center;
display: none;
position: absolute;
z-index: 10;
width: 20vw;
height: 20vh;
background-color: var( --hint-color );
border-radius: 20px;
top: 125%;
right: -9.3vw;
}
.info-box::before {
content: " ";
position: absolute;
bottom: 100%; /* At the bottom of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 10px;
border-style: solid;
border-color: transparent transparent var( --hint-color ) transparent;
}
.info-box-container {
display: flex;
width: 80%;
height: 80%;
padding: 10%;
padding-top: 5%;
align-items: center;
justify-content: center;
}
/* https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_switch */
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>

View File

@@ -1,3 +1,12 @@
/*
* libreevent - main.js
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';

View File

@@ -1,9 +1,18 @@
/*
* libreevent - adminRoutes.js
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
export default {
path: '/admin',
name: 'admin',
component: () => import( '../views/admin/AdminView.vue' ),
meta: {
title: 'Admin - myevent',
title: 'Admin - libreevent',
adminAuthRequired: true,
},
children: [
@@ -12,16 +21,16 @@ export default {
name: 'adminHome',
component: () => import( '../views/admin/HomeView.vue' ),
meta: {
title: 'Home :: Admin - myevent',
title: 'Home :: Admin - libreevent',
adminAuthRequired: true,
}
},
{
path: 'admin-accounts',
name: 'adminAccounts',
component: () => import( '../views/admin/AccountView.vue' ),
path: 'locations',
name: 'adminLocations',
component: () => import( '../views/admin/LocationsView.vue' ),
meta: {
title: 'Accounts :: Admin - myevent',
title: 'Accounts :: Admin - libreevent',
adminAuthRequired: true,
permissions: 'root'
}
@@ -31,7 +40,7 @@ export default {
name: 'adminPages',
component: () => import( '../views/admin/PagesView.vue' ),
meta: {
title: 'Pages :: Admin - myevent',
title: 'Pages :: Admin - libreevent',
adminAuthRequired: true,
}
},
@@ -40,16 +49,16 @@ export default {
name: 'adminEvents',
component: () => import( '../views/admin/EventsView.vue' ),
meta: {
title: 'Events :: Admin - myevent',
title: 'Events :: Admin - libreevent',
adminAuthRequired: true,
}
},
},
{
path: 'plugins',
name: 'adminPlugins',
component: () => import( '../views/admin/PluginsView.vue' ),
meta: {
title: 'Plugins :: Admin - myevent',
title: 'Plugins :: Admin - libreevent',
adminAuthRequired: true,
}
},
@@ -58,7 +67,25 @@ export default {
name: 'adminSettings',
component: () => import( '../views/admin/SettingsView.vue' ),
meta: {
title: 'Admin - myevent',
title: 'Admin - libreevent',
adminAuthRequired: true,
}
},
{
path: 'events/view',
name: 'eventDetails',
component: () => import( '../views/admin/events/EventsDetailsView.vue' ),
meta: {
title: 'Event details :: Admin - libreevent',
adminAuthRequired: true,
}
},
{
path: 'events/analytics',
name: 'eventAnalytics',
component: () => import( '../views/admin/events/AnalyticsView.vue' ),
meta: {
title: 'Event analytics :: Admin - libreevent',
adminAuthRequired: true,
}
},

View File

@@ -1,3 +1,12 @@
/*
* libreevent - index.js
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { createRouter, createWebHistory } from 'vue-router'
import { useUserStore } from '@/stores/userStore';
import { useBackendStore } from '@/stores/backendStore';
@@ -20,7 +29,7 @@ const router = createRouter( {
router.afterEach( ( to, from ) => {
document.title = to.meta.title ? to.meta.title : 'myevent';
document.title = to.meta.title ? to.meta.title : 'libreevent';
} );
let UserAccountPages = [ 'account' ];
@@ -40,11 +49,11 @@ router.beforeEach( ( to, from ) => {
return { name: 'adminHome' };
} else if ( UserAccountPages.includes( to.name ) && !isUserAuthenticated ) {
return { name: 'login' };
} else if ( !isUserAuthenticated && to.name === 'purchase' && authRequired ) {
return { name: 'login' };
} else if ( isUserAuthenticated && to.name === 'login' ) {
return { name: 'account' };
} else if ( !isUserAuthenticated && to.name === 'pay' ) {
return { name: 'purchase' };
} else if ( to.name.substring( 0, 5 ) === 'setup' && !backendStore.getVisitedSetupPages[ to.name.substring( 5 ).toLowerCase() ] && to.name.substring( 5 ).toLowerCase() !== 'start' ) {
} else if ( to.name.substring( 0, 5 ) === 'setup' && !backendStore.getVisitedSetupPages[ to.name.substring( 5 ).toLowerCase() ] && to.name.substring( 5 ).toLowerCase() !== 'start' && to.name.substring( 5 ).toLowerCase() !== 'root' ) {
return { name: 'setupStart' };
}
} );
@@ -56,7 +65,7 @@ if ( doSetup ) {
router.addRoute( data.default );
setTimeout( function () {
router.replace( window.location.pathname );
}, 300 );
}, 200 );
} );
}

View File

@@ -1,12 +1,27 @@
/*
* libreevent - mainRoutes.js
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import HomeView from '../views/HomeView.vue';
/*
This file contains all the routes for all pages accessible to a normal
user. It also includes some pages that require sign in.
*/
export default [
{
path: '/',
name: 'home',
component: HomeView,
meta: {
title: 'Home - myevent'
title: 'Home - libreevent'
}
},
{
@@ -14,7 +29,7 @@ export default [
name: 'tickets',
component: () => import( '../views/OrderView.vue' ),
meta: {
title: 'Order ticket - myevent'
title: 'Order ticket - libreevent'
}
},
{
@@ -22,7 +37,7 @@ export default [
name: 'login',
component: () => import( '../views/LoginView.vue' ),
meta: {
title: 'Login - myevent'
title: 'Login - libreevent'
}
},
{
@@ -30,7 +45,7 @@ export default [
name: 'adminLogin',
component: () => import( '../views/AdminLoginView.vue' ),
meta: {
title: 'Login :: Admin - myevent'
title: 'Login :: Admin - libreevent'
}
},
{
@@ -38,7 +53,15 @@ export default [
name: 'signup',
component: () => import( '../views/SignupView.vue' ),
meta: {
title: 'Signup - myevent'
title: 'Signup - libreevent'
}
},
{
path: '/account',
name: 'account',
component: () => import( '../views/AccountView.vue' ),
meta: {
title: 'Account - libreevent'
}
},
{
@@ -46,7 +69,7 @@ export default [
name: 'ticketDetails',
component: () => import( '../views/TicketsDetailsView.vue' ),
meta: {
title: 'Details - myevent',
title: 'Details - libreevent',
transition: 'scale'
}
},
@@ -55,7 +78,7 @@ export default [
name: 'ticketOrder',
component: () => import( '../views/TicketsOrderingView.vue' ),
meta: {
title: 'Order ticket - myevent',
title: 'Order ticket - libreevent',
transition: 'scale'
}
},
@@ -64,7 +87,7 @@ export default [
name: 'cart',
component: () => import( '../views/CartView.vue' ),
meta: {
title: 'Cart - myevent',
title: 'Cart - libreevent',
transition: 'scale'
}
},
@@ -73,7 +96,7 @@ export default [
name: 'purchase',
component: () => import( '@/views/PurchaseView.vue' ),
meta: {
title: 'Pay - myevent',
title: 'Purchase - libreevent',
transition: 'scale'
}
},
@@ -82,13 +105,35 @@ export default [
name: 'pay',
component: () => import( '@/views/PaymentView.vue' ),
meta: {
title: 'Pay - myevent',
title: 'Pay - libreevent',
transition: 'scale',
}
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: () => import( '@/views/404.vue')
component: () => import( '@/views/404.vue' ),
meta: {
title: '404 - Page not found :: libreevent',
transition: 'scale',
}
},
{
path: '/admin/seatplan',
name: 'adminSeatplanEditor',
component: () => import( '@/views/admin/events/EditorView.vue' ),
meta: {
title: 'Seatplan Editor :: Admin - libreevent',
adminAuthRequired: true,
}
},
{
path: '/admin/ticketEditor',
name: 'adminTicketEditor',
component: () => import( '@/views/admin/events/TicketEditorView.vue' ),
meta: {
title: 'Ticket Editor :: Admin - libreevent',
adminAuthRequired: true,
}
},
]

View File

@@ -1,10 +1,19 @@
/*
* libreevent - setupRoutes.js
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
export default {
path: '/setup',
name: 'setup',
component: () => import( '../views/SetupView.vue' ),
meta: {
title: 'Login :: Admin - myevent',
adminAuthRequired: true,
title: 'Login :: Admin - libreevent',
setupAuthRequired: true,
},
children: [
{
@@ -12,8 +21,8 @@ export default {
name: 'setupStart',
component: () => import( '../views/setup/SetupStartView.vue' ),
meta: {
title: 'Start :: Setup - myevent',
adminAuthRequired: true,
title: 'Start :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -21,8 +30,8 @@ export default {
name: 'setupRoot',
component: () => import( '../views/setup/SetupRootView.vue' ),
meta: {
title: 'Root account :: Setup - myevent',
adminAuthRequired: true,
title: 'Root account :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -30,8 +39,8 @@ export default {
name: 'setupPage',
component: () => import( '../views/setup/SetupPageView.vue' ),
meta: {
title: 'Landing page :: Setup - myevent',
adminAuthRequired: true,
title: 'Landing page :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -39,8 +48,8 @@ export default {
name: 'setupPayments',
component: () => import( '../views/setup/SetupPaymentsView.vue' ),
meta: {
title: 'Payments :: Setup - myevent',
adminAuthRequired: true,
title: 'Payments :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -48,8 +57,8 @@ export default {
name: 'setupEvents',
component: () => import( '../views/setup/SetupEventsView.vue' ),
meta: {
title: 'Events :: Setup - myevent',
adminAuthRequired: true,
title: 'Events :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -57,8 +66,8 @@ export default {
name: 'setupTOS',
component: () => import( '../views/setup/SetupTOSView.vue' ),
meta: {
title: 'TOS (Optional) :: Setup - myevent',
adminAuthRequired: true,
title: 'TOS (Optional) :: Setup - libreevent',
setupAuthRequired: true,
}
},
{
@@ -66,8 +75,8 @@ export default {
name: 'setupComplete',
component: () => import( '../views/setup/SetupCompleteView.vue' ),
meta: {
title: 'Setup complete :: Setup - myevent',
adminAuthRequired: true,
title: 'Setup complete :: Setup - libreevent',
setupAuthRequired: true,
}
},
]

View File

@@ -1,7 +1,16 @@
/*
* libreevent - backendStore.js
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { defineStore } from "pinia";
export const useBackendStore = defineStore ( 'backend', {
state: () => ( { 'visitedSetupPages': {}, 'guestPurchase': false, 'guestPurchaseAllowed': false } ),
state: () => ( { 'visitedSetupPages': {}, 'guestPurchase': false, 'guestPurchaseAllowed': true } ),
getters: {
getVisitedSetupPages: ( state ) => state.visitedSetupPages,
getIsGuestPurchase: ( state ) => state.guestPurchase,

View File

@@ -1,7 +1,16 @@
/*
* libreevent - userStore.js
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { defineStore } from "pinia";
export const useUserStore = defineStore ( 'user', {
state: () => ( { 'isUserAuth': false, 'isAdminAuth': true, 'userPermissions': {} } ),
state: () => ( { 'isUserAuth': true, 'isAdminAuth': true, 'userData': {} } ),
getters: {
getUserAuthenticated: ( state ) => state.isUserAuth,
getAdminAuthenticated: ( state ) => state.isAdminAuth,

View File

@@ -1,9 +1,18 @@
<!--
* libreevent - 404.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="notFound">
<h1 class="code">404</h1>
<h2 class="message">The page you are looking for was not found on the server!</h2>
<router-link to="/">Return to home page</router-link>
<a href="https://myevent.janishutz.com/docs/errors#404">More information on this error</a>
<a href="https://libreevent.janishutz.com/docs/errors#404" target="_blank">More information on this error</a>
</div>
</template>
@@ -32,4 +41,8 @@
.small {
font-style: italic;
}
nav {
display: initial;
}
</style>

View File

@@ -0,0 +1,12 @@
<template>
<div>
<h1>Account</h1>
</div>
</template>
<style>
nav {
display: initial;
}
</style>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - AdminLoginView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="login">
<div class="login-app">

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - CartView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="cart">
<h1>Cart</h1>
@@ -17,6 +26,9 @@
</div>
<div v-else>
Cart is empty. Please add tickets <router-link to="/tickets">here</router-link>
<div class="empty-cart-wrapper">
<span class="material-symbols-outlined empty-cart">remove_shopping_cart</span>
</div>
</div>
</div>
</template>
@@ -31,6 +43,19 @@
justify-content: center;
}
.empty-cart-wrapper {
width: 100%;
height: 70vh;
display: flex;
justify-content: center;
align-items: center;
}
.empty-cart {
display: block;
font-size: 20rem;
}
.cart-list {
width: 50%;
}
@@ -124,3 +149,10 @@
}
}
</script>
<style>
nav {
display: initial;
}
</style>

View File

@@ -0,0 +1,8 @@
<!--
* libreevent - GuestPurchaseView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - HomeView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<initial></initial>
</template>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - LoginView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="login">
<div class="login-app">
@@ -68,4 +77,8 @@
padding: 5px 10px;
margin-top: 2%;
}
nav {
display: initial;
}
</style>

View File

@@ -1,9 +1,18 @@
<!--
* libreevent - OrderView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="order">
<h1>Order tickets</h1>
<div class="order-app" v-if="events">
<ul v-for="event in events">
<li>
<ul>
<li v-for="event in events">
<router-link to="/tickets/details" class="ticket" @click="setActiveTicket( event.eventID );">
<div class="ticket-name">
<h3>{{ event.name }}</h3>
@@ -91,3 +100,10 @@
}
};
</script>
<style>
nav {
display: initial;
}
</style>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - PaymentView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="order">
<h1>Purchase</h1>
@@ -53,3 +62,10 @@
margin-right: auto
}
</style>
<style>
nav {
display: initial;
}
</style>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - PurchaseView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="purchase">
<h1>Purchase</h1>
@@ -10,8 +19,13 @@
<div v-else class="wrapper">
<div class="data">
<h2>Billing</h2>
<router-link to="/pay">Buy now</router-link>
<table class="billing-info-table">
<tr>
<td>Street and house number</td>
<td><input type="text" name="address" id="address"></td>
</tr>
</table>
<router-link to="/pay" id="buy-button">Buy now</router-link>
</div>
<div class="cart">
<div class="cart-list">
@@ -35,6 +49,25 @@
</template>
<style scoped>
#buy-button {
background-color: var( --accent-background );
padding: 2% 4%;
border-radius: 50px;
color: var( --secondary-color );
text-decoration: none;
transition: all 0.5s;
font-size: 100%;
margin-top: 4%;
}
#buy-button:hover {
margin-top: 2%;
border-radius: 20px;
padding: 3% 6%;
font-size: 130%;
background-color: var( --accent-background-hover );
}
.purchase {
height: 100%;
display: flex;

View File

@@ -1,21 +1,28 @@
<!--
* libreevent - SetupView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<nav class="setup-nav">
<router-link to="/setup">Start</router-link> |
<router-link to="/setup/root" v-if="backendStore.getVisitedSetupPages[ 'root' ]">Root account</router-link>
<a v-else class="inactive">Root account</a> |
<router-link to="/setup/page" v-if="backendStore.getVisitedSetupPages[ 'page' ]">Landing page</router-link>
<router-link to="/setup/root" @click="unlock( 'page' )">Root account</router-link> |
<router-link to="/setup/page" v-if="backendStore.getVisitedSetupPages[ 'page' ]" @click="unlock( 'payments' )">Landing page</router-link>
<a v-else class="inactive">Landing page</a> |
<router-link to="/setup/payments" v-if="backendStore.getVisitedSetupPages[ 'payments' ]">Payments</router-link>
<router-link to="/setup/payments" v-if="backendStore.getVisitedSetupPages[ 'payments' ]" @click="unlock( 'events' )">Payments</router-link>
<a v-else class="inactive">Payments</a> |
<router-link to="/setup/events" v-if="backendStore.getVisitedSetupPages[ 'events' ]">Events</router-link>
<router-link to="/setup/events" v-if="backendStore.getVisitedSetupPages[ 'events' ]" @click="unlock( 'tos' )">Events</router-link>
<a v-else class="inactive">Events</a> |
<router-link to="/setup/tos" v-if="backendStore.getVisitedSetupPages[ 'tos' ]">TOS</router-link>
<router-link to="/setup/tos" v-if="backendStore.getVisitedSetupPages[ 'tos' ]" @click="unlock( 'complete' )">TOS</router-link>
<a v-else class="inactive">TOS</a> |
<router-link to="/setup/complete" v-if="backendStore.getVisitedSetupPages[ 'complete' ]">Complete</router-link>
<a v-else class="inactive">Complete</a>
</nav>
<h1>Setup</h1>
<div class="main-view">
<router-view v-slot="{ Component, route }">
<transition :name="route.meta.transition || 'scale'" mode="out-in">
@@ -42,6 +49,11 @@
created () {
this.backendStore.loadVisitedSetupPages();
},
methods: {
unlock ( page ) {
this.backendStore.addVisitedSetupPages( page, true );
}
}
};
</script>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - SignupView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="login">
<div class="login-app">

View File

@@ -1,16 +1,33 @@
<!--
* libreevent - TicketsDetailsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="details">
<h1>Details</h1>
<div class="top-container">
<h1>{{ event.name }}</h1>
<router-link to="/tickets"><span class="material-symbols-outlined" style="font-size: 100%;">arrow_back</span>Back</router-link>
<h3>{{ event.name }}</h3>
<p>{{ event.description }}</p>
<router-link to="/tickets/order">Order tickets</router-link>
</div>
</div>
</template>
<style scoped>
.details {
flex-grow: 1;
height: 100%;
}
.top-container {
background: linear-gradient( to top, rgba( 0, 0, 0, 0.9 ) 50%, rgba( 0, 0, 0, 0 ) ), url( '@/assets/logo.png');
background-repeat: no-repeat;
background-size: cover;
height: 100%;
}
</style>

View File

@@ -1,3 +1,12 @@
<!--
* libreevent - TicketsOrderingView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="details">
<!-- Load correct component depending on what the event's config is -->
@@ -13,7 +22,7 @@
</style>
<script>
import seatplan from '@/components/seatplan.vue';
import seatplan from '@/components/seatplan/userApp/userWindow.vue';
import noseatplan from '@/components/noseatplan.vue';
export default {

View File

@@ -1,17 +1,31 @@
<!--
* libreevent - AdminView.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="admin-wrapper">
<div class="top-bar">
<h1>Admin panel</h1>
</div>
<button class="hideNav navHidden" @click="navMenu( 'toggle' );">&#9776</button>
<nav class="side-nav">
<router-link to="/admin" class="admin-menu">Home</router-link>
<router-link to="/admin/admin-accounts" class="admin-menu">Admin Accounts</router-link>
<router-link to="/admin/pages" class="admin-menu">Pages</router-link>
<router-link to="/admin/events" class="admin-menu">Events</router-link>
<router-link to="/admin/plugins" class="admin-menu">Plugins</router-link>
<router-link to="/admin/settings" class="admin-menu">Settings</router-link>
<button to="/admin/login" class="admin-menu" @click="logout()">Logout</button>
<div class="side-nav-wrapper">
<img src="@/assets/logo.png" alt="libreevent logo" style="width: 80%; margin-left: 10%; margin-bottom: 5%;">
<router-link to="/admin" class="admin-menu" @click="navMenu( 'hide' )" title="The home page of the admin panel">Home</router-link>
<router-link to="/admin/pages" class="admin-menu" @click="navMenu( 'hide' )" title="Modify your landing page, your terms of service, etc.">Pages</router-link>
<router-link to="/admin/events" class="admin-menu" @click="navMenu( 'hide' )" title="Change, view and analyse everything about your events">Events</router-link>
<router-link to="/admin/locations" class="admin-menu" @click="navMenu( 'hide' )" title="Change settings about your event locations">Locations</router-link>
<router-link to="/admin/plugins" class="admin-menu" @click="navMenu( 'hide' )" title="Install, Uninstall and manage plugins">Plugins</router-link>
<router-link to="/admin/settings" class="admin-menu" @click="navMenu( 'hide' )" title="Change global settings for libreevent">Settings</router-link>
<button to="/admin/login" class="admin-menu" @click="logout()" title="Log out of the admin panel">Logout</button>
</div>
</nav>
<div class="backdrop" @click="navMenu( 'hide' )"></div>
<div class="main-view">
<router-view v-slot="{ Component, route }">
<transition :name="route.meta.transition || 'fade'" mode="out-in">
@@ -23,6 +37,102 @@
</template>
<style scoped>
.admin-wrapper {
display: block;
height: 100%;
}
.top-bar {
display: flex;
justify-content: center;
align-items: center;
height: 10vh;
}
.main-view {
grid-area: main;
height: 90vh;
width: 100vw;
min-height: 80vh;
overflow: scroll;
}
.backdrop {
width: 100vw;
height: 100vh;
z-index: 1;
display: none;
position: fixed;
top: 0;
left: 0;
background-color: rgba( 0, 0, 0, 0.7 );
}
.side-nav {
position: fixed;
display: none;
height: 100vh;
top: 0;
width: 30vw;
padding: 0;
margin: 0;
background-color: var( --accent-background );
z-index: 3;
}
.side-nav-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
overflow: scroll;
height: 100%;
}
.admin-menu {
padding: 4% 0%;
width: 100%;
background-color: rgba( 0, 0, 0, 0 );
color: var( --secondary-color );
cursor: pointer;
font-family: Avenir, Helvetica, Arial, sans-serif;
font-weight: bold;
text-decoration: none;
transition: 1s;
font-size: 100%;
border-style: none;
}
nav a.router-link-exact-active {
background-color: var( --accent-background-hover );
}
.admin-menu:hover {
background-color: var( --accent-background-hover );
transition: 0.4s;
}
.hideNav {
border: none;
font-size: 300%;
color: var( --secondary-color );
width: fit-content;
background-color: rgba( 0, 0, 0, 0 );
position: fixed;
cursor: pointer;
top: 1vw;
left: 2vw;
z-index: 5;
}
.navHidden {
color: var( --primary-color );
}
@media only screen and (min-width: 1299px) {
.hideNav, .backdrop {
display: none;
}
.admin-wrapper {
display: grid;
grid-template-areas:
@@ -49,15 +159,18 @@
.main-view {
grid-area: main;
height: 100%;
width: 80vw;
min-height: 80vh;
overflow: scroll;
}
.side-nav {
position: initial;
grid-area: sidebar;
display: flex;
flex-direction: column;
height: 100%;
width: 20vw;
padding: 0;
margin: 0;
background-color: var( --accent-background );
@@ -87,7 +200,7 @@
background-color: var( --accent-background-hover );
transition: 0.4s;
}
}
</style>
<style>
@@ -117,6 +230,23 @@
this.$router.push( '/admin/login' );
} );
}
},
navMenu ( action ) {
if ( screen.width < 1300 ) {
if ( action === 'toggle' ) {
$( '.side-nav' ).toggle( 300 );
$( '.hideNav' ).toggleClass( 'navHidden' );
$( '.backdrop' ).toggle( 300 );
} else if ( action === 'show' ) {
$( '.backdrop' ).show( 300 );
$( '.side-nav' ).show( 300 );
$( '.hideNav' ).removeClass( 'navHidden' );
} else {
$( '.side-nav' ).hide( 300 );
$( '.backdrop' ).hide( 300 );
$( '.hideNav' ).addClass( 'navHidden' );
}
}
}
}
};

View File

@@ -1,21 +1,126 @@
<!--
* libreevent - EventsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<div class="order">
<h2>Events</h2>
<p>Welcome to the admin panel!</p>
<div class="bigButtons"></div>
<div class="order-app" v-if="events">
<ul v-for="timeframe in eventList">
<h3>{{ timeframe.name }}</h3>
<li v-for="event in timeframe.content">
<router-link to="/admin/events/view" class="ticket" @click="setActiveTicket( event.eventID );" v-if="new Date( event.date ).getTime() > currentDate">
<div class="ticket-name">
<h3>{{ event.name }}</h3>
<p>{{ event.description }}</p>
<b>{{ event.date }}</b>
</div>
<img :src="require( '@/assets/' + event.logo )" alt="event logo" class="ticket-logo">
</router-link>
<router-link to="/admin/events/analytics" class="ticket" @click="setActiveTicket( event.eventID );" v-else="new Date( event.date ).getTime() > currentDate">
<div class="ticket-name">
<h3>{{ event.name }}</h3>
<p>{{ event.description }}</p>
<b>{{ event.date }}</b>
</div>
<img :src="require( '@/assets/' + event.logo )" alt="event logo" class="ticket-logo">
</router-link>
</li>
</ul>
</div>
<div class="order-app" v-else>
No future events are available!
</div>
</div>
</template>
<style scoped>
.order-app {
text-align: justify;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
ul {
list-style: none;
width: 80%;
}
.ticket {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
color: var( --primary-color );
border-color: var( --primary-color );
border-width: 1px;
height: fit-content;
border-style: solid;
padding: 10px;
transition: 0.4s;
}
.ticket:hover {
background-color: var( --hover-color );
transition: 0.4s;
}
.ticket-logo {
height: 20vh;
width: auto;
margin-left: auto;
}
.ticket-name {
margin-right: auto;
max-width: 60%;
}
.ticket-info {
margin-left: auto;
margin-right: auto
}
</style>
<script>
export default {
data () {
return {
formData: {}
name: 'OrderView',
methods: {
setActiveTicket ( id ) {
sessionStorage.setItem( 'selectedTicket', id );
}
},
methods: {
setup () {
data () {
return {
events: { 'test':{ 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-07-15', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': 'logo.png' }, 'test2':{ 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-06-14', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': 'logo.png' } },
currentDate: new Date().getTime(),
eventList: { 'upcoming': { 'name': 'Upcoming', 'content': {} }, 'past': { 'name': 'Past', 'content': {} } },
}
},
created() {
// Sort events object such that events closest to today are displayed first and past events displayed last
let sortable = [];
for ( let event in this.events ) {
sortable.push( [ this.events[ event ][ 'eventID' ], new Date( this.events[ event ][ 'date' ] ).getTime() ] );
}
sortable.sort( function( a, b ) {
return a[ 1 ] - b [ 1 ];
} );
for ( let element in sortable ) {
if ( sortable[ element ][ 1 ] > this.currentDate ) {
this.eventList.upcoming.content[ sortable[ element ][ 0 ] ] = this.events[ sortable[ element ][ 0 ] ];
} else {
this.eventList.past.content[ sortable[ element ][ 0 ] ] = this.events[ sortable[ element ][ 0 ] ];
}
}
}
};

View File

@@ -1,14 +1,24 @@
<!--
* libreevent - HomeView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Home</h2>
<p>Welcome to the admin panel!</p>
<div class="bigButton-container">
<router-link to="/admin/admin-accounts" class="bigButton">Admin-accounts</router-link>
<router-link to="/admin/pages" class="bigButton">Pages</router-link>
<router-link to="/admin/events" class="bigButton">Events</router-link>
<router-link to="/admin/events" class="bigButton">Plugins</router-link>
<router-link to="/admin/events" class="bigButton">Settings</router-link>
<a href="https://myevent.janishutz.com/docs/admin-panel" class="bigButton" target="_blank">Documentation</a>
<router-link to="/admin/locations" class="bigButton">Locations</router-link>
<router-link to="/admin/plugins" class="bigButton">Plugins</router-link>
<router-link to="/admin/settings" class="bigButton">Settings</router-link>
<a href="https://libreevent.janishutz.com/docs/admin-panel" class="bigButton" target="_blank">Documentation <span class="material-symbols-outlined" style="display: inline; font-size: 100%;">open_in_new</span></a>
</div>
</div>
</template>

View File

@@ -0,0 +1,152 @@
<!--
* libreevent - LocationsView.vue
*
* Created by Janis Hutz 06/05/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Locations</h2>
<p>Here you can change everything regarding event locations. All locations can have a seating plan.</p>
<button @click="addLocation();">Add new location</button>
<div class="location-app" v-if="Object.keys( locations ).length">
<ul>
<li v-for="location in locations">
<div class="location" @click="selectLocation( location.locationID );" title="Edit this location">
<div class="location-name">
<h3>{{ location.name }}</h3>
<p v-if="location['seatplan-enabled']">This location has a seatplan.</p>
<p v-else>This location has NO seatplan.</p>
</div>
</div>
</li>
</ul>
</div>
<div v-else class="no-location-hint">
No locations configured, please <b @click="addLocation();" style="cursor: pointer;">add</b> one
</div>
<popups ref="popup" size="big"></popups>
<popups ref="popup2" size="huge"></popups>
</div>
</template>
<script>
import popups from '@/components/notifications/popups.vue';
export default {
data () {
return {
locations: { 'test':{ 'name':'TestLocation', 'locationID':'test', 'seatplan-enabled': true, 'seatplan': {} } },
}
},
components: {
popups,
},
methods: {
selectLocation ( locationID ) {
sessionStorage.setItem( 'locationID', locationID );
this.$refs.popup.openPopup( 'Settings for ' + this.locations[ locationID ][ 'name' ], {
'locationName': {
'display': 'Location name',
'id': 'locationName',
'tooltip':'Give the location the event takes place a name. This name will also be shown to customers',
'value': '',
'type': 'text',
},
'usesSeatplan': {
'display': 'Use seat plan?',
'id': 'usesSeatplan',
'tooltip':'With this toggle you may specify whether or not this location has a seat plan or not.',
'value': true,
'type': 'toggle',
},
'seatplanEditor': {
'display': 'Seat plan editor',
'id': 'seatplanEditor',
'tooltip':'The seat plan editor allows you to create a seat plan that closely resembles the location you host the event in.',
'type': 'link',
'restrictions': {
'to': '/admin/seatplan',
'displayName': 'Edit seat plan'
}
},
}
, 'settings' );
},
addLocation () {
this.$refs.popup.openPopup( 'Add a new location', {
'locationName': {
'display': 'Location name',
'id': 'locationName',
'tooltip':'Give the location the event takes place a name. This name will also be shown to customers',
'value': '',
'type': 'text',
},
'usesSeatplan': {
'display': 'Use seat plan?',
'id': 'usesSeatplan',
'tooltip':'With this toggle you may specify whether or not this location has a seat plan or not.',
'value': true,
'type': 'toggle',
},
'seatplanEditor': {
'display': 'Seat plan editor',
'id': 'seatplanEditor',
'tooltip':'The seat plan editor allows you to create a seat plan that closely resembles the location you host the event in.',
'type': 'link',
'restrictions': {
'to': '/admin/seatplan',
'displayName': 'Edit seat plan'
}
},
}
, 'settings' );
},
}
};
</script>
<style scoped>
.location-app {
text-align: justify;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
ul {
list-style: none;
width: 80%;
}
.location {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
color: var( --primary-color );
border-color: var( --primary-color );
border-width: 1px;
height: fit-content;
border-style: solid;
padding: 10px;
transition: 0.4s;
cursor: pointer;
}
.location:hover {
background-color: var( --hover-color );
transition: 0.4s;
}
.location-name {
margin-right: auto;
max-width: 35%;
}
</style>

View File

@@ -1,8 +1,16 @@
<!--
* libreevent - PagesView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Pages</h2>
<p>Welcome to the admin panel!</p>
<div class="bigButtons"></div>
<p>Here you can modify your landing page (the start page of libreǝvent) and other pages</p>
</div>
</template>

View File

@@ -1,7 +1,16 @@
<!--
* libreevent - PluginsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Plugins</h2>
<p>Welcome to the admin panel!</p>
<p>Here you can manage installed plugins and install more</p>
<div class="bigButtons"></div>
</div>
</template>

View File

@@ -1,22 +1,259 @@
<!--
* libreevent - SettingsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Settings</h2>
<p>Welcome to the admin panel!</p>
<div class="bigButtons"></div>
<settings v-model:settings="settings"></settings>
<table class="gateway-settings">
<tr>
<td style="width: 75%;">
Edit settings of the payment gateway
</td>
<td>
<span class="material-symbols-outlined" @click="showPaymentSettings();" style="cursor: pointer;" title="Edit settings for the payment gateway you selected">settings</span>
</td>
</tr>
</table>
<p>Detailed explanation of payment gateways can be found <a href="https://libreevent.janishutz.com/docs/payments" target="_blank">here</a>. You may install more payment gateway integrations in the plugins section.</p>
<div class="admin-settings">
<h2>Admin Accounts</h2>
<p>Before setting or editing permissions here, please read the corresponding section of the documentation <a href="https://libreevent.janishutz.com/docs/admin-panel/settings/admin-accounts#permissions" target="_blank">here</a>.
<br>Usually, the permissions automatically set by the system on account creation should be appropriate.</p>
<div v-for="account in adminAccounts" class="account" @click="showAccountSettings( account.username );" title="Edit permissions of this account (right click for more options)" @contextmenu="( e ) => { e.preventDefault(); openRightClickMenu( account.username, e ); }">
<div class="location-name">
<h3>{{ account.username }}</h3>
<p>{{ account.email }}</p>
</div>
</div>
</div>
<rightClickMenu ref="rclk" @command="( command ) => { executeCommand( command ) }"></rightClickMenu>
<popups ref="popup" size="big"></popups>
</div>
</template>
<script>
import settings from '@/components/settings/settings.vue';
import popups from '@/components/notifications/popups.vue';
import rightClickMenu from '@/components/settings/rightClickMenu.vue';
export default {
name: 'adminSettingsView',
components: {
settings,
popups,
rightClickMenu,
},
data () {
return {
formData: {}
adminAccounts: { 'janis': { 'username': 'janis', 'email': 'info@janishutz.com', 'permissions': [ ] }, 'admin': { 'username': 'admin', 'email': 'development@janishutz.com', 'permissions': [ ] } },
currentlyOpenMenu: '',
settings: {
'2fa': {
'display': 'Require Two-Factor-Authentication of user',
'id': '2fa',
'tooltip':'Control whether or not users are required to use Two-Factor-Authentication. Defaults to "User can decide", which is recommended',
'value': 'always',
'type': 'select',
'restrictions': {
'always': {
'displayName':'Always require',
'value': 'always'
},
'userDecided': {
'displayName':'User can decide',
'value': 'userDecided'
},
'never': {
'displayName':'Disable',
'value': 'never'
},
}
},
'addressRequired': {
'display': 'Require user to provide address?',
'id': 'addressRequired',
'tooltip':'With this toggle you may specify whether or not a user has to provide their address when purchasing something. (Keep GDPR in mind when processing data!)',
'value': false,
'type': 'toggle',
},
'phoneNumberRequired': {
'display': 'Require user to provide address?',
'id': 'phoneNumberRequired',
'tooltip':'With this toggle you may specify whether or not a user has to provide their address when purchasing something. (Keep GDPR in mind when processing data!)',
'value': false,
'type': 'toggle',
},
'paymentGateway': {
'display': 'Select the payment gateway to use',
'id': 'paymentGateway',
'tooltip':'With this setting you may change which payment gateway you want to use. You will need to provide details below! If you are not sure what this setting means, please click the link below.',
'value': 'stripe',
'type': 'select',
'restrictions': {
'stripe': {
'displayName':'Stripe',
'value': 'stripe'
},
'adyen': {
'displayName':'Adyen',
'value': 'adyen'
},
}
},
}
}
},
methods: {
setup () {
showAccountSettings ( account ) {
this.$refs.popup.openPopup( 'Edit user permissions for ' + this.adminAccounts[ account ][ 'username' ], {
'pagesSettings': {
'display': 'Modify pages',
'id': 'pagesSettings',
'tooltip':'Change this setting to allow or disallow the selected user to access and change any settings of pages like the start page.',
'value': false,
'type': 'toggle',
},
'locationsSettings': {
'display': 'Location settings and seat plans',
'id': 'locationsSettings',
'tooltip':'Change this setting to allow or disallow the selected user to modify, delete or create locations with their corresponding seat plans.',
'value': false,
'type': 'toggle',
},
'plugins': {
'display': 'Plugin management',
'id': 'plugins',
'tooltip':'Change this setting to allow or disallow the selected user to install or uninstall plugins. Some plugins might allow you to set extra permissions inside of their settings panels',
'value': false,
'type': 'toggle',
},
'events': {
'display': 'Event management',
'id': 'events',
'tooltip':'Change this setting to allow or disallow the selected user to install or uninstall plugins. Some plugins might allow you to set extra permissions inside of their settings panels',
'value': false,
'type': 'toggle',
},
'entryControl': {
'display': 'Entry control',
'id': 'entryControl',
'tooltip':'Change this setting to allow or disallow the selected user to execute entry control at the entrance to your event location.',
'value': true,
'type': 'toggle',
},
}
, 'settings' );
},
showPaymentSettings () {
this.$refs.popup.openPopup( 'Payment gateway settings', {
'pagesSettings': {
'display': 'Modify pages',
'id': 'pagesSettings',
'tooltip':'Change this setting to allow or disallow the selected user to access and change any settings of pages like the start page.',
'value': false,
'type': 'toggle',
},
'locationsSettings': {
'display': 'Location settings and seat plans',
'id': 'locationsSettings',
'tooltip':'Change this setting to allow or disallow the selected user to modify, delete or create locations with their corresponding seat plans.',
'value': false,
'type': 'toggle',
},
'plugins': {
'display': 'Plugin management',
'id': 'plugins',
'tooltip':'Change this setting to allow or disallow the selected user to install or uninstall plugins. Some plugins might allow you to set extra permissions inside of their settings panels',
'value': false,
'type': 'toggle',
},
'events': {
'display': 'Event management',
'id': 'events',
'tooltip':'Change this setting to allow or disallow the selected user to install or uninstall plugins. Some plugins might allow you to set extra permissions inside of their settings panels',
'value': false,
'type': 'toggle',
},
'entryControl': {
'display': 'Entry control',
'id': 'entryControl',
'tooltip':'Change this setting to allow or disallow the selected user to execute entry control at the entrance to your event location.',
'value': true,
'type': 'toggle',
},
}
, 'settings' );
},
executeCommand( command ) {
if ( command === 'openPermissions' ) {
this.showAccountSettings( this.currentlyOpenMenu );
} else if ( command === 'deleteUser' ) {
this.$refs.popup.openPopup( 'Do you really want to delete the user ' + this.currentlyOpenMenu + '?', {}, 'confirm' );
}
},
handlePopupReturns( message, data ) {
},
openRightClickMenu( id, event ) {
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'openPermissions', 'symbol': 'edit', 'display': 'Edit permissions' }, 'delete': { 'command': 'deleteUser', 'symbol': 'delete', 'display': 'Delete User' } } )
this.currentlyOpenMenu = id;
}
}
};
// TODO: Load gateways and settings in general from server.
</script>
<style scoped>
.gateway-settings {
width: 70%;
text-align: justify;
margin-left: 15%;
}
.admin-settings {
text-align: justify;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.account {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
color: var( --primary-color );
border-color: var( --primary-color );
border-width: 1px;
height: fit-content;
border-style: solid;
padding: 10px;
transition: 0.4s;
cursor: pointer;
width: 60%;
margin-bottom: 5px;
}
.account:hover {
background-color: var( --hover-color );
transition: 0.4s;
}
.location-name {
margin-right: auto;
max-width: 35%;
}
</style>

View File

@@ -0,0 +1,16 @@
<!--
* libreevent - AnalyticsView.vue
*
* Created by Janis Hutz 06/28/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Event analytics</h2>
<p>Get insights into tickets sold, people checked in, available tickets, revenue, etc, in real time!</p>
<!-- TODO: Add toggle for real-time update (will fetch every 30s, possibly even using a WS) -->
</div>
</template>

View File

@@ -0,0 +1,41 @@
<!--
* libreevent - EditorView.vue
*
* Created by Janis Hutz 05/12/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Seat Plan Editor</h2>
<window />
</div>
</template>
<script>
import window from '@/components/seatplan/editor/window.vue';
export default {
components: {
window,
},
methods: {
checkLocationSelected () {
if ( !sessionStorage.getItem( 'locationID' ) ) {
this.$router.push( '/admin/locations' );
}
}
},
created() {
this.checkLocationSelected();
}
};
</script>
<style>
nav {
display: none;
}
</style>

View File

@@ -0,0 +1,192 @@
<!--
* libreevent - TicketsDetailsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="details">
<h2>{{ event.name }}</h2>
<div class="category-wrapper">
<p>Event Description</p>
<textarea v-model="event.description" class="big-text" cols="70" rows="3" placeholder="Event description..."></textarea>
<table class="category">
<tr>
<td>Event location</td>
<td>
<select v-model="event.location" class="small-text">
<option value="TestLocation">TestLocation</option>
</select>
</td>
</tr>
<tr>
<td>Event date</td>
<td><input v-model="event.date" class="small-text" type="date"></td>
</tr>
<tr>
<td>Ticket editor</td>
<router-link to="/admin/ticketEditor">Edit ticket layout</router-link>
</tr>
</table>
</div>
<div class="ticket-settings">
<h3>Ticket Settings</h3>
<p>The foreground and background colours of the seats are used to show the customer to which category the seats belong.</p>
<div class="category-wrapper">
<table class="category" v-for="category in event.categories">
{{ category.name }}
<tr v-for="price in category.price">
<td>
<div class="category-details">{{ price.name }}:</div>
</td>
<td>
<input type="number" v-model="price.price">
</td>
</tr>
<tr>
<td><div class="category-details">Foreground colour:</div></td>
<td>
<input type="text" data-coloris v-model="category.fg" onkeydown="return false;">
</td>
</tr>
<tr>
<td><div class="category-details">Background colour:</div></td>
<td>
<input type="text" data-coloris v-model="category.bg" onkeydown="return false;">
</td>
</tr>
</table>
</div>
</div>
<div class="special-settings">
<h3>General Settings</h3>
<p>Currency codes used must be valid ISO 4217 codes. Read more on <a href="https://libreevent.janishutz.com/docs/admin-panel/events#currency">this page</a> of the documentation <!-- https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes"--></p>
<settings v-model:settings="specialSettings"></settings>
</div>
<div>
<p>Please read into the documentation of this section if you want to use the requirements. It requires specific syntax to work. See <a href="https://libreevent.janishutz.com/docs/admin-panel/events#special-requirements">here</a> for more information</p>
</div>
<notifications ref="notification" location="topright"></notifications>
</div>
</template>
<style scoped>
.details {
flex-grow: 1;
}
.ticket-settings {
width: 100%;
}
.category-wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex-direction: column;
}
.category {
width: 50%;
text-align: justify;
}
.category-details {
margin-left: 7%;;
}
</style>
<script>
import settings from '@/components/settings/settings.vue';
import notifications from '@/components/notifications/notifications.vue';
export default {
name: 'TicketsDetailsView',
components: {
settings,
notifications,
},
created () {
if ( !sessionStorage.getItem( 'selectedTicket' ) ) {
this.$router.push( '/admin/events' );
}
this.eventID = sessionStorage.getItem( 'selectedTicket' );
},
data() {
return {
event: { 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'TestDate', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': 'logo.png', 'categories': { '1': { 'price': { '1': { 'price':25, 'name':'Child (0-15.99 years)'}, '2': { 'price':35, 'name':'Adult'} }, 'bg': 'black', 'fg': 'white', 'name': 'Category 1' }, '2': { 'price': { '1': { 'price':25, 'name':'Child (0-15.99 years)' }, '2': { 'price':35, 'name':'Adult'} }, 'bg': 'green', 'fg': 'white', 'name': 'Category 2' } } },
specialSettings: {
'currency': {
'display': 'Currency',
'id': 'currency',
'tooltip':'Specify a currency in which the prices are displayed to the customer. Defaults to USD. Please use valid currency codes.',
'value': 'USD',
'type': 'text',
},
'guest-purchase': {
'display': 'Enable guest purchase',
'id': 'guest-purchase',
'tooltip':'Allowing guest purchase means that a user does not have to create an account in order for them to be able to make a purchase. Default: On',
'value': true,
'type': 'toggle'
},
'overbooking': {
'display': 'Enable overbooking of event',
'id': 'overbooking',
'tooltip':'Allow more ticket reservations than you have tickets available. Currently only available for events without seatplans. Default: Off',
'value': false,
'type': 'toggle'
},
'maxTickets': {
'display': 'Maximum ticket count per account',
'id': 'maxTickets',
'tooltip':'With this setting you can control how many tickets a person can buy. Defaults to 0, which means do not limit.',
'value': 0,
'type': 'number',
'restrictions': {
'min': 0,
'max': 100,
}
},
'requiredParameter': {
'display': 'Special requirements',
'id': 'requiredParameter',
'tooltip':'Set this parameter to require the user to provide a certain email domain, a special number or special string of characters. Defaults to None',
'value': 'none',
'type': 'select',
'restrictions': {
'none': {
'displayName':'None',
'value': 'none'
},
'email': {
'displayName':'Email domain',
'value': 'email'
},
'numbers': {
'displayName':'Number sequence',
'value': 'numbers'
},
'string': {
'displayName':'Text sequence',
'value': 'string'
},
}
},
'requiredParameterValue': {
'display': 'Special requirements values ',
'id': 'requiredParameterValue',
'tooltip':'Put a filter here, corresponding to your selection above. Please read the documentation on our website. See link below!',
'value': '',
'type': 'text',
},
}
}
}
};
</script>

View File

@@ -0,0 +1,136 @@
<template>
<div id="ticketEditor">
<h1>Ticket Editor</h1>
<div class="toolbar">
<router-link to="/admin/events/view" class="toolbar-item" title="Back to event settings">Back</router-link>
<form class="toolbar-item">
<input type="file" accept="application/pdf" id="pdfTemplate" class="toolbar-item">
</form>
<button @click="loadPDF();" class="toolbar-item">Load file</button>
<button @click="saveTemplate()" class="toolbar-item" title="Save your ticket">Save Template</button>
<button @click="testNotifications();" class="toolbar-item">Test notifications</button>
</div>
<div id="editor">Loading editor...</div>
<notifications ref="notification" location="topleft"></notifications>
</div>
</template>
<script>
import { Designer, BLANK_PDF } from '@pdfme/ui';
import notifications from '@/components/notifications/notifications.vue';
export default {
name: 'ticketEditor',
data() {
return {
designer: null,
}
},
components: {
notifications
},
methods: {
saveTemplate() {
// Save to server instead
this.$refs.notification.createNotification( 'Saving...', 5, 'progress', 'normal' );
this.$refs.notification.createNotification( 'Saved successfully', 5, 'ok', 'normal' );
console.log( this.designer.getTemplate() );
},
testNotifications () {
this.$refs.notification.createNotification( 'Warning', 10, 'warning', 'normal' );
this.$refs.notification.createNotification( 'Error', 10, 'error', 'normal' );
this.$refs.notification.createNotification( 'Info', 10, 'info', 'normal' );
this.$refs.notification.createNotification( 'Ok', 10, 'ok', 'normal' );
this.$refs.notification.createNotification( 'Progress', 10, 'progress', 'normal' );
},
loadPDF () {
let files = document.getElementById( 'pdfTemplate' ).files;
if ( files.length ) {
let pdfLoading = this.$refs.notification.createNotification( 'Loading pdf...', 5, 'progress', 'normal' );
let pdf = files[ 0 ];
if ( pdf.name.substring( pdf.name.length - 4 ) === '.pdf' ) {
let fileReader = new FileReader();
let base64;
let self = this;
// Onload of file read the file content
// https://stackoverflow.com/questions/13538832/convert-pdf-to-a-base64-encoded-string-in-javascript?rq=4
fileReader.onload = function( fileLoadedEvent ) {
base64 = fileLoadedEvent.target.result;
let oldTemplate = self.designer.getTemplate();
oldTemplate[ 'basePdf' ] = base64;
self.designer.updateTemplate( oldTemplate );
self.$refs.notification.cancelNotification( pdfLoading );
self.$refs.notification.createNotification( 'Loaded pdf successfully', 5, 'ok', 'normal' );
};
fileReader.readAsDataURL( pdf );
} else {
this.$refs.notification.createNotification( 'Cannot load pdf: Not a pdf!', 5, 'error', 'normal' );
}
} else {
this.$refs.notification.createNotification( 'Cannot load pdf: No file selected', 5, 'error', 'normal' );
}
}
},
created() {
setTimeout( () => {
const domContainer = document.getElementById( 'editor' );
// TODO: Load from server if available
const template = {
basePdf: BLANK_PDF,
schemas: [
{
locationAndTime: {
type: 'text',
position: { x: 0, y: 0 },
width: 10,
height: 10,
},
ticketName: {
type: 'text',
position: { x: 10, y: 10 },
width: 10,
height: 10,
},
ticketQRCode: {
type: 'qrcode',
position: { x: 20, y: 20 },
width: 10,
height: 10,
},
},
],
}
this.designer = new Designer( { domContainer, template } );
// designer.updateTemplate( ) -> Used to update the template AND base PDF
}, 300 );
}
}
</script>
<style>
nav {
display: none;
}
</style>
<style scoped>
#editor {
height: 85vh;
}
.toolbar {
height: 5vh;
display: flex;
width: 100%;
justify-content: center;
align-items: center;
margin-top: 0;
}
.toolbar-item {
margin: 0;
margin-left: 0.5%;
}
</style>

View File

@@ -0,0 +1,88 @@
<!--
* libreevent - TicketsDetailsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div class="details">
<h2>{{ event.name }}</h2>
<div class="category-wrapper">
<table class="category">
<tr>
<td>Location name</td>
<td>
<input type="text" v-model="event.name">
</td>
</tr>
<tr>
<td>Seat plan editor</td>
<router-link to="/admin/seatplan">Edit seat plan</router-link>
</tr>
</table>
</div>
<button @click="openPopup()">Open Popup</button>
<popups ref="popup" @data="( event ) => { popupReturnHandling( event ) }"></popups>
<notifications ref="notification" location="topright"></notifications>
</div>
</template>
<style scoped>
.details {
flex-grow: 1;
}
.ticket-settings {
width: 100%;
}
.category-wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex-direction: column;
}
.category {
width: 50%;
text-align: justify;
}
.category-details {
margin-left: 7%;;
}
</style>
<script>
import settings from '@/components/settings/settings.vue';
import notifications from '@/components/notifications/notifications.vue';
import popups from '@/components/notifications/popups.vue';
export default {
name: 'TicketsDetailsView',
components: {
settings,
notifications,
popups,
},
data() {
return {
event: { 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'TestDate', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': 'logo.png', 'categories': { '1': { 'price': { '1': { 'price':25, 'name':'Child (0-15.99 years)'}, '2': { 'price':35, 'name':'Adult'} }, 'bg': 'black', 'fg': 'white', 'name': 'Category 1' }, '2': { 'price': { '1': { 'price':25, 'name':'Child (0-15.99 years)' }, '2': { 'price':35, 'name':'Adult'} }, 'bg': 'green', 'fg': 'white', 'name': 'Category 2' } } },
}
},
methods: {
openPopup() {
console.log( 'opening' );
this.$refs.popup.openPopup();
},
popupReturnHandling( event ) {
console.log( event );
}
}
};
</script>

View File

@@ -1,8 +1,15 @@
<!--
* libreevent - StartPageEditorView.vue
*
* Created by Janis Hutz 06/24/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Admin Accounts</h2>
<p>Here you can change everything regarding admin accounts. You may create, modify or delete admin accounts.</p>
<div class="bigButtons"></div>
<h2>Page editor</h2>
</div>
</template>

View File

@@ -1,6 +1,18 @@
<!--
* libreevent - SetupCompleteView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Setup was completed!</h2>
<img src="@/assets/logo.png" alt="libreevent logo" style="height: 30vh;">
<h1>Setup complete!</h1>
<p>Congratulations on finishing the setup of libreǝvent!</p>
<p>It is now time to head to the admin panel to add more accounts and to familiarise yourself with the admin portal</p>
<router-link to="/admin">To the admin panel</router-link>
</div>
</template>

View File

@@ -1,8 +1,17 @@
<!--
* libreevent - SetupEventsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h3>Setting up Events</h3>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://myevent.janishutz.com/docs/payments">here</a></p>
<p>You may find more infos about this part <a href="https://myevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<h1>Events</h1>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments">here</a></p>
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<button @click="submit()">Continue</button>
</div>
</template>
@@ -22,7 +31,7 @@
},
methods: {
submit () {
this.backendStore.addVisitedSetupPages( 'tos', true );
this.backendStore.addVisitedSetupPages( 'complete', true );
this.$router.push( '/setup/tos' );
}
},

View File

@@ -1,8 +1,17 @@
<!--
* libreevent - SetupPageView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h3>Setting up the landing page</h3>
<p>The landing page is the page your customers see when they visit your webpage. You may select a page template <a href="https://myevent.janishutz.com/docs/homepage/templates">here</a>.</p>
<p>You may find more infos about this part <a href="https://myevent.janishutz.com/docs/setup/setup#page-setup" target="_blank">here</a></p>
<h1>Landing page</h1>
<p>The landing page is the page your customers see when they visit your webpage. You may select a page template <a href="https://libreevent.janishutz.com/docs/homepage/templates">here</a>.</p>
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#page-setup" target="_blank">here</a></p>
<label for="template">Choose a template</label><br>
<select name="template" id="template" v-for="option in options">
@@ -28,7 +37,7 @@
},
methods: {
submit () {
this.backendStore.addVisitedSetupPages( 'payments', true );
this.backendStore.addVisitedSetupPages( 'events', true );
this.$router.push( '/setup/payments' );
}
},

View File

@@ -1,8 +1,17 @@
<!--
* libreevent - SetupPaymentsView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h3>Setting up payment methods</h3>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://myevent.janishutz.com/docs/payments">here</a></p>
<p>You may find more infos about this part <a href="https://myevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<h1>Setting up payment methods</h1>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments">here</a></p>
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<button @click="submit()">Continue</button>
</div>
</template>
@@ -22,7 +31,7 @@
},
methods: {
submit () {
this.backendStore.addVisitedSetupPages( 'events', true );
this.backendStore.addVisitedSetupPages( 'tos', true );
this.$router.push( '/setup/events' );
}
},

View File

@@ -1,8 +1,17 @@
<!--
* libreevent - SetupRootView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h3>Setting up the root account</h3>
<h1>Root account</h1>
<p>The root account is the most powerful account. Therefore, it should only be used if really necessary and should have a strong password. It also always requires Two Factor Authentication for added security. You may log into the root account by typing 'root' into the Email/Username field on the admin login screen.</p>
<p>You may find more infos about this part <a href="https://myevent.janishutz.com/docs/setup/setup#root-account" target="_blank">here</a></p>
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#root-account" target="_blank">here</a></p>
<p>Password requirements:</p>
<ul style="list-style: none;">
<li>At least 15 characters long</li>
@@ -37,7 +46,7 @@
},
methods: {
submit () {
this.backendStore.addVisitedSetupPages( 'page', true );
this.backendStore.addVisitedSetupPages( 'payments', true );
this.$router.push( 'page' );
}
},

View File

@@ -1,8 +1,19 @@
<!--
* libreevent - SetupStartView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h2>Welcome to myevent!</h2>
<img src="@/assets/logo.png" alt="libreevent logo" style="height: 30vh;">
<h1>Welcome to libreǝvent!</h1>
<i style="font-size: small;">All links during setup open in separate tabs</i>
<p>Let's start by setting it up. We strongly encourage you to also have a look at the extensive documentation of the setup process <a href="https://myevent.janishutz.com/docs/setup/setup" target="_blank">here</a></p>
<p>Thank you for downloading libreǝvent, the free & open source event management solution. libreǝvent aims to help you save both time and money when hosting events, so you can focus on what really matters.</p>
<p>Let's start by setting it up. We strongly encourage you to also have a look at the extensive documentation of the setup process <a href="https://libreevent.janishutz.com/docs/setup/setup" target="_blank">here</a></p>
<router-link to="/setup/root" @click="setup();">Start setup</router-link>
</div>
</template>
@@ -22,7 +33,7 @@
},
methods: {
setup () {
this.backendStore.addVisitedSetupPages( 'root', true );
this.backendStore.addVisitedSetupPages( 'page', true );
}
},
};

View File

@@ -1,8 +1,17 @@
<!--
* libreevent - SetupTOSView.vue
*
* Created by Janis Hutz 05/14/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
-->
<template>
<div>
<h3>Setting up TOS (optional)</h3>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://myevent.janishutz.com/docs/payments" target="_blank">here</a></p>
<p>You may find more infos about this part <a href="https://myevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<p>You may choose all of the below payment methods, but we recommend to only select one payment gateway for simplicity. Recommended: Either Stripe or Adyen. See the comparison of the different payment methods <a href="https://libreevent.janishutz.com/docs/payments" target="_blank">here</a></p>
<p>You may find more infos about this part <a href="https://libreevent.janishutz.com/docs/setup/setup#payment-methods" target="_blank">here</a></p>
<button @click="submit()">Continue</button>
</div>
</template>
@@ -22,7 +31,6 @@
},
methods: {
submit () {
this.backendStore.addVisitedSetupPages( 'complete', true );
this.$router.push( '/setup/complete' );
}
},

View File

@@ -3,7 +3,7 @@ The main website's pages are written in HTML & CSS whilst the doc pages are auto
** DO NOT MODIFY THE DOC PAGES IN THE [dist/docs/](dist/docs/) DIRECTORY! **
## Links in the md files in [src/](src/)
Please note that you are required to use either a link relative to the root folder with double forward slash (example: *//server/app.js*), to the website root with a single forward slash (example: */download*), to the docs root with &/ (example: *&/setup*) or simply /docs/ (example: */docs/setup*), a full link (example: *https://myevent.janishutz.com/docs*) or a relative link (example: *plugins/music*). If you do not follow these patterns, the website won't build or the links will not work correctly.
Please note that you are required to use either a link relative to the root folder with double forward slash (example: *//server/app.js*), to the website root with a single forward slash (example: */download*), to the docs root with &/ (example: *&/setup*) or simply /docs/ (example: */docs/setup*), a full link (example: *https://libreevent.janishutz.com/docs*) or a relative link (example: *plugins/music*). Note that *../* relative links are NOT intended to be used and will lead to an error when building the docs! If you do not follow these patterns, the website won't build or the links will not work correctly.
***NOTE: Don't be confused if the root folder links don't work in the Markdown, as they use specific syntax for the build script.***

View File

@@ -1,5 +1,5 @@
/*
* myevent - build.js
* libreevent - build.js
*
* Created by Janis Hutz 03/09/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
@@ -7,19 +7,185 @@
*
*/
const prompt = require( 'prompt-sync' );
const markdownIt = require( 'markdown-it' );
const md2html = new markdownIt();
const fs = require( 'fs' );
const path = require( 'path' );
buildNav( buildDocs() );
if ( prompt( 'Do you want to rebuild the ' ).toLowercase === 'y' ) {
buildDocs();
buildNav();
}
function buildNav ( pathObject ) {
let html = `<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="/docs/css/navstyle.css">
</head>
<body>
<div class="side-nav-container">
<div class="side-nav-wrapper">
<div class="side-nav-list">
<a class="side-nav-item" id="docs-home" href="/docs">Home</a>`;
let groups = {};
for ( let item in pathObject ) {
if ( groups[ pathObject[ item ][ 'group' ] ] ) {
groups[ pathObject[ item ][ 'group' ] ].push( pathObject[ item ] );
} else {
groups[ pathObject[ item ][ 'group' ] ] = [ pathObject[ item ] ];
}
}
function buildNav () {
for ( let group in groups ) {
if ( Object.keys( groups[ group ] ).length > 1 ) {
html += `<a class="side-nav-item" id="${ group }Nav" onclick="toggleList( '${ group }' );">${ group.slice( 0, 1 ).toUpperCase() + group.substring( 1 ) }</a>
<div class="side-dropdown" id="${ group }-dropdown">\n`;
for ( let entry in groups[ group ] ) {
html += `<a class="side-nav-subitem" id="${ groups[ group ][ entry ][ 'id' ] }" href="${ groups[ group ][ entry ][ 'filePath' ] }">${ groups[ group ][ entry ][ 'title' ] }</a>\n`;
}
html += '</div>\n';
} else {
html += `<a class="side-nav-item" id="${ groups[ group ][ 0 ][ 'id' ] }" href="${ groups[ group ][ 0 ][ 'filePath' ] }">${ groups[ group ][ 0 ][ 'title' ] }</a>\n`;
}
}
html += `</div>
</div>
</div>
<script src="/docs/js/nav.js"></script>
</body>
</html>`;
fs.writeFileSync( path.join( __dirname + '/dist/docs/side-bar.html' ), html );
console.log( '\n\n==> Completed building website! \n\n' );
}
function buildDocs () {
md2html.render( '#Test' );
let allFiles = [];
let directoriesToScan = [];
let files = fs.readdirSync( path.join( __dirname + '/src/' ) );
for ( let file in files ) {
if ( files[ file ].substring( files[ file ].length - 3 ) == '.md' ) {
allFiles.push( handleMD( path.join( __dirname + '/src/' + files[ file ] ) ) );
} else {
directoriesToScan.push( files[ file ] );
}
}
let count = directoriesToScan.length;
while ( count > 0 ) {
for ( let missing in directoriesToScan ) {
let files = fs.readdirSync( path.join( __dirname + '/src/' + directoriesToScan[ missing ] ) );
count -= 1;
for ( let file in files ) {
if ( files[ file ].substring( files[ file ].length - 3 ) == '.md' ) {
allFiles.push( handleMD( path.join( __dirname + '/src/' + directoriesToScan[ missing ] + '/' + files[ file ] ) ) );
} else {
directoriesToScan.push( directoriesToScan[ missing ] + '/' + files[ file ] );
count += 1;
}
}
}
}
return allFiles;
}
function handleMD ( filepath ) {
let fileContent = md2html.render( fs.readFileSync( filepath ).toString() );
for ( let letter in fileContent ) {
if ( fileContent[ letter ] == '<' ) {
if ( fileContent.slice( parseInt( letter ), parseInt( letter ) + 9 ) === '<a href="' ) {
let newLink = '';
let i = 9;
while ( fileContent.slice( parseInt( letter ) + i, parseInt( letter ) + i + 1 ) !== '"' ) {
i += 1;
}
let link = fileContent.slice( parseInt( letter ) + 9, parseInt( letter ) + i );
if ( link.slice( 0, 1 ) === '/' || link.slice( 0, 8 ) === 'https://' || link.slice( 0, 7 ) === 'http://' || link.slice( 0, 1 ) !== '/' && link.slice( 0, 1 ) !== '&' ) {
newLink = '<a href="' + link + '">';
} else if ( link.slice( 0, 2 ) == '&/' ) {
newLink = '<a href="/docs/' + link.substring( 2 ) + '">';
} else if ( link.slice( 0, 6 ) == '&amp;/' ) {
newLink = '<a href="/docs/' + link.substring( 6 ) + '">';
} else if ( link.slice( 0, 2 ) == '//' ) {
if ( link.includes( '.' ) ) {
newLink = '<a href="https://github.com/simplePCBuilding/libreevent/blob/master/' + link.substring( 2 ) + '">';
} else {
newLink = '<a href="https://github.com/simplePCBuilding/libreevent/tree/master/' + link.substring( 2 ) + '">';
}
} else {
console.error( 'Unsupported link: ' + link );
throw 'INVALID LINK FOUND IN PLUGINS README! Please fix and rerun the script';
}
fileContent = fileContent.slice( 0, parseInt( letter ) ) + newLink + fileContent.slice( parseInt( letter ) + i + 2, parseInt( fileContent.length ) );
}
}
}
return storeHTML( fileContent, filepath );
}
function guessTitle( html ) {
return html.substring( parseInt( html.indexOf( '<h1>' ) ) + 4, html.indexOf( '</h1>' ) );
}
function storeHTML( html, filepath ) {
let title = guessTitle( html );
let data = `<!DOCTYPE html>
<html lang="en">
<head>
<title>${ title } :: docs - libreevent</title>
<link rel="stylesheet" href="/docs/css/style.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="description" content="Looking for a free and open source event management solution you can host yourself? libreevent is a project that does exactly that.">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>
<body>
<div id="nav"></div>
<div id="side-bar"></div>
<div id="backToTop" onclick="backToTop();"></div>
<div id="docPage">
<div id="doc-container">
${ html }</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="/docs/js/index.js"></script>
</body>
</html>`;
/*
Transform file path into correct file structure and output file to dist/docs folder
*/
let fileOutputPath = path.join( __dirname + '/dist/docs' );
let pos = filepath.indexOf( 'src' );
let category = filepath.substring( parseInt( pos ) + 4, filepath.length - 3 );
fileOutputPath += '/' + category;
let group = '';
if ( category.lastIndexOf( '/' ) >= 0 ) {
group = category.slice( 0, category.lastIndexOf( '/' ) );
} else {
group = category;
}
try {
fs.mkdirSync( fileOutputPath, { recursive: true } );
} catch ( error ) {
null;
}
fileOutputPath += '/index.html';
fs.writeFileSync( fileOutputPath, data );
let id = '';
for ( let letter in category ) {
if ( category[ letter ] == '/' ) {
id += '-';
} else {
id += category[ letter ];
}
}
return { 'filePath': '/docs/' + category, 'title': title, 'group': group, 'id': id };
}

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