merge dropdown menu from develop with new dynamic, fix translation filter

This commit is contained in:
Jacson Passold 2018-05-24 12:02:20 -03:00
commit 425fd89022
136 changed files with 7611 additions and 11651 deletions

View File

@ -5,15 +5,18 @@ module.exports = {
'plugin:vue/strongly-recommended' 'plugin:vue/strongly-recommended'
], ],
parserOptions: { parserOptions: {
"ecmaVersion": 2017 'ecmaVersion': 2017
}, },
rules: { rules: {
// override/add rules settings here, such as: // override/add rules settings here, such as:
'vue/no-unused-vars': 'error', 'vue/no-unused-vars': 'error',
"no-console": "warn", 'no-console': 'warn',
"no-unused-vars": "warn", 'no-unused-vars': 'warn',
"no-undef": "warn", 'no-undef': 'warn',
"vue/html-indent": "off", 'vue/html-indent': 'off',
"vue/require-default-prop": "off", // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-default-prop.md 'vue/require-default-prop': 'off', // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-default-prop.md
},
globals: {
'tainacan_plugin': true
} }
} }

6
.gitignore vendored
View File

@ -22,4 +22,8 @@ src/assets/css/tainacan-admin.css.map
cypress/videos cypress/videos
cypress/screenshots cypress/screenshots
.vscode .vscode
src/pdf-viewer/pdfjs-dist src/pdf-viewer/pdfjs-dist
report.txt
.tmp
src/assets/css/tainacan-embeds.css
src/assets/css/tainacan-embeds.css.map

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. <http://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 <http://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
<http://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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -62,9 +62,13 @@ fi
echo "Updating files in $wp_plugin_dir" echo "Updating files in $wp_plugin_dir"
rm -rf $wp_plugin_dir rm -rf $wp_plugin_dir
mkdir $wp_plugin_dir mkdir $wp_plugin_dir
cp -R src/* $wp_plugin_dir/
rsync -axz --exclude='vendor/bin/phpc*' --exclude='vendor/squizlabs' --exclude='vendor/wimg' src/* $wp_plugin_dir/
rm -rf $wp_plugin_dir/scss rm -rf $wp_plugin_dir/scss
echo "Build complete!" echo "Build complete!"

View File

@ -10,10 +10,10 @@ command -v sass >/dev/null 2>&1 || {
echo "Compilando Sass..." echo "Compilando Sass..."
cd src/scss cd src/scss
sass -E 'UTF-8' style.scss:../style.css sass -E 'UTF-8' --cache-location ../../.tmp/sass-cache-1 tainacan-embeds.scss:../assets/css/tainacan-embeds.css
cd ../admin/scss cd ../admin/scss
sass -E 'UTF-8' tainacan-admin.scss:../../assets/css/tainacan-admin.css sass -E 'UTF-8' --cache-location ../../../.tmp/sass-cache-2 tainacan-admin.scss:../../assets/css/tainacan-admin.css
echo "Compilação do Sass Concluído!" echo "Compilação do Sass Concluído!"

View File

@ -5,8 +5,17 @@
"require": { "require": {
"respect/validation": "^1.1" "respect/validation": "^1.1"
}, },
"require-dev": {
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
"wimg/php-compatibility": "*"
},
"prefer-stable" : true,
"minimum-stability": "dev", "minimum-stability": "dev",
"config": { "config": {
"vendor-dir": "src/vendor" "vendor-dir": "src/vendor"
},
"scripts": {
"post-install-cmd": "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility",
"post-update-cmd" : "\"src/vendor/bin/phpcs\" --config-set installed_paths src/vendor/wimg/php-compatibility"
} }
} }

136
composer.lock generated
View File

@ -1,23 +1,23 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "64fbb4d01225b482970da995b00dccfb", "content-hash": "b5a7a81dd7eed9bc122ee36e472c6430",
"packages": [ "packages": [
{ {
"name": "respect/validation", "name": "respect/validation",
"version": "1.1.x-dev", "version": "1.1.16",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Respect/Validation.git", "url": "https://github.com/Respect/Validation.git",
"reference": "22f1f14430155c21c1d6ba271a652f28c5057851" "reference": "020ea1ebb5dc626bb7f1958ff49f69172ff589cc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Respect/Validation/zipball/22f1f14430155c21c1d6ba271a652f28c5057851", "url": "https://api.github.com/repos/Respect/Validation/zipball/020ea1ebb5dc626bb7f1958ff49f69172ff589cc",
"reference": "22f1f14430155c21c1d6ba271a652f28c5057851", "reference": "020ea1ebb5dc626bb7f1958ff49f69172ff589cc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -26,7 +26,6 @@
}, },
"require-dev": { "require-dev": {
"egulias/email-validator": "~1.2", "egulias/email-validator": "~1.2",
"malkusch/bav": "~1.0",
"mikey179/vfsstream": "^1.5", "mikey179/vfsstream": "^1.5",
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "~4.0",
"symfony/validator": "~2.6.9", "symfony/validator": "~2.6.9",
@ -37,7 +36,6 @@
"ext-bcmath": "Arbitrary Precision Mathematics", "ext-bcmath": "Arbitrary Precision Mathematics",
"ext-mbstring": "Multibyte String Functions", "ext-mbstring": "Multibyte String Functions",
"fabpot/php-cs-fixer": "Fix PSR2 and other coding style issues", "fabpot/php-cs-fixer": "Fix PSR2 and other coding style issues",
"malkusch/bav": "German bank account validation",
"symfony/validator": "Use Symfony validator through Respect\\Validation", "symfony/validator": "Use Symfony validator through Respect\\Validation",
"zendframework/zend-validator": "Use Zend Framework validator through Respect\\Validation" "zendframework/zend-validator": "Use Zend Framework validator through Respect\\Validation"
}, },
@ -69,20 +67,20 @@
"validation", "validation",
"validator" "validator"
], ],
"time": "2017-10-17T10:15:51+00:00" "time": "2018-05-19T14:26:44+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "dev-master", "version": "v1.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" "reference": "3296adf6a6454a050679cde90f95350ad604b171"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -94,7 +92,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.6-dev" "dev-master": "1.8-dev"
} }
}, },
"autoload": { "autoload": {
@ -128,14 +126,118 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2017-10-11T12:05:26+00:00" "time": "2018-04-26T10:06:28+00:00"
}
],
"packages-dev": [
{
"name": "squizlabs/php_codesniffer",
"version": "3.2.3",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "4842476c434e375f9d3182ff7b89059583aa8b27"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27",
"reference": "4842476c434e375f9d3182ff7b89059583aa8b27",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "http://www.squizlabs.com/php-codesniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2018-02-20T21:35:23+00:00"
},
{
"name": "wimg/php-compatibility",
"version": "8.1.0",
"source": {
"type": "git",
"url": "https://github.com/wimg/PHPCompatibility.git",
"reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e",
"reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e",
"shasum": ""
},
"require": {
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2"
},
"conflict": {
"squizlabs/php_codesniffer": "2.6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
},
"type": "phpcodesniffer-standard",
"autoload": {
"psr-4": {
"PHPCompatibility\\": "PHPCompatibility/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
}
],
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.",
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
"keywords": [
"compatibility",
"phpcs",
"standards"
],
"time": "2017-12-27T21:58:38+00:00"
} }
], ],
"packages-dev": [],
"aliases": [], "aliases": [],
"minimum-stability": "dev", "minimum-stability": "dev",
"stability-flags": [], "stability-flags": [],
"prefer-stable": false, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": [],
"platform-dev": [] "platform-dev": []

View File

@ -108,7 +108,7 @@ Represents the entity Filter
### `protected $repository = 'Filters'` ### `protected $repository = 'Filters'`
{@inheritDoc} {@inheritDoc}
### `public function __toArray()` ### `public function _toArray()`
**Returns:** array **Returns:** array

View File

@ -75,7 +75,9 @@ Terms can have hierarchy, which means that when you browse for items that have a
Terms also have a description, may have an icon or image that represents it and may also be linked to a existing concept of an ontology. They can have their own URL in your site, with a page listing all items that are related to them, despite their collection. In that way, they behave as if they were a collection themselves. Terms also have a description, may have an icon or image that represents it and may also be linked to a existing concept of an ontology. They can have their own URL in your site, with a page listing all items that are related to them, despite their collection. In that way, they behave as if they were a collection themselves.
## Item types ## Under discussion
### Item types
Item types gives you the abiity to specialize the desription of an item based on its nature. So, inside the same collection you may have items that vary in its nature and, therefore, have a different set of metadata. Item types gives you the abiity to specialize the desription of an item based on its nature. So, inside the same collection you may have items that vary in its nature and, therefore, have a different set of metadata.
@ -83,8 +85,6 @@ For each item type you can choose a group of Metadata, in the same way you do fo
An item type can be anything. For example, LPs, Books and paintings are õbvious distinct item types that may have specific metadata. But it could also more abstract concepts, such as "financial transactions". An item type can be anything. For example, LPs, Books and paintings are õbvious distinct item types that may have specific metadata. But it could also more abstract concepts, such as "financial transactions".
## Under discussion
### Desktop ### Desktop
Desktop holds items that are not part of any collections yet. You might want to use it when you want to upload a bunch of items and organize them afterwards, instead of having to thinh an prepare all the collections beforehand. Desktop holds items that are not part of any collections yet. You might want to use it when you want to upload a bunch of items and organize them afterwards, instead of having to thinh an prepare all the collections beforehand.

View File

@ -51,7 +51,7 @@ Set up a WordPress installation. This could be a dedicated installation to devel
When we want to build the plugin, we run `build.sh` that basically installs any dependencies, compiles all the assets (sass and js) and moves the files to the plugin directory. This compiled version of the plugin is the one added to the official WordPress Plugin repository. When we want to build the plugin, we run `build.sh` that basically installs any dependencies, compiles all the assets (sass and js) and moves the files to the plugin directory. This compiled version of the plugin is the one added to the official WordPress Plugin repository.
In order to use it, make a copy of `build-config-sample.sh` and name it only `build-config.sh`. Edit and fill in your environment details: In order to use it, make a copy of `build-config-sample.cfg` and name it only `build-config.cfg`. Edit and fill in your environment details:
* `wp_base_dir`: The base directory for you local WordPress installation, used for development and testing. e.g `~/develop/wordpress` * `wp_base_dir`: The base directory for you local WordPress installation, used for development and testing. e.g `~/develop/wordpress`
* `wp_url`: The base URL for your local WordPress installation/ e.g `http://localhost/wp` * `wp_url`: The base URL for your local WordPress installation/ e.g `http://localhost/wp`

5035
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
"moment": "^2.22.1", "moment": "^2.22.1",
"qs": "^6.5.2", "qs": "^6.5.2",
"v-mask": "^1.3.2", "v-mask": "^1.3.2",
"v-tooltip": "^2.0.0-rc.32",
"vue": "^2.5.16", "vue": "^2.5.16",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuedraggable": "^2.16.0", "vuedraggable": "^2.16.0",

View File

@ -82,7 +82,7 @@
padding: 0px; padding: 0px;
margin: $header-height auto 0 auto; margin: $header-height auto 0 auto;
position: relative; position: relative;
overflow-y: auto; overflow-y: hidden;
height: calc(100% - 53px); height: calc(100% - 53px);
@media screen and (max-width: 769px) { @media screen and (max-width: 769px) {

View File

@ -28,10 +28,14 @@ class Admin {
} }
function add_admin_menu() { function add_admin_menu() {
$dummyEntity = new \Tainacan\Entities\Taxonomy();
// a capability everybody bu subscriber have.
// Maybe we will create a specific cap to view_admin later
$entity_cap = $dummyEntity->get_capabilities()->edit_posts;
$page_suffix = add_menu_page( $page_suffix = add_menu_page(
__( 'Tainacan', 'tainacan' ), __( 'Tainacan', 'tainacan' ),
__( 'Tainacan', 'tainacan' ), __( 'Tainacan', 'tainacan' ),
'edit_posts', $entity_cap,
$this->menu_slug, $this->menu_slug,
array( &$this, 'admin_page' ), array( &$this, 'admin_page' ),
plugin_dir_url( __FILE__ ) . 'images/tainacan_logo_symbol.svg' plugin_dir_url( __FILE__ ) . 'images/tainacan_logo_symbol.svg'

View File

@ -3,7 +3,7 @@
<div class="page-container primary-page"> <div class="page-container primary-page">
<tainacan-title /> <tainacan-title />
<b-tabs v-model="activeTab"> <b-tabs v-model="activeTab">
<b-tab-item :label="$i18n.get('category')"> <b-tab-item :label="$i18n.get('taxonomy')">
<form <form
v-if="category != null && category != undefined" v-if="category != null && category != undefined"
class="tainacan-form" class="tainacan-form"

View File

@ -25,12 +25,12 @@
</a> </a>
<figure class="image is-128x128"> <figure class="image is-128x128">
<span <span
v-if="collection.thumbnail == undefined || collection.thumbnail == false" v-if="collection.thumbnail.thumb == undefined || collection.thumbnail.thumb == false"
class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span> class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span>
<img <img
id="thumbail-image" id="thumbail-image"
:alt="$i18n.get('label_thumbnail')" :alt="$i18n.get('label_thumbnail')"
:src="(collection.thumbnail == undefined || collection.thumbnail == false) ? thumbPlaceholderPath : collection.thumbnail"> :src="(collection.thumbnail.thumb == undefined || collection.thumbnail.thumb == false) ? thumbPlaceholderPath : collection.thumbnail.thumb">
</figure> </figure>
<div class="thumbnail-buttons-row"> <div class="thumbnail-buttons-row">
<a <a
@ -646,6 +646,13 @@ export default {
this.createNewCollection(); this.createNewCollection();
} }
} }
},
mounted() {
if (this.$route.fullPath.split("/").pop() != "new") {
document.getElementById('collection-page-container').addEventListener('scroll', ($event) => {
this.$emit('onShrinkHeader', ($event.originalTarget.scrollTop > 53));
});
}
} }
} }

View File

@ -1,12 +1,17 @@
<template> <template>
<div> <div>
<button
id="metadata-column-compress-button"
@click="isMetadataColumnCompressed = !isMetadataColumnCompressed">
<b-icon :icon="isMetadataColumnCompressed ? 'menu-left' : 'menu-right'" />
</button>
<tainacan-title /> <tainacan-title />
<form <form
v-if="!isLoading" v-if="!isLoading"
class="tainacan-form" class="tainacan-form"
label-width="120px"> label-width="120px">
<div class="columns"> <div class="columns">
<div class="column is-4"> <div class="column is-5-5">
<!-- Status -------------------------------- --> <!-- Status -------------------------------- -->
<div class="section-label"> <div class="section-label">
@ -16,8 +21,18 @@
:title="$i18n.getHelperTitle('items', 'status')" :title="$i18n.getHelperTitle('items', 'status')"
:message="$i18n.getHelperMessage('items', 'status')"/> :message="$i18n.getHelperMessage('items', 'status')"/>
</div> </div>
<div class="section-box"> <div class="section-box section-status">
<div class="field"> <div class="field">
<!-- <div class="block">
<b-radio
:id="`status-option-${statusOption.value}`"
v-for="statusOption in statusOptions"
:key="statusOption.value"
:value="statusOption.value"
:disabled="statusOption.disabled">
{{ statusOption.label }}
</b-radio>
</div> -->
<b-select <b-select
v-model="form.status" v-model="form.status"
:placeholder="$i18n.get('instruction_select_a_status')"> :placeholder="$i18n.get('instruction_select_a_status')">
@ -56,7 +71,7 @@
:title="$i18n.getHelperTitle('items', 'document')" :title="$i18n.getHelperTitle('items', 'document')"
:message="$i18n.getHelperMessage('items', 'document')"/> :message="$i18n.getHelperMessage('items', 'document')"/>
</div> </div>
<div class="section-box"> <div class="section-box ">
<div <div
v-if="form.document != undefined && form.document != null && v-if="form.document != undefined && form.document != null &&
form.document_type != undefined && form.document_type != null && form.document_type != undefined && form.document_type != null &&
@ -99,14 +114,14 @@
<div v-html="item.document_as_html" /> <div v-html="item.document_as_html" />
<button <button
type="button" type="button"
class="button is-primary" class="button is-secondary"
size="is-small" size="is-small"
@click.prevent="setURLDocument()"> @click.prevent="setURLDocument()">
{{ $i18n.get('edit') }} {{ $i18n.get('edit') }}
</button> </button>
<button <button
type="button" type="button"
class="button is-primary" class="button is-secondary"
size="is-small" size="is-small"
@click.prevent="removeDocument()"> @click.prevent="removeDocument()">
{{ $i18n.get('remove') }} {{ $i18n.get('remove') }}
@ -220,7 +235,7 @@
:message="$i18n.getHelperMessage('items', '_thumbnail_id')"/> :message="$i18n.getHelperMessage('items', '_thumbnail_id')"/>
</div> </div>
<div class="section-box"> <div class="section-box section-thumbnail">
<div class="thumbnail-field"> <div class="thumbnail-field">
<a <a
class="button is-rounred is-secondary" class="button is-rounred is-secondary"
@ -229,21 +244,31 @@
@click.prevent="thumbnailMediaFrame.openFrame($event)"> @click.prevent="thumbnailMediaFrame.openFrame($event)">
<b-icon icon="pencil" /> <b-icon icon="pencil" />
</a> </a>
<figure class="image"> <file-item
<span v-if="item.thumbnail.thumb != undefined && item.thumbnail.thumb != false"
v-if="item.thumbnail == undefined || item.thumbnail == false" :show-name="false"
class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span> :file="{
media_type: 'image',
guid: { rendered: item.thumbnail.thumb },
title: { rendered: $i18n.get('label_thumbnail')},
description: { rendered: `<img alt='Thumbnail' src='` + item.thumbnail.full + `'/>` }}"/>
<figure
v-if="item.thumbnail.thumb == undefined || item.thumbnail.thumb == false"
class="image">
<span class="image-placeholder">{{ $i18n.get('label_empty_thumbnail') }}</span>
<img <img
id="thumbail-image"
:alt="$i18n.get('label_thumbnail')" :alt="$i18n.get('label_thumbnail')"
:src="(item.thumbnail == undefined || item.thumbnail == false) ? thumbPlaceholderPath : item.thumbnail"> :src="thumbPlaceholderPath">
</figure> </figure>
<div class="thumbnail-buttons-row"> <div class="thumbnail-buttons-row">
<a <a
id="button-delete" id="button-delete"
:aria-label="$i18n.get('label_button_delete_thumb')" :aria-label="$i18n.get('label_button_delete_thumb')"
@click="deleteThumbnail()"> @click="deleteThumbnail()">
<b-icon icon="delete" /> <b-icon
type="is-gray"
icon="delete" />
<span class="text">{{ $i18n.get('remove') }} </span>
</a> </a>
</div> </div>
</div> </div>
@ -253,28 +278,30 @@
<div class="section-label"> <div class="section-label">
<label>{{ $i18n.get('label_attachments') }}</label> <label>{{ $i18n.get('label_attachments') }}</label>
</div> </div>
<div class="section-box"> <div class="section-box section-attachments">
<button <button
type="button" type="button"
class="button is-secondary" class="button is-secondary"
@click.prevent="attachmentMediaFrame.openFrame($event)"> @click.prevent="attachmentMediaFrame.openFrame($event)">
Attatchments (tests) {{ $i18n.get("label_edit_attachments") }}
</button> </button>
<div class="uploaded-files"> <div class="uploaded-files">
<div <file-item
:style="{ margin: 15 + 'px'}"
v-if="attachmentsList.length > 0"
v-for="(attachment, index) in attachmentsList" v-for="(attachment, index) in attachmentsList"
:key="index"> :key="index"
<span class="tag is-primary"> :show-name="true"
{{ attachment.title.rendered }} :file="attachment"/>
</span> <p v-if="attachmentsList.length <= 0"><br>{{ $i18n.get('info_no_attachments_on_item_yet') }}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-1" /> <div
<div class="column is-7"> class="column is-4-5"
v-show="!isMetadataColumnCompressed">
<label class="section-label">{{ $i18n.get('fields') }}</label> <label class="section-label">{{ $i18n.get('fields') }}</label>
<br> <br>
<a <a
@ -282,7 +309,7 @@
@click="toggleCollapseAll()"> @click="toggleCollapseAll()">
{{ collapseAll ? $i18n.get('label_collapse_all') : $i18n.get('label_expand_all') }} {{ collapseAll ? $i18n.get('label_collapse_all') : $i18n.get('label_expand_all') }}
<b-icon <b-icon
type="is-secondary" type="is-gray"
:icon=" collapseAll ? 'menu-down' : 'menu-right'" /> :icon=" collapseAll ? 'menu-down' : 'menu-right'" />
</a> </a>
@ -308,6 +335,7 @@
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { eventBus } from '../../../js/event-bus-web-components.js' import { eventBus } from '../../../js/event-bus-web-components.js'
import wpMediaFrames from '../../js/wp-media-frames'; import wpMediaFrames from '../../js/wp-media-frames';
import FileItem from '../other/file-item.vue';
export default { export default {
name: 'ItemEditionForm', name: 'ItemEditionForm',
@ -318,6 +346,7 @@ export default {
item: null, item: null,
collectionId: Number, collectionId: Number,
isLoading: false, isLoading: false,
isMetadataColumnCompressed: false,
fieldCollapses: [], fieldCollapses: [],
collapseAll: false, collapseAll: false,
form: { form: {
@ -352,6 +381,17 @@ export default {
textLink: '' textLink: ''
} }
}, },
computed: {
fieldList() {
return JSON.parse(JSON.stringify(this.getFields()));
},
attachmentsList(){
return this.getAttachments();
}
},
components: {
FileItem
},
methods: { methods: {
...mapActions('item', [ ...mapActions('item', [
'sendItem', 'sendItem',
@ -570,7 +610,7 @@ export default {
frame_button: this.$i18n.get('label_attach_to_item'), frame_button: this.$i18n.get('label_attach_to_item'),
}, },
relatedPostId: this.itemId, relatedPostId: this.itemId,
onSave: (files) => { onSave: () => {
// Fetch current existing attachments // Fetch current existing attachments
this.fetchAttachments(this.itemId); this.fetchAttachments(this.itemId);
} }
@ -589,14 +629,6 @@ export default {
this.fieldCollapses.splice(index, 1, event); this.fieldCollapses.splice(index, 1, event);
} }
}, },
computed: {
fieldList() {
return JSON.parse(JSON.stringify(this.getFields()));
},
attachmentsList(){
return this.getAttachments();
}
},
created(){ created(){
// Obtains collection ID // Obtains collection ID
this.cleanFields(); this.cleanFields();
@ -635,6 +667,11 @@ export default {
this.fetchAttachments(this.itemId); this.fetchAttachments(this.itemId);
} }
}, },
mounted() {
document.getElementById('collection-page-container').addEventListener('scroll', ($event) => {
this.$emit('onShrinkHeader', ($event.originalTarget.scrollTop > 53));
});
},
beforeRouteLeave ( to, from, next ) { beforeRouteLeave ( to, from, next ) {
if (this.item.status == 'auto-draft') { if (this.item.status == 'auto-draft') {
this.$dialog.confirm({ this.$dialog.confirm({
@ -657,12 +694,58 @@ export default {
@import '../../scss/_variables.scss'; @import '../../scss/_variables.scss';
.page-container{ #metadata-column-compress-button {
height: calc(100% - 82px); position: relative;
z-index: 99;
float: right;
top: 70px;
max-width: 36px;
height: 36px;
width: 36px;
border: none;
background-color: $tainacan-input-background;
color: $secondary;
padding: 0px;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
cursor: pointer;
.icon {
margin-top: 2px;
margin-right: 8px;
}
} }
form>.columns>.column{ .page-container {
padding: 0px; padding: 25px 0px;
.tainacan-page-title {
padding-left: $page-side-padding;
padding-right: $page-side-padding;
}
.column {
padding-top: 0px;
padding-bottom: 0px;
}
.column.is-5-5 {
width: 45.833333333%;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
transition: width 0.6s;
}
.column.is-4-5 {
width: 37.5%;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
transition: all 0.6s;
.field {
padding: 10px 0px 10px 25px;
}
}
} }
.section-label { .section-label {
@ -682,7 +765,8 @@ export default {
.section-box { .section-box {
border: 1px solid $draggable-border-color; border: 1px solid $draggable-border-color;
padding: 30px; background-color: white;
padding: 26px;
margin-top: 16px; margin-top: 16px;
margin-bottom: 38px; margin-bottom: 38px;
@ -708,20 +792,40 @@ export default {
} }
} }
} }
.section-status{
width: 174px;
}
.section-thumbnail {
width: 174px;
padding-top: 0;
padding-bottom: 0;
}
.section-attachments {
height: 250px;
max-width: 100%;
resize: vertical;
overflow: auto;
p { margin: 4px 15px }
}
.uploaded-files {
display: flex;
flex-flow: wrap;
margin-left: -15px;
margin-right: -15px;
}
.thumbnail-field { .thumbnail-field {
max-height: 128px; margin-top: -8px;
margin-bottom: 96px;
margin-top: -20px;
.content { .content {
padding: 10px; padding: 10px;
font-size: 0.8em; font-size: 0.8em;
} }
img { img {
position: absolute; height: 112px;
height: 105px; width: 112px;
width: 105px;
} }
.image-placeholder { .image-placeholder {
position: absolute; position: absolute;
@ -751,21 +855,21 @@ export default {
margin-top: 1px; margin-top: 1px;
} }
} }
.thumbnail-buttons-row { .thumbnail-buttons-row {
display: none; display: inline-block;
} padding: 8px 0px;
&:hover { border-radius: 0px 0px 0px 4px;
.thumbnail-buttons-row { font-size: 14px;
display: inline-block; a { color: $tainacan-input-color; }
.text {
top: -3px;
position: relative; position: relative;
top: 0px; }
background-color: rgba(255, 255, 255, 0.9); i.mdi-24px.mdi-set, i.mdi-24px.mdi::before {
padding: 2px 8px; font-size: 20px;
border-radius: 0px 0px 0px 4px;
left: 65px;
} }
} }
} }

View File

@ -7,12 +7,6 @@
<div class="columns"> <div class="columns">
<div class="column is-narrow"> <div class="column is-narrow">
<!-- Header Image -------------------------------- --> <!-- Header Image -------------------------------- -->
<a
v-if="editForm.url != undefined && editForm.url!= ''"
class="button is-success is-pulled-right"
:href="editForm.url">
{{ $i18n.get('see') + ' ' + $i18n.get('term') }}
</a>
<b-field <b-field
:addons="false" :addons="false"
:label="$i18n.get('label_header_image')"> :label="$i18n.get('label_header_image')">
@ -40,6 +34,12 @@
<b-icon icon="delete"/> <b-icon icon="delete"/>
</a> </a>
</div> </div>
<a
v-if="editForm.url != undefined && editForm.url!= ''"
class="button is-secondary"
:href="editForm.url">
{{ $i18n.get('see') + ' ' + $i18n.get('term') }}
</a>
</div> </div>
</b-field> </b-field>
</div> </div>

View File

@ -1,102 +1,120 @@
<template> <template>
<div class="table-container"> <div
<b-field v-if="totalCategories > 0 && !isLoading"
grouped class="table-container">
group-multiline>
<button
v-if="selectedCategories.length > 0"
class="button field is-danger"
@click="deleteSelectedCategories()">
<span>{{ $i18n.get('instruction_delete_selected_categories') }} </span>
<b-icon icon="delete"/>
</button>
</b-field>
<b-table <div class="selection-control">
v-if="totalCategories > 0" <div class="field select-all is-pulled-left">
ref="categoryTable" <span>
:data="categories" <b-checkbox
:checked-rows.sync="selectedCategories" @click.native="selectAllCategoriesOnPage()"
checkable :value="allCategoriesOnPageSelected">{{ $i18n.get('label_select_all_categories_page') }}</b-checkbox>
:loading="isLoading" </span>
hoverable </div>
striped <div class="field is-pulled-right">
selectable <b-dropdown
backend-sorting> position="is-bottom-left"
v-if="categories[0].current_user_can_edit"
:disabled="!isSelectingCategories"
id="bulk-actions-dropdown">
<button
class="button is-white"
slot="trigger">
<span>{{ $i18n.get('label_bulk_actions') }}</span>
<b-icon icon="menu-down"/>
</button>
<template slot-scope="props"> <b-dropdown-item
<b-table-column id="item-delete-selected-items"
tabindex="0" @click="deleteSelectedCategories()">
:label="$i18n.get('label_name')" {{ $i18n.get('label_delete_selected_categories') }}
:aria-label="$i18n.get('label_name')" </b-dropdown-item>
field="props.row.name"> <b-dropdown-item disabled>{{ $i18n.get('label_edit_selected_categories') + ' (Not ready)' }}
<router-link </b-dropdown-item>
class="clickable-row" </b-dropdown>
tag="span" </div>
:to="{path: $routerHelper.getCategoryEditPath(props.row.id)}"> </div>
{{ props.row.name }}
</router-link>
</b-table-column>
<b-table-column <div class="table-wrapper">
tabindex="0" <table class="table">
:aria-label="$i18n.get('label_description')" <thead>
:label="$i18n.get('label_description')" <tr>
property="description" <!-- Checking list -->
show-overflow-tooltip <th>
field="props.row.description"> &nbsp;
<router-link <!-- nothing to show on header -->
class="clickable-row" </th>
tag="span" <!-- Name -->
:to="{path: $routerHelper.getCategoryEditPath(props.row.id)}"> <th>
{{ props.row.description }} <div class="th-wrap">{{ $i18n.get('label_name') }}</div>
</router-link> </th>
</b-table-column> <!-- Description -->
<th>
<b-table-column <div class="th-wrap">{{ $i18n.get('label_description') }}</div>
tabindex="0" </th>
:label="$i18n.get('label_actions')" <!-- Actions -->
width="78" <th class="actions-header">
:aria-label="$i18n.get('label_actions')"> &nbsp;
<!-- <a id="button-view" :aria-label="$i18n.get('label_button_view')" @click.prevent.stop="goToCollectionPage(props.row.id)"><b-icon icon="eye"></a> --> <!-- nothing to show on header for actions cell-->
<a </th>
id="button-edit" </tr>
:aria-label="$i18n.getFrom('categories','edit_item')" </thead>
@click.prevent.stop="goToCategoryEditPage(props.row.id)"> <tbody>
<b-icon <tr
type="is-gray" :class="{ 'selected-row': selectedCategories[index] }"
icon="pencil" /> :key="index"
</a> v-for="(category, index) of categories">
<a <!-- Checking list -->
id="button-delete" <td
:aria-label="$i18n.get('label_button_delete')" :class="{ 'is-selecting': isSelectingCategories }"
@click.prevent.stop="deleteOneCategory(props.row.id)"> class="checkbox-cell">
<b-icon <b-checkbox
type="is-gray" size="is-small"
icon="delete" /> v-model="selectedCategories[index]"/>
</a> </td>
</b-table-column> <!-- Name -->
</template> <td
class="column-default-width column-main-content"
</b-table> @click="goToCategoryEditPage(category.id)"
:label="$i18n.get('label_name')"
<div v-if="!totalCategories || totalCategories <= 0"> :aria-label="$i18n.get('label_name') + ': ' + category.name">
<section class="section"> <p>{{ category.name }}</p>
<div class="content has-text-grey has-text-centered"> </td>
<p> <!-- Description -->
<b-icon <td
icon="inbox" class="column-large-width"
size="is-large"/> @click="goToCategoryEditPage(category.id)"
</p> :label="$i18n.get('label_description')"
<p>{{ $i18n.get('info_no_category_created') }}</p> :aria-label="$i18n.get('label_description') + ': ' + category.description">
<router-link <p>{{ category.description }}</p>
tag="button" </td>
class="button is-secondary" <!-- Actions -->
:to="{ path: $routerHelper.getNewCategoryPath() }"> <td
{{ $i18n.getFrom('taxonomies', 'new') }} @click="goToCategoryEditPage(category.id)"
</router-link> class="actions-cell column-default-width"
</div> :label="$i18n.get('label_actions')">
</section> <div class="actions-container">
<a
id="button-edit"
:aria-label="$i18n.getFrom('categories','edit_item')"
@click="goToCategoryEditPage(category.id)">
<b-icon
type="is-secondary"
icon="pencil"/>
</a>
<a
id="button-delete"
:aria-label="$i18n.get('label_button_delete')"
@click.prevent.stop="deleteOneCategory(category.id)">
<b-icon
type="is-secondary"
icon="delete"/>
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
</template> </template>
@ -106,6 +124,13 @@
export default { export default {
name: 'CategoriesList', name: 'CategoriesList',
data() {
return {
selectedCategories: [],
allCategoriesOnPageSelected: false,
isSelectingCategories: false
}
},
props: { props: {
isLoading: false, isLoading: false,
totalCategories: 0, totalCategories: 0,
@ -113,72 +138,93 @@
categoriesPerPage: 12, categoriesPerPage: 12,
categories: Array categories: Array
}, },
data() { watch: {
return { categories() {
selectedCategories: [] this.selectedCategories = [];
for (let i = 0; i < this.categories.length; i++)
this.selectedCategories.push(false);
},
selectedCategories() {
let allSelected = true;
let isSelecting = false;
for (let i = 0; i < this.selectedCategories.length; i++) {
if (this.selectedCategories[i] == false) {
allSelected = false;
} else {
isSelecting = true;
}
}
this.allCategoriesOnPageSelected = allSelected;
this.isSelectingCategories = isSelecting;
} }
}, },
methods: { methods: {
...mapActions('category', [ ...mapActions('category', [
'deleteCategory' 'deleteCategory'
]), ]),
selectAllCategoriesOnPage() {
for (let i = 0; i < this.selectedCategories.length; i++)
this.selectedCategories.splice(i, 1, !this.allCategoriesOnPageSelected);
},
deleteOneCategory(categoryId) { deleteOneCategory(categoryId) {
this.$dialog.confirm({ this.$dialog.confirm({
message: this.$i18n.get('info_warning_category_delete'), message: this.$i18n.get('info_warning_category_delete'),
onConfirm: () => { onConfirm: () => {
this.deleteCategory(categoryId) this.deleteCategory(categoryId)
.then(() => { .then(() => {
this.$toast.open({ // this.$toast.open({
duration: 3000, // duration: 3000,
message: this.$i18n.get('info_category_deleted'), // message: this.$i18n.get('info_category_deleted'),
position: 'is-bottom', // position: 'is-bottom',
type: 'is-secondary', // type: 'is-secondary',
queue: true // queue: true
}); // });
for (let i = 0; i < this.selectedCategories.length; i++) { for (let i = 0; i < this.selectedCategories.length; i++) {
if (this.selectedCategories[i].id === this.categoryId) if (this.selectedCategories[i].id === this.categoryId)
this.selectedCategories.splice(i, 1); this.selectedCategories.splice(i, 1);
} }
}) })
.catch(() => { .catch(() => {
this.$toast.open({ // this.$toast.open({
duration: 3000, // duration: 3000,
message: this.$i18n.get('info_error_deleting_category'), // message: this.$i18n.get('info_error_deleting_category'),
position: 'is-bottom', // position: 'is-bottom',
type: 'is-danger', // type: 'is-danger',
queue: true // queue: true
}); // });
}); });
} }
}); });
}, },
deleteSelectedCategories() { deleteSelectedCategories() {
this.$dialog.confirm({ this.$dialog.confirm({
message: this.$i18n.get('info_selected_categories_delete'), message: this.$i18n.get('info_warning_selected_categories_delete'),
onConfirm: () => { onConfirm: () => {
for (let category of this.selectedCategories) { for (let i = 0; i < this.categories.length; i++) {
this.deleteCategory(category.id) if (this.selectedCategories[i]) {
.then(() => { this.deleteCategory(this.categories[i].id)
this.loadCategories(); .then(() => {
this.$toast.open({ // this.loadCategories();
duration: 3000, // this.$toast.open({
message: this.$i18n.get('info_category_deleted'), // duration: 3000,
position: 'is-bottom', // message: this.$i18n.get('info_category_deleted'),
type: 'is-secondary', // position: 'is-bottom',
queue: false // type: 'is-secondary',
}) // queue: false
}).catch(() => { // })
this.$toast.open({ }).catch(() => {
duration: 3000, // this.$toast.open({
message: this.$i18n.get('info_error_deleting_category'), // duration: 3000,
position: 'is-bottom', // message: this.$i18n.get('info_error_deleting_category'),
type: 'is-danger', // position: 'is-bottom',
queue: false // type: 'is-danger',
// queue: false
// });
}); });
}); }
} }
this.selectedCategories = []; this.allCategoriesOnPageSelected = false;
} }
}); });
}, },
@ -196,19 +242,21 @@
@import "../../scss/_variables.scss"; @import "../../scss/_variables.scss";
.table-thumb { .selection-control {
max-height: 38px !important;
vertical-align: middle !important; padding: 6px 0px 0px 13px;
} background: white;
height: 40px;
.row-creation span { .select-all {
color: $gray-light; color: $gray-light;
font-size: 0.75em; font-size: 14px;
line-height: 1.5 &:hover {
color: $gray-light;
}
}
} }
.clickable-row{ cursor: pointer !important; }
</style> </style>

View File

@ -1,5 +1,7 @@
<template> <template>
<div class="table-container"> <div
v-if="totalCollections > 0 && !isLoading"
class="table-container">
<div class="selection-control"> <div class="selection-control">
<div class="field select-all is-pulled-left"> <div class="field select-all is-pulled-left">
<span> <span>
@ -11,13 +13,13 @@
<div class="field is-pulled-right"> <div class="field is-pulled-right">
<b-dropdown <b-dropdown
position="is-bottom-left" position="is-bottom-left"
v-if="collections.length > 0 && collections[0].current_user_can_edit" v-if="collections[0].current_user_can_edit"
:disabled="!isSelectingCollections" :disabled="!isSelectingCollections"
id="mass-actions-dropdown"> id="bulk-actions-dropdown">
<button <button
class="button is-white" class="button is-white"
slot="trigger"> slot="trigger">
<span>{{ $i18n.get('label_mass_actions') }}</span> <span>{{ $i18n.get('label_bulk_actions') }}</span>
<b-icon icon="menu-down"/> <b-icon icon="menu-down"/>
</button> </button>
@ -36,7 +38,7 @@
<thead> <thead>
<tr> <tr>
<!-- Checking list --> <!-- Checking list -->
<th class="checkbox-cell"> <th>
&nbsp; &nbsp;
<!-- nothing to show on header --> <!-- nothing to show on header -->
</th> </th>
@ -56,6 +58,10 @@
<th> <th>
<div class="th-wrap">{{ $i18n.get('label_creation') }}</div> <div class="th-wrap">{{ $i18n.get('label_creation') }}</div>
</th> </th>
<th class="actions-header">
&nbsp;
<!-- nothing to show on header for actions cell-->
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -80,12 +86,12 @@
<span> <span>
<img <img
class="table-thumb" class="table-thumb"
:src="collection.thumbnail"> :src="collection.thumbnail.thumb">
</span> </span>
</td> </td>
<!-- Name --> <!-- Name -->
<td <td
class="column-default-width" class="column-default-width column-main-content"
@click="goToCollectionPage(collection.id)" @click="goToCollectionPage(collection.id)"
:label="$i18n.get('label_name')" :label="$i18n.get('label_name')"
:aria-label="$i18n.get('label_name') + ': ' + collection.name"> :aria-label="$i18n.get('label_name') + ': ' + collection.name">
@ -93,7 +99,7 @@
</td> </td>
<!-- Description --> <!-- Description -->
<td <td
class="column-default-width" class="column-large-width"
@click="goToCollectionPage(collection.id)" @click="goToCollectionPage(collection.id)"
:label="$i18n.get('label_description')" :label="$i18n.get('label_description')"
:aria-label="$i18n.get('label_description') + ': ' + collection.description"> :aria-label="$i18n.get('label_description') + ': ' + collection.description">
@ -119,7 +125,7 @@
@click.prevent.stop="goToCollectionEditPage(collection.id)"> @click.prevent.stop="goToCollectionEditPage(collection.id)">
<b-icon <b-icon
type="is-secondary" type="is-secondary"
icon="pencil"/> icon="settings"/>
</a> </a>
<a <a
id="button-delete" id="button-delete"
@ -135,28 +141,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- Empty state image -->
<div v-if="!totalCollections || totalCollections <= 0">
<section class="section">
<div class="content has-text-grey has-text-centered">
<p>
<b-icon
icon="inbox"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_no_collection_created') }}</p>
<router-link
id="button-create-collection"
tag="button"
class="button is-primary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
{{ $i18n.getFrom('collections', 'new_item') }}
</router-link>
</div>
</section>
</div>
</div> </div>
</template> </template>
@ -315,8 +299,7 @@ export default {
// document.addEventListener('mouseup', function () { // document.addEventListener('mouseup', function () {
// thElm = undefined; // thElm = undefined;
// }); // });
// })(); // })();
} }
} }
</script> </script>
@ -327,7 +310,9 @@ export default {
.selection-control { .selection-control {
padding: 20px 14px 0px 14px; padding: 6px 0px 0px 13px;
background: white;
height: 40px;
.select-all { .select-all {
color: $gray-light; color: $gray-light;
@ -336,141 +321,6 @@ export default {
color: $gray-light; color: $gray-light;
} }
} }
}
.table {
width: 100%;
.checkbox-cell {
width: 44px;
height: 58px;
padding: 0;
position: absolute !important;
left: $page-side-padding;
visibility: hidden;
display: flex;
justify-content: space-around;
z-index: 9;
&::before {
box-shadow: inset 53px 0 10px -12px #222;
content: " ";
width: 64px;
height: 100%;
position: absolute;
left: 0;
}
.checkbox {
border-radius: 0px;
background-color: white;
padding: 10px 10px 10px 14px;
width: 100%;
height: 100%;
}
&.is-selecting {
visibility: visible;
}
}
// Only to be used in case we can implement Column resizing
// th:not(:last-child) {
// border-right: 1px solid $tainacan-input-background !important;
// }
.thumbnail-cell {
width: 58px;
padding-left: 54px;
}
tbody {
tr {
cursor: pointer;
background-color: transparent;
&.selected-row {
background-color: $primary-lighter !important;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $primary-lighter !important;
}
}
td {
height: 58px;
max-height: 58px;
padding: 10px;
vertical-align: middle;
line-height: 12px;
border: none;
p {
font-size: 14px;
margin: 0px;
}
}
td.column-default-width{
max-width: 350px;
p {
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
img.table-thumb {
max-height: 38px !important;
border-radius: 3px;
}
td.table-creation p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
td.actions-cell {
padding: 0px;
visibility: hidden;
position: absolute;
right: $page-side-padding;
display: none;
.actions-container {
position: relative;
padding: 10px;
height: 100%;
z-index: 9;
background-color: $tainacan-input-background;
}
a .icon {
margin: 8px;
}
&::before {
box-shadow: inset -113px 0 17px -17px #222;
content: " ";
width: 125px;
height: 100%;
position: absolute;
right: 0;
top: 0;
}
}
&:hover {
background-color: $tainacan-input-background;
cursor: pointer;
.checkbox-cell {
visibility: visible;
.checkbox { background-color: $tainacan-input-background; }
}
.actions-cell {
visibility: visible;
display: block;
}
}
}
}
} }
</style> </style>

View File

@ -13,9 +13,9 @@
<div class="th-wrap">{{ $i18n.get('label_who_when') }}</div> <div class="th-wrap">{{ $i18n.get('label_who_when') }}</div>
</th> </th>
<!-- Status --> <!-- Status -->
<th> <!--<th>-->
<div class="th-wrap">{{ $i18n.get('label_status') }}</div> <!--<div class="th-wrap">{{ $i18n.get('label_status') }}</div>-->
</th> <!--</th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -24,7 +24,7 @@
v-for="(event, index) of events"> v-for="(event, index) of events">
<!-- Name --> <!-- Name -->
<td <td
class="column-default-width" class="column-default-width column-main-content"
@click="goToEventPage(event.id)" @click="goToEventPage(event.id)"
:label="$i18n.get('label_event_title')" :label="$i18n.get('label_event_title')"
:aria-label="$i18n.get('label_event_title') + ': ' + event.title"> :aria-label="$i18n.get('label_event_title') + ': ' + event.title">
@ -32,132 +32,61 @@
</td> </td>
<!-- Who and When --> <!-- Who and When -->
<td <td
class="table-creation column-default-width" class="table-creation column-small-width"
@click="goToEventPage(event.id)" @click="goToEventPage(event.id)"
:label="$i18n.get('label_who_when')" :label="$i18n.get('label_who_when')"
:aria-label="$i18n.get('label_who_when') + ': ' + event.by"> :aria-label="$i18n.get('label_who_when') + ': ' + event.by">
<p v-html="event.by" /> <p v-html="event.by" />
</td> </td>
<!-- Status --> <!-- Status -->
<td <!--<td-->
@click="goToEventPage(event.id)" <!--@click="goToEventPage(event.id)"-->
class="status-cell" <!--class="status-cell" -->
:label="$i18n.get('label_status')" <!--:label="$i18n.get('label_status')" -->
:aria-label="$i18n.get('label_status') + ': ' + event.status"> <!--:aria-label="$i18n.get('label_status') + ': ' + event.status">-->
<p> <!--<p>-->
<a <!--<a-->
v-if="event.status === 'pending'" <!--v-if="event.status === 'pending'"-->
id="button-approve" <!--id="button-approve"-->
:aria-label="$i18n.get('approve_item')" <!--:aria-label="$i18n.get('approve_item')"-->
@click.prevent.stop="approveEvent(event.id)"> <!--@click.prevent.stop="approveEvent(event.id)">-->
<b-icon <!--<b-icon-->
icon="check" /> <!--icon="check" />-->
</a> <!--</a>-->
<a <!--<a-->
v-if="event.status === 'pending'" <!--v-if="event.status === 'pending'"-->
id="button-not-approve" <!--id="button-not-approve"-->
class="delete" <!--class="delete"-->
:aria-label="$i18n.get('not_approve_item')" <!--:aria-label="$i18n.get('not_approve_item')"-->
@click.prevent.stop="notApproveEvent(event.id)" /> <!--@click.prevent.stop="notApproveEvent(event.id)" />-->
<small v-if="event.status !== 'pending'">{{ $i18n.get('label_approved') }}</small> <!--<small v-if="event.status !== 'pending'">{{ $i18n.get('label_approved') }}</small>-->
</p> <!--</p>-->
</td> <!--</td>-->
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<!--
<b-table
v-if="totalEvents > 0"
ref="eventsTable"
:data="events"
:checked-rows.sync="selectedEvents"
:loading="isLoading"
hoverable
striped
backend-sorting>
<template slot-scope="props">
<b-table-column <!-- Empty state image -->
tabindex="0" <div v-if="(totalEvents <= 0 || !totalEvents) && !isLoading">
:label="$i18n.get('label_event_title')" <section class="section">
:aria-label="$i18n.get('label_event_title')" <div class="content has-text-grey has-text-centered">
field="props.row.title"> <p>
<router-link
class="clickable-row"
tag="span"
router-link-active
:active="props.row.log_diffs.length > 0"
:to="{path: $routerHelper.getEventPath(props.row.id)}">
{{ props.row.title }}
</router-link>
</b-table-column>
<b-table-column
class="row-creation"
tabindex="0"
:aria-label="$i18n.get('label_who_when') + ': ' + props.row.creation"
:label="$i18n.get('label_who_when')"
property="by"
show-overflow-tooltip
field="props.row.by">
<router-link
class="clickable-row"
v-html="props.row.by"
tag="span"
:active="props.row.log_diffs.length > 0"
:to="{path: $routerHelper.getEventPath(props.row.id)}"/>
</b-table-column>
<b-table-column
tabindex="0"
:label="$i18n.get('label_actions')"
width="78"
:aria-label="$i18n.get('label_actions')">
<a
v-if="props.row.status === 'pending'"
id="button-approve"
:aria-label="$i18n.get('approve_item')"
@click.prevent.stop="approveEvent(props.row.id)">
<b-icon <b-icon
icon="check" /> icon="inbox"
</a> size="is-large"/>
</p>
<a <p>{{ $i18n.get('info_no_events') }}</p>
v-if="props.row.status === 'pending'"
id="button-not-approve"
class="delete"
:aria-label="$i18n.get('not_approve_item')"
@click.prevent.stop="notApproveEvent(props.row.id)" />
<small v-if="props.row.status !== 'pending'"> Approved </small>
</b-table-column>
</template>
</b-table>
-->
<section
v-if="totalEvents <= 0 || !totalEvents"
class="hero is-bold is-large">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title">
<b-icon icon="notifications-none" />
{{ this.$i18n.get('info_no_events') }}
</h1>
</div> </div>
</div> </section>
</section> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapActions } from 'vuex' // import { mapActions } from 'vuex'
export default { export default {
name: 'EventsList', name: 'EventsList',
@ -174,16 +103,16 @@
events: Array events: Array
}, },
methods: { methods: {
...mapActions('event', [ // ...mapActions('event', [
'approve', // 'approve',
'notApprove' // 'notApprove'
]), // ]),
approveEvent(eventId){ // approveEvent(eventId){
this.approve(eventId); // this.approve(eventId);
}, // },
notApproveEvent(eventId){ // notApproveEvent(eventId){
this.notApprove(eventId); // this.notApprove(eventId);
}, // },
goToEventPage(eventId) { goToEventPage(eventId) {
this.$router.push(this.$routerHelper.getEventPath(eventId)); this.$router.push(this.$routerHelper.getEventPath(eventId));
} }
@ -191,145 +120,6 @@
} }
</script> </script>
<style lang="scss" scoped> <style>
@import "../../scss/_variables.scss";
.table {
width: 100%;
.status-cell {
width: 78px;
}
.checkbox-cell {
width: 44px;
height: 58px;
padding: 0;
position: absolute !important;
left: 82px;
visibility: hidden;
display: flex;
justify-content: space-around;
z-index: 9;
&::before {
box-shadow: inset 53px 0 10px -12px #222;
content: " ";
width: 64px;
height: 100%;
position: absolute;
left: 0;
}
.checkbox {
border-radius: 0px;
background-color: white;
padding: 10px 10px 10px 14px;
width: 100%;
height: 100%;
}
&.is-selecting {
visibility: visible;
}
}
// Only to be used in case we can implement Column resizing
// th:not(:last-child) {
// border-right: 1px solid $tainacan-input-background !important;
// }
.thumbnail-cell {
width: 58px;
padding-left: 54px;
}
tbody {
tr {
cursor: pointer;
background-color: transparent;
&.selected-row {
background-color: $primary-lighter !important;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $primary-lighter !important;
}
}
td {
height: 58px;
max-height: 58px;
padding: 10px;
vertical-align: middle;
line-height: 12px;
p {
font-size: 14px;
margin: 0px;
}
}
td.column-default-width{
max-width: 350px;
p, {
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
img.table-thumb {
max-height: 38px !important;
border-radius: 3px;
}
td.table-creation p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
td.actions-cell {
padding: 0px;
visibility: hidden;
position: absolute;
right: 82px;
display: none;
.actions-container {
position: relative;
padding: 10px;
height: 100%;
z-index: 9;
background-color: $tainacan-input-background;
}
a .icon {
margin: 8px;
}
&::before {
box-shadow: inset -113px 0 17px -17px #222;
content: " ";
width: 125px;
height: 100%;
position: absolute;
right: 0;
top: 0;
}
}
&:hover {
background-color: $tainacan-input-background;
cursor: pointer;
.checkbox-cell {
visibility: visible;
.checkbox { background-color: $tainacan-input-background; }
}
.actions-cell {
visibility: visible;
display: block;
}
}
}
}
}
</style> </style>

View File

@ -2,10 +2,25 @@
<div> <div>
<b-loading :active.sync="isLoadingFieldTypes"/> <b-loading :active.sync="isLoadingFieldTypes"/>
<tainacan-title v-if="!isRepositoryLevel"/> <tainacan-title v-if="!isRepositoryLevel"/>
<p v-if="isRepositoryLevel">{{ $i18n.get('info_repository_metadata_inheritance') }}</p>
<br>
<b-tabs v-model="activeTab"> <b-tabs v-model="activeTab">
<b-tab-item :label="$i18n.get('category')"> <b-tab-item :label="$i18n.get('fields')">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<section
v-if="activeFieldList.length <= 0 && !isLoadingFields"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<b-icon
icon="format-list-bulleted-type"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_there_is_no_field' ) }}</p>
<p>{{ $i18n.get('info_create_metadata' ) }}</p>
</div>
</section>
<draggable <draggable
v-model="activeFieldList" v-model="activeFieldList"
class="active-fields-area" class="active-fields-area"
@ -122,8 +137,8 @@
</div> </div>
</b-tab-item> </b-tab-item>
<!-- Exposer --> <!-- Exposer -->
<b-tab-item :label="$i18n.get('exposer')"> <b-tab-item :label="$i18n.get('mapping')">
<p>Exposer Logic goes in here.</p> <p>Under construction. You will be able to map your metadata to other metadata standards in this page.</p>
</b-tab-item> </b-tab-item>
</b-tabs> </b-tabs>
</div> </div>
@ -322,6 +337,13 @@ export default {
.catch(() => { .catch(() => {
this.isLoadingFields = false; this.isLoadingFields = false;
}); });
},
mounted() {
if (!this.isRepositoryLevel) {
document.getElementById('collection-page-container').addEventListener('scroll', ($event) => {
this.$emit('onShrinkHeader', ($event.originalTarget.scrollTop > 53));
});
}
} }
} }
</script> </script>

View File

@ -2,8 +2,23 @@
<div> <div>
<b-loading :active.sync="isLoadingFieldTypes"/> <b-loading :active.sync="isLoadingFieldTypes"/>
<tainacan-title v-if="!isRepositoryLevel"/> <tainacan-title v-if="!isRepositoryLevel"/>
<p v-if="isRepositoryLevel">{{ $i18n.get('info_repository_filters_inheritance') }}</p>
<br>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<section
v-if="activeFilterList.length <= 0 && !isLoadingFilters"
class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered">
<p>
<b-icon
icon="filter"
size="is-large"/>
</p>
<p>{{ $i18n.get('info_there_is_no_filter' ) }}</p>
<p>{{ $i18n.get('info_create_filters' ) }}</p>
</div>
</section>
<draggable <draggable
class="active-filters-area" class="active-filters-area"
@change="handleChange" @change="handleChange"
@ -115,7 +130,7 @@
</div> </div>
<div class="column available-fields-area"> <div class="column available-fields-area">
<div class="field" > <div class="field" >
<h3 class="label"> {{ $i18n.get('label_available_field_types') }}</h3> <h3 class="label"> {{ $i18n.get('label_available_fields') }}</h3>
<draggable <draggable
v-if="availableFieldList.length > 0" v-if="availableFieldList.length > 0"
v-model="availableFieldList" v-model="availableFieldList"
@ -438,6 +453,13 @@ export default {
.catch(() => { .catch(() => {
this.isLoadingFilters = false; this.isLoadingFilters = false;
}); });
},
mounted() {
if (!this.isRepositoryLevel) {
document.getElementById('collection-page-container').addEventListener('scroll', ($event) => {
this.$emit('onShrinkHeader', ($event.originalTarget.scrollTop > 53));
});
}
} }
} }
</script> </script>

View File

@ -16,11 +16,11 @@
position="is-bottom-left" position="is-bottom-left"
v-if="items.length > 0 && items[0].current_user_can_edit" v-if="items.length > 0 && items[0].current_user_can_edit"
:disabled="!isSelectingItems" :disabled="!isSelectingItems"
id="mass-actions-dropdown"> id="bulk-actions-dropdown">
<button <button
class="button is-white" class="button is-white"
slot="trigger"> slot="trigger">
<span>{{ $i18n.get('label_mass_actions') }}</span> <span>{{ $i18n.get('label_bulk_actions') }}</span>
<b-icon icon="menu-down"/> <b-icon icon="menu-down"/>
</button> </button>
@ -50,8 +50,14 @@
<th <th
v-for="(column, index) in tableFields" v-for="(column, index) in tableFields"
:key="index" :key="index"
v-if="column.field != 'row_actions' && column.display" v-if="column.display"
:class="{'thumbnail-cell': column.field == 'row_thumbnail'}" class="column-default-width"
:class="{
'thumbnail-cell': column.field == 'row_thumbnail',
'column-small-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Date' || column.field_type_object.className == 'Tainacan\\Field_Types\\Numeric') : false,
'column-medium-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Selectbox' || column.field_type_object.className == 'Tainacan\\Field_Types\\Category' || column.field_type_object.className == 'Tainacan\\Field_Types\\Compound') : false,
'column-large-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Textarea') : false,
}"
:custom-key="column.slug"> :custom-key="column.slug">
<div class="th-wrap">{{ column.name }}</div> <div class="th-wrap">{{ column.name }}</div>
</th> </th>
@ -84,42 +90,59 @@
v-for="(column, index) in tableFields" v-for="(column, index) in tableFields"
v-if="column.display" v-if="column.display"
:label="column.name" :label="column.name"
:aria-label="column.field != 'row_thumbnail' && :aria-label="(column.field != 'row_thumbnail' && column.field != 'row_creation' && column.field != 'row_author')
column.field != 'row_actions' && ? column.name + '' + (item.metadata ? item.metadata[column.slug].value_as_string : '') : ''"
column.field != 'row_creation' ? column.name + '' + item.metadata[column.slug].value_as_string : ''"
class="column-default-width" class="column-default-width"
:class="{ :class="{
'thumbnail-cell': column.field == 'row_thumbnail', 'thumbnail-cell': column.field == 'row_thumbnail',
'table-creation': column.field == 'row_creation'}" 'column-main-content' : column.field_type_object != undefined ? (column.field_type_object.related_mapped_prop == 'title') : false,
'column-needed-width column-align-right' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Numeric') : false,
'column-small-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Date' || column.field_type_object.className == 'Tainacan\\Field_Types\\Numeric') : false,
'column-medium-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Selectbox' || column.field_type_object.className == 'Tainacan\\Field_Types\\Category' || column.field_type_object.className == 'Tainacan\\Field_Types\\Compound') : false,
'column-large-width' : column.field_type_object != undefined ? (column.field_type_object.className == 'Tainacan\\Field_Types\\Textarea') : false,
}"
@click="goToItemPage(item)"> @click="goToItemPage(item)">
<p <!-- <data-and-tooltip
v-if="column.field !== 'row_thumbnail' && v-if="column.field !== 'row_thumbnail' &&
column.field !== 'row_actions' && column.field !== 'row_actions' &&
column.field !== 'row_creation'" column.field !== 'row_creation'"
:data="renderMetadata( item.metadata[column.slug] )"/> -->
<p
v-tooltip="{
content: renderMetadata( item.metadata[column.slug] ),
html: true,
autoHide: false
}"
v-if="item.metadata != undefined &&
column.field !== 'row_thumbnail' &&
column.field !== 'row_actions' &&
column.field !== 'row_creation' &&
column.field !== 'row_author'"
v-html="renderMetadata( item.metadata[column.slug] )"/> v-html="renderMetadata( item.metadata[column.slug] )"/>
<span v-if="column.field == 'row_thumbnail'"> <span v-if="column.field == 'row_thumbnail'">
<img <img
class="table-thumb" class="table-thumb"
:src="item[column.slug]"> :src="item[column.slug].thumb">
</span> </span>
<p <p v-if="column.field == 'row_author' || column.field == 'row_creation'">
v-if="column.field == 'row_creation'" {{ item[column.slug] }}
v-html="getCreationHtml(item)" /> </p>
</td> </td>
<!-- Actions --> <!-- Actions -->
<td <td
v-if="item.current_user_can_edit && !isOnTheme" v-if="!isOnTheme && item.current_user_can_edit"
class="column-default-width actions-cell"> class="actions-cell"
:label="$i18n.get('label_actions')">
<div class="actions-container"> <div class="actions-container">
<a <a
id="button-edit" id="button-edit"
:aria-label="$i18n.getFrom('items','edit_item')" :aria-label="$i18n.getFrom('items','edit_item')"
@click.prevent.stop="goToItemEditPage(item.id)"> @click.prevent.stop="goToItemEditPage(item.id)">
<b-icon <b-icon
type="is-secondary" type="is-secondary"
icon="pencil"/> icon="pencil"/>
</a> </a>
@ -144,6 +167,7 @@
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import DataAndTooltip from '../other/data-and-tooltip.vue'
export default { export default {
name: 'ItemsList', name: 'ItemsList',
@ -161,6 +185,9 @@ export default {
isLoading: false, isLoading: false,
isOnTheme: false isOnTheme: false
}, },
components: {
DataAndTooltip
},
mounted() { mounted() {
this.selectedItems = []; this.selectedItems = [];
for (let i = 0; i < this.items.length; i++) for (let i = 0; i < this.items.length; i++)
@ -275,7 +302,10 @@ export default {
} }
}, },
getCreationHtml(item) { getCreationHtml(item) {
return this.$i18n.get('info_created_by') + item['author_name'] + '<br>' + this.$i18n.get('info_date') + item['creation_date']; return this.$i18n.get('info_date') + item['creation_date'];
},
getAuthorHtml(item) {
return item['author_name'];
}, },
getDecodedURI(url) { getDecodedURI(url) {
return decodeURIComponent(url); return decodeURIComponent(url);
@ -290,8 +320,7 @@ export default {
.selection-control { .selection-control {
padding: 6px 14px 0px 14px; padding: 6px 0px 0px 13px;
position: relative;
background: white; background: white;
height: 40px; height: 40px;
@ -304,170 +333,6 @@ export default {
} }
} }
.table {
width: 100%;
border-collapse: separate;
th {
position: sticky;
position: -webkit-sticky;
background-color: white;
border-bottom: 1px solid $tainacan-input-background;
top: 0px;
z-index: 9;
&.actions-header {
min-width: 8.333333333%;
}
}
// &.selectable-table th:nth-child(2), &.selectable-table td:nth-child(2) {
// padding-left: 54px;
// }
.checkbox-cell {
min-width: 44px;
width: 44px;
padding: 0;
position: sticky !important;
position: -webkit-sticky !important;
left: 0;
top: auto;
visibility: hidden;
&::before {
box-shadow: inset 54px 0 10px -12px #222;
content: " ";
width: 54px;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
label.checkbox {
border-radius: 0px;
background-color: white;
padding: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
&.is-selecting {
visibility: visible;
}
}
// Only to be used in case we can implement Column resizing
// th:not(:last-child) {
// border-right: 1px solid $tainacan-input-background !important;
// }
.thumbnail-cell {
width: 58px;
}
tbody {
tr {
cursor: pointer;
background-color: transparent;
&.selected-row {
background-color: $primary-lighter !important;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $primary-lighter !important;
}
}
td {
height: 58px;
max-height: 58px;
padding: 10px;
vertical-align: middle;
line-height: 12px;
border: none;
p {
font-size: 14px;
margin: 0px;
}
}
td.column-default-width{
max-width: 300px;
p {
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
img.table-thumb {
max-height: 38px !important;
border-radius: 3px;
}
td.table-creation p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
td.actions-cell {
padding: 0px;
position: sticky !important;
position: -webkit-sticky !important;
right: 0px;
top: auto;
width: 8.333333333%;
.actions-container {
visibility: hidden;
display: flex;
position: relative;
padding: 0;
height: 100%;
min-width: 120px;
z-index: 9;
background-color: transparent;
}
a {
margin: auto;
.mdi {font-size: 18px !important; }
}
}
&:hover {
background-color: $tainacan-input-background;
cursor: pointer;
.checkbox-cell {
visibility: visible;
.checkbox { background-color: $tainacan-input-background; }
}
.actions-cell {
.actions-container {
visibility: visible;
background: $tainacan-input-background;
}
&::after {
box-shadow: inset -134px 0 17px -21px #222;
content: " ";
width: 140px;
height: 100%;
position: absolute;
right: 0px;
top: 0;
}
}
}
}
}
}
</style> </style>

View File

@ -45,12 +45,15 @@
{{ $i18n.get('label_view_term') }} {{ $i18n.get('label_view_term') }}
</button> </button>
--> -->
<button <a
class="button is-secondary is-small" class="is-small"
type="button" type="button"
@click="addNewChildTerm(term, index)"> @click="addNewChildTerm(term, index)">
<b-icon
size="is-small"
icon="plus-circle"/>
{{ $i18n.get('label_new_child') }} {{ $i18n.get('label_new_child') }}
</button> </a>
<a @click.prevent="editTerm(term, index)"> <a @click.prevent="editTerm(term, index)">
<b-icon <b-icon
@ -380,6 +383,12 @@ export default {
bottom: 1px; bottom: 1px;
position: relative; position: relative;
i, i:before { font-size: 20px; } i, i:before { font-size: 20px; }
.mdi-plus-circle, .mdi-plus-circle:before{
font-size: 18px;
}
a {
margin-right: 8px;
}
} }
.button { .button {
margin-right: 1em; margin-right: 1em;

View File

@ -43,7 +43,7 @@
</router-link></li> </router-link></li>
<li><router-link <li><router-link
tag="a" tag="a"
to="/categories" to="/taxonomies"
:class="activeRoute == 'CategoriesPage' ? 'is-active':''"> :class="activeRoute == 'CategoriesPage' ? 'is-active':''">
<b-icon <b-icon
size="is-small" size="is-small"
@ -55,7 +55,7 @@
:class="activeRoute == 'EventsPage' ? 'is-active':''"> :class="activeRoute == 'EventsPage' ? 'is-active':''">
<b-icon <b-icon
size="is-small" size="is-small"
icon="calendar-range"/> <span class="menu-text">{{ $i18n.get('events') }}</span> icon="flash"/> <span class="menu-text">{{ $i18n.get('events') }}</span>
</router-link></li> </router-link></li>
</ul> </ul>
</aside> </aside>

View File

@ -33,9 +33,9 @@
:aria-label="$i18n.get('label_collection_items')"> :aria-label="$i18n.get('label_collection_items')">
<b-icon <b-icon
size="is-small" size="is-small"
icon="folder-outline"/> icon="file-multiple"/>
<br> <br>
<span class="menu-text">{{ $i18n.getFrom('collections', 'singular_name') }}</span> <span class="menu-text">{{ $i18n.get('items') }}</span>
</router-link> </router-link>
</li> </li>
<li class="level-item"> <li class="level-item">
@ -43,12 +43,12 @@
tag="a" tag="a"
:to="{ path: $routerHelper.getCollectionEditPath(id) }" :to="{ path: $routerHelper.getCollectionEditPath(id) }"
:class="activeRoute == 'CollectionEditionForm' ? 'is-active':''" :class="activeRoute == 'CollectionEditionForm' ? 'is-active':''"
:aria-label="$i18n.getFrom('collections','edit_item')"> :aria-label="$i18n.get('label_settings')">
<b-icon <b-icon
size="is-small" size="is-small"
icon="pencil"/> icon="settings"/>
<br> <br>
<span class="menu-text">{{ $i18n.get('edit') }}</span> <span class="menu-text">{{ $i18n.get('label_settings') }}</span>
</router-link> </router-link>
</li> </li>
<li class="level-item"> <li class="level-item">
@ -85,7 +85,7 @@
:aria-label="$i18n.get('label_collection_events')"> :aria-label="$i18n.get('label_collection_events')">
<b-icon <b-icon
size="is-small" size="is-small"
icon="calendar-range"/> icon="flash"/>
<br> <br>
<span class="menu-text">{{ $i18n.get('events') }}</span> <span class="menu-text">{{ $i18n.get('events') }}</span>
</router-link> </router-link>
@ -110,7 +110,7 @@ export default {
} }
}, },
props: { props: {
id: Number id: Number,
}, },
watch: { watch: {
'$route' (to) { '$route' (to) {
@ -166,7 +166,7 @@ export default {
.then(itemTitle => this.arrayViewPath.splice(i, 1, itemTitle)) .then(itemTitle => this.arrayViewPath.splice(i, 1, itemTitle))
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
break; break;
case 'categories': case 'taxonomies':
this.fetchCategoryName(this.arrayRealPath[i]) this.fetchCategoryName(this.arrayRealPath[i])
.then(categoryName => this.arrayViewPath.splice(i, 1, categoryName)) .then(categoryName => this.arrayViewPath.splice(i, 1, categoryName))
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
@ -208,6 +208,7 @@ export default {
height: $subheader-height; height: $subheader-height;
max-height: $subheader-height; max-height: $subheader-height;
width: 100%; width: 100%;
overflow-y: hidden;
padding-top: 18px; padding-top: 18px;
padding-bottom: 18px; padding-bottom: 18px;
padding-right: $page-side-padding; padding-right: $page-side-padding;
@ -217,6 +218,28 @@ export default {
left: 0; left: 0;
right: 0; right: 0;
z-index: 9; z-index: 9;
transition: padding 0.3s, height 0.3s;
&.is-shrink {
height: $header-height;
max-height: $header-height;
padding-top: 12px;
padding-bottom: 12px;
h1 { margin-bottom: 4px; }
li a {
line-height: 20px;
.menu-text {
visibility: hidden;
opacity: 0;
font-size: 0;
line-height: 0;
display: block;
width: 0;
height: 0;
}
}
}
h1 { h1 {
font-size: 18px; font-size: 18px;
@ -228,6 +251,8 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
-webkit-transition: margin-bottom 0.2s linear; /* Safari */
transition: margin-bottom 0.2s linear;
} }
.breadcrumbs { .breadcrumbs {
@ -245,6 +270,9 @@ export default {
li{ li{
margin-right: 0px; margin-right: 0px;
transition: height 0.5s linear, padding 0.5s linear;
-webkit-transition: height 0.5s linear, padding 0.5s linear;
a { a {
color: $tertiary; color: $tertiary;
text-align: center; text-align: center;
@ -254,8 +282,6 @@ export default {
min-width: 75px; min-width: 75px;
line-height: 1.5em; line-height: 1.5em;
border-radius: 0px; border-radius: 0px;
-webkit-transition: padding 0.3s linear; /* Safari */
transition: padding 0.3s linear;
position: relative; position: relative;
overflow: inherit; overflow: inherit;
} }
@ -287,8 +313,8 @@ export default {
font-size: 14px; font-size: 14px;
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
transition: opacity 0.3s linear, visibility 0.3s linear; transition: opacity 0.5s linear, visibility 0.5s linear, height 0.5s linear;
-webkit-transition: opacity 0.3s linear, visibility 0.3s linear; -webkit-transition: opacity 0.5s linear, visibility 0.5s linear, height 0.5s linear;
} }
} }

View File

@ -1,7 +1,6 @@
<template> <template>
<div <div
class="tainacan-page-title" class="tainacan-page-title">
id="title-row">
<h1>{{ pageTitle }} <span class="is-italic">{{ isRepositoryLevel ? '' : entityName }}</span></h1> <h1>{{ pageTitle }} <span class="is-italic">{{ isRepositoryLevel ? '' : entityName }}</span></h1>
<a <a
@click="$router.go(-1)" @click="$router.go(-1)"
@ -87,7 +86,7 @@ export default {
.then(itemName => { this.arrayViewPath.splice(i, 1, itemName); this.entityName = itemName; }) .then(itemName => { this.arrayViewPath.splice(i, 1, itemName); this.entityName = itemName; })
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
break; break;
case 'categories': case 'taxonomies':
this.fetchCategoryName(this.arrayRealPath[i]) this.fetchCategoryName(this.arrayRealPath[i])
.then(categoryName => this.arrayViewPath.splice(i, 1, categoryName)) .then(categoryName => this.arrayViewPath.splice(i, 1, categoryName))
.catch((error) => this.$console.error(error)); .catch((error) => this.$console.error(error));
@ -133,20 +132,34 @@ export default {
@import "../../scss/_variables.scss"; @import "../../scss/_variables.scss";
// Tainacan Header .tainacan-page-title {
#title-row { margin-bottom: 40px;
h1, h2 {
font-size: 20px;
font-weight: 500;
color: $tertiary;
display: inline-block;
}
a.back-link{
font-weight: 500;
float: right;
margin-top: 5px;
}
hr{
margin: 3px 0px 4px 0px;
height: 1px;
background-color: $secondary;
}
.breadcrumbs { .breadcrumbs {
font-size: 12px; font-size: 12px;
} }
.level-left { .level-left {
.level-item { .level-item {
display: inline-block; display: inline-block;
margin-left: 268px; margin-left: 268px;
} }
} }
@media screen and (max-width: 769px) { @media screen and (max-width: 769px) {
.level-left { .level-left {
margin-left: 0px !important; margin-left: 0px !important;
@ -161,7 +174,6 @@ export default {
top: 206px; top: 206px;
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
} }
</style> </style>

View File

@ -0,0 +1,89 @@
<template>
<span class="data-wrapper">
<p
class="data-area"
v-html="data" />
<div class="data-tooltip">
<div class="data-tooltip-body">
<p v-html="data" />
</div>
</div>
</span>
</template>
<script>
export default {
name: 'DataAndTooltip',
props: {
data: '',
}
}
</script>
<style lang="scss">
@import "../../scss/_variables.scss";
.data-wrapper {
position: relative;
}
.data-area {
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
margin-bottom: 0;
}
.data-wrapper:hover .data-tooltip {
margin-bottom: -8px;
margin-left: -8px;
visibility: visible;
opacity: 1;
}
.data-tooltip {
z-index: 99999999999999999999;
color: $tertiary;
background-color: $primary-light;
border: none;
display: block;
border-radius: 5px;
max-width: 280px;
min-width: 100px;
height: auto;
transition: margin-bottom 0.2s ease, opacity 0.3s ease;
position: absolute;
bottom: calc(100% - 6px);
left: 0;
margin-bottom: -27px;
visibility: hidden;
opacity: 0;
.data-tooltip-body {
padding: 20px;
p {
font-size: 11px;
font-weight: normal;
}
}
&:before {
content: "";
display: block;
position: absolute;
left: 28px;
width: 0;
height: 0;
border-style: solid;
}
&:before {
border-color: $primary-light transparent transparent transparent;
border-right-width: 6px;
border-top-width: 7px;
border-left-width: 6px;
bottom: -10px;
}
}
</style>

View File

@ -5,7 +5,7 @@
<div class="tile is-parent"> <div class="tile is-parent">
<article class="tile box is-child"> <article class="tile box is-child">
<div class="content"> <div class="content">
<div class="title">{{ this.$i18n.get('info_logs_before') }}</div> <h1 class="event-titles">{{ this.$i18n.get('info_logs_before') }}</h1>
<div <div
v-for="(diff, key) in event.log_diffs" v-for="(diff, key) in event.log_diffs"
v-if="diff.old" v-if="diff.old"
@ -88,7 +88,7 @@
<div class="tile is-parent"> <div class="tile is-parent">
<article class="tile box is-child"> <article class="tile box is-child">
<div class="content"> <div class="content">
<div class="title">{{ this.$i18n.get('info_logs_after') }}</div> <h1 class="event-titles">{{ this.$i18n.get('info_logs_after') }}</h1>
<div <div
v-for="(diff, key) in event.log_diffs" v-for="(diff, key) in event.log_diffs"
:key="key"> :key="key">
@ -186,4 +186,11 @@
.content { .content {
overflow: auto; overflow: auto;
} }
.event-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
</style> </style>

View File

@ -6,7 +6,7 @@
<article class="tile box is-child"> <article class="tile box is-child">
<div class="content"> <div class="content">
<div class="title">{{ this.$i18n.get('info_changes') }}</div> <h1 class="event-titles">{{ this.$i18n.get('info_changes') }}</h1>
<div <div
v-for="(diff, key) in event.log_diffs" v-for="(diff, key) in event.log_diffs"
v-if="diff.old" v-if="diff.old"
@ -184,4 +184,11 @@
.content { .content {
overflow: auto; overflow: auto;
} }
.event-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
</style> </style>

View File

@ -0,0 +1,156 @@
<template>
<div>
<figure
class="file-item"
@click="isPreviewModalActive = true">
<div class="image-wrapper">
<div
v-if="file.media_type == 'image'"
class="image"
:style="{ 'background-image': 'url(' + file.guid.rendered + ')' }"/>
<div
v-else
class="file-placeholder">
<b-icon
:icon="getIconForMimeType(file.mime_type)"
size="is-large"
type="is-gray"/>
</div>
</div>
<figcaption v-if="showName">{{ file.title.rendered }}</figcaption>
</figure>
<!-- Preview Modal ----------------- -->
<b-modal
:can-cancel="false"
:active.sync="isPreviewModalActive"
:width="640"
scroll="keep">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ file.title.rendered }}</h2>
<hr>
</div>
<div
class="is-flex"
v-html="file.description.rendered" />
<div class="field is-grouped form-submit">
<div class="control">
<button
id="button-cancel-url-link-selection"
class="button is-outlined"
type="button"
@click="isPreviewModalActive = false">
{{ $i18n.get('cancel') }}</button>
</div>
</div>
</div>
</b-modal>
</div>
</template>
<script>
export default {
name: 'FileItem',
props: {
file: Object,
showName: false,
isSelected: false,
isPreviewModalActive: false
},
methods: {
getIconForMimeType(mimeType) {
let type = mimeType.split('/');
if (type[0] == 'application' && type[1] != undefined){
switch (type[1]) {
case 'pdf':
return 'file-pdf';
default:
return '';
}
} else {
switch (type[0]) {
case 'video':
return 'video';
case 'audio':
return 'volume-high';
case 'text':
return 'format-align-left';
default:
return '';
}
}
}
}
}
</script>
<style lang="scss">
@import "../../scss/_variables.scss";
.file-item {
&:hover {
cursor: pointer;
.image, .file-placeholder {
transform: scale(1.1);
}
}
.image-wrapper {
height: 112px;
width: 112px;
border-radius: 2px;
overflow: hidden;
position: relative;
display: inline-block;
background-color: $tainacan-input-background;
.image {
height: 100%;
width: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.file-placeholder {
height: 100%;
width: 100%;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
}
figcaption {
background-color: $tainacan-input-background;
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
padding: 5px 15px;
font-size: 9px;
margin-top: -4px;
width: 112px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
text-align: center;
}
}
.is-flex {
justify-content: center;
}
</style>

View File

@ -19,9 +19,12 @@
{{ $i18n.get('add_one_item') }} {{ $i18n.get('add_one_item') }}
</router-link> </router-link>
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item disabled>{{ $i18n.get('add_items_bulk') + ' (Not ready)' }} <b-dropdown-item disabled>
{{ $i18n.get('add_items_bulk') + ' (Not ready)' }}
</b-dropdown-item>
<b-dropdown-item disabled>
{{ $i18n.get('add_items_external_source') + ' (Not ready)' }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item disabled>{{ $i18n.get('add_items_external_source') + ' (Not ready)' }}<br><small class="is-small">{{ $i18n.get() }}</small></b-dropdown-item>
</b-dropdown> </b-dropdown>
</div> </div>
@ -39,9 +42,9 @@
class="control" class="control"
custom> custom>
<b-checkbox <b-checkbox
@input="onChangeDisplayedField($event, index)"
v-model="column.display" :value="column.display"
:native-value="column.field"> :native-value="column.display">
{{ column.name }} {{ column.name }}
</b-checkbox> </b-checkbox>
</b-dropdown-item> </b-dropdown-item>
@ -55,12 +58,13 @@
<option <option
v-for="field in tableFields" v-for="field in tableFields"
v-if=" v-if="
field.id === 'date' || ( field.id === 'creation_date' ||
field.id !== undefined && field.id === 'author_name' || (
field.field_type_object.related_mapped_prop !== 'description' && field.id !== undefined &&
field.field_type_object.primitive_type !== 'term' && field.field_type_object.related_mapped_prop !== 'description' &&
field.field_type_object.primitive_type !== 'item' && field.field_type_object.primitive_type !== 'term' &&
field.field_type_object.primitive_type !== 'compound' field.field_type_object.primitive_type !== 'item' &&
field.field_type_object.primitive_type !== 'compound'
)" )"
:value="field" :value="field"
:key="field.id"> :key="field.id">
@ -104,8 +108,7 @@
methods: { methods: {
...mapGetters('search', [ ...mapGetters('search', [
'getOrderBy', 'getOrderBy',
'getOrder', 'getOrder'
//'getFetchOnlyMeta'
]), ]),
onChangeOrderBy(field) { onChangeOrderBy(field) {
this.$eventBusSearch.setOrderBy(field); this.$eventBusSearch.setOrderBy(field);
@ -113,13 +116,15 @@
onChangeOrder() { onChangeOrder() {
this.order == 'DESC' ? this.$eventBusSearch.setOrder('ASC') : this.$eventBusSearch.setOrder('DESC'); this.order == 'DESC' ? this.$eventBusSearch.setOrder('ASC') : this.$eventBusSearch.setOrder('DESC');
}, },
// onChangeDisplayedField(event, fieldId) { onChangeDisplayedField(event, index) {
// column.display = event; if (this.tableFields[index] != undefined) {
// if (event) this.tableFields[index].display = event;
// this.$eventBusSearch.addFetchOnlyMeta(field.id); if (event)
// else this.$eventBusSearch.addFetchOnlyMeta(this.tableFields[index].id);
// this.$eventBusSearch.removeFetchOnlyMeta(field.id); else
// } this.$eventBusSearch.removeFetchOnlyMeta(this.tableFields[index].id);
}
}
} }
} }
</script> </script>

View File

@ -5,6 +5,8 @@ window.underscore = _.noConflict();
// Main imports // Main imports
import Vue from 'vue'; import Vue from 'vue';
import Buefy from 'buefy'; import Buefy from 'buefy';
import VTooltip from 'v-tooltip'
// Custom elements // Custom elements
import Text from '../../classes/field-types/text/Text.vue'; import Text from '../../classes/field-types/text/Text.vue';
@ -45,6 +47,7 @@ import VueMask from 'v-mask';
// Configure and Register Plugins // Configure and Register Plugins
Vue.use(Buefy); Vue.use(Buefy);
Vue.use(VTooltip)
Vue.use(I18NPlugin); Vue.use(I18NPlugin);
Vue.use(UserPrefsPlugin); Vue.use(UserPrefsPlugin);
Vue.use(RouterHelperPlugin); Vue.use(RouterHelperPlugin);

View File

@ -1,5 +1,6 @@
import axios from 'axios'; import axios from 'axios';
import qs from 'qs'; import qs from 'qs';
import moment from 'moment';
export const wpAjax = { export const wpAjax = {
data(){ data(){
@ -44,11 +45,15 @@ export const wpAjax = {
export const dateInter = { export const dateInter = {
methods: { methods: {
getDateLocaleFormat() { getDateLocaleMask() {
let locale = navigator.language;
let now = new Date(); moment.locale(locale);
return now.toLocaleDateString().replace(/[\d]/g, '#'); let localeData = moment.localeData();
let format = localeData.longDateFormat('L');
return format.replace(/[\w]/g, '#');
} }
} }
}; };

View File

@ -47,7 +47,7 @@ const routes = [
{ path: 'edit', component: CollectionEditionForm, name: 'CollectionEditionForm', meta: {title: i18nGet('title_edit_collection'), icon: 'folder-multiple'} }, { path: 'edit', component: CollectionEditionForm, name: 'CollectionEditionForm', meta: {title: i18nGet('title_edit_collection'), icon: 'folder-multiple'} },
{ path: 'fields', component: FieldsList, name: 'FieldsList', meta: {title: i18nGet('title_collection_fields_edition'), icon: 'folder-multiple'} }, { path: 'fields', component: FieldsList, name: 'FieldsList', meta: {title: i18nGet('title_collection_fields_edition'), icon: 'folder-multiple'} },
{ path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} }, { path: 'filters', component: FiltersList, name: 'FiltersList', meta: {title: i18nGet('title_collection_filters_edition'), icon: 'folder-multiple'} },
{ path: 'events', component: EventsPage, name: 'CollectionEventsPage', meta: {title: i18nGet('title_collection_events'), icon: 'calendar'} } { path: 'events', component: EventsPage, name: 'CollectionEventsPage', meta: {title: i18nGet('title_collection_events'), icon: 'flash'} }
] ]
}, },
@ -58,13 +58,13 @@ const routes = [
{ path: '/fields', name: 'FieldsPage', component: FieldsPage, meta: {title: i18nGet('title_repository_fields_page'), icon: 'format-list-checks'} }, { path: '/fields', name: 'FieldsPage', component: FieldsPage, meta: {title: i18nGet('title_repository_fields_page'), icon: 'format-list-checks'} },
{ path: '/categories', name: 'CategoriesPage', component: CategoriesPage, meta: {title: i18nGet('title_categories_page'), icon: 'shape'} }, { path: '/taxonomies', name: 'CategoriesPage', component: CategoriesPage, meta: {title: i18nGet('title_categories_page'), icon: 'shape'} },
{ path: '/categories/new', name: 'CategoryCreationForm', component: CategoryEditionForm, meta: {title: i18nGet('title_create_category_page'), icon: 'shape'} }, { path: '/taxonomies/new', name: 'CategoryCreationForm', component: CategoryEditionForm, meta: {title: i18nGet('title_create_category_page'), icon: 'shape'} },
{ path: '/categories/:categoryId/edit', name: 'CategoryEditionForm', component: CategoryEditionForm, meta: {title: i18nGet('title_category_edition_page'), icon: 'shape'} }, { path: '/taxonomies/:categoryId/edit', name: 'CategoryEditionForm', component: CategoryEditionForm, meta: {title: i18nGet('title_category_edition_page'), icon: 'shape'} },
{ path: '/categories/:categoryId', name: 'CategoryPage', component: CategoryPage, meta: {title: i18nGet('title_category_page'), icon: 'shape'} }, { path: '/taxonomies/:categoryId', name: 'CategoryPage', component: CategoryPage, meta: {title: i18nGet('title_category_page'), icon: 'shape'} },
{ path: '/events', name: 'EventsPage', component: EventsPage, meta: {title: i18nGet('title_repository_events_page'), icon: 'calendar'} }, { path: '/events', name: 'EventsPage', component: EventsPage, meta: {title: i18nGet('title_repository_events_page'), icon: 'flash'} },
{ path: '/events/:eventId', name: 'EventPage', component: EventPage, meta: {title: i18nGet('title_event_page'), icon: 'calendar'} }, { path: '/events/:eventId', name: 'EventPage', component: EventPage, meta: {title: i18nGet('title_event_page'), icon: 'flash'} },
{ path: '*', redirect: '/'} { path: '*', redirect: '/'}
]; ];

View File

@ -175,7 +175,7 @@ RouterHelperPlugin.install = function (Vue, options = {}) {
return '/items/?' + qs.stringify(query); return '/items/?' + qs.stringify(query);
}, },
getCategoriesPath(query) { getCategoriesPath(query) {
return '/categories/?' + qs.stringify(query); return '/taxonomies/?' + qs.stringify(query);
}, },
getCategoryTermsPath(categoryId, query) { getCategoryTermsPath(categoryId, query) {
return '/categoryId/' + categoryId + 'terms/?' + qs.stringify(query); return '/categoryId/' + categoryId + 'terms/?' + qs.stringify(query);
@ -200,10 +200,10 @@ RouterHelperPlugin.install = function (Vue, options = {}) {
return '/filters/' + id; return '/filters/' + id;
}, },
getCategoryPath(id) { getCategoryPath(id) {
return '/categories/' + id; return '/taxonomies/' + id;
}, },
getTermPath(categoryId, termId) { getTermPath(categoryId, termId) {
return '/categories/' + categoryId + '/terms/' + termId; return '/taxonomies/' + categoryId + '/terms/' + termId;
}, },
getEventPath(id) { getEventPath(id) {
return '/events/' + id; return '/events/' + id;
@ -231,10 +231,10 @@ RouterHelperPlugin.install = function (Vue, options = {}) {
return '/filters/new'; return '/filters/new';
}, },
getNewCategoryPath() { getNewCategoryPath() {
return '/categories/new'; return '/taxonomies/new';
}, },
getNewTermPath() { getNewTermPath() {
return '/categories/' + categoryId + '/terms/new'; return '/taxonomies/' + categoryId + '/terms/new';
}, },
getNewEventPath() { getNewEventPath() {
return '/events/new'; return '/events/new';
@ -250,10 +250,10 @@ RouterHelperPlugin.install = function (Vue, options = {}) {
return '/filters/' + id + '/edit'; return '/filters/' + id + '/edit';
}, },
getCategoryEditPath(id) { getCategoryEditPath(id) {
return '/categories/' + id + '/edit'; return '/taxonomies/' + id + '/edit';
}, },
getTermEditPath(categoryId, termId) { getTermEditPath(categoryId, termId) {
return '/categories/' + categoryId + '/terms/' + termId + '/edit'; return '/taxonomies/' + categoryId + '/terms/' + termId + '/edit';
}, },
getEventEditPath(id) { getEventEditPath(id) {
return '/events/' + id + '/edit'; return '/events/' + id + '/edit';

View File

@ -16,7 +16,7 @@ export default {
content: 'upload', // First view that is opened content: 'upload', // First view that is opened
autoSelect: true, autoSelect: true,
states: [ states: [
new wp.media.controller.MediaLibrary({ new wp.media.controller.Library({
title: this.params.button_labels.frame_title, title: this.params.button_labels.frame_title,
library: wp.media.query({ library: wp.media.query({
status: null, status: null,

View File

@ -4,7 +4,7 @@
<tainacan-title /> <tainacan-title />
<div <div
class="sub-header" class="sub-header"
v-if="totalCategories > 0"> v-if="checkIfUserCanEdit()">
<div class="header-item"> <div class="header-item">
<router-link <router-link
id="button-create-category" id="button-create-category"
@ -17,53 +17,90 @@
</div> </div>
<div class="above-subheader"> <div class="above-subheader">
<div class="tabs">
<categories-list <ul>
:is-loading="isLoading" <li
:total-categories="totalCategories" @click="onChangeTab('')"
:page="page" :class="{ 'is-active': status == undefined || status == ''}"><a>{{ $i18n.get('label_all_items') }}</a></li>
:categories-per-page="categoriesPerPage" <li
:categories="categories"/> @click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}"><a>{{ $i18n.get('label_draft_items') }}</a></li>
<!-- Footer --> <li
<div @click="onChangeTab('trash')"
class="pagination-area" :class="{ 'is-active': status == 'trash'}"><a>{{ $i18n.get('label_trash_items') }}</a></li>
v-if="totalCategories > 0"> </ul>
<div class="shown-items"> </div>
{{ <div>
$i18n.get('info_showing_categories') + <categories-list
(categoriesPerPage * (page - 1) + 1) + :is-loading="isLoading"
$i18n.get('info_to') + :total-categories="totalCategories"
getLastCategoryNumber() + :page="page"
$i18n.get('info_of') + totalCategories + '.' :categories-per-page="categoriesPerPage"
}} :categories="categories"/>
<!-- Empty state image -->
<div v-if="totalCategories <= 0 && !isLoading">
<section class="section">
<div class="content has-text-grey has-text-centered">
<p>
<b-icon
icon="inbox"
size="is-large"/>
</p>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_category_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_category_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_category_trash') }}</p>
<router-link
v-if="status == undefined || status == ''"
id="button-create-category"
tag="button"
class="button is-primary"
:to="{ path: $routerHelper.getNewCategoryPath() }">
{{ $i18n.getFrom('categories', 'new_item') }}
</router-link>
</div>
</section>
</div> </div>
<div class="items-per-page"> <!-- Footer -->
<b-field <div
horizontal class="pagination-area"
:label="$i18n.get('label_categories_per_page')"> v-if="totalCategories > 0">
<b-select <div class="shown-items">
:value="categoriesPerPage" {{
@input="onChangeCategoriesPerPage" $i18n.get('info_showing_categories') +
:disabled="categories.length <= 0"> (categoriesPerPage * (page - 1) + 1) +
<option value="12">12</option> $i18n.get('info_to') +
<option value="24">24</option> getLastCategoryNumber() +
<option value="48">48</option> $i18n.get('info_of') + totalCategories + '.'
<option value="96">96</option> }}
</b-select> </div>
</b-field> <div class="items-per-page">
</div> <b-field
<div class="pagination"> horizontal
<b-pagination :label="$i18n.get('label_categories_per_page')">
@change="onPageChange" <b-select
:total="totalCategories" :value="categoriesPerPage"
:current.sync="page" @input="onChangeCategoriesPerPage"
order="is-centered" :disabled="categories.length <= 0">
size="is-small" <option value="12">12</option>
:per-page="categoriesPerPage"/> <option value="24">24</option>
<option value="48">48</option>
<option value="96">96</option>
</b-select>
</b-field>
</div>
<div class="pagination">
<b-pagination
@change="onPageChange"
:total="totalCategories"
:current.sync="page"
order="is-centered"
size="is-small"
:per-page="categoriesPerPage"/>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -80,7 +117,8 @@
isLoading: false, isLoading: false,
totalCategories: 0, totalCategories: 0,
page: 1, page: 1,
categoriesPerPage: 12 categoriesPerPage: 12,
status: ''
} }
}, },
components: { components: {
@ -93,6 +131,17 @@
...mapGetters('category', [ ...mapGetters('category', [
'getCategories' 'getCategories'
]), ]),
onChangeTab(status) {
this.status = status;
this.loadCategories();
},
checkIfUserCanEdit() {
for (let capability of tainacan_plugin.user_caps) {
if (capability == 'edit_tainacan-taxonomies')
return true;
}
return false;
},
onChangeCategoriesPerPage(value) { onChangeCategoriesPerPage(value) {
let prevValue = this.categoriesPerPage; let prevValue = this.categoriesPerPage;
this.categoriesPerPage = value; this.categoriesPerPage = value;
@ -106,7 +155,7 @@
loadCategories() { loadCategories() {
this.isLoading = true; this.isLoading = true;
this.fetchCategories({ 'page': this.page, 'categoriesPerPage': this.categoriesPerPage }) this.fetchCategories({ 'page': this.page, 'categoriesPerPage': this.categoriesPerPage, 'status': this.status })
.then((res) => { .then((res) => {
this.isLoading = false; this.isLoading = false;
this.totalCategories = res.total; this.totalCategories = res.total;
@ -152,6 +201,7 @@
height: $subheader-height; height: $subheader-height;
margin-left: -$page-side-padding; margin-left: -$page-side-padding;
margin-right: -$page-side-padding; margin-right: -$page-side-padding;
margin-top: -$page-top-padding;
padding-top: $page-small-top-padding; padding-top: $page-small-top-padding;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
@ -172,11 +222,15 @@
} }
} }
} }
.tabs {
padding-top: 20px;
margin-bottom: 20px;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
}
.above-subheader { .above-subheader {
margin-bottom: 0; margin-bottom: 0;
margin-top: 0; margin-top: 0;
min-height: 100%;
height: auto; height: auto;
} }
</style> </style>

View File

@ -4,32 +4,30 @@
<tainacan-title /> <tainacan-title />
<div <div
class="sub-header" class="sub-header"
v-if="totalCollections > 0"> v-if="checkIfUserCanEdit()">
<div class="header-item"> <div class="header-item">
<b-dropdown <b-dropdown id="collection-creation-options-dropdown">
position="is-bottom-right"
id="create-actions-dropdown"
hoverable>
<button <button
class="button is-secondary" class="button is-secondary"
slot="trigger"> slot="trigger">
<div>{{ $i18n.getFrom('collections', 'new_item') }}</div> <div>{{ $i18n.getFrom('collections', 'new_item') }}</div>
<b-icon icon="menu-down"/>
</button> </button>
<b-dropdown-item> <b-dropdown-item>
<router-link <router-link
id="dropdown-button-create-collection" id="a-create-collection"
class="is-white"
tag="div" tag="div"
:to="{ path: $routerHelper.getNewCollectionPath() }"> :to="{ path: $routerHelper.getNewCollectionPath() }">
{{ $i18n.get('new_blank_collection') }} {{ $i18n.get('new_blank_collection') }}
<br>
<small class="is-small">{{ $i18n.get('info_choose_your_metadata') }}</small>
</router-link> </router-link>
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item <b-dropdown-item
:key="field_mapper.slug" :key="field_mapper.slug"
v-for="field_mapper in field_mappers"> v-for="field_mapper in field_mappers">
<router-link <router-link
:id="'dropdown-button-create-collection-' + field_mapper.slug" :id="'a-create-collection-' + field_mapper.slug"
class="is-white"
tag="div" tag="div"
:to="{ path: $routerHelper.getNewMappedCollectionPath(field_mapper.slug) }"> :to="{ path: $routerHelper.getNewMappedCollectionPath(field_mapper.slug) }">
{{ $i18n.get(field_mapper.name) }} {{ $i18n.get(field_mapper.name) }}
@ -38,14 +36,53 @@
</b-dropdown> </b-dropdown>
</div> </div>
</div> </div>
<div class="above-subheader"> <div class="above-subheader">
<div class="tabs">
<ul>
<li
@click="onChangeTab('')"
:class="{ 'is-active': status == undefined || status == ''}"><a>{{ $i18n.get('label_all_items') }}</a></li>
<li
@click="onChangeTab('draft')"
:class="{ 'is-active': status == 'draft'}"><a>{{ $i18n.get('label_draft_items') }}</a></li>
<li
@click="onChangeTab('trash')"
:class="{ 'is-active': status == 'trash'}"><a>{{ $i18n.get('label_trash_items') }}</a></li>
</ul>
</div>
<div> <div>
<collections-list <collections-list
:is-loading="isLoading" :is-loading="isLoading"
:total-collections="totalCollections" :total-collections="totalCollections"
:page="page" :page="page"
:collections-per-page="collectionsPerPage" :collections-per-page="collectionsPerPage"
:collections="collections"/> :collections="collections"/>
<!-- Empty state image -->
<div v-if="totalCollections <= 0 && !isLoading">
<section class="section">
<div class="content has-text-grey has-text-centered">
<p>
<b-icon
icon="inbox"
size="is-large"/>
</p>
<p v-if="status == undefined || status == ''">{{ $i18n.get('info_no_collection_created') }}</p>
<p v-if="status == 'draft'">{{ $i18n.get('info_no_collection_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_collection_trash') }}</p>
<router-link
v-if="status == undefined || status == ''"
id="button-create-collection"
tag="button"
class="button is-primary"
:to="{ path: $routerHelper.getNewCollectionPath() }">
{{ $i18n.getFrom('collections', 'new_item') }}
</router-link>
</div>
</section>
</div>
<!-- Footer --> <!-- Footer -->
<div <div
class="pagination-area" class="pagination-area"
@ -101,7 +138,8 @@ export default {
totalCollections: 0, totalCollections: 0,
page: 1, page: 1,
collectionsPerPage: 12, collectionsPerPage: 12,
isLoadingFieldMappers: true isLoadingFieldMappers: true,
status: ''
} }
}, },
components: { components: {
@ -120,6 +158,17 @@ export default {
...mapGetters('fields', [ ...mapGetters('fields', [
'getFieldMappers' 'getFieldMappers'
]), ]),
onChangeTab(status) {
this.status = status;
this.loadCollections();
},
checkIfUserCanEdit() {
for (let capability of tainacan_plugin.user_caps) {
if (capability == 'edit_tainacan-collections')
return true;
}
return false;
},
onChangeCollectionsPerPage(value) { onChangeCollectionsPerPage(value) {
let prevValue = this.collectionsPerPage; let prevValue = this.collectionsPerPage;
this.collectionsPerPage = value; this.collectionsPerPage = value;
@ -132,8 +181,7 @@ export default {
}, },
loadCollections() { loadCollections() {
this.isLoading = true; this.isLoading = true;
this.fetchCollections({ 'page': this.page, 'collectionsPerPage': this.collectionsPerPage, 'status': this.status })
this.fetchCollections({ 'page': this.page, 'collectionsPerPage': this.collectionsPerPage })
.then((res) => { .then((res) => {
this.isLoading = false; this.isLoading = false;
this.totalCollections = res.total; this.totalCollections = res.total;
@ -153,6 +201,7 @@ export default {
let collectionsList = this.getCollections(); let collectionsList = this.getCollections();
for (let collection of collectionsList) for (let collection of collectionsList)
collection['creation'] = this.$i18n.get('info_created_by') + collection['author_name'] + '<br>' + this.$i18n.get('info_date') + collection['creation_date']; collection['creation'] = this.$i18n.get('info_created_by') + collection['author_name'] + '<br>' + this.$i18n.get('info_date') + collection['creation_date'];
return collectionsList; return collectionsList;
}, },
field_mappers: { field_mappers: {
@ -194,6 +243,7 @@ export default {
height: $subheader-height; height: $subheader-height;
margin-left: -$page-side-padding; margin-left: -$page-side-padding;
margin-right: -$page-side-padding; margin-right: -$page-side-padding;
margin-top: -$page-top-padding;
padding-top: $page-small-top-padding; padding-top: $page-small-top-padding;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
@ -214,7 +264,12 @@ export default {
} }
} }
} }
.tabs {
padding-top: 20px;
margin-bottom: 20px;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
}
.above-subheader { .above-subheader {
margin-bottom: 0; margin-bottom: 0;
margin-top: 0; margin-top: 0;

View File

@ -145,6 +145,12 @@
}, },
mounted(){ mounted(){
this.loadEvents(); this.loadEvents();
if (!this.isRepositoryLevel) {
document.getElementById('collection-page-container').addEventListener('scroll', ($event) => {
this.$emit('onShrinkHeader', ($event.originalTarget.scrollTop > 53));
});
}
} }
} }
</script> </script>

View File

@ -1,9 +1,11 @@
<template> <template>
<div :class="{'primary-page': isRepositoryLevel, 'page-container': isRepositoryLevel, 'page-container-small' :!isRepositoryLevel }"> <div
:class="{'primary-page': isRepositoryLevel}">
<!-- SEARCH AND FILTERS --------------------- --> <!-- SEARCH AND FILTERS --------------------- -->
<button <button
id="filter-menu-compress-button" id="filter-menu-compress-button"
:style="{ top: isHeaderShrinked ? '125px' : '152px'}"
@click="isFiltersMenuCompressed = !isFiltersMenuCompressed"> @click="isFiltersMenuCompressed = !isFiltersMenuCompressed">
<b-icon :icon="isFiltersMenuCompressed ? 'menu-right' : 'menu-left'" /> <b-icon :icon="isFiltersMenuCompressed ? 'menu-right' : 'menu-left'" />
</button> </button>
@ -14,7 +16,7 @@
:is-full-page="false" :is-full-page="false"
:active.sync="isLoadingFilters"/> :active.sync="isLoadingFilters"/>
<b-field class="margin-1"> <b-field class="margin-1">
<div class="control is-small is-clearfix"> <div class="control is-small is-clearfix">
<input <input
class="input is-small" class="input is-small"
@ -85,6 +87,7 @@
</aside> </aside>
<div <div
id="items-list-area"
class="items-list-area" class="items-list-area"
:class="{ 'spaced-to-right': !isFiltersMenuCompressed }"> :class="{ 'spaced-to-right': !isFiltersMenuCompressed }">
<!-- SEARCH CONTROL ------------------------- --> <!-- SEARCH CONTROL ------------------------- -->
@ -140,10 +143,12 @@
icon="inbox" icon="inbox"
size="is-large"/> size="is-large"/>
</p> </p>
<p>{{ hasFiltered ? $i18n.get('info_no_item_found') : $i18n.get('info_no_item_created') <p v-if="status == undefined || status == ''">{{ hasFiltered ? $i18n.get('info_no_item_found') : $i18n.get('info_no_item_created') }}</p>
}}</p> <p v-if="status == 'draft'">{{ $i18n.get('info_no_item_draft') }}</p>
<p v-if="status == 'trash'">{{ $i18n.get('info_no_item_trash') }}</p>
<router-link <router-link
v-if="!hasFiltered" v-if="!hasFiltered && (status == undefined || status == '')"
id="button-create-item" id="button-create-item"
tag="button" tag="button"
class="button is-primary" class="button is-primary"
@ -179,9 +184,10 @@
isLoadingFields: false, isLoadingFields: false,
hasFiltered: false, hasFiltered: false,
isFiltersMenuCompressed: false, isFiltersMenuCompressed: false,
collapseAll: false, collapseAll: true,
isOnTheme: false, isOnTheme: false,
futureSearchQuery: '' futureSearchQuery: '',
isHeaderShrinked: false
} }
}, },
props: { props: {
@ -218,6 +224,103 @@
}, },
onChangeTab(status) { onChangeTab(status) {
this.$eventBusSearch.setStatus(status); this.$eventBusSearch.setStatus(status);
},
prepareFieldsAndFilters() {
this.isLoadingFilters = true;
this.fetchFilters({
collectionId: this.collectionId,
isRepositoryLevel: this.isRepositoryLevel,
isContextEdit: true,
includeDisabled: 'no',
})
.then(() => this.isLoadingFilters = false)
.catch(() => this.isLoadingFilters = false);
this.isLoadingFields = true;
this.tableFields = [];
this.fetchFields({
collectionId: this.collectionId,
isRepositoryLevel: this.isRepositoryLevel,
isContextEdit: false
})
.then(() => {
this.tableFields.push({
name: this.$i18n.get('label_thumbnail'),
field: 'row_thumbnail',
field_type: undefined,
slug: 'thumbnail',
id: undefined,
display: true
})
;
let fetchOnlyFieldIds = [];
for (let field of this.fields) {
if (field.display !== 'never') {
// Will be pushed on array
let display = true;
if (field.display === 'no') {
display = false;
}
this.tableFields.push(
{
name: field.name,
field: field.description,
slug: field.slug,
field_type: field.field_type,
field_type_object: field.field_type_object,
id: field.id,
display: display
}
);
fetchOnlyFieldIds.push(field.id);
}
}
this.tableFields.push({
name: this.$i18n.get('label_creation_date'),
field: 'row_creation',
field_type: undefined,
slug: 'creation_date',
id: 'creation_date',
display: true
});
this.tableFields.push({
name: this.$i18n.get('label_created_by'),
field: 'row_author',
field_type: undefined,
slug: 'author_name',
id: 'author_name',
display: true
});
// this.prefTableFields = this.tableFields;
// this.$userPrefs.get('table_columns_' + this.collectionId)
// .then((value) => {
// this.prefTableFields = value;
// })
// .catch((error) => {
// this.$userPrefs.set('table_columns_' + this.collectionId, this.prefTableFields, null);
// });
this.$eventBusSearch.addFetchOnly({
'0': 'thumbnail',
'meta': fetchOnlyFieldIds,
'1': 'creation_date',
'2': 'author_name'
});
this.isLoadingFields = false;
})
.catch(() => {
this.isLoadingFields = false;
});
} }
}, },
computed: { computed: {
@ -252,6 +355,8 @@
this.isOnTheme = (this.$route.name == null); this.isOnTheme = (this.$route.name == null);
this.isRepositoryLevel = (this.collectionId == undefined); this.isRepositoryLevel = (this.collectionId == undefined);
this.$eventBusSearch.setCollectionId(this.collectionId);
this.$eventBusSearch.$on('isLoadingItems', isLoadingItems => { this.$eventBusSearch.$on('isLoadingItems', isLoadingItems => {
this.isLoadingItems = isLoadingItems; this.isLoadingItems = isLoadingItems;
}); });
@ -260,90 +365,24 @@
this.hasFiltered = hasFiltered; this.hasFiltered = hasFiltered;
}); });
this.isLoadingFilters = true; this.$eventBusSearch.$on('hasToPrepareFieldsAndFilters', () => {
this.fetchFilters({ this.prepareFieldsAndFilters();
collectionId: this.collectionId, });
isRepositoryLevel: this.isRepositoryLevel,
isContextEdit: true,
includeDisabled: 'no',
})
.then(() => this.isLoadingFilters = false)
.catch(() => this.isLoadingFilters = false);
this.isLoadingFields = true;
this.fetchFields({
collectionId: this.collectionId,
isRepositoryLevel: this.isRepositoryLevel,
isContextEdit: false
})
.then(() => {
this.tableFields.push({
name: this.$i18n.get('label_thumbnail'),
field: 'row_thumbnail',
field_type: undefined,
slug: 'thumbnail',
id: undefined,
display: true
});
for (let field of this.fields) {
if (field.display !== 'never') {
// Will be pushed on array
let display = true;
if (field.display === 'no') {
display = false;
}
this.tableFields.push(
{
name: field.name,
field: field.description,
slug: field.slug,
field_type: field.field_type,
field_type_object: field.field_type_object,
id: field.id,
display: display
}
);
//this.$eventBusSearch.addFetchOnlyMeta(field.id);
}
}
this.$eventBusSearch.loadItems();
this.tableFields.push({
name: this.$i18n.get('label_creation'),
field: 'row_creation',
field_type: undefined,
slug: 'creation',
id: 'date',
display: true
});
// this.prefTableFields = this.tableFields;
// this.$userPrefs.get('table_columns_' + this.collectionId)
// .then((value) => {
// this.prefTableFields = value;
// })
// .catch((error) => {
// this.$userPrefs.set('table_columns_' + this.collectionId, this.prefTableFields, null);
// });
this.isLoadingFields = false;
})
.catch(() => {
this.isLoadingFields = false;
});
}, },
mounted() { mounted() {
this.$eventBusSearch.setCollectionId(this.collectionId); //this.$eventBusSearch.updateStoreFromURL();
this.$eventBusSearch.updateStoreFromURL(); //this.$eventBusSearch.loadItems();
this.$eventBusSearch.loadItems();
} this.prepareFieldsAndFilters();
if (!this.isRepositoryLevel && !this.isOnTheme) {
document.getElementById('items-list-area').addEventListener('scroll', ($event) => {
this.isHeaderShrinked = ($event.originalTarget.scrollTop > 53);
this.$emit('onShrinkHeader', this.isHeaderShrinked);
});
}
}
} }
</script> </script>
@ -355,7 +394,7 @@
margin-bottom: 0.1rem; margin-bottom: 0.1rem;
} }
.page-container, .page-container-small { .page-container {
padding: 0px; padding: 0px;
} }
@ -380,7 +419,8 @@
} }
.tabs { .tabs {
padding-top: $page-small-top-padding; padding-top: 20px;
margin-bottom: 20px;
padding-left: $page-side-padding; padding-left: $page-side-padding;
padding-right: $page-side-padding; padding-right: $page-side-padding;
} }
@ -397,23 +437,24 @@
.table-container { .table-container {
padding-left: 8.333333%; padding-left: 8.333333%;
padding-right: 8.333333%; padding-right: 8.333333%;
height: calc(100% - 82px); //height: calc(100% - 82px);
} }
#collection-search-button { #collection-search-button {
border-radius: 0px !important; border-radius: 0px !important;
padding: 0px 8px !important; padding: 0px 8px !important;
border-color: $tainacan-input-background;
&:focus, &:active { &:focus, &:active {
border-color: none !important; border-color: none !important;
} }
} }
.filters-menu { .filters-menu {
position: absolute; position: relative;
width: $filter-menu-width; width: $filter-menu-width;
max-width: $filter-menu-width; max-width: $filter-menu-width;
min-height: calc(100% - 82px); min-height: 100%;
height: calc(100% - 82px); height: 100%;
background-color: $tainacan-input-background; background-color: $tainacan-input-background;
padding: $page-small-side-padding; padding: $page-small-side-padding;
float: left; float: left;
@ -437,6 +478,7 @@
margin-left: 0; margin-left: 0;
transition: margin-left ease 0.5s; transition: margin-left ease 0.5s;
height: 100%; height: 100%;
overflow: auto;
} }
.spaced-to-right { .spaced-to-right {
margin-left: $filter-menu-width; margin-left: $filter-menu-width;
@ -457,6 +499,7 @@
border-top-right-radius: 2px; border-top-right-radius: 2px;
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
cursor: pointer; cursor: pointer;
transition: top 0.3s;
.icon { .icon {
margin-top: -1px; margin-top: -1px;

View File

@ -14,7 +14,7 @@
<router-link <router-link
class="card-footer-item" class="card-footer-item"
:to="{ path: $routerHelper.getCategoryEditPath(categoryId)}"> :to="{ path: $routerHelper.getCategoryEditPath(categoryId)}">
{{ $i18n.getFrom('taxonomies','edit') }} {{ $i18n.getFrom('taxonomies','edit_item') }}
</router-link> </router-link>
<a class="card-footer-item"> <a class="card-footer-item">
Edit terms Edit terms

View File

@ -1,10 +1,15 @@
<template> <template>
<div class="columns is-fullheight"> <div class="columns is-fullheight">
<section class="column is-secondary-content"> <section class="column is-secondary-content">
<tainacan-subheader :id="collectionId"/> <tainacan-subheader
<router-view :class="{ 'is-shrink': shouldShrinkHeader }"
:id="collectionId"/>
<router-view
@onShrinkHeader="shouldShrinkHeader = $event"
id="collection-page-container"
:collection-id="collectionId" :collection-id="collectionId"
class="page-container page-container-small"/> class="page-container page-container-small"
:class="{'page-container-shrinked': shouldShrinkHeader }"/>
</section> </section>
</div> </div>
</template> </template>
@ -16,7 +21,8 @@ export default {
name: 'CollectionPage', name: 'CollectionPage',
data(){ data(){
return { return {
collectionId: Number collectionId: Number,
shouldShrinkHeader: false
} }
}, },
components: { components: {
@ -25,6 +31,8 @@ export default {
created(){ created(){
this.collectionId = parseInt(this.$route.params.collectionId); this.collectionId = parseInt(this.$route.params.collectionId);
this.$eventBusSearch.setCollectionId(this.collectionId); this.$eventBusSearch.setCollectionId(this.collectionId);
},
mounted() {
} }
} }

View File

@ -2,21 +2,38 @@
<div> <div>
<div class="is-fullheight"> <div class="is-fullheight">
<div class="page-container primary-page"> <div class="page-container primary-page">
<tainacan-title /> <tainacan-title/>
<div class="title">{{ event.description }}</div> <h1 class="event-titles">{{ event.description }}</h1>
<div <div
class="level" class="level"
v-if="event.title !== undefined && event.title.includes('updated')"> v-if="event.title !== undefined && event.title.includes('updated')">
<div class="level-left"/> <div class="level-left"/>
<div class="level-right"> <div class="level-right">
<div class="level-item"> <div class="level-item">
<b-switch <div class="field has-addons is-pulled-right">
v-model="comp" <p class="control">
true-value="Unified" <a
false-value="Split" @click="comp = 'Split'"
class="is-pulled-right"> :class="{'is-selected': comp === 'Split', 'is-focused': comp === 'Split'}"
{{ comp }} class="button">
</b-switch> <b-icon
icon="pause"
size="is-small"/>
<span>{{ $i18n.get('split') }}</span>
</a>
</p>
<p class="control">
<a
@click="comp = 'Unified'"
:class="{'is-selected': comp === 'Unified', 'is-focused': comp === 'Unified'}"
class="button">
<b-icon
icon="minus"
size="is-small"/>
<span>{{ $i18n.get('unified') }}</span>
</a>
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -30,7 +47,7 @@
</div> </div>
<div v-else-if="event.title !== undefined"> <div v-else-if="event.title !== undefined">
<no-diff :event="event" /> <no-diff :event="event"/>
</div> </div>
</div> </div>
@ -91,4 +108,21 @@
.bottom-space-tainacan { .bottom-space-tainacan {
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
} }
.event-titles {
font-size: 20px;
font-weight: 500;
color: #01295c;
display: inline-block;
}
.field.has-addons .control:first-child .button {
border-bottom-right-radius: 0 !important;
border-top-right-radius: 0 !important;
}
.field.has-addons .control:last-child .button {
border-bottom-left-radius: 0 !important;
border-top-left-radius: 0 !important;
}
</style> </style>

View File

@ -3,11 +3,14 @@
<b-loading <b-loading
:active.sync="isLoading" :active.sync="isLoading"
:can-cancel="false"/> :can-cancel="false"/>
<button
id="metadata-column-compress-button"
@click="isMetadataColumnCompressed = !isMetadataColumnCompressed">
<b-icon :icon="isMetadataColumnCompressed ? 'menu-left' : 'menu-right'" />
</button>
<tainacan-title/> <tainacan-title/>
<div class="columns"> <div class="columns">
<div class="column is-4"> <div class="column is-5-5">
<div class="column is-12"> <div class="column is-12">
<router-link <router-link
class="button is-secondary" class="button is-secondary"
@ -30,6 +33,7 @@
<div> <div>
<p>{{ item.status }}</p> <p>{{ item.status }}</p>
</div> </div>
<br>
</div> </div>
<div class="column is-12"> <div class="column is-12">
@ -62,26 +66,29 @@
<div class="column is-12"> <div class="column is-12">
<!-- Attachments ----------------------------- --> <!-- Attachments ------------------------------------------ -->
<div class="section-label"> <div class="section-label">
<label>{{ $i18n.get('label_attachments') }}</label> <label>{{ $i18n.get('label_attachments') }}</label>
</div> </div>
<div class="section-box"> <div class="section-box section-attachments">
<div class="uploaded-files"> <div class="uploaded-files">
<div <file-item
:style="{ margin: 15 + 'px'}"
v-if="attachmentsList.length > 0"
v-for="(attachment, index) in attachmentsList" v-for="(attachment, index) in attachmentsList"
:key="index"> :key="index"
<span class="tag is-primary"> :show-name="true"
{{ attachment.title.rendered }} :file="attachment"/>
</span> <p v-if="attachmentsList.length <= 0"><br>{{ $i18n.get('info_no_attachments_on_item_yet') }}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-1" /> <div
<div class="column is-7"> v-show="!isMetadataColumnCompressed"
class="column is-4-5">
<label class="section-label">{{ $i18n.get('fields') }}</label> <label class="section-label">{{ $i18n.get('fields') }}</label>
<br> <br>
<a <a
@ -112,13 +119,13 @@
</label> </label>
<div <div
v-if="field.date_i18n" v-if="field.date_i18n"
class="notification"> class="content">
<div v-html="field.date_i18n"/> <p v-html="field.date_i18n"/>
</div> </div>
<div <div
v-else v-else
class="notification"> class="content">
<div v-html="field.value_as_html"/> <p v-html="field.value_as_html"/>
</div> </div>
</b-collapse> </b-collapse>
</div> </div>
@ -130,6 +137,7 @@
<script> <script>
import {mapActions, mapGetters} from 'vuex' import {mapActions, mapGetters} from 'vuex'
import FileItem from '../../components/other/file-item.vue';
export default { export default {
name: 'ItemPage', name: 'ItemPage',
@ -138,9 +146,13 @@
collectionId: Number, collectionId: Number,
itemId: Number, itemId: Number,
isLoading: false, isLoading: false,
isMetadataColumnCompressed: false,
open: false, open: false,
} }
}, },
components: {
FileItem
},
methods: { methods: {
...mapActions('item', [ ...mapActions('item', [
'fetchItem', 'fetchItem',
@ -194,12 +206,53 @@
@import '../../scss/_variables.scss'; @import '../../scss/_variables.scss';
.page-container { #metadata-column-compress-button {
height: calc(100% - 82px); position: relative;
z-index: 99;
float: right;
top: 70px;
max-width: 36px;
height: 36px;
width: 36px;
border: none;
background-color: $tainacan-input-background;
color: $secondary;
padding: 0px;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
cursor: pointer;
.icon {
margin-top: 2px;
margin-right: 8px;
}
} }
.columns > .column { .page-container {
padding: 0; padding: 25px 0px;
.tainacan-page-title {
padding-left: $page-side-padding;
padding-right: $page-side-padding;
}
.column {
padding-top: 0px;
padding-bottom: 0px;
}
.column.is-5-5 {
width: 45.833333333%;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
transition: width 0.6s;
}
.column.is-4-5 {
width: 37.5%;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
transition: all 0.6s;
}
} }
.field { .field {
@ -264,5 +317,29 @@
} }
} }
} }
.section-status{
width: 174px;
}
.section-thumbnail {
width: 174px;
padding-top: 0;
padding-bottom: 0;
}
.section-attachments {
height: 250px;
max-width: 100%;
resize: vertical;
overflow: auto;
padding: 15px;
p { margin: 4px 15px }
}
.uploaded-files {
display: flex;
flex-flow: wrap;
margin-left: -15px;
margin-right: -15px;
}
</style> </style>

View File

@ -0,0 +1,44 @@
.button {
border-radius: 6px !important;
font-weight: normal;
padding: 2px 15px !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
height: inherit !important;
box-shadow: none !important;
display: inline-flex !important;
&.is-secondary:hover, &.is-secondary:focus {
background: $secondary !important;
}
&.is-primary:hover, &.is-primary:focus {
background: $primary !important;
}
&.is-success:hover, &.is-success:focus {
background: $success !important;
}
&.is-white:hover, &.is-white:focus, &.is-outlined:hover, &.is-outlined:focus {
background: $white !important;
}
&:active {
-webkit-transform: none !important;
transform: none !important;
}
&.is-outlined {
color: #150e38 !important;
background-color: white;
border-color: $gray-light !important;
}
&:focus {
outline: 0px;
}
}
.button.is-small {
height: 26px !important;
line-height: 12px;
}
.button:not(.is-small):not(.is-medium):not(.is-large) {
height: 30px !important;
line-height: 20px !important;
font-size: 14px !important;
}

View File

@ -0,0 +1,28 @@
.b-checkbox.checkbox {
input[type="checkbox"] {
box-shadow: none !important;
}
input[type="checkbox"] + .check {
width: 12px;
height: 12px;
flex-shrink: 0;
border-radius: 0;
display: inline-block;
border: 1px solid $gray-light;
transition: background 150ms ease-out;
box-shadow: none !important;
}
&:focus input[type="checkbox"] + .check,
&:active input[type="checkbox"] + .check,
&:hover input[type="checkbox"] + .check {
box-shadow: none !important;
border-color: $gray-light !important;
}
input[type="checkbox"]:checked + .check {
background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3Cpath style='fill:%23000' d='M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z'%3E%3C/path%3E%3C/svg%3E") no-repeat center center !important;
border-color: $gray-light !important;
}
}

View File

@ -0,0 +1,96 @@
.dropdown, .autocomplete {
.dropdown-trigger{
.button {
border: none;
.icon {
color: $secondary;
align-items: start;
}
}
.button.is-primary, .button.is-secondary, .button.is-success {
.icon {
color: $white;
}
}
}
.dropdown-menu {
.dropdown-content {
border-radius: 0px !important;
.dropdown-item {
.b-checkbox { width: 100% };
&:hover {
background-color: $primary-lighter;
}
.is-small {
color: gray;
}
}
}
}
}
.taginput-container {
padding: 0 !important;
background-color: white !important;
&:focus, &:active {
border: none !important;
}
.input { margin-bottom: 0px !important; }
.input.has-selected, .input:focus, .input:active {
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
.tag {
background: white;
padding-right: 0;
padding-left: 0.5em;
&.is-delete {
color: $gray-light;
&::after {
height: 30% !important;
width: 1px !important;
}
&::before {
width: 30% !important;
height: 1px !important;
}
&:hover, &:focus {
background-color: white;
color: black;
}
}
}
}
.selected-list-box {
padding: 4px 0px;
border: 1px solid $tainacan-input-background;
background-color: white;
display: flex;
font-size: 12px;
.tags {
margin-right: 8px;
}
.tag {
background: white;
padding-right: 0;
padding-left: 0.5em;
&.is-delete {
color: $gray-light;
&::after {
height: 30% !important;
width: 1px !important;
}
&::before {
width: 30% !important;
height: 1px !important;
}
&:hover, &:focus {
background-color: white;
color: black;
}
}
}
}

View File

@ -0,0 +1,12 @@
.input, .textarea {
font-size: 14px;
border: none;
border-radius: 1px !important;
box-shadow: none !important;
&:focus, &:active {
box-shadow: none !important;
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
}

180
src/admin/scss/_modals.scss Normal file
View File

@ -0,0 +1,180 @@
// Tainacan modals
.tainacan-modal-title {
h1, h2 {
font-size: 20px;
font-weight: 500;
color: $tertiary;
display: inline-block;
}
a.back-link{
font-weight: 500;
float: right;
margin-top: 5px;
}
hr{
margin: 3px 0px 4px 0px;
height: 1px;
background-color: $secondary;
}
margin-bottom: 40px;
}
.tainacan-modal-content {
background-color: white;
padding: 52px 80px;
figure {
margin: 0;
text-align: center;
}
.attachment {
width: 100%;
}
.form-submit {
padding: 80px 0em 0.4em 0em !important;
}
}
.modal-background {
background-color: rgba(0, 0, 0, 0.70);
}
// WordPress Media Modal customization
.wp-core-ui {
a:focus{ box-shadow: none; }
}
.media-modal-backdrop {
z-index: 9999999 !important;
}
.media-modal {
left: 100px;
top: 100px;
bottom: 100px;
right: 100px;
background-color: white;
z-index: 99999999999 !important;
}
// .media-modal {
// left: 100px;
// top: 100px;
// bottom: 100px;
// right: 100px;
// background-color: white;
// z-index: 99999999999 !important;
// .media-modal-content {
// background-color: white;
// margin: 42px 60px;
// box-shadow: none;
// }
// .media-frame-title {
// border-bottom: 1px solid #298596 !important;
// margin-bottom: 60px !important;
// box-shadow: none !important;
// h1, h2 {
// font-size: 20px;
// font-weight: 500;
// color: $tertiary;
// display: inline-block;
// margin-bottom: 3px;
// }
// }
// .media-frame-router {
// margin-top: 28px;
// a.media-menu-item.active {
// border-top: none;
// border-left: none;
// border-right: none;
// border-bottom: 3px solid $primary;
// }
// }
// .media-frame-content {
// margin-top: 30px;
// .attachments-browser .attachments, .media-toolbar {
// padding: 12px;
// right: 270px;
// .media-toolbar-primary {
// max-width: 30%;
// }
// .media-toolbar-secondary {
// max-width: 70%;
// }
// .attachment {
// padding: 12px;
// }
// .attachment.details {
// box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 14px $primary-light;
// }
// .attachment.details .check, .wp-core-ui .attachment.selected .check:focus, .wp-core-ui .media-frame.mode-grid .attachment.selected .check {
// background-color: $primary-light;
// box-shadow: 0 0 0 1px #fff,0 0 0 2px $primary-light;
// }
// }
// .media-sidebar {
// background-color: white;
// width: 238px;
// }
// .crop-content{
// .imgareaselect-outer {
// background-color: white;
// opacity: 0.6;
// }
// }
// }
// .media-frame-toolbar .media-toolbar {
// bottom: initial;
// margin-top: -1px;
// padding: 28px 0px;
// }
// .media-button.button-primary {
// background-color: $success;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// }
// .media-button.button-primary[disabled] {
// color: #66c6e4 !important;
// background: $success !important;
// border-color: none!important;
// box-shadow: none !important;
// text-shadow: none !important;
// cursor: default;
// }
// .media-button.button-secondary {
// color: $tertiary;
// border-color: #999;
// background: white;
// box-shadow: none;
// vertical-align: middle;
// }
// .button-hero {
// background-color: $secondary;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// font-size: 14px;
// height: 46px;
// line-height: 20px !important;
// padding: 0 36px;
// &:hover{
// background-color: #339daf;
// color: white;
// }
// }
// }

View File

@ -0,0 +1,63 @@
.pagination-area {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.85em !important;
font-weight: normal !important;
border-top: 1px solid $gray;
padding-top: 0;
padding-bottom: 0;
padding-left: $page-side-padding;
padding-right: $page-side-padding;
color: $gray-light;
.shown-items {
flex-grow: 1;
}
.items-per-page {
flex-grow: 5;
margin-top: 0.35em;
.field-label {
flex-grow: 5;
margin-right: 0.5em;
.label {
font-size: 1em !important;
font-weight: normal !important;
color: $gray-light;
}
}
select {
font-size: 0.85em;
}
}
.pagination {
flex-grow: 1;
a[disabled="disabled"] {
color: $gray-light;
}
.pagination-link, .pagination-previous, .pagination-next {
background-color: transparent;
color: $secondary;
border: none;
}
.pagination-link.is-current {
color: $gray-light;
}
.pagination-link::after:not(:last-child) {
content: ',';
color: $gray-light;
}
.mdi-chevron-left::before {
content: "\F40A";
font-size: 17px;
transform: rotate(180deg);
}
.mdi-chevron-right::before {
content: "\F40A";
font-size: 17px;
}
}
}

View File

@ -0,0 +1,25 @@
.b-radio.radio {
input[type="radio"] + .check {
width: 13px !important;
height: 13px !important;
border: 1px solid $gray-light !important;
}
input[type="radio"] + .check::before {
background: black !important;
width: 7px !important;
height: 7px !important;
}
&:focus input[type="radio"] + .check,
&:active input[type="radio"] + .check,
&:hover input[type="radio"] + .check {
box-shadow: none !important;
}
input[type="radio"]:checked + .check {
border-color: $gray-light !important;
}
&:focus input[type="radio"]:checked + .check {
box-shadow: none !important;
}
}

View File

@ -0,0 +1,32 @@
.select {
padding-top: 0px !important;
select {
border: none;
border-radius: 1px !important;
font-weight: normal;
font-size: 14px !important;
height: 30px !important;
padding: 2px 25px 2px 15px!important;
margin-top: 0px !important;
margin-bottom: 0px !important;
color: $tainacan-input-color;
option:checked, option:hover {
background-color: $primary-lighter !important;
}
&:focus, &:active {
box-shadow: none !important;
text-decoration: none !important;
}
}
&:not(.is-multiple)::after {
content: "\F35D" !important;
font: normal normal normal 24px/1 "Material Design Icons" !important;
border: none !important;
transform: none !important;
margin-top: -15px !important;
right: 10px !important;
color: $primary;
display: flex !important;
align-items: initial;
}
}

View File

@ -0,0 +1,57 @@
.switch {
input[type="checkbox"] + .check {
background-color: $gray-light;
border: 2px solid $gray-light;
width: 2.7em;
height: 1.7em;
&::before {
background-color: white;
box-shadow: none;
}
}
&:hover input[type="checkbox"]:checked + .check {
background-color: $primary-light;
}
input[type="checkbox"]:checked + .check {
border: 2px solid $secondary;
background-color: transparent;
&::before {
background-color: $secondary;
transform: translate3d(78%, 0, 0);
}
}
&:hover input[type="checkbox"] + .check {
background-color: $gray-light;
}
&:focus input[type="checkbox"] + .check,
&:focus input[type="checkbox"]:checked + .check {
box-shadow: none;
}
&.is-small {
font-size: 9px;
input[type="checkbox"] + .check {
border: 1.5px solid $gray-light;
width: 2.55em;
height: 1.7em;
&::before {
width: 1.0em;
height: 1.0em;
}
}
input[type="checkbox"]:checked + .check {
border: 1.5px solid $secondary;
&::before {
transform: translate3d(84%, 0, 0);
}
}
}
}

228
src/admin/scss/_tables.scss Normal file
View File

@ -0,0 +1,228 @@
// Tables
.table-container {
padding: 0 $table-side-padding;
position: relative;
margin-bottom: 40px;
.table-wrapper {
width: 100%;
height: calc(100% - 40px);
border-collapse: separate;
overflow: auto;
margin-bottom: 0px !important;
table.table {
width: 100%;
.checkbox-cell {
min-width: 38px;
width: 38px;
padding: 0;
left: 0;
top: auto;
display: table-cell;
&::before {
box-shadow: inset 50px 0 10px -12px #222;
content: " ";
width: 50px;
height: 100%;
position: absolute;
left: 0;
top: 0;
visibility: hidden;
}
label.checkbox {
border-radius: 0px;
background-color: white;
padding: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.b-checkbox.checkbox .control-label {
display: none;
}
&.is-selecting {
position: sticky !important;
position: -webkit-sticky !important;
&::before { visibility: visible !important; }
}
}
// Only to be used in case we can implement Column resizing
// th:not(:last-child) {
// border-right: 1px solid $tainacan-input-background !important;
// }
.thumbnail-cell {
width: 60px;
text-align: center;
}
.column-small-width {
min-width: 80px;
max-width: 80px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-default-width {
min-width: 80px;
max-width: 160px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-medium-width {
min-width: 120px;
max-width: 200px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-large-width {
min-width: 120px;
max-width: 240px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-main-content {
min-width: 120px !important;
max-width: 240px !important;
p {
font-size: 14px !important;
color: $tainacan-input-color !important;
margin: 0px !important;
}
}
.column-needed-width {
max-width: unset !important;
}
.column-align-right {
text-align: right !important;
}
th {
position: sticky;
position: -webkit-sticky;
background-color: white;
border-bottom: 1px solid $tainacan-input-background;
top: 0px;
z-index: 9;
padding: 10px;
vertical-align: bottom;
.th-wrap {
font-size: 12px !important;
font-weight: normal !important;
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
tbody {
tr {
cursor: pointer;
background-color: transparent;
&.selected-row {
background-color: $primary-lighter;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $primary-lighter;
}
}
td {
height: 60px;
max-height: 60px;
padding: 10px;
vertical-align: middle;
line-height: 12px;
border: none !important;
p {
font-size: 14px;
margin: 0px;
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
img.table-thumb {
max-height: 38px !important;
border-radius: 3px;
}
td.actions-cell {
padding: 0px;
position: sticky !important;
position: -webkit-sticky !important;
right: 0px;
top: auto;
width: 80px;
.actions-container {
visibility: hidden;
display: flex;
position: relative;
padding: 0;
height: 100%;
width: 80px;
z-index: 9;
background-color: transparent;
float: right;
}
a {
margin: auto;
font-size: 18px !important;
}
}
&:hover {
background-color: $tainacan-input-background !important;
cursor: pointer;
.checkbox-cell {
position: sticky !important;
position: -webkit-sticky !important;
&::before { visibility: visible; }
.checkbox {
background-color: $tainacan-input-background !important;
}
}
.actions-cell {
.actions-container {
visibility: visible;
background: $tainacan-input-background !important;
}
&::after {
box-shadow: inset -97px 0 17px -21px #222;
content: " ";
width: 100px;
height: 100%;
position: absolute;
right: 0px;
top: 0;
}
}
}
}
}
}
}
}

14
src/admin/scss/_tabs.scss Normal file
View File

@ -0,0 +1,14 @@
// Tabs
.tabs {
a {
font-size: 13px;
margin-bottom: -3px;
&:hover{
border-bottom-color: transparent;
}
}
li.is-active a {
border-bottom: 5px solid $primary;
color: $primary;
}
}

View File

@ -0,0 +1,87 @@
// Input components used in forms are gray in Tainacan
.tainacan-form {
color: $tainacan-input-color;
.form-submit {
justify-content: space-between !important;
padding: 1em 1.2em 0.4em 1.2em;
margin-bottom: 0px;
.button {
border-width: 1px;
padding: 2px 30px !important;
}
&.has-only-save {
justify-content: end !important;
}
}
.label {
font-weight: bold;
font-size: 14px;
display: inline-block;
}
.required-field-asterisk {
color: $gray;
&.is-danger {
color: $danger;
}
}
.input, .textarea {
background-color: $tainacan-input-background;
color: $tainacan-input-color;
transition: background-color 0.1s;
&.is-danger {
background-color: #e7dede;
}
}
.control{
&.has-content {
.input, .textarea {
background-color: white;
border: 1px solid $tainacan-input-background;
}
}
&.has-icons-right {
.icon {
height: 2.0em;
.mdi-alert-circle::before {
content: "\F156" !important;
font-size: 16px !important;
}
}
}
}
.radio, .checkbox {
margin-bottom: 0.2em;
&.is-danger {
border-color: $danger;
}
}
.control-label { // The value part in checkbox, radio and switches
color: $tainacan-input-color;
padding-left: 0.8em;
font-size: 12px;
}
.select {
select {
font-size: 14px;
color: $tainacan-input-color;
background-color: white !important;
border: 1px solid $tainacan-input-background;
&:focus>option:checked, &:focus>option:hover {
background-color: $primary-lighter !important;
}
}
&.is-empty select{
background-color: $tainacan-input-background !important;
}
&:not(.is-multiple)::after {
margin-top: -0.6em;
right: 0.95em;
color: $primary;
}
}
}

View File

@ -0,0 +1,92 @@
// These tooltips are customized versions of V-Tooltip
// Tooltips:
.tooltip {
z-index: 999999999;
display: block !important;
&::after {
box-shadow: none;
}
.tooltip-inner {
background: $primary-lighter;
color: $gray-light;
font-size: 11px;
border-radius: 5px;
padding: 20px;
max-width: 280px;
max-height: 200px;
overflow: auto;
}
.tooltip-arrow {
width: 0;
height: 0;
border-style: solid;
position: absolute;
margin: 5px;
border-color: $primary-lighter;
z-index: 1;
}
&[x-placement^="top"] {
margin-bottom: 5px;
.tooltip-arrow {
border-width: 5px 8px 0 8px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
bottom: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="bottom"] {
margin-top: 5px;
.tooltip-arrow {
border-width: 0 8px 5px 8px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-top-color: transparent !important;
top: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="right"] {
margin-left: 5px;
.tooltip-arrow {
border-width: 8px 5px 8px 0;
border-left-color: transparent !important;
border-top-color: transparent !important;
border-bottom-color: transparent !important;
left: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
&[x-placement^="left"] {
margin-right: 5px;
.tooltip-arrow {
border-width: 8px 0 8px 5px;
border-top-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
right: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
&[aria-hidden='true'] {
visibility: hidden;
opacity: 0;
transition: opacity .15s, visibility .15s;
}
&[aria-hidden='false'] {
visibility: visible;
opacity: 1;
transition: opacity .15s;
}
}

View File

@ -90,6 +90,8 @@ $table-foot-cell-color: $gray-light;
$table-foot-cell-border-width: 1px 0 0 !important; $table-foot-cell-border-width: 1px 0 0 !important;
$table-cell-padding: 1.0em 0.75em; $table-cell-padding: 1.0em 0.75em;
// Roboto font
$family-sans-serif: 'Roboto', sans-serif;
// Bulma's modal (needs to be greather than taincan-admin-app) // Bulma's modal (needs to be greather than taincan-admin-app)
$modal-z: 9999999; $modal-z: 9999999;

View File

@ -6,8 +6,20 @@
@import "../../../node_modules/bulma/bulma.sass"; @import "../../../node_modules/bulma/bulma.sass";
@import "../../../node_modules/buefy/src/scss/buefy.scss"; @import "../../../node_modules/buefy/src/scss/buefy.scss";
// Roboto font // Import Tainacan custom styles
$family-sans-serif: 'Roboto', sans-serif; @import "../scss/_tainacan-form.scss";
@import "../scss/_buttons.scss";
@import "../scss/_selects.scss";
@import "../scss/_inputs.scss";
@import "../scss/_checkboxes.scss";
@import "../scss/_radios.scss";
@import "../scss/_switches.scss";
@import "../scss/_dropdown-and-autocomplete.scss";
@import "../scss/_tabs.scss";
@import "../scss/_tables.scss";
@import "../scss/_tooltips.scss";
@import "../scss/_pagination.scss";
@import "../scss/_modals.scss";
// Clears wordpress content // Clears wordpress content
body.tainacan-admin-page #adminmenumain, body.tainacan-admin-page #wpfooter, body.tainacan-admin-page #wp-auth-check-wrap { body.tainacan-admin-page #adminmenumain, body.tainacan-admin-page #wpfooter, body.tainacan-admin-page #wp-auth-check-wrap {
@ -36,20 +48,7 @@ a:hover {
color: $secondary; color: $secondary;
} }
/* Rules for sizing the icon. */ // Page settings
.material-icons.md-18 { font-size: 18px; }
.material-icons.md-24 { font-size: 24px; }
.material-icons.md-36 { font-size: 36px; }
.material-icons.md-48 { font-size: 48px; }
/* Rules for using icons as black on a light background. */
.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); }
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
/* Rules for using icons as white on a dark background. */
.material-icons.md-light { color: rgba(255, 255, 255, 1); }
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
.primary-page { .primary-page {
margin-top: $header-height; margin-top: $header-height;
height: $page-height !important; height: $page-height !important;
@ -58,6 +57,7 @@ a:hover {
margin-top: 0; margin-top: 0;
} }
} }
// Generic page container
.page-container { .page-container {
padding: $page-top-padding $page-side-padding; padding: $page-top-padding $page-side-padding;
height: 100%; height: 100%;
@ -68,10 +68,17 @@ a:hover {
padding: $page-mobile-top-padding $page-mobile-side-padding; padding: $page-mobile-top-padding $page-mobile-side-padding;
} }
} }
.page-container-small{ // Used for pages with collection subheader
.page-container-small {
height: calc(100% - 82px); height: calc(100% - 82px);
overflow-y: auto; overflow-y: auto;
transition: height 0.6s;
} }
// Used for pages with shrinked collection subheader
.page-container-shrinked {
height: calc(100% - 53px) !important;
}
// Used for pages with subheader in mobile
.page-container-narrow{ .page-container-narrow{
padding: $page-small-top-padding $page-small-side-padding; padding: $page-small-top-padding $page-small-side-padding;
@ -80,682 +87,7 @@ a:hover {
} }
} }
// Modal
.tainacan-page-title, .tainacan-modal-title {
h1, h2 {
font-size: 20px;
font-weight: 500;
color: $tertiary;
display: inline-block;
}
a.back-link{
font-weight: 500;
float: right;
margin-top: 5px;
}
hr{
margin: 3px 0px 4px 0px;
height: 1px;
background-color: $secondary;
}
margin-bottom: 60px;
}
.tainacan-modal-content {
background-color: white;
padding: 52px 80px;
.form-submit {
padding: 80px 0em 0.4em 0em !important;
}
}
.modal-background {
background-color: rgba(0, 0, 0, 0.70);
}
// Custom ScrollBar (will work only in Chrome, Opera, Safari, webkit browsers)
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
opacity: 0.5;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
opacity: 0.5;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
// Buefy notices (toast, snackbar...) // Buefy notices (toast, snackbar...)
.notices { .notices {
z-index: 99999999999999 !important; z-index: 99999999999999 !important;
} }
// Input components used in forms are gray in Tainacan
.tainacan-form {
color: $tainacan-input-color;
.form-submit {
justify-content: space-between !important;
padding: 1em 1.2em 0.4em 1.2em;
margin-bottom: 0px;
.button {
border-width: 1px;
padding: 2px 30px !important;
}
&.has-only-save {
justify-content: end !important;
}
}
.label {
font-weight: bold;
font-size: 14px;
display: inline-block;
}
.required-field-asterisk {
color: $gray;
&.is-danger {
color: $danger;
}
}
.input, .textarea {
background-color: $tainacan-input-background;
color: $tainacan-input-color;
transition: background-color 0.1s;
&.is-danger {
background-color: #e7dede;
}
}
.control{
&.has-content {
.input, .textarea {
background-color: white;
border: 1px solid $tainacan-input-background;
}
}
&.has-icons-right {
.icon {
height: 2.0em;
.mdi-alert-circle::before {
content: "\F156" !important;
font-size: 16px !important;
}
}
}
}
.radio, .checkbox {
margin-bottom: 0.2em;
&.is-danger {
border-color: $danger;
}
}
.control-label { // The value part in checkbox, radio and switches
color: $tainacan-input-color;
padding-left: 0.8em;
font-size: 12px;
}
.select {
select {
font-size: 14px;
color: $tainacan-input-color;
background-color: white !important;
border: 1px solid $tainacan-input-background;
&:focus>option:checked, &:focus>option:hover {
background-color: $primary-lighter !important;
}
}
&.is-empty select{
background-color: $tainacan-input-background !important;
}
&:not(.is-multiple)::after {
margin-top: -0.6em;
right: 0.95em;
color: $primary;
}
}
}
// Some components have a different style in listing pages
.button {
border-radius: 6px !important;
font-weight: normal;
padding: 2px 15px !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
height: inherit !important;
box-shadow: none !important;
display: inline-flex !important;
&.is-secondary:hover, &.is-secondary:focus {
background: $secondary !important;
}
&.is-primary:hover, &.is-primary:focus {
background: $primary !important;
}
&.is-success:hover, &.is-success:focus {
background: $success !important;
}
&.is-white:hover, &.is-white:focus, &.is-outlined:hover, &.is-outlined:focus {
background: $white !important;
}
&:active {
-webkit-transform: none !important;
transform: none !important;
}
&.is-outlined {
color: #150e38 !important;
background-color: white;
border-color: $gray-light !important;
}
&:focus {
outline: 0px;
}
}
.button.is-small {
height: 26px !important;
line-height: 12px;
}
.button:not(.is-small):not(.is-medium):not(.is-large) {
height: 30px !important;
line-height: 20px !important;
font-size: 14px !important;
}
.input, .textarea {
font-size: 14px;
border: none;
border-radius: 1px !important;
box-shadow: none !important;
&:focus, &:active {
box-shadow: none !important;
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
}
.select {
padding-top: 0px !important;
select {
border: none;
border-radius: 1px !important;
font-weight: normal;
font-size: 14px !important;
height: 30px !important;
padding: 2px 25px 2px 15px!important;
margin-top: 0px !important;
margin-bottom: 0px !important;
color: $tainacan-input-color;
option:checked, option:hover {
background-color: $primary-lighter !important;
}
&:focus, &:active {
box-shadow: none !important;
text-decoration: none !important;
}
}
&:not(.is-multiple)::after {
content: "\F35D" !important;
font: normal normal normal 24px/1 "Material Design Icons" !important;
border: none !important;
transform: none !important;
margin-top: -15px !important;
right: 10px !important;
color: $primary;
display: flex !important;
align-items: initial;
}
}
.dropdown, .autocomplete {
.dropdown-trigger{
.button {
border: none;
.icon {
color: $secondary;
align-items: start;
}
}
.button.is-primary, .button.is-secondary, .button.is-success {
.icon {
color: $white;
}
}
}
.dropdown-menu {
.dropdown-content {
border-radius: 0px !important;
.dropdown-item {
.b-checkbox { width: 100% };
&:hover {
background-color: $primary-lighter;
}
.is-small {
color: gray;
}
}
}
}
}
.taginput-container {
padding: 0 !important;
background-color: white !important;
&:focus, &:active {
border: none !important;
}
.input { margin-bottom: 0px !important; }
.input.has-selected, .input:focus, .input:active {
background-color: white;
border: 1px solid $tainacan-input-background !important;
}
.tag {
background: white;
padding-right: 0;
padding-left: 0.5em;
&.is-delete {
color: $gray-light;
&::after {
height: 30% !important;
width: 1px !important;
}
&::before {
width: 30% !important;
height: 1px !important;
}
&:hover, &:focus {
background-color: white;
color: black;
}
}
}
}
.selected-list-box {
padding: 4px 0px;
border: 1px solid $tainacan-input-background;
background-color: white;
display: flex;
font-size: 12px;
.tags {
margin-right: 8px;
}
.tag {
background: white;
padding-right: 0;
padding-left: 0.5em;
&.is-delete {
color: $gray-light;
&::after {
height: 30% !important;
width: 1px !important;
}
&::before {
width: 30% !important;
height: 1px !important;
}
&:hover, &:focus {
background-color: white;
color: black;
}
}
}
}
.switch {
input[type="checkbox"] + .check {
background-color: $gray-light;
border: 2px solid $gray-light;
width: 2.7em;
height: 1.7em;
&::before {
background-color: white;
box-shadow: none;
}
}
&:hover input[type="checkbox"]:checked + .check {
background-color: $primary-light;
}
input[type="checkbox"]:checked + .check {
border: 2px solid $secondary;
background-color: transparent;
&::before {
background-color: $secondary;
transform: translate3d(78%, 0, 0);
}
}
&:hover input[type="checkbox"] + .check {
background-color: $gray-light;
}
&:focus input[type="checkbox"] + .check,
&:focus input[type="checkbox"]:checked + .check {
box-shadow: none;
}
&.is-small {
font-size: 9px;
input[type="checkbox"] + .check {
border: 1.5px solid $gray-light;
width: 2.55em;
height: 1.7em;
&::before {
width: 1.0em;
height: 1.0em;
}
}
input[type="checkbox"]:checked + .check {
border: 1.5px solid $secondary;
&::before {
transform: translate3d(84%, 0, 0);
}
}
}
}
.b-checkbox.checkbox {
input[type="checkbox"] {
box-shadow: none !important;
}
input[type="checkbox"] + .check {
width: 12px;
height: 12px;
flex-shrink: 0;
border-radius: 0;
display: inline-block;
border: 1px solid $gray-light;
transition: background 150ms ease-out;
box-shadow: none !important;
}
&:focus input[type="checkbox"] + .check,
&:active input[type="checkbox"] + .check,
&:hover input[type="checkbox"] + .check {
box-shadow: none !important;
border-color: $gray-light !important;
}
input[type="checkbox"]:checked + .check {
background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'%3E%3Cpath style='fill:%23000' d='M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z'%3E%3C/path%3E%3C/svg%3E") no-repeat center center !important;
border-color: $gray-light !important;
}
}
.b-radio.radio {
input[type="radio"] + .check {
width: 13px !important;
height: 13px !important;
border: 1px solid $gray-light !important;
}
input[type="radio"] + .check::before {
background: black !important;
width: 7px !important;
height: 7px !important;
}
&:focus input[type="radio"] + .check,
&:active input[type="radio"] + .check,
&:hover input[type="radio"] + .check {
box-shadow: none !important;
}
input[type="radio"]:checked + .check {
border-color: $gray-light !important;
}
&:focus input[type="radio"]:checked + .check {
box-shadow: none !important;
}
}
// Tables
.table-container {
padding: 0 $table-side-padding;
position: relative;
.table-wrapper {
width: 100%;
height: calc(100% - 40px);
overflow: auto;
.table {
tbody {
td { border-bottom: 0px solid $gray-light !important; }
}
.th-wrap {
font-size: 12px !important;
font-weight: normal !important;
}
}
margin-bottom: 0px !important;
}
}
.pagination-area {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.85em !important;
font-weight: normal !important;
border-top: 1px solid $gray;
padding: 0em 1.0em;
color: $gray-light;
.shown-items {
flex-grow: 1;
}
.items-per-page {
flex-grow: 3;
margin-top: 0.35em;
.field-label {
flex-grow: 5;
margin-right: 0.5em;
.label {
font-size: 1em !important;
font-weight: normal !important;
color: $gray-light;
}
}
select {
font-size: 0.85em;
}
}
.pagination {
flex-grow: 1;
a[disabled="disabled"] {
color: $gray-light;
}
.pagination-link, .pagination-previous, .pagination-next {
background-color: transparent;
color: $secondary;
border: none;
}
.pagination-link.is-current {
color: $gray-light;
}
.pagination-link::after:not(:last-child) {
content: ',';
color: $gray-light;
}
.mdi-chevron-left::before {
content: "\F40A";
font-size: 17px;
transform: rotate(180deg);
}
.mdi-chevron-right::before {
content: "\F40A";
font-size: 17px;
}
}
}
// Tabs
.tabs {
a {
font-size: 13px;
margin-bottom: -3px;
&:hover{
border-bottom-color: transparent;
}
}
li.is-active a {
border-bottom: 5px solid $primary;
color: $primary;
}
}
// WordPress Media Modal customization
.wp-core-ui {
a:focus{ box-shadow: none; }
}
.media-modal-backdrop {
z-index: 9999999 !important;
}
.media-modal {
left: 100px;
top: 100px;
bottom: 100px;
right: 100px;
background-color: white;
z-index: 99999999999 !important;
}
// .media-modal {
// left: 100px;
// top: 100px;
// bottom: 100px;
// right: 100px;
// background-color: white;
// z-index: 99999999999 !important;
// .media-modal-content {
// background-color: white;
// margin: 42px 60px;
// box-shadow: none;
// }
// .media-frame-title {
// border-bottom: 1px solid #298596 !important;
// margin-bottom: 60px !important;
// box-shadow: none !important;
// h1, h2 {
// font-size: 20px;
// font-weight: 500;
// color: $tertiary;
// display: inline-block;
// margin-bottom: 3px;
// }
// }
// .media-frame-router {
// margin-top: 28px;
// a.media-menu-item.active {
// border-top: none;
// border-left: none;
// border-right: none;
// border-bottom: 3px solid $primary;
// }
// }
// .media-frame-content {
// margin-top: 30px;
// .attachments-browser .attachments, .media-toolbar {
// padding: 12px;
// right: 270px;
// .media-toolbar-primary {
// max-width: 30%;
// }
// .media-toolbar-secondary {
// max-width: 70%;
// }
// .attachment {
// padding: 12px;
// }
// .attachment.details {
// box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 14px $primary-light;
// }
// .attachment.details .check, .wp-core-ui .attachment.selected .check:focus, .wp-core-ui .media-frame.mode-grid .attachment.selected .check {
// background-color: $primary-light;
// box-shadow: 0 0 0 1px #fff,0 0 0 2px $primary-light;
// }
// }
// .media-sidebar {
// background-color: white;
// width: 238px;
// }
// .crop-content{
// .imgareaselect-outer {
// background-color: white;
// opacity: 0.6;
// }
// }
// }
// .media-frame-toolbar .media-toolbar {
// bottom: initial;
// margin-top: -1px;
// padding: 28px 0px;
// }
// .media-button.button-primary {
// background-color: $success;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// }
// .media-button.button-primary[disabled] {
// color: #66c6e4 !important;
// background: $success !important;
// border-color: none!important;
// box-shadow: none !important;
// text-shadow: none !important;
// cursor: default;
// }
// .media-button.button-secondary {
// color: $tertiary;
// border-color: #999;
// background: white;
// box-shadow: none;
// vertical-align: middle;
// }
// .button-hero {
// background-color: $secondary;
// border: none;
// box-shadow: none;
// color: #fff;
// text-decoration: none;
// text-shadow: none;
// font-size: 14px;
// height: 46px;
// line-height: 20px !important;
// padding: 0 36px;
// &:hover{
// background-color: #339daf;
// color: white;
// }
// }
// }

View File

@ -7,17 +7,17 @@ return apply_filters('tainacan-admin-i18n', [
'items' => __( 'Items', 'tainacan' ), 'items' => __( 'Items', 'tainacan' ),
'fields' => __( 'Metadata', 'tainacan' ), 'fields' => __( 'Metadata', 'tainacan' ),
'filters' => __( 'Filters', 'tainacan' ), 'filters' => __( 'Filters', 'tainacan' ),
'categories' => __( 'Categories', 'tainacan' ), 'taxonomies' => __( 'Taxonomies', 'tainacan' ),
'events' => __( 'Events', 'tainacan' ), 'events' => __( 'Events', 'tainacan' ),
'collection' => __( 'Collection', 'tainacan' ), 'collection' => __( 'Collection', 'tainacan' ),
'item' => __( 'Item', 'tainacan' ), 'item' => __( 'Item', 'tainacan' ),
'field' => __( 'Metadata', 'tainacan' ), 'field' => __( 'Metadata', 'tainacan' ),
'filter' => __( 'Filter', 'tainacan' ), 'filter' => __( 'Filter', 'tainacan' ),
'category' => __( 'Category', 'tainacan' ), 'taxonomy' => __( 'Taxonomia', 'tainacan' ),
'event' => __( 'Event', 'tainacan' ), 'event' => __( 'Event', 'tainacan' ),
'term' => __( 'Term', 'tainacan' ), 'term' => __( 'Term', 'tainacan' ),
'terms' => __( 'Terms', 'tainacan' ), 'terms' => __( 'Terms', 'tainacan' ),
'exposer' => __( 'Exposer', 'tainacan' ), 'mapping' => __( 'Mapping', 'tainacan' ),
// Actions // Actions
'edit' => __( 'Edit', 'tainacan' ), 'edit' => __( 'Edit', 'tainacan' ),
@ -40,7 +40,9 @@ return apply_filters('tainacan-admin-i18n', [
'add_items_bulk' => __( 'Add items in bulk', 'tainacan' ), 'add_items_bulk' => __( 'Add items in bulk', 'tainacan' ),
'add_items_external_source' => __( 'Add items from an external source', 'tainacan' ), 'add_items_external_source' => __( 'Add items from an external source', 'tainacan' ),
'new_mapped_item' => __( 'New mapped collection', 'tainacan' ), 'new_mapped_item' => __( 'New mapped collection', 'tainacan' ),
'new_blank_collection' => __( 'New Blank Collection', 'tainacan' ), 'new_blank_collection' => __( 'New Blank Collection', 'tainacan' ),
'split' => __( 'Split', 'tainacan' ),
'unified' => __( 'Unified', 'tainacan' ),
// Wordpress Status // Wordpress Status
'publish' => __( 'Publish', 'tainacan' ), 'publish' => __( 'Publish', 'tainacan' ),
@ -52,33 +54,31 @@ return apply_filters('tainacan-admin-i18n', [
'private_visibility' => __( 'Visible only for editors', 'tainacan' ), 'private_visibility' => __( 'Visible only for editors', 'tainacan' ),
// Page Titles (used mainly on Router) // Page Titles (used mainly on Router)
'title_repository_collections_page' => __( 'Repository Collections Page', 'tainacan' ), 'title_repository_collections_page' => __( 'Repository Collections', 'tainacan' ),
'title_items_page' => __( 'Items Page', 'tainacan' ), 'title_items_page' => __( 'Items', 'tainacan' ),
'title_repository_fields_page' => __( 'Repository Fields Page', 'tainacan' ), 'title_repository_fields_page' => __( 'Repository Metadata', 'tainacan' ),
'title_repository_filters_page' => __( 'Repository Filters Page', 'tainacan' ), 'title_repository_filters_page' => __( 'Repository Filters', 'tainacan' ),
'title_categories_page' => __( 'Categories Page', 'tainacan' ), 'title_categories_page' => __( 'Categories Page', 'tainacan' ),
'title_terms_page' => __( 'Terms Page', 'tainacan' ), 'title_terms_page' => __( 'Terms', 'tainacan' ),
'title_repository_events_page' => __( 'Repository Events Page', 'tainacan' ), 'title_repository_events_page' => __( 'Repository Events', 'tainacan' ),
'title_collection_page' => __( 'Collection Page', 'tainacan' ), 'title_collection_page' => __( 'Collection', 'tainacan' ),
'title_item_page' => __( 'Item Page', 'tainacan' ), 'title_item_page' => __( 'Item', 'tainacan' ),
'title_field_page' => __( 'Field Page', 'tainacan' ), 'title_field_page' => __( 'Metadata', 'tainacan' ),
'title_collection_events' => __( 'Collection Events', 'tainacan' ), 'title_collection_events' => __( 'Collection Events', 'tainacan' ),
'title_filter_page' => __( 'Filter', 'tainacan' ),
/* translators: alkdjklasdj laksjd klsadj */ 'title_category_page' => __( 'Taxonomy', 'tainacan' ),
'title_filter_page' => __( 'Filter Page', 'tainacan' ), 'title_term_page' => __( 'Term', 'tainacan' ),
'title_category_page' => __( 'Category Page', 'tainacan' ), 'title_event_page' => __( 'Event', 'tainacan' ),
'title_term_page' => __( 'Term Page', 'tainacan' ), 'title_create_collection' => __( 'Collection Creation', 'tainacan' ),
'title_event_page' => __( 'Event Page', 'tainacan' ), 'title_create_category_page' => __( 'Taxonomy Creation', 'tainacan' ),
'title_create_collection' => __( 'Collection Creation Page', 'tainacan' ),
'title_create_category_page' => __( 'Category Creation Page', 'tainacan' ),
'title_create_item_collection' => __( 'Create Item on Collection', 'tainacan' ), 'title_create_item_collection' => __( 'Create Item on Collection', 'tainacan' ),
'title_create_filter' => __( 'Filter Creation Page', 'tainacan' ), 'title_create_filter' => __( 'Filter Creation', 'tainacan' ),
'title_edit_collection' => __( 'Edit Collection', 'tainacan' ), 'title_edit_collection' => __( 'Settings of Collection', 'tainacan' ),
'title_edit_item' => __( 'Edit Item', 'tainacan' ), 'title_edit_item' => __( 'Edit Item', 'tainacan' ),
'title_category_edition_page' => __( 'Category Edition Page', 'tainacan' ), 'title_category_edition_page' => __( 'Taxonomy Edition', 'tainacan' ),
'title_filter_edition' => __( 'Filter Edition Page', 'tainacan' ), 'title_filter_edition' => __( 'Filter Edition', 'tainacan' ),
'title_field_edition' => __( 'Field Edition Page', 'tainacan' ), 'title_field_edition' => __( 'Metadata Edition', 'tainacan' ),
'title_collection_fields_edition' => __( 'Edit Fields of', 'tainacan' ), 'title_collection_fields_edition' => __( 'Edit Metadata of', 'tainacan' ),
'title_collection_filters_edition' => __( 'Edit Filters of', 'tainacan' ), 'title_collection_filters_edition' => __( 'Edit Filters of', 'tainacan' ),
// Labels (used mainly on Aria Labels and Inputs) // Labels (used mainly on Aria Labels and Inputs)
@ -90,6 +90,7 @@ return apply_filters('tainacan-admin-i18n', [
'label_main_menu' => __( 'Main Menu', 'tainacan' ), 'label_main_menu' => __( 'Main Menu', 'tainacan' ),
'label_collection_menu' => __( 'Collection Menu', 'tainacan' ), 'label_collection_menu' => __( 'Collection Menu', 'tainacan' ),
'label_title' => __( 'Title', 'tainacan' ), 'label_title' => __( 'Title', 'tainacan' ),
'label_settings' => __( 'Settings', 'tainacan' ),
'label_actions' => __( 'Actions', 'tainacan' ), 'label_actions' => __( 'Actions', 'tainacan' ),
'label_name' => __( 'Name', 'tainacan' ), 'label_name' => __( 'Name', 'tainacan' ),
'label_description' => __( 'Description', 'tainacan' ), 'label_description' => __( 'Description', 'tainacan' ),
@ -113,15 +114,15 @@ return apply_filters('tainacan-admin-i18n', [
'label_categories_per_page' => __( 'Categories per Page:', 'tainacan' ), 'label_categories_per_page' => __( 'Categories per Page:', 'tainacan' ),
'label_events_per_page' => __( 'Events per Page:', 'tainacan' ), 'label_events_per_page' => __( 'Events per Page:', 'tainacan' ),
'label_items_per_page' => __( 'Items per Page:', 'tainacan' ), 'label_items_per_page' => __( 'Items per Page:', 'tainacan' ),
'label_active_fields' => __( 'Active Fields', 'tainacan' ), 'label_active_fields' => __( 'Active Metadata', 'tainacan' ),
'label_available_fields' => __( 'Available Fields', 'tainacan' ), 'label_available_fields' => __( 'Available Metadata', 'tainacan' ),
'label_available_field_types' => __( 'Available Field Types', 'tainacan' ), 'label_available_field_types' => __( 'Available Metadata Types', 'tainacan' ),
'label_active_filters' => __( 'Active Filters', 'tainacan' ), 'label_active_filters' => __( 'Active Filters', 'tainacan' ),
'label_filter_type' => __( 'Filter Type', 'tainacan' ), 'label_filter_type' => __( 'Filter Type', 'tainacan' ),
'label_available_filters' => __( 'Available Filters', 'tainacan' ), 'label_available_filters' => __( 'Available Filters', 'tainacan' ),
'label_available_filter_types' => __( 'Available Filter Types', 'tainacan' ), 'label_available_filter_types' => __( 'Available Filter Types', 'tainacan' ),
'label_per_page' => __( 'per Page', 'tainacan' ), 'label_per_page' => __( 'per Page', 'tainacan' ),
'label_table_fields' => __( 'Fields on table', 'tainacan' ), 'label_table_fields' => __( 'Metadata on table', 'tainacan' ),
'label_required' => __( 'Required', 'tainacan' ), 'label_required' => __( 'Required', 'tainacan' ),
'label_allow_multiple' => __( 'Allow multiple values', 'tainacan' ), 'label_allow_multiple' => __( 'Allow multiple values', 'tainacan' ),
'label_default_value' => __( 'Default value', 'tainacan' ), 'label_default_value' => __( 'Default value', 'tainacan' ),
@ -130,24 +131,26 @@ return apply_filters('tainacan-admin-i18n', [
'label_no' => __( 'No', 'tainacan' ), 'label_no' => __( 'No', 'tainacan' ),
'label_approved' => __( 'Approved', 'tainacan' ), 'label_approved' => __( 'Approved', 'tainacan' ),
'label_collection_related' => __( 'Collection Related', 'tainacan' ), 'label_collection_related' => __( 'Collection Related', 'tainacan' ),
'label_fields_for_search' => __( 'Fields for search', 'tainacan' ), 'label_fields_for_search' => __( 'Metadata for search', 'tainacan' ),
'label_allow_repeated_items' => __( 'Allow repeated items', 'tainacan' ), 'label_allow_repeated_items' => __( 'Allow repeated items', 'tainacan' ),
'label_select_category' => __( 'Select category', 'tainacan' ), 'label_select_category' => __( 'Select taxonomy', 'tainacan' ),
'label_select_category_input_type' => __( 'Input type', 'tainacan' ), 'label_select_category_input_type' => __( 'Input type', 'tainacan' ),
'label_category_allow_new_terms' => __( 'Allow new terms', 'tainacan' ), 'label_category_allow_new_terms' => __( 'Allow new terms', 'tainacan' ),
'label_selectbox_init' => __( 'Select', 'tainacan' ), 'label_selectbox_init' => __( 'Select', 'tainacan' ),
'label_options' => __( 'Insert options', 'tainacan' ), 'label_options' => __( 'Insert options', 'tainacan' ),
'label_attachments' => __( 'Attachments', 'tainacan' ), 'label_attachments' => __( 'Attachments', 'tainacan' ),
'label_attachment' => __( 'Attachment', 'tainacan' ),
'label_enabled' => __( 'Enabled', 'tainacan' ), 'label_enabled' => __( 'Enabled', 'tainacan' ),
'label_disabled' => __( 'Disabled', 'tainacan' ), 'label_disabled' => __( 'Disabled', 'tainacan' ),
'label_creation' => __( 'Creation', 'tainacan' ), 'label_creation' => __( 'Creation', 'tainacan' ),
'label_creation_date' => __( 'Creation date', 'tainacan' ),
'label_collection_items' => __( 'Collection Items', 'tainacan' ), 'label_collection_items' => __( 'Collection Items', 'tainacan' ),
'label_collection_fields' => __( 'Collection Fields', 'tainacan' ), 'label_collection_fields' => __( 'Collection Metadata', 'tainacan' ),
'label_collection_filters' => __( 'Collection Filters', 'tainacan' ), 'label_collection_filters' => __( 'Collection Filters', 'tainacan' ),
'label_parent_term' => __( 'Parent Term', 'tainacan' ), 'label_parent_term' => __( 'Parent Term', 'tainacan' ),
'label_new_term' => __( 'New Term', 'tainacan' ), 'label_new_term' => __( 'New Term', 'tainacan' ),
'label_new_child' => __( 'New Child', 'tainacan' ), 'label_new_child' => __( 'New Child', 'tainacan' ),
'label_category_terms' => __( 'Category Terms', 'tainacan' ), 'label_category_terms' => __( 'Taxonomy Terms', 'tainacan' ),
'label_no_parent_term' => __( 'No parent term', 'tainacan' ), 'label_no_parent_term' => __( 'No parent term', 'tainacan' ),
'label_term_without_name' => __( 'Term without name', 'tainacan' ), 'label_term_without_name' => __( 'Term without name', 'tainacan' ),
'label_inherited' => __( 'Inherited', 'tainacan' ), 'label_inherited' => __( 'Inherited', 'tainacan' ),
@ -158,7 +161,7 @@ return apply_filters('tainacan-admin-i18n', [
'label_empty_header_image' => __( 'Empty Header Image', 'tainacan' ), 'label_empty_header_image' => __( 'Empty Header Image', 'tainacan' ),
'label_enable_cover_page' => __( 'Enable Cover Page', 'tainacan' ), 'label_enable_cover_page' => __( 'Enable Cover Page', 'tainacan' ),
'label_cover_page' => __( 'Cover Page', 'tainacan' ), 'label_cover_page' => __( 'Cover Page', 'tainacan' ),
'label_default_displayed_fields' => __( 'Default Displayed Fields', 'tainacan' ), 'label_default_displayed_fields' => __( 'Default Displayed Metadata', 'tainacan' ),
'label_display' => __( 'Display on Listing', 'tainacan' ), 'label_display' => __( 'Display on Listing', 'tainacan' ),
'label_display_default' => __( 'Display by default', 'tainacan' ), 'label_display_default' => __( 'Display by default', 'tainacan' ),
'label_display_never' => __( 'Never displayed', 'tainacan' ), 'label_display_never' => __( 'Never displayed', 'tainacan' ),
@ -176,13 +179,20 @@ return apply_filters('tainacan-admin-i18n', [
'label_all_items' => __( 'All items', 'tainacan' ), 'label_all_items' => __( 'All items', 'tainacan' ),
'label_draft_items' => __( 'Draft', 'tainacan' ), 'label_draft_items' => __( 'Draft', 'tainacan' ),
'label_trash_items' => __( 'Trash', 'tainacan' ), 'label_trash_items' => __( 'Trash', 'tainacan' ),
'label_mass_actions' => __( 'Mass actions', 'tainacan' ), 'label_bulk_actions' => __( 'Bulk actions', 'tainacan' ),
'label_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ), 'label_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
'label_edit_selected_collections' => __( 'Edit selected collections', 'tainacan' ), 'label_edit_selected_collections' => __( 'Edit selected collections', 'tainacan' ),
'label_delete_selected_items' => __( 'Delete selected items', 'tainacan' ), 'label_delete_selected_items' => __( 'Delete selected items', 'tainacan' ),
'label_delete_selected_categories' => __( 'Delete selected categories', 'tainacan' ),
'label_edit_selected_items' => __( 'Edit selected items', 'tainacan' ), 'label_edit_selected_items' => __( 'Edit selected items', 'tainacan' ),
'label_edit_selected_categories' => __( 'Edit selected categories', 'tainacan' ),
'label_select_all_collections_page' => __( 'Select all collections on page', 'tainacan' ), 'label_select_all_collections_page' => __( 'Select all collections on page', 'tainacan' ),
'label_select_all_items_page' => __( 'Select all items on page', 'tainacan' ), 'label_select_all_items_page' => __( 'Select all items on page', 'tainacan' ),
'label_select_all_categories_page' => __( 'Select all categories on page', 'tainacan' ),
'label_edit_attachments' => __( 'Edit attachments', 'tainacan' ),
'label_blank_collection' => __( 'Blank collection', 'tainacan' ),
'label_dublin_core' => __( 'Dublin Core', 'tainacan' ),
'label_created_by' => __( 'Created by', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders // Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ), 'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),
@ -209,25 +219,32 @@ return apply_filters('tainacan-admin-i18n', [
// Info. Other feedback to user. // Info. Other feedback to user.
'info_name_is_required' => __( 'Name is required.', 'tainacan' ), 'info_name_is_required' => __( 'Name is required.', 'tainacan' ),
'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ), 'info_no_collection_created' => __( 'No collection was created in this repository.', 'tainacan' ),
'info_no_category_created' => __( 'No category was created in this repository.', 'tainacan' ), 'info_no_collection_draft' => __( 'No draft collection found.', 'tainacan' ),
'info_no_collection_trash' => __( 'No collection on trash.', 'tainacan' ),
'info_no_category_draft' => __( 'No draft category found.', 'tainacan' ),
'info_no_category_trash' => __( 'No category on trash.', 'tainacan' ),
'info_no_category_created' => __( 'No taxonomy was created in this repository.', 'tainacan' ),
'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ), 'info_no_item_created' => __( 'No item was created in this collection.', 'tainacan' ),
'info_no_item_draft' => __( 'No draft item found.', 'tainacan' ),
'info_no_item_trash' => __( 'No item on trash.', 'tainacan' ),
'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ), 'info_no_page_found' => __( 'No page was found with this name.', 'tainacan' ),
'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ), 'info_no_user_found' => __( 'No user was found with this name.', 'tainacan' ),
'info_no_item_found' => __( 'No item was found here with these filters.', 'tainacan' ), 'info_no_item_found' => __( 'No item was found here with these filters.', 'tainacan' ),
'info_item_not_saved' => __( 'Warning: Item not saved.', 'tainacan' ), 'info_item_not_saved' => __( 'Warning: Item not saved.', 'tainacan' ),
'info_no_moderator_on_collection' => __( "This collection doesn't have any moderator yet.", 'tainacan' ), 'info_no_moderator_on_collection' => __( "This collection doesn't have any moderator yet.", 'tainacan' ),
'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ), 'info_error_deleting_collection' => __( 'Error on deleting collection.', 'tainacan' ),
'info_error_deleting_category' => __( 'Error on deleting category', 'tainacan' ), 'info_error_deleting_category' => __( 'Error on deleting taxonomy', 'tainacan' ),
'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ), 'info_collection_deleted' => __( 'Collection deleted.', 'tainacan' ),
'info_item_deleted' => __( 'Item deleted.', 'tainacan' ), 'info_item_deleted' => __( 'Item deleted.', 'tainacan' ),
'info_category_deleted' => __( 'Category deleted', 'tainacan' ), 'info_category_deleted' => __( 'Taxonomy deleted', 'tainacan' ),
'info_warning_collection_delete' => __( 'Do you really want to delete this collection?', 'tainacan' ), 'info_warning_collection_delete' => __( 'Do you really want to delete this collection?', 'tainacan' ),
'info_warning_item_delete' => __( 'Do you really want to delete this item?', 'tainacan' ), 'info_warning_item_delete' => __( 'Do you really want to delete this item?', 'tainacan' ),
'info_warning_category_delete' => __( 'Do you really want to delete this category?', 'tainacan' ), 'info_warning_category_delete' => __( 'Do you really want to delete this taxonomy?', 'tainacan' ),
'info_warning_selected_collections_delete' => __( 'Do you really want to delete the selected collections?', 'tainacan' ), 'info_warning_selected_collections_delete' => __( 'Do you really want to delete the selected collections?', 'tainacan' ),
'info_warning_selected_items_delete' => __( 'Do you really want to delete the selected items?', 'tainacan' ), 'info_warning_selected_items_delete' => __( 'Do you really want to delete the selected items?', 'tainacan' ),
'info_warning_collection_related' => __( 'The field Collection related is required', 'tainacan' ), 'info_warning_selected_categories_delete' => __( 'Do you really want to delete the selected categories?', 'tainacan' ),
'info_warning_no_fields_found' => __( 'No fields found in this collection', 'tainacan' ), 'info_warning_collection_related' => __( 'The metadata Collection related is required', 'tainacan' ),
'info_warning_no_fields_found' => __( 'No metadata found in this collection', 'tainacan' ),
'info_showing_items' => __( 'Showing items ', 'tainacan' ), 'info_showing_items' => __( 'Showing items ', 'tainacan' ),
'info_showing_collections' => __( 'Showing collections ', 'tainacan' ), 'info_showing_collections' => __( 'Showing collections ', 'tainacan' ),
'info_showing_categories' => __( 'Showing categories ', 'tainacan' ), 'info_showing_categories' => __( 'Showing categories ', 'tainacan' ),
@ -238,22 +255,28 @@ return apply_filters('tainacan-admin-i18n', [
'info_by' => __( 'By: ', 'tainacan' ), 'info_by' => __( 'By: ', 'tainacan' ),
'info_date' => __( 'Date: ', 'tainacan' ), 'info_date' => __( 'Date: ', 'tainacan' ),
'info_not_saved' => __( 'Not saved ', 'tainacan' ), 'info_not_saved' => __( 'Not saved ', 'tainacan' ),
'info_warning_item_not_saved' => __( 'Are you sure? The item is not saved, changes will be lost.', 'tainacan' ), 'info_warning_item_not_saved' => __( 'Are you sure? The item is not saved, changes will be lost.', 'tainacan' ),
'info_warning_fields_not_saved' => __( 'Are you sure? There are fields not saved, changes will be lost.', 'tainacan' ), 'info_warning_fields_not_saved' => __( 'Are you sure? There are metadata not saved, changes will be lost.', 'tainacan' ),
'info_warning_filters_not_saved' => __( 'Are you sure? There are filters not saved, changes will be lost.', 'tainacan' ), 'info_warning_filters_not_saved' => __( 'Are you sure? There are filters not saved, changes will be lost.', 'tainacan' ),
'info_no_description_provided' => __( 'No description provided.', 'tainacan' ), 'info_no_description_provided' => __( 'No description provided.', 'tainacan' ),
'info_warning_category_not_saved' => __( 'Are you sure? The category is not saved, changes will be lost.', 'tainacan' ), 'info_warning_category_not_saved' => __( 'Are you sure? The metadata is not saved, changes will be lost.', 'tainacan' ),
'info_warning_terms_not_saved' => __( 'Are you sure? There are terms not saved, changes will be lost.', 'tainacan' ), 'info_warning_terms_not_saved' => __( 'Are you sure? There are terms not saved, changes will be lost.', 'tainacan' ),
'info_warning_orphan_terms' => __( 'Are you sure? This term is parent of other terms. These will be converted to root terms.', 'tainacan' ), 'info_warning_orphan_terms' => __( 'Are you sure? This term is parent of other terms. These will be converted to root terms.', 'tainacan' ),
'info_no_events' => __( 'No events', 'tainacan' ), 'info_no_events' => __( 'No events', 'tainacan' ),
'info_logs_before' => __( 'Before updating', 'tainacan' ), 'info_logs_before' => __( 'Before updating', 'tainacan' ),
'info_logs_after' => __( 'What was updated', 'tainacan' ), 'info_logs_after' => __( 'What was updated', 'tainacan' ),
'info_there_is_no_field' => __( 'There is no field here yet.', 'tainacan' ), 'info_there_is_no_field' => __( 'There is no metadata here yet.', 'tainacan' ),
'info_there_is_no_filter' => __( 'There is no filter here yet.', 'tainacan' ), 'info_there_is_no_filter' => __( 'There is no filter here yet.', 'tainacan' ),
'info_changes' => __( 'Changes', 'tainacan' ), 'info_changes' => __( 'Changes', 'tainacan' ),
'info_possible_external_sources' => __( 'Possible external sources: CSV, Instagram, Youtube, etc.', 'tainacan' ), 'info_possible_external_sources' => __( 'Possible external sources: CSV, Instagram, Youtube, etc.', 'tainacan' ),
'info_help_term_name' => __( 'The term name', 'tainacan' ), 'info_help_term_name' => __( 'The term name', 'tainacan' ),
'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ), 'info_help_term_description' => __( 'The description of the Term.', 'tainacan' ),
'info_no_attachments_on_item_yet' => __( 'The are no attachments on this item so far.', 'tainacan' ),
'info_repository_metadata_inheritance' => __( 'Repository Metadata will be inherited by all collections.', 'tainacan' ),
'info_repository_filters_inheritance' => __( 'Repository Filters will be inherited by all collections.', 'tainacan' ),
'info_create_filters' => __( 'Click or Drag and Drop Metadata here for creating a new Filter.', 'tainacan' ),
'info_create_metadata' => __( 'Click or Drag and Drop Metadata Types here for creating a new Metadata.', 'tainacan' ),
'info_choose_your_metadata' => __( 'Choose your metadata.', 'tainacan' ),
// Tainacan Field Types // Tainacan Field Types
'tainacan-text' => __( 'Text', 'tainacan' ), 'tainacan-text' => __( 'Text', 'tainacan' ),
@ -262,7 +285,7 @@ return apply_filters('tainacan-admin-i18n', [
'tainacan-numeric' => __( 'Numeric', 'tainacan' ), 'tainacan-numeric' => __( 'Numeric', 'tainacan' ),
'tainacan-selectbox' => __( 'Select box', 'tainacan' ), 'tainacan-selectbox' => __( 'Select box', 'tainacan' ),
'tainacan-relationship' => __( 'Relationship', 'tainacan' ), 'tainacan-relationship' => __( 'Relationship', 'tainacan' ),
'tainacan-category' => __( 'Category', 'tainacan' ), 'tainacan-category' => __( 'Taxonomy', 'tainacan' ),
// Tainacan Filter Types // Tainacan Filter Types
'tainacan-filter-custom-interval' => __( 'Custom Interval', 'tainacan' ), 'tainacan-filter-custom-interval' => __( 'Custom Interval', 'tainacan' ),
@ -270,8 +293,8 @@ return apply_filters('tainacan-admin-i18n', [
'tainacan-filter-autocomplete' => __( 'Autocomplete', 'tainacan' ), 'tainacan-filter-autocomplete' => __( 'Autocomplete', 'tainacan' ),
'tainacan-filter-taginput' => __( 'Tag Input', 'tainacan' ), 'tainacan-filter-taginput' => __( 'Tag Input', 'tainacan' ),
'tainacan-filter-checkbox' => __( 'Check Box', 'tainacan' ), 'tainacan-filter-checkbox' => __( 'Check Box', 'tainacan' ),
'tainacan-filter-category-taginput' => __( 'Category Tag Input', 'tainacan' ), 'tainacan-filter-category-taginput' => __( 'Taxonomy Tag Input', 'tainacan' ),
'tainacan-filter-category-checkbox' => __( 'Category Check Box', 'tainacan' ), 'tainacan-filter-category-checkbox' => __( 'Taxonomy Check Box', 'tainacan' ),
'tainacan-filter-category-selectbox' => __( 'Category Select Box', 'tainacan' ) 'tainacan-filter-category-selectbox' => __( 'Taxonomy Select Box', 'tainacan' )
]); ]);
?> ?>

View File

@ -63,6 +63,8 @@ export default {
$danger: #a23939; $danger: #a23939;
$danger-invert: findColorInvert($danger); $danger-invert: findColorInvert($danger);
$table-side-padding: 4.166666667%;
.theme-items-list { .theme-items-list {
@ -384,23 +386,232 @@ export default {
} }
// Tables // Tables
.table-wrapper { // Tables
.table { .table-container {
tbody { padding: 0 $table-side-padding;
td { border-bottom: 0px solid $gray-light !important; } position: relative;
} margin-bottom: 40px;
.b-checkbox.checkbox input[type="checkbox"] + .check {
width: 0.85em !important; .table-wrapper {
height: 0.85em !important; width: 100%;
border-radius: 2px !important; height: calc(100% - 40px);
border: 1px solid #7a7a7a !important; border-collapse: separate;
} overflow: auto;
.th-wrap { margin-bottom: 0px !important;
font-size: 12px !important;
font-weight: normal !important; table.table {
width: 100%;
.checkbox-cell {
min-width: 38px;
width: 38px;
padding: 0;
left: 0;
top: auto;
display: table-cell;
&::before {
box-shadow: inset 50px 0 10px -12px #222;
content: " ";
width: 50px;
height: 100%;
position: absolute;
left: 0;
top: 0;
visibility: hidden;
}
label.checkbox {
border-radius: 0px;
background-color: white;
padding: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.b-checkbox.checkbox .control-label {
display: none;
}
&.is-selecting {
position: sticky !important;
position: -webkit-sticky !important;
&::before { visibility: visible !important; }
}
}
// Only to be used in case we can implement Column resizing
// th:not(:last-child) {
// border-right: 1px solid $tainacan-input-background !important;
// }
.thumbnail-cell {
width: 60px;
text-align: center;
}
.column-small-width {
min-width: 80px;
max-width: 80px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-default-width {
min-width: 80px;
max-width: 160px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-medium-width {
min-width: 120px;
max-width: 200px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-large-width {
min-width: 120px;
max-width: 240px;
p {
color: $gray-light;
font-size: 11px;
line-height: 1.5;
}
}
.column-main-content {
min-width: 120px !important;
max-width: 240px !important;
p {
font-size: 14px !important;
color: $tainacan-input-color !important;
margin: 0px !important;
}
}
.column-needed-width {
max-width: unset !important;
}
.column-align-right {
text-align: right !important;
}
th {
position: sticky;
position: -webkit-sticky;
background-color: white;
border-bottom: 1px solid $tainacan-input-background;
top: 0px;
z-index: 9;
padding: 10px;
vertical-align: bottom;
.th-wrap {
font-size: 12px !important;
font-weight: normal !important;
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
tbody {
tr {
cursor: pointer;
background-color: transparent;
&.selected-row {
background-color: $primary-lighter;
.checkbox-cell .checkbox, .actions-cell .actions-container {
background-color: $primary-lighter;
}
}
td {
height: 60px;
max-height: 60px;
padding: 10px;
vertical-align: middle;
line-height: 12px;
border: none !important;
p {
font-size: 14px;
margin: 0px;
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
}
}
img.table-thumb {
max-height: 38px !important;
border-radius: 3px;
}
td.actions-cell {
padding: 0px;
position: sticky !important;
position: -webkit-sticky !important;
right: 0px;
top: auto;
width: 80px;
.actions-container {
visibility: hidden;
display: flex;
position: relative;
padding: 0;
height: 100%;
width: 80px;
z-index: 9;
background-color: transparent;
float: right;
}
a {
margin: auto;
font-size: 18px !important;
}
}
&:hover {
background-color: $tainacan-input-background !important;
cursor: pointer;
.checkbox-cell {
position: sticky !important;
position: -webkit-sticky !important;
&::before { visibility: visible; }
.checkbox {
background-color: $tainacan-input-background !important;
}
}
.actions-cell {
.actions-container {
visibility: visible;
background: $tainacan-input-background !important;
}
&::after {
box-shadow: inset -97px 0 17px -21px #222;
content: " ";
width: 100px;
height: 100%;
position: absolute;
right: 0px;
top: 0;
}
}
}
}
}
} }
} }
margin-bottom: 0px !important;
} }
.pagination-area { .pagination-area {
display: flex; display: flex;

View File

@ -24,22 +24,12 @@ class REST_Controller extends \WP_REST_Controller {
if (is_array($attributes)) { if (is_array($attributes)) {
foreach ( $attributes as $attribute ) { foreach ( $attributes as $attribute ) {
try { if ( ! is_array( $attribute ) ) {
if(!is_array($attribute)) { $object_filtered[ $attribute ] = $object->get( $attribute );
$get_ = 'get_' . $attribute;
$object_filtered[ $attribute ] = $object->$get_();
}
} catch ( \Error $error ) {
// Do nothing
} }
} }
} else { } else {
try{ $object_filtered[ $attributes ] = $object->get( $attributes );
$get_ = 'get_' . $attributes;
$object_filtered[$attributes] = $object->$get_();
} catch (\Error $error){
// Do nothing
}
} }
return $object_filtered; return $object_filtered;
@ -54,12 +44,7 @@ class REST_Controller extends \WP_REST_Controller {
protected function prepare_item_for_updating($object, $new_values){ protected function prepare_item_for_updating($object, $new_values){
foreach ($new_values as $key => $value) { foreach ($new_values as $key => $value) {
try { $object->set($key, $value);
$set_ = 'set_' . $key;
$object->$set_( $value );
} catch (\Error $error){
// Do nothing
}
} }
return $object; return $object;
@ -354,7 +339,6 @@ class REST_Controller extends \WP_REST_Controller {
'enum' => array_merge(array_keys(get_post_stati()), array('any')), 'enum' => array_merge(array_keys(get_post_stati()), array('any')),
'type' => 'string', 'type' => 'string',
), ),
'sanitize_callback' => array($this, 'sanitize_post_statuses'),
); );
$query_params['offset'] = array( $query_params['offset'] = array(
@ -443,7 +427,7 @@ class REST_Controller extends \WP_REST_Controller {
'value' => array( 'value' => array(
'type' => 'string/array', 'type' => 'string/array',
'description' => __('Custom metadata value. It can be an array only when compare is IN, NOT IN, BETWEEN, or NOT BETWEEN. You dont have to specify a value when using the EXISTS or NOT EXISTS comparisons in WordPress 3.9 and up. 'description' => __('Custom metadata value. It can be an array only when compare is IN, NOT IN, BETWEEN, or NOT BETWEEN. You dont have to specify a value when using the EXISTS or NOT EXISTS comparisons in WordPress 3.9 and up.
(Note: Due to bug #23268, value is required for NOT EXISTS comparisons to work correctly prior to 3.9. You must supply some string for the value parameter. An empty string or NULL will NOT work. However, any other string will do the trick and will NOT show up in your SQL when using NOT EXISTS. Need inspiration? How about \'bug #23268\'.)'), (Note: Due to bug #23268, value is required for NOT EXISTS comparisons to work correctly prior to 3.9. You must supply some string for the value parameter. An empty string or NULL will NOT work. However, any other string will do the trick and will NOT show up in your SQL when using NOT EXISTS. Need inspiration? How about \'bug #23268\'.'),
), ),
'compare' => array( 'compare' => array(
'type' => 'string', 'type' => 'string',

View File

@ -145,7 +145,7 @@ class REST_Collections_Controller extends REST_Controller {
if(!isset($request['fetch_only'])) { if(!isset($request['fetch_only'])) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if ( $request['context'] === 'edit' ) { if ( $request['context'] === 'edit' ) {
$moderators_ids = $item_arr['moderators_ids']; $moderators_ids = $item_arr['moderators_ids'];
@ -171,9 +171,22 @@ class REST_Collections_Controller extends REST_Controller {
unset($item_arr['moderators_ids']); unset($item_arr['moderators_ids']);
} else { } else {
$attributes_to_filter = $request['fetch_only']; $attributes_to_filter = $request['fetch_only'];
$item_arr = $this->filter_object_by_attributes($item, $attributes_to_filter); # Always returns id
if(is_array($attributes_to_filter)) {
$attributes_to_filter[] = 'id';
} else {
$attributes_to_filter = array($attributes_to_filter, 'id');
}
$item_arr = $this->filter_object_by_attributes($item, $attributes_to_filter);
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
}
$item_arr['url'] = get_permalink( $item_arr['id'] );
} }
return $item_arr; return $item_arr;
@ -239,7 +252,7 @@ class REST_Collections_Controller extends REST_Controller {
try { try {
$prepared_post = $this->prepare_item_for_database( $body ); $prepared_post = $this->prepare_item_for_database( $body );
} catch (\Error $exception){ } catch (\Exception $exception){
return new \WP_REST_Response($exception->getMessage(), 400); return new \WP_REST_Response($exception->getMessage(), 400);
} }
@ -365,7 +378,7 @@ class REST_Collections_Controller extends REST_Controller {
} }
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('Collection with that ID not found', 'tainacan' ), 'error_message' => __('Collection with this ID was not found', 'tainacan' ),
'collection_id' => $collection_id 'collection_id' => $collection_id
], 400); ], 400);
} }

View File

@ -138,7 +138,7 @@ class REST_Export_Controller extends REST_Controller {
$prepared_item = []; $prepared_item = [];
foreach ($items_metadata as $item_metadata){ foreach ($items_metadata as $item_metadata){
$prepared_item[] = $item_metadata->__toArray(); $prepared_item[] = $item_metadata->_toArray();
} }
return $prepared_item; return $prepared_item;

View File

@ -70,7 +70,7 @@ class REST_Field_Types_Controller extends REST_Controller {
$name = "\Tainacan\Field_Types\\$item"; $name = "\Tainacan\Field_Types\\$item";
$field_type = new $name(); $field_type = new $name();
$field_arr = $field_type->__toArray(); $field_arr = $field_type->_toArray();
$field_arr['name'] = $item; $field_arr['name'] = $item;
return $field_arr; return $field_arr;

View File

@ -197,7 +197,7 @@ class REST_Fields_Controller extends REST_Controller {
try { try {
$prepared = $this->prepare_item_for_database( $request->get_body(), $collection_id ); $prepared = $this->prepare_item_for_database( $request->get_body(), $collection_id );
} catch (\Error $exception){ } catch (\Exception $exception){
return new \WP_REST_Response($exception->getMessage(), 400); return new \WP_REST_Response($exception->getMessage(), 400);
} }
@ -217,7 +217,7 @@ class REST_Fields_Controller extends REST_Controller {
} elseif (!empty($request->get_body())) { } elseif (!empty($request->get_body())) {
try { try {
$prepared = $this->prepare_item_for_database( $request->get_body() ); $prepared = $this->prepare_item_for_database( $request->get_body() );
} catch ( \Error $exception ) { } catch ( \Exception $exception ) {
return new \WP_REST_Response( $exception->getMessage(), 400 ); return new \WP_REST_Response( $exception->getMessage(), 400 );
} }
@ -266,9 +266,9 @@ class REST_Fields_Controller extends REST_Controller {
*/ */
public function prepare_item_for_response( $item, $request ) { public function prepare_item_for_response( $item, $request ) {
if(!empty($item)){ if(!empty($item)){
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
$item_arr['field_type_object'] = $item->get_field_type_object()->__toArray(); $item_arr['field_type_object'] = $item->get_field_type_object()->_toArray();
if($request['context'] === 'edit'){ if($request['context'] === 'edit'){
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
@ -393,20 +393,20 @@ class REST_Fields_Controller extends REST_Controller {
$field = $this->field_repository->fetch($field_id); $field = $this->field_repository->fetch($field_id);
$error_message = __('Metadata with that ID was not found', 'tainacan'); $error_message = __('Metadata with this ID was not found', 'tainacan');
if($field){ if($field){
// These conditions are for verify if endpoints are used correctly // These conditions are for verify if endpoints are used correctly
if(!$collection_id && $field->get_collection_id() !== 'default') { if(!$collection_id && $field->get_collection_id() !== 'default') {
$error_message = __('That metadata is not a default metadata', 'tainacan'); $error_message = __('This metadata is not a default metadata', 'tainacan');
return new \WP_REST_Response( [ return new \WP_REST_Response( [
'error_message' => $error_message, 'error_message' => $error_message,
'field_id' => $field_id 'field_id' => $field_id
] ); ] );
} elseif ($collection_id && $field->get_collection_id() === 'default'){ } elseif ($collection_id && $field->get_collection_id() === 'default'){
$error_message = __('That metadata is not a collection metadata', 'tainacan'); $error_message = __('This metadata is not a collection metadata', 'tainacan');
return new \WP_REST_Response( [ return new \WP_REST_Response( [
'error_message' => $error_message, 'error_message' => $error_message,

View File

@ -55,7 +55,7 @@ class REST_Filter_Types_Controller extends REST_Controller {
$name = "\Tainacan\Filter_Types\\$item"; $name = "\Tainacan\Filter_Types\\$item";
$filter_type = new $name(); $filter_type = new $name();
$filter_arr = $filter_type->__toArray(); $filter_arr = $filter_type->_toArray();
$filter_arr['name'] = $item; $filter_arr['name'] = $item;
return $filter_arr; return $filter_arr;

View File

@ -128,12 +128,7 @@ class REST_Filters_Controller extends REST_Controller {
$filter_type = new $type(); $filter_type = new $type();
foreach ($filter as $attribute => $value){ foreach ($filter as $attribute => $value){
try { $filter_obj->set($attribute, $value);
$set_ = 'set_'. $attribute;
$filter_obj->$set_($value);
} catch (\Error $error){
//
}
} }
if(isset($request['collection_id']) && isset($request['field_id'])) { if(isset($request['collection_id']) && isset($request['field_id'])) {
@ -174,7 +169,7 @@ class REST_Filters_Controller extends REST_Controller {
} }
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('Please verify, invalid attribute(s)', 'tainacan'), 'error_message' => __('Please verify, invalid attribute(s).', 'tainacan'),
'error' => $filter_obj->get_errors() 'error' => $filter_obj->get_errors()
], 400); ], 400);
} }
@ -279,7 +274,7 @@ class REST_Filters_Controller extends REST_Controller {
} }
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('A filter with that ID was not found', 'tainacan' ), 'error_message' => __('A filter with this ID was not found', 'tainacan' ),
'filter_id' => $filter_id 'filter_id' => $filter_id
], 400); ], 400);
@ -315,11 +310,11 @@ class REST_Filters_Controller extends REST_Controller {
*/ */
public function prepare_item_for_response( $item, $request ) { public function prepare_item_for_response( $item, $request ) {
if(!empty($item)) { if(!empty($item)) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if($request['context'] === 'edit'){ if($request['context'] === 'edit'){
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
$item_arr['filter_type_object'] = $item->get_filter_type_object()->__toArray(); $item_arr['filter_type_object'] = $item->get_filter_type_object()->_toArray();
$item_arr['enabled'] = $item->get_enabled_for_collection(); $item_arr['enabled'] = $item->get_enabled_for_collection();
} }

View File

@ -96,7 +96,7 @@ class REST_Item_Metadata_Controller extends REST_Controller {
* @return array|\WP_Error|\WP_REST_Response * @return array|\WP_Error|\WP_REST_Response
*/ */
public function prepare_item_for_response( $item, $request ) { public function prepare_item_for_response( $item, $request ) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if($request['context'] === 'edit'){ if($request['context'] === 'edit'){
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
@ -209,7 +209,7 @@ class REST_Item_Metadata_Controller extends REST_Controller {
} }
elseif($field->get_accept_suggestion()) { elseif($field->get_accept_suggestion()) {
$log = $this->item_metadata_repository->suggest( $item_metadata ); $log = $this->item_metadata_repository->suggest( $item_metadata );
$prepared_item = $log->__toArray(); $prepared_item = $log->_toArray();
} }
else { else {
return new \WP_REST_Response( [ return new \WP_REST_Response( [

View File

@ -92,6 +92,8 @@ class REST_Items_Controller extends REST_Controller {
* @param $item_object * @param $item_object
* @param $item_array * @param $item_array
* *
* @param array $args
*
* @return mixed * @return mixed
*/ */
private function add_metadata_to_item($item_object, $item_array, $args = []){ private function add_metadata_to_item($item_object, $item_array, $args = []){
@ -100,14 +102,15 @@ class REST_Items_Controller extends REST_Controller {
foreach($item_metadata as $index => $me){ foreach($item_metadata as $index => $me){
$field = $me->get_field(); $field = $me->get_field();
$slug = $field->get_slug(); $slug = $field->get_slug();
$item_metadata_array = $me->__toArray(); $item_metadata_array = $me->_toArray();
$item_array['metadata'][ $slug ]['name'] = $field->get_name(); $item_array['metadata'][ $slug ]['name'] = $field->get_name();
$item_array['metadata'][ $slug ]['value'] = $item_metadata_array['value'];
$item_array['metadata'][ $slug ]['value_as_html'] = $item_metadata_array['value_as_html'];
$item_array['metadata'][ $slug ]['value_as_string'] = $item_metadata_array['value_as_string'];
if($field->get_field_type_object()->get_primitive_type() === 'date') { if($field->get_field_type_object()->get_primitive_type() === 'date') {
$item_array['metadata'][ $slug ]['date_i18n'] = $item_metadata_array['date_i18n']; $item_array['metadata'][ $slug ]['date_i18n'] = $item_metadata_array['date_i18n'];
} else {
$item_array['metadata'][ $slug ]['value'] = $item_metadata_array['value'];
$item_array['metadata'][ $slug ]['value_as_html'] = $item_metadata_array['value_as_html'];
$item_array['metadata'][ $slug ]['value_as_string'] = $item_metadata_array['value_as_string'];
} }
$item_array['metadata'][ $slug ]['multiple'] = $field->get_multiple(); $item_array['metadata'][ $slug ]['multiple'] = $field->get_multiple();
} }
@ -125,7 +128,7 @@ class REST_Items_Controller extends REST_Controller {
if(!empty($item)){ if(!empty($item)){
if(!isset($request['fetch_only'])) { if(!isset($request['fetch_only'])) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if ( $request['context'] === 'edit' ) { if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
@ -160,6 +163,12 @@ class REST_Items_Controller extends REST_Controller {
$item_arr = $this->add_metadata_to_item($item, $item_arr, $args); $item_arr = $this->add_metadata_to_item($item, $item_arr, $args);
} }
if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit();
}
$item_arr['url'] = get_permalink( $item_arr['id'] );
return $item_arr; return $item_arr;
} }
@ -298,7 +307,7 @@ class REST_Items_Controller extends REST_Controller {
try { try {
$this->prepare_item_for_database( [ $item, $collection_id ] ); $this->prepare_item_for_database( [ $item, $collection_id ] );
} catch (\Error $exception){ } catch (\Exception $exception){
return new \WP_REST_Response($exception->getMessage(), 400); return new \WP_REST_Response($exception->getMessage(), 400);
} }
@ -404,7 +413,7 @@ class REST_Items_Controller extends REST_Controller {
} }
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('Item with that ID not found', 'tainacan' ), 'error_message' => __('An item with this ID was not found', 'tainacan' ),
'item_id' => $item_id 'item_id' => $item_id
], 400); ], 400);
} }

View File

@ -77,7 +77,7 @@ class REST_Logs_Controller extends REST_Controller {
if(!empty($item)){ if(!empty($item)){
if(!isset($request['fetch_only'])) { if(!isset($request['fetch_only'])) {
$item_array = $item->__toArray(); $item_array = $item->_toArray();
unset($item_array['value']); unset($item_array['value']);
unset($item_array['old_value']); unset($item_array['old_value']);
@ -112,7 +112,7 @@ class REST_Logs_Controller extends REST_Controller {
if(!$collection){ if(!$collection){
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('A collection with that ID does not exist.', 'tainacan'), 'error_message' => __('A collection with this ID does not exist', 'tainacan'),
'collection_id' => $collection_id 'collection_id' => $collection_id
], 400); ], 400);
} }

View File

@ -95,7 +95,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
public function prepare_item_for_response( $item, $request ) { public function prepare_item_for_response( $item, $request ) {
if(!empty($item)) { if(!empty($item)) {
if(!isset($request['fetch_only'])) { if(!isset($request['fetch_only'])) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if ( $request['context'] === 'edit' ) { if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
@ -416,7 +416,7 @@ class REST_Taxonomies_Controller extends REST_Controller {
$query_params = array_merge($query_params, parent::get_collection_params('tax')); $query_params = array_merge($query_params, parent::get_collection_params('tax'));
$query_params['name'] = array( $query_params['name'] = array(
'description' => __('Limit result set to taxonomy with specific name.'), 'description' => __('Limits the result set to a taxonomy with a specific name.'),
'type' => 'string', 'type' => 'string',
); );

View File

@ -86,13 +86,7 @@ class REST_Terms_Controller extends REST_Controller {
$taxonomy = $to_prepare[1]; $taxonomy = $to_prepare[1];
foreach ($attributes as $attribute => $value){ foreach ($attributes as $attribute => $value){
$set_ = 'set_'. $attribute; $this->term->set($attribute, $value);
try {
$this->term->$set_( $value );
} catch (\Error $error){
// Do nothing
}
} }
$this->term->set_taxonomy($taxonomy); $this->term->set_taxonomy($taxonomy);
@ -226,7 +220,7 @@ class REST_Terms_Controller extends REST_Controller {
} }
return new \WP_REST_Response([ return new \WP_REST_Response([
'error_message' => __('Term or Taxonomy with that IDs not found', 'tainacan' ), 'error_message' => __('Term or Taxonomy with this ID was not found', 'tainacan' ),
'term_id' => $term_id, 'term_id' => $term_id,
'taxonomy_id' => $taxonomy_id 'taxonomy_id' => $taxonomy_id
], 400); ], 400);
@ -262,7 +256,7 @@ class REST_Terms_Controller extends REST_Controller {
public function prepare_item_for_response( $item, $request ) { public function prepare_item_for_response( $item, $request ) {
if(!empty($item)){ if(!empty($item)){
if(!isset($request['fetch_only'])) { if(!isset($request['fetch_only'])) {
$item_arr = $item->__toArray(); $item_arr = $item->_toArray();
if ( $request['context'] === 'edit' ) { if ( $request['context'] === 'edit' ) {
$item_arr['current_user_can_edit'] = $item->can_edit(); $item_arr['current_user_can_edit'] = $item->can_edit();
@ -400,7 +394,7 @@ class REST_Terms_Controller extends REST_Controller {
$query_params = array_merge($query_params, parent::get_collection_params('term')); $query_params = array_merge($query_params, parent::get_collection_params('term'));
$query_params['name'] = array( $query_params['name'] = array(
'description' => __('Limit result set to term with specific name.'), 'description' => __('Limits the result set to terms with a specific name'),
'type' => 'string', 'type' => 'string',
); );

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -18,14 +18,21 @@ class Embed {
/** /**
* Replace default WordPress embedders with HTML 5 tags instead of shortcodes * Replace default WordPress embedders with HTML 5 tags instead of shortcodes
*/ */
add_filter('wp_embed_handler_video', [&$this, 'filter_video_embed'], 10, 4); add_filter('wp_embed_handler_video', [$this, 'filter_video_embed'], 10, 4);
add_filter('wp_embed_handler_audio', [&$this, 'filter_audio_embed'], 10, 4); add_filter('wp_embed_handler_audio', [$this, 'filter_audio_embed'], 10, 4);
/**
* Add responsiveness to embeds
*/
add_filter('embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
/** /**
* ADD PDF Embed handler using PDF.js * ADD PDF Embed handler using PDF.js
* @var [type] * @var [type]
*/ */
wp_embed_register_handler( 'pdf', '#^https?://.+?\.(pdf)$#i', [&$this, 'pdf_embed_handler'] ); wp_embed_register_handler( 'pdf', '#^https?://.+?\.(pdf)$#i', [$this, 'pdf_embed_handler'] );
} }
@ -101,5 +108,24 @@ class Embed {
return null; return null;
} }
/**
* Responsiveness
*/
public function add_css() {
global $TAINACAN_BASE_URL;
wp_enqueue_style( 'tainacan-embeds', $TAINACAN_BASE_URL . '/assets/css/tainacan-embeds.css' );
}
/**
* Adds a responsive embed wrapper around oEmbed content
* @param string $html The oEmbed markup
* @param string $url The URL being embedded
* @param array $attr An array of attributes
* @return string Updated embed markup
*/
function responsive_embed($html, $url, $attr) {
return $html !== '' ? '<div class="tainacan-embed-container">'.$html.'</div>' : '';
}
} }

View File

@ -65,8 +65,8 @@ class Collection extends Entity {
return 'Hello, my name is ' . $this->get_name(); return 'Hello, my name is ' . $this->get_name();
} }
public function __toArray() { public function _toArray() {
$array_collection = parent::__toArray(); $array_collection = parent::_toArray();
$array_collection['thumbnail'] = $this->get_thumbnail(); $array_collection['thumbnail'] = $this->get_thumbnail();
$array_collection['header_image'] = $this->get_header_image(); $array_collection['header_image'] = $this->get_header_image();
@ -206,10 +206,16 @@ class Collection extends Entity {
} }
/** /**
* @return false|string * @return array
*/ */
function get_thumbnail() { function get_thumbnail() {
return get_the_post_thumbnail_url( $this->get_id(), 'full' ); return array(
'thumb' => get_the_post_thumbnail_url( $this->get_id(), 'thumbnail' ),
'full' => get_the_post_thumbnail_url( $this->get_id(), 'full' ),
'medium' => get_the_post_thumbnail_url( $this->get_id(), 'medium' ),
'medium_large' => get_the_post_thumbnail_url( $this->get_id(), 'medium_large' ),
'large' => get_the_post_thumbnail_url( $this->get_id(), 'large' ),
);
} }
/** /**

View File

@ -139,9 +139,13 @@ class Entity {
*/ */
public function get_date_i18n($date){ public function get_date_i18n($date){
$unix_time_stamp = strtotime($date); if($date) {
$unix_time_stamp = strtotime( $date );
return date_i18n(get_option('date_format'), $unix_time_stamp); return date_i18n( get_option( 'date_format' ), $unix_time_stamp );
}
return '';
} }
/** /**
@ -187,9 +191,22 @@ class Entity {
if ( method_exists($this, $method) ) { if ( method_exists($this, $method) ) {
return $this->$method($value); return $this->$method($value);
} }
return null;
} }
/**
* get the value property
*
*
* @param string $prop id of the property
* @return null|mixed Null on failure, the value that was set on success
*/
public function get($prop) {
$method = 'get_' . $prop;
if ( method_exists($this, $method) ) {
return $this->$method();
}
}
/** /**
* set the status of the entity * set the status of the entity
* @param string $value * @param string $value
@ -333,7 +350,7 @@ class Entity {
return true; return true;
} }
public function __toArray(){ public function _toArray(){
$repository = $this->get_repository(); $repository = $this->get_repository();
$map = $repository->get_map(); $map = $repository->get_map();
@ -345,8 +362,8 @@ class Entity {
return $attributes; return $attributes;
} }
public function __toJSON(){ public function _toJson(){
return json_encode($this->__toArray(), JSON_NUMERIC_CHECK); return json_encode($this->_toArray(), JSON_NUMERIC_CHECK);
} }
/** /**

View File

@ -414,7 +414,7 @@ class Field extends Entity {
// You cant have a multiple field inside a compound field (except category) // You cant have a multiple field inside a compound field (except category)
if ($this->get_parent() > 0) { if ($this->get_parent() > 0) {
if ( $this->is_multiple() && $this->get_field_type_object()->get_primitive_type() != 'term') { if ( $this->is_multiple() && $this->get_field_type_object()->get_primitive_type() != 'term') {
$this->add_error($this->get_id(), __('Compound fields do not support fields with multiple values (except categories)', 'tainacan')); $this->add_error($this->get_id(), __('Compound metadata do not support metadata with multiple values (except categories)', 'tainacan'));
return false; return false;
} }
} }
@ -423,7 +423,7 @@ class Field extends Entity {
if ( $this->get_parent() > 0 && $this->get_field_type_object()->get_primitive_type() == 'term' ) { if ( $this->get_parent() > 0 && $this->get_field_type_object()->get_primitive_type() == 'term' ) {
$parent_field = new \Tainacan\Entities\Field($this->get_parent()); $parent_field = new \Tainacan\Entities\Field($this->get_parent());
if ( $parent_field->is_multiple() ) { if ( $parent_field->is_multiple() ) {
$this->add_error($this->get_id(), __('Category fields can not be used inside Compound field with multiple values', 'tainacan')); $this->add_error($this->get_id(), __('Taxonomy metadata can not be used inside Compound metadata with multiple values', 'tainacan'));
return false; return false;
} }
} }
@ -438,7 +438,7 @@ class Field extends Entity {
, 'OBJECT'); , 'OBJECT');
if ( sizeof($children) > 0 ) { if ( sizeof($children) > 0 ) {
$this->add_error($this->get_id(), __('Category fields can not be used inside Compound field with multiple values', 'tainacan')); $this->add_error($this->get_id(), __('Taxonomy metadata can not be used inside Compound metadata with multiple values', 'tainacan'));
return false; return false;
} }
} }

View File

@ -37,8 +37,8 @@ class Filter extends Entity {
* @return array * @return array
* @throws \Exception * @throws \Exception
*/ */
public function __toArray(){ public function _toArray(){
$filter_array = parent::__toArray(); $filter_array = parent::_toArray();
$field_id = $filter_array['field']; $field_id = $filter_array['field'];
$filter_array['field'] = []; $filter_array['field'] = [];

View File

@ -111,7 +111,7 @@ class Item_Metadata_Entity extends Entity {
foreach ($value as $v) { foreach ($value as $v) {
if ( $v instanceof Term || $v instanceof ItemMetadataEntity ) { if ( $v instanceof Term || $v instanceof ItemMetadataEntity ) {
$return[] = $v->__toArray(); $return[] = $v->_toArray();
} else { } else {
$return[] = $v; $return[] = $v;
} }
@ -122,7 +122,7 @@ class Item_Metadata_Entity extends Entity {
$return = ''; $return = '';
if ( $value instanceof Term || $value instanceof ItemMetadataEntity ) { if ( $value instanceof Term || $value instanceof ItemMetadataEntity ) {
$return = $value->__toArray(); $return = $value->_toArray();
} else { } else {
$return = $value; $return = $value;
} }
@ -136,7 +136,7 @@ class Item_Metadata_Entity extends Entity {
* Convert the object to an Array * Convert the object to an Array
* @return array the representation of this object as an array * @return array the representation of this object as an array
*/ */
public function __toArray(){ public function _toArray(){
$as_array = []; $as_array = [];
$as_array['value'] = $this->get_value_as_array(); $as_array['value'] = $this->get_value_as_array();
@ -147,8 +147,8 @@ class Item_Metadata_Entity extends Entity {
$as_array['date_i18n'] = $this->get_date_i18n($this->get_value_as_string()); $as_array['date_i18n'] = $this->get_date_i18n($this->get_value_as_string());
} }
$as_array['item'] = $this->get_item()->__toArray(); $as_array['item'] = $this->get_item()->_toArray();
$as_array['field'] = $this->get_field()->__toArray(); $as_array['field'] = $this->get_field()->_toArray();
return $as_array; return $as_array;
} }

View File

@ -49,8 +49,8 @@ class Item extends Entity {
return 'Hello, my name is ' . $this->get_title(); return 'Hello, my name is ' . $this->get_title();
} }
public function __toArray() { public function _toArray() {
$array_item = parent::__toArray(); $array_item = parent::_toArray();
$array_item['thumbnail'] = $this->get_thumbnail(); $array_item['thumbnail'] = $this->get_thumbnail();
$array_item['_thumbnail_id'] = $this->get__thumbnail_id(); $array_item['_thumbnail_id'] = $this->get__thumbnail_id();
@ -126,10 +126,16 @@ class Item extends Entity {
} }
/** /**
* @return false|string * @return array
*/ */
function get_thumbnail() { function get_thumbnail() {
return get_the_post_thumbnail_url( $this->get_id(), 'full' ); return array(
'thumb' => get_the_post_thumbnail_url( $this->get_id(), 'thumbnail' ),
'full' => get_the_post_thumbnail_url( $this->get_id(), 'full' ),
'medium' => get_the_post_thumbnail_url( $this->get_id(), 'medium' ),
'medium_large' => get_the_post_thumbnail_url( $this->get_id(), 'medium_large' ),
'large' => get_the_post_thumbnail_url( $this->get_id(), 'large' ),
);
} }
/** /**
@ -417,7 +423,7 @@ class Item extends Entity {
} }
public function __toHtml() { public function _toHtml() {
$return = ''; $return = '';
$id = $this->get_id(); $id = $this->get_id();
@ -449,18 +455,40 @@ class Item extends Entity {
* it returns all metadata * it returns all metadata
* *
* @param int|string|Tainacan\Entities\Field $field Field object, ID or slug to retrieve only one field. empty returns all fields * @param int|string|Tainacan\Entities\Field $field Field object, ID or slug to retrieve only one field. empty returns all fields
* @param bool $hide_empty Wether to hide or not fields the item has no value to * @param array|string $args {
* Optional. Array or string of arguments.
*
* @type bool $hide_empty Wether to hide or not fields the item has no value to
* Default: true
* @type string $before_title String to be added before each metadata title
* Default '<h3>'
* @type string $after_title String to be added after each metadata title
* Default '</h3>'
* @type string $before_value String to be added before each metadata value
* Default '<p>'
* @type string $after_value String to be added after each metadata value
* Default '</p>'
* }
* *
* @return string The HTML output * @return string The HTML output
* @throws \Exception * @throws \Exception
*/ */
public function get_metadata_as_html($field = null, $hide_empty = true) { public function get_metadata_as_html($field = null, $args = array()) {
$Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance(); $Tainacan_Item_Metadata = \Tainacan\Repositories\Item_Metadata::get_instance();
$Tainacan_Fields = \Tainacan\Repositories\Fields::get_instance(); $Tainacan_Fields = \Tainacan\Repositories\Fields::get_instance();
$return = ''; $return = '';
$defaults = array(
'hide_empty' => true,
'before_title' => '<h3>',
'after_title' => '</h3>',
'before_value' => '<p>',
'after_value' => '</p>',
);
$args = wp_parse_args($args, $defaults);
if (!is_null($field)) { if (!is_null($field)) {
$field_object = null; $field_object = null;
@ -478,9 +506,9 @@ class Item extends Entity {
if ( $field_object instanceof \Tainacan\Entities\Field ) { if ( $field_object instanceof \Tainacan\Entities\Field ) {
$item_meta = new \Tainacan\Entities\Item_Metadata_Entity($this, $field_object); $item_meta = new \Tainacan\Entities\Item_Metadata_Entity($this, $field_object);
if ($item_meta->has_value() || !$hide_empty) { if ($item_meta->has_value() || !$args['hide_empty']) {
$return .= '<h3>' . $field_object->get_name() . '</h3>'; $return .= $args['before_title'] . $field_object->get_name() . $args['after_title'];
$return .= $item_meta->get_value_as_html(); $return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
} }
} }
@ -492,9 +520,9 @@ class Item extends Entity {
$fields = $this->get_fields(); $fields = $this->get_fields();
foreach ( $fields as $item_meta ) { foreach ( $fields as $item_meta ) {
if ($item_meta->has_value() || !$hide_empty) { if ($item_meta->has_value() || !$args['hide_empty']) {
$return .= '<h3>' . $item_meta->get_field()->get_name() . '</h3>'; $return .= $args['before_title'] . $item_meta->get_field()->get_name() . $args['after_title'];
$return .= $item_meta->get_value_as_html(); $return .= $args['before_value'] . $item_meta->get_value_as_html() . $args['after_value'];
} }
} }

View File

@ -44,8 +44,8 @@ class Log extends Entity {
/** /**
* @return array * @return array
*/ */
public function __toArray() { public function _toArray() {
$array_log = parent::__toArray(); $array_log = parent::_toArray();
$array_log['user_name'] = $this->get_user_name(); $array_log['user_name'] = $this->get_user_name();

View File

@ -55,8 +55,8 @@ class Term extends Entity {
return 'Hello, my name is '. $this->get_name(); return 'Hello, my name is '. $this->get_name();
} }
public function __toArray(){ public function _toArray(){
$term_array = parent::__toArray(); $term_array = parent::_toArray();
$term_id = $term_array['term_id']; $term_id = $term_array['term_id'];
@ -257,7 +257,7 @@ class Term extends Entity {
} }
public function __toHtml() { public function _toHtml() {
$return = ''; $return = '';
$id = $this->get_id(); $id = $this->get_id();

View File

@ -41,7 +41,7 @@ class Category extends Field_Type {
], ],
'allow_new_terms' => [ 'allow_new_terms' => [
'title' => __( 'Allow new terms', 'tainacan' ), 'title' => __( 'Allow new terms', 'tainacan' ),
'description' => __( 'Allow create new terms', 'tainacan' ), 'description' => __( 'Allows to create new terms', 'tainacan' ),
] ]
]; ];
} }
@ -67,7 +67,7 @@ class Category extends Field_Type {
return true; return true;
if (empty($this->get_option('taxonomy_id'))) if (empty($this->get_option('taxonomy_id')))
return ['taxonomy_id' => __('Please select a category', 'tainacan')]; return ['taxonomy_id' => __('Please select a taxonomy', 'tainacan')];
$Tainacan_Fields = Fields::get_instance(); $Tainacan_Fields = Fields::get_instance();
@ -85,7 +85,7 @@ class Category extends Field_Type {
foreach ($category_fields as $field_id => $category_field) { foreach ($category_fields as $field_id => $category_field) {
if ( is_array( $category_field ) && key($category_field) != $field->get_id() if ( is_array( $category_field ) && key($category_field) != $field->get_id()
&& in_array($this->get_option('taxonomy_id'), $category_field)) { && in_array($this->get_option('taxonomy_id'), $category_field)) {
return ['taxonomy_id' => __('You can not have 2 Category Fields using the same category in a collection', 'tainacan')]; return ['taxonomy_id' => __('You can not have 2 taxonomy metadata using the same taxonomy in a collection.', 'tainacan')];
} }
} }
} }
@ -154,7 +154,7 @@ class Category extends Field_Type {
foreach ( $value as $term ) { foreach ( $value as $term ) {
if ( $term instanceof \Tainacan\Entities\Term ) { if ( $term instanceof \Tainacan\Entities\Term ) {
$return .= $term->__toHtml(); $return .= $term->_toHtml();
} }
$count ++; $count ++;
@ -168,7 +168,7 @@ class Category extends Field_Type {
} else { } else {
if ( $value instanceof \Tainacan\Entities\Term ) { if ( $value instanceof \Tainacan\Entities\Term ) {
$return .= $value->__toHtml(); $return .= $value->_toHtml();
} }
} }

View File

@ -5,11 +5,12 @@
class="control is-inline"> class="control is-inline">
<input <input
class="input" class="input"
type="date" type="text"
v-mask="dateMask" v-mask="dateMask"
v-model="dateValue" v-model="dateValue"
@blur="onBlur" @blur="onBlur"
@input="onInput"> @input="onInput"
:placeholder="dateFormat">
<!--<b-collapse--> <!--<b-collapse-->
<!--position="is-bottom-right">--> <!--position="is-bottom-right">-->
<!--<b-icon--> <!--<b-icon-->
@ -35,19 +36,27 @@
<script> <script>
import { dateInter } from "../../../admin/js/mixins"; import { dateInter } from "../../../admin/js/mixins";
import moment from 'moment';
export default { export default {
mixins: [ dateInter ], mixins: [ dateInter ],
created(){ created(){
let locale = navigator.language;
moment.locale(locale);
let localeData = moment.localeData();
this.dateFormat = localeData.longDateFormat('L');
if( this.value ){ if( this.value ){
this.dateValue = new Date(this.value.replace(/-/g, '/')).toLocaleDateString(); this.dateValue = this.parseDateToNavigatorLanguage(new Date(this.value.replace(/-/g, '/')));
} }
}, },
data() { data() {
return { return {
dateValue: '', dateValue: '',
datePlaceHolder: new Date().toLocaleDateString(), dateMask: this.getDateLocaleMask(),
dateMask: this.getDateLocaleFormat(), dateFormat: ''
} }
}, },
props: { props: {
@ -65,13 +74,16 @@
let dateISO = ''; let dateISO = '';
if($event && $event instanceof Date) { if($event && $event instanceof Date) {
dateISO = this.dateValue.toISOString().split('T')[0] dateISO = moment(this.dateValue, this.dateFormat).toISOString().split('T')[0];
} else if($event.target.value && $event.target.value.length === this.dateMask.length) { } else if($event.target.value && $event.target.value.length === this.dateMask.length) {
dateISO = new Date($event.target.value).toISOString().split('T')[0]; dateISO = moment($event.target.value, this.dateFormat).toISOString().split('T')[0];
} }
this.$emit('input', dateISO); this.$emit('input', dateISO);
this.$emit('blur'); this.$emit('blur');
},
parseDateToNavigatorLanguage(date){
return moment(date, moment.ISO_8601).format(this.dateFormat);
} }
} }
} }

View File

@ -160,7 +160,7 @@ abstract class Field_Type {
} }
public function __toArray(){ public function _toArray(){
$attributes = []; $attributes = [];
$attributes['errors'] = $this->get_errors(); $attributes['errors'] = $this->get_errors();

View File

@ -27,12 +27,12 @@ class Relationship extends Field_Type {
'description' => __( 'Select the collection to fetch items', 'tainacan' ), 'description' => __( 'Select the collection to fetch items', 'tainacan' ),
], ],
'search' => [ 'search' => [
'title' => __( 'Fields for search', 'tainacan' ), 'title' => __( 'Metadata for search', 'tainacan' ),
'description' => __( 'Select the fields to help the search', 'tainacan' ), 'description' => __( 'Select the metadata to help the search', 'tainacan' ),
], ],
'repeated' => [ 'repeated' => [
'title' =>__( 'Allow repeated items', 'tainacan' ), 'title' =>__( 'Allow repeated items', 'tainacan' ),
'description' => __( 'Allow different items with the same item selected', 'tainacan' ), 'description' => __( 'Allows different items to be related to the same item selected in another collection.', 'tainacan' ),
] ]
]; ];
} }
@ -57,11 +57,11 @@ class Relationship extends Field_Type {
if (!empty($this->get_option('collection_id')) && !is_numeric($this->get_option('collection_id'))) { if (!empty($this->get_option('collection_id')) && !is_numeric($this->get_option('collection_id'))) {
return [ return [
'collection_id' => __('Collection ID invalid','tainacan') 'collection_id' => __('Invalid collection ID','tainacan')
]; ];
} else if( empty($this->get_option('collection_id'))) { } else if( empty($this->get_option('collection_id'))) {
return [ return [
'collection_id' => __('Collection related is required','tainacan') 'collection_id' => __('The related collection is required','tainacan')
]; ];
} }
return true; return true;
@ -90,7 +90,7 @@ class Relationship extends Field_Type {
$item = new \Tainacan\Entities\Item($item_id); $item = new \Tainacan\Entities\Item($item_id);
if ( $item instanceof \Tainacan\Entities\Item ) { if ( $item instanceof \Tainacan\Entities\Item ) {
$return .= $item->__toHtml(); $return .= $item->_toHtml();
} }
$count ++; $count ++;
@ -112,7 +112,7 @@ class Relationship extends Field_Type {
$item = new \Tainacan\Entities\Item($value); $item = new \Tainacan\Entities\Item($value);
if ( $item instanceof \Tainacan\Entities\Item ) { if ( $item instanceof \Tainacan\Entities\Item ) {
$return .= $item->__toHtml(); $return .= $item->_toHtml();
} }
} catch (Exception $e) { } catch (Exception $e) {

View File

@ -24,7 +24,7 @@ class Selectbox extends Field_Type {
return [ return [
'options' => [ 'options' => [
'title' => __( 'Options', 'tainacan' ), 'title' => __( 'Options', 'tainacan' ),
'description' => __( 'Create the options for the select, hit enter to add new one', 'tainacan' ), 'description' => __( 'Creates options for what is selected. Hit <enter> to add a new one.', 'tainacan' ),
] ]
]; ];
} }
@ -53,10 +53,10 @@ class Selectbox extends Field_Type {
if ( empty($this->get_option('options')) ) { if ( empty($this->get_option('options')) ) {
return [ return [
'options' => __('Options is required','tainacan') 'options' => __('Required options','tainacan')
]; ];
} }
return true; return true;
} }
} }

View File

@ -50,7 +50,7 @@ abstract class Filter_Type {
/** /**
* @return array * @return array
*/ */
public function __toArray(){ public function _toArray(){
$attributes = []; $attributes = [];
$attributes['className'] = get_class($this); $attributes['className'] = get_class($this);
@ -89,7 +89,7 @@ abstract class Filter_Type {
if(in_array( $class->get_primitive_type(), $this->supported_types )){ if(in_array( $class->get_primitive_type(), $this->supported_types )){
return true; return true;
} else { } else {
return ['unsupported_type' => __('The field primitive type is not supported by this filter', 'tainacan')]; return ['unsupported_type' => __('The metadata primitive type is not supported by this filter', 'tainacan')];
} }
} }

View File

@ -36,7 +36,7 @@
props: { props: {
filter: Object, filter: Object,
query: Object, query: Object,
open: false, open: true,
}, },
data(){ data(){
return { return {

View File

@ -72,7 +72,7 @@ class Collections extends Repository {
'map' => 'menu_order', 'map' => 'menu_order',
'title' => __( 'Order', 'tainacan' ), 'title' => __( 'Order', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'Collection order. Field used if collections are manually ordered.', 'tainacan' ), 'description' => __( 'Collection order. This metadata is used if collections are manually ordered.', 'tainacan' ),
//'validation' => v::stringType(), //'validation' => v::stringType(),
], ],
'parent' => [ 'parent' => [
@ -99,7 +99,7 @@ class Collections extends Repository {
], ],
'default_orderby' => [ 'default_orderby' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Default Order field', 'tainacan' ), 'title' => __( 'Default Order metadata', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'Default property items in this collections will be ordered by', 'tainacan' ), 'description' => __( 'Default property items in this collections will be ordered by', 'tainacan' ),
'default' => 'name', 'default' => 'name',
@ -115,11 +115,11 @@ class Collections extends Repository {
], ],
'default_displayed_fields' => [ 'default_displayed_fields' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Default Displayed Fields', 'tainacan' ), 'title' => __( 'Default Displayed Metadata', 'tainacan' ),
'type' => 'array/object/string', 'type' => 'array/object/string',
'items' => [ 'type' => 'array/string/integer/object' ], 'items' => [ 'type' => 'array/string/integer/object' ],
'default' => [], 'default' => [],
'description' => __( 'List of collections property that will be displayed in the table view.', 'tainacan' ), 'description' => __( 'List of collection properties that will be displayed in the table view', 'tainacan' ),
//'validation' => v::stringType(), //'validation' => v::stringType(),
], ],
'default_view_mode' => [ 'default_view_mode' => [
@ -131,10 +131,10 @@ class Collections extends Repository {
], ],
'fields_order' => [ 'fields_order' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Ordination fields', 'tainacan' ), 'title' => __( 'Ordination metadata', 'tainacan' ),
'type' => 'array/object/string', 'type' => 'array/object/string',
'items' => [ 'type' => 'array/string/integer/object' ], 'items' => [ 'type' => 'array/string/integer/object' ],
'description' => __( 'Collection fields ordination', 'tainacan' ), 'description' => __( 'Collection metadata ordination', 'tainacan' ),
//'validation' => v::stringType(), //'validation' => v::stringType(),
], ],
'filters_order' => [ 'filters_order' => [

View File

@ -45,7 +45,7 @@ class Fields extends Repository {
'map' => 'post_title', 'map' => 'post_title',
'title' => __( 'Name', 'tainacan' ), 'title' => __( 'Name', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'Name of the field', 'tainacan' ), 'description' => __( 'Name of the metadata', 'tainacan' ),
'on_error' => __( 'The name should be a text value and not empty', 'tainacan' ), 'on_error' => __( 'The name should be a text value and not empty', 'tainacan' ),
'validation' => v::stringType()->notEmpty(), 'validation' => v::stringType()->notEmpty(),
], ],
@ -53,14 +53,14 @@ class Fields extends Repository {
'map' => 'post_name', 'map' => 'post_name',
'title' => __( 'Slug', 'tainacan' ), 'title' => __( 'Slug', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'A unique and santized string representation of the field', 'tainacan' ), 'description' => __( 'A unique and santized string representation of the metadata', 'tainacan' ),
//'validation' => v::stringType(), //'validation' => v::stringType(),
], ],
'order' => [ 'order' => [
'map' => 'menu_order', 'map' => 'menu_order',
'title' => __( 'Order', 'tainacan' ), 'title' => __( 'Order', 'tainacan' ),
'type' => 'string/integer', 'type' => 'string/integer',
'description' => __( 'Metadata order. This metadata will be used if collections were manually ordered', 'tainacan' ), 'description' => __( 'Metadata order. This metadata will be used if collections were manually ordered.', 'tainacan' ),
'on_error' => __( 'The menu order should be a numeric value', 'tainacan' ), 'on_error' => __( 'The menu order should be a numeric value', 'tainacan' ),
//'validation' => v::numeric(), //'validation' => v::numeric(),
], ],
@ -68,7 +68,7 @@ class Fields extends Repository {
'map' => 'post_parent', 'map' => 'post_parent',
'title' => __( 'Parent', 'tainacan' ), 'title' => __( 'Parent', 'tainacan' ),
'type' => 'integer', 'type' => 'integer',
'description' => __( 'Parent field', 'tainacan' ), 'description' => __( 'Parent metadata', 'tainacan' ),
'default' => 0 'default' => 0
//'on_error' => __('The Parent should be numeric value', 'tainacan'), //'on_error' => __('The Parent should be numeric value', 'tainacan'),
//'validation' => v::numeric(), //'validation' => v::numeric(),
@ -77,7 +77,7 @@ class Fields extends Repository {
'map' => 'post_content', 'map' => 'post_content',
'title' => __( 'Description', 'tainacan' ), 'title' => __( 'Description', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The field description', 'tainacan' ), 'description' => __( 'The metadata description', 'tainacan' ),
'default' => '', 'default' => '',
//'on_error' => __('The description should be a text value', 'tainacan'), //'on_error' => __('The description should be a text value', 'tainacan'),
//'validation' => v::stringType()->notEmpty(), //'validation' => v::stringType()->notEmpty(),
@ -86,16 +86,16 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Type', 'tainacan' ), 'title' => __( 'Type', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The field type', 'tainacan' ), 'description' => __( 'The metadata type', 'tainacan' ),
'on_error' => __( 'Field type is empty', 'tainacan' ), 'on_error' => __( 'Metadata type is empty', 'tainacan' ),
'validation' => v::stringType()->notEmpty(), 'validation' => v::stringType()->notEmpty(),
], ],
'required' => [ 'required' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Required', 'tainacan' ), 'title' => __( 'Required', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The field is required', 'tainacan' ), 'description' => __( 'The metadata is required', 'tainacan' ),
'on_error' => __( 'Field required field is invalid', 'tainacan' ), 'on_error' => __( 'The metadata content is invalid', 'tainacan' ),
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no 'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
'default' => 'no' 'default' => 'no'
], ],
@ -103,7 +103,7 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Collection key', 'tainacan' ), 'title' => __( 'Collection key', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'Field value should not be repeated', 'tainacan' ), 'description' => __( 'Metadata value should not be repeated', 'tainacan' ),
'on_error' => __( 'Collection key is invalid', 'tainacan' ), 'on_error' => __( 'Collection key is invalid', 'tainacan' ),
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no 'validation' => v::stringType()->in( [ 'yes', 'no' ] ), // yes or no
'default' => 'no' 'default' => 'no'
@ -112,8 +112,8 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Multiple', 'tainacan' ), 'title' => __( 'Multiple', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'Allow multiple fields for the field', 'tainacan' ), 'description' => __( 'Allow multiple values for the metadata', 'tainacan' ),
'on_error' => __( 'Multiple fields is invalid', 'tainacan' ), 'on_error' => __( 'Invalid multiple metadata', 'tainacan' ),
'validation' => v::stringType()->in( [ 'yes', 'no' ] ), 'validation' => v::stringType()->in( [ 'yes', 'no' ] ),
// yes or no. It cant be multiple if its collection_key // yes or no. It cant be multiple if its collection_key
'default' => 'no' 'default' => 'no'
@ -122,8 +122,8 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Cardinality', 'tainacan' ), 'title' => __( 'Cardinality', 'tainacan' ),
'type' => 'string/number', 'type' => 'string/number',
'description' => __( 'Number of multiples possible fields', 'tainacan' ), 'description' => __( 'Number of multiples possible metadata', 'tainacan' ),
'on_error' => __( 'The number of fields not allowed', 'tainacan' ), 'on_error' => __( 'This number of multiples metadata is not allowed', 'tainacan' ),
'validation' => v::numeric()->positive(), 'validation' => v::numeric()->positive(),
'default' => 1 'default' => 1
], ],
@ -131,7 +131,7 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Mask', 'tainacan' ), 'title' => __( 'Mask', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The mask to be used in the field', 'tainacan' ), 'description' => __( 'The mask to be used in the metadata', 'tainacan' ),
//'on_error' => __('Mask is invalid', 'tainacan'), //'on_error' => __('Mask is invalid', 'tainacan'),
//'validation' => '' //'validation' => ''
], ],
@ -139,14 +139,14 @@ class Fields extends Repository {
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Default value', 'tainacan' ), 'title' => __( 'Default value', 'tainacan' ),
'type' => 'string', 'type' => 'string',
'description' => __( 'The value default fot the field', 'tainacan' ), 'description' => __( 'The default value for the metadata', 'tainacan' ),
], ],
'field_type_options' => [ // not showed in form 'field_type_options' => [ // not showed in form
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Field Type options', 'tainacan' ), 'title' => __( 'Metadata type options', 'tainacan' ),
'type' => 'array/object/string', 'type' => 'array/object/string',
'items' => [ 'type' => 'array/string/integer/object' ], 'items' => [ 'type' => 'array/string/integer/object' ],
'description' => __( 'Options specific for field type', 'tainacan' ), 'description' => __( 'Specific options for metadata type', 'tainacan' ),
// 'validation' => '' // 'validation' => ''
], ],
'collection_id' => [ // not showed in form 'collection_id' => [ // not showed in form
@ -158,19 +158,19 @@ class Fields extends Repository {
], ],
'accept_suggestion' => [ 'accept_suggestion' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'Field Value Accepts Suggestions', 'tainacan' ), 'title' => __( 'Metadata Value Accepts Suggestions', 'tainacan' ),
'type' => 'bool', 'type' => 'bool',
'description' => __( 'Allow the community suggest a different values for that field', 'tainacan' ), 'description' => __( 'Allow community to suggest different values for the metadata', 'tainacan' ),
'default' => false, 'default' => false,
'validation' => v::boolType() 'validation' => v::boolType()
], ],
'exposer_mapping' => [ 'exposer_mapping' => [
'map' => 'meta', 'map' => 'meta',
'title' => __( 'exposer_mapping', 'tainacan' ), 'title' => __( 'Relationship metadata mapping', 'tainacan' ),
'type' => 'array/object/string', 'type' => 'array/object/string',
'items' => [ 'type' => 'array/string/integer/object' ], 'items' => [ 'type' => 'array/string/integer/object' ],
'description' => __( 'The field mapping options', 'tainacan' ), 'description' => __( 'The metadata mapping options. Metadata can be configured to match another type of data distribution.', 'tainacan' ),
'on_error' => __( 'Invalid Field Mapping', 'tainacan' ), 'on_error' => __( 'Invalid Metadata Mapping', 'tainacan' ),
//'validation' => v::arrayType(), //'validation' => v::arrayType(),
'default' => [] 'default' => []
], ],
@ -179,7 +179,7 @@ class Fields extends Repository {
'title' => __( 'Display', 'tainacan' ), 'title' => __( 'Display', 'tainacan' ),
'type' => __( 'string' ), 'type' => __( 'string' ),
'validation' => v::stringType()->in( [ 'yes', 'no', 'never' ] ), 'validation' => v::stringType()->in( [ 'yes', 'no', 'never' ] ),
'description' => __( 'Display by default on listing or not display or never display.', 'tainacan' ), 'description' => __( 'Display by default on listing or do not display or never display.', 'tainacan' ),
'default' => 'yes' 'default' => 'yes'
] ]
] ); ] );
@ -191,7 +191,7 @@ class Fields extends Repository {
*/ */
public function get_cpt_labels() { public function get_cpt_labels() {
return array( return array(
'name' => __('Metadatas', 'tainacan'), 'name' => __('Metadata', 'tainacan'),
'singular_name' => __('Metadata', 'tainacan'), 'singular_name' => __('Metadata', 'tainacan'),
'add_new' => __('Add new', 'tainacan'), 'add_new' => __('Add new', 'tainacan'),
'add_new_item' => __('Add new Metadata', 'tainacan'), 'add_new_item' => __('Add new Metadata', 'tainacan'),
@ -202,7 +202,7 @@ class Fields extends Repository {
'not_found' => __('No Metadata found ', 'tainacan'), 'not_found' => __('No Metadata found ', 'tainacan'),
'not_found_in_trash' => __('No Metadata found in trash', 'tainacan'), 'not_found_in_trash' => __('No Metadata found in trash', 'tainacan'),
'parent_item_colon' => __('Parent Metadata:', 'tainacan'), 'parent_item_colon' => __('Parent Metadata:', 'tainacan'),
'menu_name' => __('Metadatas', 'tainacan') 'menu_name' => __('Metadata', 'tainacan')
); );
} }

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