Add hourglass
1
hourglass/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules/
|
||||
15
hourglass/.meteor/.finished-upgraders
Normal file
@ -0,0 +1,15 @@
|
||||
# This file contains information which helps Meteor properly upgrade your
|
||||
# app when you run 'meteor update'. You should check it into version control
|
||||
# with your project.
|
||||
|
||||
notices-for-0.9.0
|
||||
notices-for-0.9.1
|
||||
0.9.4-platform-file
|
||||
notices-for-facebook-graph-api-2
|
||||
1.2.0-standard-minifiers-package
|
||||
1.2.0-meteor-platform-split
|
||||
1.2.0-cordova-changes
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
1.4.0-remove-old-dev-bundle-link
|
||||
1.4.1-add-shell-server-package
|
||||
1
hourglass/.meteor/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
local
|
||||
7
hourglass/.meteor/.id
Normal file
@ -0,0 +1,7 @@
|
||||
# This file contains a token that is unique to your project.
|
||||
# Check it into your repository along with the rest of this directory.
|
||||
# It can be used for purposes such as:
|
||||
# - ensuring you don't accidentally deploy one app on top of another
|
||||
# - providing package authors with aggregated statistics
|
||||
|
||||
gqrxcygykwad5nac7m
|
||||
49
hourglass/.meteor/packages
Normal file
@ -0,0 +1,49 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
# Check this file (and the other files in this directory) into your repository.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-base@1.0.4 # Packages every Meteor app needs to have
|
||||
mobile-experience@1.0.4 # Packages for a great mobile UX
|
||||
mongo@1.1.14 # The database Meteor supports right now
|
||||
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
|
||||
reactive-var@1.0.11 # Reactive variable for tracker
|
||||
jquery@1.11.10 # Helpful client-side library
|
||||
tracker@1.1.1 # Meteor's client-side reactive programming library
|
||||
|
||||
standard-minifier-js@1.2.1 # JS minifier run for production mode
|
||||
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript@0.5.9 # Enable ECMAScript2015+ syntax in app code
|
||||
|
||||
fortawesome:fontawesome
|
||||
session@1.1.7
|
||||
proyk:meteor-cookies
|
||||
aldeed:simple-schema
|
||||
accounts-google@1.0.11
|
||||
accounts-ui@1.1.9
|
||||
iron:router
|
||||
ongoworks:security
|
||||
mizzao:autocomplete
|
||||
alanning:roles
|
||||
rzymek:fullcalendar
|
||||
momentjs:moment@=2.15.1
|
||||
shell-server@0.2.1
|
||||
http@1.2.10
|
||||
underscore@1.0.10
|
||||
ahref:dragula
|
||||
pfafman:filesaver
|
||||
natestrauser:select2
|
||||
juliancwirko:s-alert
|
||||
juliancwirko:s-alert-stackslide
|
||||
aldeed:collection2
|
||||
dburles:collection-helpers
|
||||
yogiben:admin-edit
|
||||
mfactory:admin-lte
|
||||
standard-minifier-css@1.3.2
|
||||
rochal:slimscroll
|
||||
mrt:jquery-ui
|
||||
rajit:bootstrap3-datepicker
|
||||
hammer:hammer@=2.0.4_1
|
||||
velocityjs:velocityjs
|
||||
mystor:device-detection
|
||||
2
hourglass/.meteor/platforms
Normal file
@ -0,0 +1,2 @@
|
||||
browser
|
||||
server
|
||||
1
hourglass/.meteor/release
Normal file
@ -0,0 +1 @@
|
||||
METEOR@1.4.2
|
||||
133
hourglass/.meteor/versions
Normal file
@ -0,0 +1,133 @@
|
||||
accounts-base@1.2.14
|
||||
accounts-google@1.0.11
|
||||
accounts-oauth@1.1.14
|
||||
accounts-ui@1.1.9
|
||||
accounts-ui-unstyled@1.1.13
|
||||
ahref:dragula@3.5.4
|
||||
alanning:roles@1.2.15
|
||||
aldeed:autoform@5.8.1
|
||||
aldeed:collection2@2.10.0
|
||||
aldeed:collection2-core@1.2.0
|
||||
aldeed:schema-deny@1.1.0
|
||||
aldeed:schema-index@1.1.1
|
||||
aldeed:simple-schema@1.5.3
|
||||
aldeed:tabular@1.6.1
|
||||
aldeed:template-extension@4.0.0
|
||||
allow-deny@1.0.5
|
||||
autoupdate@1.3.12
|
||||
babel-compiler@6.13.0
|
||||
babel-runtime@0.1.13
|
||||
base64@1.0.10
|
||||
binary-heap@1.0.10
|
||||
blaze@2.2.0
|
||||
blaze-html-templates@1.0.5
|
||||
blaze-tools@1.0.10
|
||||
boilerplate-generator@1.0.11
|
||||
caching-compiler@1.1.8
|
||||
caching-html-compiler@1.0.7
|
||||
callback-hook@1.0.10
|
||||
check@1.2.4
|
||||
coffeescript@1.11.1_2
|
||||
cosmos:browserify@0.10.0
|
||||
dandv:caret-position@2.1.1
|
||||
dburles:collection-helpers@1.1.0
|
||||
ddp@1.2.5
|
||||
ddp-client@1.3.2
|
||||
ddp-common@1.2.7
|
||||
ddp-rate-limiter@1.0.6
|
||||
ddp-server@1.3.11
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.7
|
||||
ecmascript@0.5.9
|
||||
ecmascript-runtime@0.3.15
|
||||
ejson@1.0.13
|
||||
email@1.1.18
|
||||
es5-shim@4.6.15
|
||||
fastclick@1.0.13
|
||||
fortawesome:fontawesome@4.7.0
|
||||
geojson-utils@1.0.10
|
||||
google@1.1.15
|
||||
hammer:hammer@2.0.4_1
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.11
|
||||
htmljs@1.0.11
|
||||
http@1.2.10
|
||||
id-map@1.0.9
|
||||
iron:controller@1.0.12
|
||||
iron:core@1.0.11
|
||||
iron:dynamic-template@1.0.12
|
||||
iron:layout@1.0.12
|
||||
iron:location@1.0.11
|
||||
iron:middleware-stack@1.1.0
|
||||
iron:router@1.0.13
|
||||
iron:url@1.0.11
|
||||
jquery@1.11.10
|
||||
juliancwirko:s-alert@3.2.0
|
||||
juliancwirko:s-alert-stackslide@3.1.3
|
||||
launch-screen@1.1.0
|
||||
less@2.7.6
|
||||
livedata@1.0.18
|
||||
localstorage@1.0.12
|
||||
logging@1.1.16
|
||||
mdg:validation-error@0.5.1
|
||||
meteor@1.6.0
|
||||
meteor-base@1.0.4
|
||||
meteorhacks:meteorx@1.4.1
|
||||
meteorhacks:unblock@1.1.0
|
||||
mfactory:admin-lte@0.0.2
|
||||
minifier-css@1.2.15
|
||||
minifier-js@1.2.15
|
||||
minimongo@1.0.18
|
||||
mizzao:autocomplete@0.5.1
|
||||
mobile-experience@1.0.4
|
||||
mobile-status-bar@1.0.13
|
||||
modules@0.7.7
|
||||
modules-runtime@0.7.7
|
||||
momentjs:moment@2.15.1
|
||||
mongo@1.1.14
|
||||
mongo-id@1.0.6
|
||||
mrt:jquery-ui@1.9.2
|
||||
mystor:device-detection@0.2.0
|
||||
natestrauser:select2@4.0.3
|
||||
npm-mongo@2.2.11_2
|
||||
oauth@1.1.12
|
||||
oauth2@1.1.11
|
||||
observe-sequence@1.0.14
|
||||
ongoworks:security@2.0.1
|
||||
ordered-dict@1.0.9
|
||||
pfafman:filesaver@1.3.2
|
||||
promise@0.8.8
|
||||
proyk:meteor-cookies@0.0.1
|
||||
raix:eventemitter@0.1.3
|
||||
raix:handlebar-helpers@0.2.5
|
||||
rajit:bootstrap3-datepicker@1.5.1
|
||||
random@1.0.10
|
||||
rate-limit@1.0.6
|
||||
reactive-dict@1.1.8
|
||||
reactive-var@1.0.11
|
||||
reload@1.1.11
|
||||
retry@1.0.9
|
||||
reywood:publish-composite@1.4.2
|
||||
rochal:slimscroll@1.3.3
|
||||
routepolicy@1.0.12
|
||||
rzymek:fullcalendar@2.7.2
|
||||
service-configuration@1.0.11
|
||||
session@1.1.7
|
||||
shell-server@0.2.1
|
||||
spacebars@1.0.13
|
||||
spacebars-compiler@1.0.13
|
||||
standard-minifier-css@1.3.2
|
||||
standard-minifier-js@1.2.1
|
||||
templating@1.2.15
|
||||
templating-compiler@1.2.15
|
||||
templating-runtime@1.2.15
|
||||
templating-tools@1.0.5
|
||||
tracker@1.1.1
|
||||
ui@1.0.12
|
||||
underscore@1.0.10
|
||||
url@1.0.11
|
||||
velocityjs:velocityjs@1.2.1
|
||||
webapp@1.3.12
|
||||
webapp-hashing@1.0.9
|
||||
yogiben:admin-edit@1.2.8
|
||||
zimme:active-route@2.3.2
|
||||
674
hourglass/LICENSE
Normal 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:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
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>.
|
||||
74
hourglass/README.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Hourglass
|
||||
Everything in one place. We'll handle the organization, you handle the work.
|
||||
|
||||
Hourglass is a planner web app specialized for schools and students. It is an student run planner,
|
||||
where people in the same class can view all the related work.
|
||||
## Usage
|
||||
How to use Hourglass:
|
||||
If you find any bugs or have an idea to make this better, you can press the question mark on the sidebar.
|
||||
### Main Page
|
||||
After logging in with a Google account and setting up your profile, you will redirect to this page. Here, you can view work from subscribed classes. The left sidebar has three modes: Main, Settings, and Feedback.
|
||||
### Main
|
||||
This will allow changing modes: class mode, and calendar mode. It also allows filters for all of the subscribed classes. Hovering over classes will highlight their respective works, and clicking on a class will filter them, only displaying those filtered. You can filter more than one class at a time or filter by the type of work.
|
||||
##### Calendar Mode
|
||||
Calendar mode organizes work by due date rather than by class. Pressing on a date will open the left sidebar, allowing you to choose a class in which you want to create the work.
|
||||
##### Class Mode
|
||||
Class mode allows you to organize work by the class it belongs to. You can drag classes to reorder them.
|
||||
### Settings
|
||||
This will allow changing preferences, including: Theme, Default Mode, Hide Homework, Hide Done, and Hide Reported, which are fairly self-explanatory. Additionally, this allows managing classes, where you can manage, join, and create classes.
|
||||
##### Manage Classes
|
||||
Here, you can see details of the class. If you are an admin of the class, clicking on it will allow you to manage details about the class. Otherwise, you can leave the class by clicking the X.
|
||||
##### Join Classes
|
||||
Join a public class by searching for and then clicking on the class you want to join. Joining a private class requires a code provided by the class administrator, which you enter in the field provided after clicking the "Join Private Class" button.
|
||||
##### Create Classes
|
||||
After filling out class details, class creators must wait for the class to be approved by administrators. Public classes can be viewed and joined by all, while private classes are hidden from others and require a code to join.
|
||||
### Feedback
|
||||
As mentioned earlier, send us feedback here, to know what we should improve on, or things that you want to add.
|
||||
##### Work
|
||||
Every piece of work has a confirmed to reported ratio. This is the ratio of the number of people who confirm the validity of the work to the number of people who believe that this is a false report. The creator of a work can edit fields after creation by clicking on details needed to be changed. Lastly, by marking a work as done, it is hidden from view. To disable this, go to preferences.
|
||||
##### Filters
|
||||
In the left sidebar, you find options for filtering. These include filtering by class or type of assignment.
|
||||
|
||||
## Changelog
|
||||
### 0.2.3
|
||||
- Mobile sidebar closes on tap from the side
|
||||
- Mobile sign-up bug fixed
|
||||
- Calendar date bug fixed
|
||||
- Fixed visual issues
|
||||
- Class code bug fixes
|
||||
- Updating system fixed
|
||||
|
||||
### 0.2.2
|
||||
- Fixed visual issues in mobile
|
||||
- Drag scrolling for classes mode on desktop version
|
||||
- Small name changes
|
||||
- Changed maximum characters of description to 300
|
||||
|
||||
### 0.2.1
|
||||
- Mobile support added
|
||||
- Fixed visual bugs
|
||||
|
||||
### 0.2.0
|
||||
- Large UI redesign
|
||||
- Scrollbars now functional
|
||||
- Redesigned logo
|
||||
- Fixed visual bugs
|
||||
- New profile creation page
|
||||
|
||||
### 0.1.3
|
||||
- Changed some icons
|
||||
- Fixed some resolution issues
|
||||
- Fixed class approval (you can now join other people’s classes)
|
||||
- Change export format to iCal
|
||||
- Admin/Server fixes
|
||||
- Minor bug fixes
|
||||
|
||||
### 0.1.2
|
||||
- First beta version
|
||||
- Fixed resolution / display issues
|
||||
- Bug fixes
|
||||
|
||||
### 0.1.1
|
||||
- Added dynamic resizing, zooming and scaling support for CSS.
|
||||
- Fixed reactive updating on work.
|
||||
- Added personal work.
|
||||
135
hourglass/client/admin/admin.css
Normal file
@ -0,0 +1,135 @@
|
||||
.content-wrapper {
|
||||
background-color: #232427 !important;
|
||||
}
|
||||
|
||||
.content-wrapper h4 {
|
||||
color: #FEFEFE;
|
||||
}
|
||||
|
||||
.col-lg-3 {
|
||||
-webkit-filter: drop-shadow(2px 2px 2px #CCC);
|
||||
filter: drop-shadow(2px 2px 2px #666);
|
||||
}
|
||||
|
||||
.main-header .logo {
|
||||
background-color: #222d32;
|
||||
}
|
||||
.main-sidebar {
|
||||
box-shadow: -2px 1px 1px 5px #666;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: #2F414A !important;
|
||||
box-shadow: 7px -2px 1px 5px #666;
|
||||
}
|
||||
|
||||
.content-header h1, #adminAddWrapper {
|
||||
background-color: #FFF;
|
||||
border: 5px solid #FFF;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-right: 1%;
|
||||
}
|
||||
|
||||
.adminUserIcon, .simpleUserIcon {
|
||||
width: 1.5vw;
|
||||
margin: 1%;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.adminUserInfo {
|
||||
margin-top: 1vh;
|
||||
padding: 0.5% 1.5% 0.5% 1.5%;
|
||||
|
||||
background-color: #fff;
|
||||
-webkit-filter: drop-shadow(0px -1px 2px #666);
|
||||
filter: drop-shadow(0px -1px 2px #666);
|
||||
|
||||
position: fixed;
|
||||
display: none;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.adminUserInfo p {
|
||||
margin: 5% 0 5% 0;
|
||||
}
|
||||
|
||||
.infoTitle {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.infoTab {
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
border-bottom: 2vh solid #fff;
|
||||
border-left: 1.5vh solid transparent;
|
||||
border-right: 1.5vh solid transparent;
|
||||
|
||||
position: absolute;
|
||||
right: 1vh;
|
||||
top: -1.9vh;
|
||||
}
|
||||
|
||||
.approveStatus {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.approveStatus .fa {
|
||||
font-size: 5vh
|
||||
}
|
||||
|
||||
.approveStatus .fa-toggle-on {
|
||||
color: #288CD3;
|
||||
}
|
||||
|
||||
.addAdmin {
|
||||
width: 35% !important;
|
||||
}
|
||||
|
||||
.simpleUserIcon {
|
||||
margin: 0.5% 0.3% 0.5% 0.2%;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.simpleUserInfo {
|
||||
margin: 0.5% 0.3% 0.5% 0.2%;
|
||||
background-color: #FFF;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.simpleUserInfo p {
|
||||
margin: 1%;
|
||||
}
|
||||
|
||||
.simpleUserInfo p:first-child {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.simpleUserInfo p:last-child {
|
||||
font-weight: 200;
|
||||
color: #D8D8D8;
|
||||
}
|
||||
|
||||
.addAdmin {
|
||||
margin: 0 0 1% 1%;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
#addAdmin {
|
||||
margin-left: 1%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
51
hourglass/client/admin/admin.html
Normal file
@ -0,0 +1,51 @@
|
||||
<template name="adminUserDisplay">
|
||||
{{#each info}}
|
||||
<img class="adminUserIcon" src="{{icon}}">
|
||||
<div class="adminUserInfo">
|
||||
<div class="infoTab"></div>
|
||||
<p><span class="infoTitle">ID: </span><span>{{id}}</span></p>
|
||||
<p><span class="infoTitle">Email: </span><span>{{email}}</span></p>
|
||||
<p><span class="infoTitle">Name: </span><span>{{name}}</span></p>
|
||||
</div>
|
||||
{{/each}}
|
||||
</template>
|
||||
|
||||
<template name="statusButton">
|
||||
<div class="approveStatus">
|
||||
<i class="fa fa-toggle-{{status}}" aria-hidden="true"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="userEditor">
|
||||
{{#if superAdmin}}
|
||||
{{> quickForm id="editUser" collection="Meteor.users" doc=userInfo schema="userSchema" type="update"}}
|
||||
{{else}}
|
||||
<h4>You are not authorized to edit users.</h4>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="createAdmin">
|
||||
{{#if superAdmin}}
|
||||
<div id="adminAddWrapper">
|
||||
<h3>Search</h3>
|
||||
<div>
|
||||
{{> inputAutocomplete settings=userComplete class="form-control addAdmin" type="text" placeholder="Example: 1234@abc.xyz" }}
|
||||
<button id="addAdmin" class="btn btn-primary">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{> disableUser}}
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="disableUser">
|
||||
<h4>You are not authorized to edit this.</h4>
|
||||
</template>
|
||||
|
||||
<template name="simpleUser">
|
||||
<img class="simpleUserIcon" src="{{services.google.picture}}">
|
||||
<div class="simpleUserInfo">
|
||||
<p>{{profile.name}}</p>
|
||||
<p>{{services.google.email}}</p>
|
||||
</div>
|
||||
</template>
|
||||
103
hourglass/client/admin/admin.js
Normal file
@ -0,0 +1,103 @@
|
||||
var inInfo = false;
|
||||
var openUserDisplay = null;
|
||||
|
||||
Template.adminUserDisplay.helpers({
|
||||
info() {
|
||||
var ids = (this.value instanceof Array) ? this.value : [this.value];
|
||||
var userInfo = [];
|
||||
for(var i = 0; i < ids.length; i++) {
|
||||
var user = Meteor.users.findOne({_id: ids[i]});
|
||||
userInfo.push({
|
||||
name: user.profile.name,
|
||||
email: user.services.google.email,
|
||||
id: user._id,
|
||||
icon: user.services.google.picture
|
||||
});
|
||||
}
|
||||
return userInfo;
|
||||
}
|
||||
});
|
||||
|
||||
Template.statusButton.helpers({
|
||||
status() {
|
||||
return (this.value) ? "on" : "off";
|
||||
}
|
||||
});
|
||||
|
||||
Template.adminUserDisplay.events({
|
||||
'click .adminUserIcon' (event) {
|
||||
var icoCoords = $(event.target)[0].getBoundingClientRect();
|
||||
var x = window.innerWidth - icoCoords.right;
|
||||
var y = icoCoords.bottom;
|
||||
openUserDisplay = $(event.target).next();
|
||||
$(".adminUserInfo").fadeOut(200);
|
||||
openUserDisplay
|
||||
.css({'right': x, 'top': y})
|
||||
.fadeIn(200);
|
||||
},
|
||||
'mouseenter .adminUserInfo' () {
|
||||
inInfo = true;
|
||||
},
|
||||
'mouseleave .adminUserInfo' (event) {
|
||||
if(inInfo) openUserDisplay.fadeOut(200);
|
||||
inInfo = false;
|
||||
openUserDisplay = null;
|
||||
}
|
||||
});
|
||||
|
||||
Template.AdminLTE.events({
|
||||
'click' (event) {
|
||||
if(!event.target.className.includes("adminUserInfo") &&
|
||||
!event.target.className.includes("adminUserIcon") &&
|
||||
openUserDisplay !== null) {
|
||||
if(!openUserDisplay[0].contains(event.target)) {
|
||||
openUserDisplay.fadeOut(200, function() {
|
||||
openUserDisplay = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.statusButton.events({
|
||||
'click .approveStatus' () {
|
||||
Meteor.call("approveClass", this.doc._id);
|
||||
}
|
||||
});
|
||||
|
||||
Template.userEditor.helpers({
|
||||
userInfo : function() {
|
||||
return Session.get("admin_doc")
|
||||
},
|
||||
superAdmin: function() {
|
||||
return Roles.userIsInRole(Meteor.userId(), ['superadmin']);
|
||||
}
|
||||
});
|
||||
|
||||
Template.createAdmin.helpers({
|
||||
userComplete() {
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 7,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: Meteor.users,
|
||||
field: 'services.google.email',
|
||||
filter: {roles: {$not: {$elemMatch: {$eq: "admin"}}}},
|
||||
template: Template.simpleUser
|
||||
}]
|
||||
};
|
||||
},
|
||||
superAdmin: function() {
|
||||
return Roles.userIsInRole(Meteor.userId(), ['superadmin']);
|
||||
}
|
||||
});
|
||||
|
||||
Template.createAdmin.events({
|
||||
'click #addAdmin' () {
|
||||
var value = document.getElementsByClassName("form-control")[0].value;
|
||||
var user = Meteor.users.findOne({'services.google.email': value});
|
||||
if(user === undefined) return;
|
||||
Meteor.call("addAdmin", user._id);
|
||||
}
|
||||
})
|
||||
252
hourglass/client/login/login.css
Normal file
@ -0,0 +1,252 @@
|
||||
#loginHeader {
|
||||
height: 6vh;
|
||||
padding: 2.5vh 0 0 2vh;
|
||||
background-color: #222328;
|
||||
}
|
||||
|
||||
#loginBody {
|
||||
height: 94vh;
|
||||
width: 100%;
|
||||
background-color: #222328;
|
||||
}
|
||||
|
||||
#loginFooter {
|
||||
width: 100%;
|
||||
height: 6vh;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#loginLogo {
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#loginTexts {
|
||||
color: #FCF0F0;
|
||||
width: 45%;
|
||||
margin-left: 48%;
|
||||
position: absolute;
|
||||
top: 23vh;
|
||||
}
|
||||
|
||||
#loginTexts h1 {
|
||||
font-size: 7vh;
|
||||
font-weight: 300;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 3vh;
|
||||
}
|
||||
|
||||
#loginTexts h2 {
|
||||
font-size: 15vh;
|
||||
}
|
||||
|
||||
#loginTexts h5 {
|
||||
font-size: 5vh;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
#loginDec {
|
||||
width: 49vw;
|
||||
height: 200vh;
|
||||
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
position: absolute;
|
||||
top: -46vh;
|
||||
right: 5vw;
|
||||
|
||||
-webkit-transform: rotate(150deg);
|
||||
-ms-transform: rotate(150deg);
|
||||
transform: rotate(150deg);
|
||||
}
|
||||
|
||||
#loginCirc {
|
||||
width: 55vh;
|
||||
height: 55vh;
|
||||
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
|
||||
position: absolute;
|
||||
top: 20vh;
|
||||
left: 7vh;
|
||||
}
|
||||
|
||||
#loginMidLogo {
|
||||
height: 44vh;
|
||||
|
||||
position: absolute;
|
||||
top: 26vh;
|
||||
left: 12.5vh;
|
||||
}
|
||||
|
||||
.loginButtons {
|
||||
font-size: 3.5vh;
|
||||
width: 12vw;
|
||||
margin-top: 4vh;
|
||||
margin-left: 5vw;
|
||||
padding: 1vh;
|
||||
background-color: #27A127;
|
||||
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.loginButtons:hover {
|
||||
background-color: #239023;
|
||||
}
|
||||
|
||||
#loginContainer {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#demoButton {
|
||||
border: 1px solid #FCF0F0;
|
||||
background-color: rgba(0,0,0,0);
|
||||
margin-left: 4vw;
|
||||
}
|
||||
|
||||
#demoButton:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
#version {
|
||||
font-size: 1.7vh;
|
||||
color: #FFF !important;
|
||||
margin-right: 1%;
|
||||
|
||||
height: 6vh;
|
||||
margin: 0;
|
||||
padding-right: 1vw;
|
||||
|
||||
line-height: 6vh;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0099CC;
|
||||
text-decoration: none;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #00BFFF;
|
||||
}
|
||||
|
||||
.github-corner:hover .octo-arm {
|
||||
animation:octocat-wave 560ms ease-in-out
|
||||
}
|
||||
|
||||
@keyframes octocat-wave {
|
||||
0%,100% { transform:rotate(0) }
|
||||
20%,60% { transform:rotate(-25deg) }
|
||||
40%,80% { transform:rotate(10deg) }
|
||||
}
|
||||
|
||||
@media (max-width:500px) {
|
||||
.github-corner:hover .octo-arm {
|
||||
animation:none
|
||||
}
|
||||
.github-corner .octo-arm {
|
||||
animation:octocat-wave 560ms ease-in-out
|
||||
}
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
|
||||
#mLoginCirc {
|
||||
width: 87vw;
|
||||
height: 87vw;
|
||||
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
|
||||
position: absolute;
|
||||
top: 15vw;
|
||||
left: 6.5vw;
|
||||
}
|
||||
|
||||
#mLoginMidLogo {
|
||||
height: 70vw;
|
||||
|
||||
position: absolute;
|
||||
top: 23.5vw;
|
||||
left: 15vw;
|
||||
}
|
||||
|
||||
#mLoginTexts {
|
||||
color: #FCF0F0;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 9vh;
|
||||
}
|
||||
|
||||
#mLoginTexts h1 {
|
||||
width: 90%;
|
||||
font-size: 8vw;
|
||||
font-weight: 300;
|
||||
margin: 0 auto 0 auto;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#mLoginTexts h5 {
|
||||
width: 90%;
|
||||
margin: 0 auto 0 auto;
|
||||
font-size: 5vw;
|
||||
font-weight: 100;
|
||||
text-align: Center;
|
||||
}
|
||||
|
||||
#mLoginButton {
|
||||
font-size: 5vw;
|
||||
width: 30vw;
|
||||
margin: auto;
|
||||
margin-top: 3vh;
|
||||
padding: 2vw;
|
||||
|
||||
border: 1px solid #FCF0F0;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-tap-highlight-color: rgba(255,255,255,0.3);
|
||||
}
|
||||
|
||||
#mVersion {
|
||||
font-size: 3vw;
|
||||
color: #FFF !important;
|
||||
margin-right: 1%;
|
||||
|
||||
height: 6vh;
|
||||
margin: 0;
|
||||
padding-right: 3vw;
|
||||
|
||||
line-height: 6vh;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
61
hourglass/client/login/login.html
Normal file
@ -0,0 +1,61 @@
|
||||
<template name="login">
|
||||
<div class="noScroll">
|
||||
<a href="https://github.com/ksjdragon/hourglass" target="_blank" class="github-corner" aria-label="View source on Github">
|
||||
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#B63737; color:#222328; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
|
||||
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
|
||||
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
|
||||
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
|
||||
</svg>
|
||||
</a>
|
||||
<div id="loginHeader">
|
||||
<img src="./Logos/LogoTextSmall.png" id="loginLogo" onclick="window.location.href='/'">
|
||||
</div>
|
||||
<div id="loginBody">
|
||||
<div id="loginDec"></div>
|
||||
<div id="loginCirc"></div>
|
||||
<img src="./Logos/ColoredLogo.png" id="loginMidLogo">
|
||||
<div id="loginTexts">
|
||||
<h1>Everything in</h1>
|
||||
<h2>One Place.</h2>
|
||||
<h5><b>We</b> handle the organization, <b>you</b> handle the work.</h5>
|
||||
<div id="loginContainer">
|
||||
<div class="loginButtons" onclick="document.getElementById('login-buttons-google').click()">Sign in!</div>
|
||||
<div class="loginButtons" id="demoButton" onclick="Session.set('demo',true);">Demo</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="loginFooter">
|
||||
<p id="version">Version {{version}}</p>
|
||||
</footer>
|
||||
</div>
|
||||
{{> loginButtons}}
|
||||
</template>
|
||||
|
||||
<template name="mLogin">
|
||||
<div class="noScroll">
|
||||
<a href="https://github.com/ksjdragon/hourglass" target="_blank" class="github-corner" aria-label="View source on Github">
|
||||
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#B63737; color:#222328; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
|
||||
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
|
||||
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
|
||||
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
|
||||
</svg>
|
||||
</a>
|
||||
<div id="loginHeader">
|
||||
<img src="./Logos/LogoTextSmall.png" id="loginLogo" onclick="window.location.href='/'">
|
||||
</div>
|
||||
<div id="loginBody">
|
||||
<div id="mLoginCirc"></div>
|
||||
<img src="./Logos/ColoredLogo.png" id="mLoginMidLogo">
|
||||
<div id="mLoginTexts">
|
||||
<h1>Everything in <b>One Place</b></h1>
|
||||
<h5><b>We</b> handle the organization, <b>you</b> handle the work.</h5>
|
||||
<div id="mLoginButton" onclick="document.getElementById('login-buttons-google').click()">Sign in!</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="loginFooter">
|
||||
<p id="mVersion">Version {{version}}</p>
|
||||
</footer>
|
||||
</div>
|
||||
{{> loginButtons}}
|
||||
</template>
|
||||
|
||||
1523
hourglass/client/main/main.css
Normal file
348
hourglass/client/main/main.html
Normal file
@ -0,0 +1,348 @@
|
||||
<head>
|
||||
<title>Hourglass</title>
|
||||
<link rel="icon" href="/favicon.ico?v=2">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||
</head>
|
||||
|
||||
<template name="main">
|
||||
{{> sAlert}}
|
||||
<div class="noScroll">
|
||||
<img id="bg" src={{bgSrc}} style="min-width:{{screen}}">
|
||||
<div id="divLeftBar">
|
||||
<div id="menuBar" style="background-color:{{divColor 'sidebarColor'}}">
|
||||
<i class="barIco fa fa-bars" style="color:{{iconStatus 'menu'}}" aria-hidden="true"></i>
|
||||
<i class="barIco fa fa-cog" style="color:{{iconStatus 'option'}}" aria-hidden="true"></i>
|
||||
<i class="barIco fa fa-question" style="color:{{iconStatus 'requests'}}" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="menuContainer" style="background-color:{{divColor 'sidebarColor'}};">
|
||||
<div class="menuWrapper">
|
||||
{{#if sidebarStatus 'menu'}}
|
||||
{{> sidebarMenuPlate}}
|
||||
{{/if}}
|
||||
{{#if sidebarStatus 'option'}}
|
||||
{{> sidebarOptionPlate}}
|
||||
{{/if}}
|
||||
{{#if sidebarStatus 'requests'}}
|
||||
{{> sidebarRequestPlate}}
|
||||
{{/if}}
|
||||
{{#if sidebarStatus 'create'}}
|
||||
{{> sidebarCreatePlate}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divCenter">
|
||||
<header id="mainHeader" style="background-color:{{divColor 'mainColor'}}">
|
||||
<h1>Hourglass</h1><h2>{{schoolName}}</h2>
|
||||
<div id="dropdown">
|
||||
<img src="{{avatar}}">
|
||||
<h4>{{username}}</h4>
|
||||
</div>
|
||||
</header>
|
||||
<div id="mainBody{{highlight}}">
|
||||
{{#if currMode 'classes'}}
|
||||
<div id="classesMode">
|
||||
{{#each myClasses}}
|
||||
{{> classesMode}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if currMode 'calendar'}}
|
||||
<div id="calendar">
|
||||
{{> fullcalendar calendarOptions}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if currSettingMode 'manageClass'}}
|
||||
{{> manageClass}}
|
||||
{{/if}}
|
||||
|
||||
{{#if currSettingMode 'addClass'}}
|
||||
{{> joinClass}}
|
||||
{{/if}}
|
||||
|
||||
{{#if currSettingMode 'createClass'}}
|
||||
{{> createClass}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overlay">
|
||||
<div id="editWork">
|
||||
<div id="editWorkCont" style="background-color:{{divColor 'mainColor'}};border-top:10px solid {{work 'typeColor'}};">
|
||||
<div id="workInfoContainer">
|
||||
{{#if inRole}}
|
||||
{{> workDisplayEdit}}
|
||||
{{else}}
|
||||
{{> workDisplay}}
|
||||
{{/if}}
|
||||
{{#unless newWork}}
|
||||
<div id="workInfo2">
|
||||
<div id="workComments">
|
||||
<h3>Comments</h3>
|
||||
<div>
|
||||
<textarea id="workComment" class="restrict" rows="4" cols="50" maxlength="200" style="color:{{divColor 'textColor'}}"></textarea><br>
|
||||
<div>
|
||||
<span class="resText">{{restrict 'workComment'}}</span>
|
||||
<div id="commentSubmit">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="comment">
|
||||
{{#each work 'comments'}}
|
||||
{{> comment}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{#unless newWork}}
|
||||
<div id="workToggle">
|
||||
<div id="doneUsers">
|
||||
{{#each work 'done'}}
|
||||
{{> doneUsers}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="toggleButtons">
|
||||
<div id="markDone" style="background-color:{{work 'doneCol'}}">
|
||||
<i class="fa {{work 'doneIcon'}}" aria-hidden="true"></i>
|
||||
<p>{{work 'doneText'}}</p>
|
||||
</div>
|
||||
<div id="markConfirm" style="color:{{work 'userConfirm'}}">
|
||||
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
|
||||
<p>{{work 'confirmations'}}</p>
|
||||
</div>
|
||||
<div id="markReport" style="color:{{work 'userReport'}}">
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||
<p>{{work 'reports'}}</p>
|
||||
</div>
|
||||
<div class="workCreator doneUser">
|
||||
<div>
|
||||
<img src="{{work 'avatar'}}">
|
||||
</div>
|
||||
<div>
|
||||
<span>{{work 'creator'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{#if inRole}}
|
||||
{{#if newWork}}
|
||||
<div id="workSubmit">Save</div>
|
||||
{{else}}
|
||||
<div id="workDelete">Delete</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="confirmOverlay">
|
||||
<div class="overlayCont" style="background-color:{{divColor 'mainColor'}}">
|
||||
<p>{{confirmText}}</p>
|
||||
<div id="faCont">
|
||||
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
|
||||
<i class="fa fa-times-circle-o" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="userDropdown" style="background-color:{{divColor 'userDropdownColor'}}">
|
||||
<div id="userTab" style="border-bottom: 3vh solid {{divColor 'userDropdownColor'}}"></div>
|
||||
<div id="userDropdownAvatar" style="background-color:{{divColor 'userDropdownColor'}}">
|
||||
<img src="{{avatar}}">
|
||||
<p>{{username}}</p>
|
||||
</div>
|
||||
<div id="userFunctions" style="background-color:{{divColor 'userDropdownColor'}}">
|
||||
{{#if admin}}
|
||||
<div class="userFunction" onclick="window.location='/admin';">
|
||||
<i class="fa fa-cogs" aria-hidden="true"></i>
|
||||
<p>Admin Panel</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div style="background-color:{{divColor 'userDropdownColor'}}">
|
||||
<div id="signout" class="userFunction">
|
||||
<i class="fa fa-sign-out" aria-hidden="true"></i>
|
||||
<p>Sign out</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> loginButtons}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="sidebarClasses">
|
||||
<div class="sideClass" classid="{{_id}}">
|
||||
<div class="status" style="background-color:{{selected}}"></div>
|
||||
<span class="sideClassName">{{name}}</span>
|
||||
<span class="sideClassHour">{{hour}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="sideTypeFilter">
|
||||
<div class="sideFilter" type="{{type}}">
|
||||
<div class="status" style="background-color:{{selected}}"></div>
|
||||
<span class="sideTypeName">{{typeName}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="classesMode">
|
||||
<div class="classWrapper"> <!-- class color -->
|
||||
<div class="mainClass" style="background-color:{{divColor 'classCardColor'}}">
|
||||
{{#if status}}
|
||||
<div class="classInfo">
|
||||
<h3 class="mainClassName">{{name}}</h3>
|
||||
<p class="mainClassHour">{{hour}}</p>
|
||||
<p class="mainClassTeacher">{{teacher}}</p>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="classInfo" style="border-top:1vh solid #E64F4F;padding-top:2vh">
|
||||
<h3 class="mainClassName">{{name}}</h3>
|
||||
<p class="mainClassHour">{{hour}}</p>
|
||||
<p class="mainClassTeacher">{{teacher}}</p>
|
||||
<p class="mainClassStatus">Unapproved</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="creWork" classid="{{_id}}">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
<h4>Add Work</h4>
|
||||
</div>
|
||||
<div class="workHolder">
|
||||
{{#each thisClassWork}}
|
||||
{{> classModeWork}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="classModeWork">
|
||||
<div class="workCard" workid="{{_id}}" classid="{{classid}}" type="{{type}}">
|
||||
<div class="cWorkType" style="background-color:{{typeColor}}"></div>
|
||||
<div class="cWorkCont">
|
||||
<div class="cWorkTop">
|
||||
<h3 class="cWorkName">{{name}}</h3>
|
||||
<span class="cWorkCreator">{{creatorname}}</span>
|
||||
</div>
|
||||
<div class="cWorkBottom">
|
||||
<span class="cWorkDate" style="font-weight:{{cardDate}}">{{dateWord}}</span>
|
||||
<div style="color:{{doneRatio}}">
|
||||
<i class="fa fa-thumbs-up" aria-hidden="true" style="color:{{confirmed}}"></i>
|
||||
<span>{{confirmationLength}}</span>
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true" style="color:{{reported}}"></i>
|
||||
<span>{{reportLength}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="comment">
|
||||
<div class="commentBox">
|
||||
<div class="commentAvatarCont">
|
||||
<img class="commentAvatar" src='{{avatar}}' onclick="window.location='/user/{{email}}'">
|
||||
</div>
|
||||
<div class="commentInfo">
|
||||
<span class="commentComment">{{comment}}</span><br>
|
||||
<span class="commentUser">{{user}}</span>
|
||||
<span class="commentDate">{{date}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="doneUsers">
|
||||
<div class="doneUser">
|
||||
<div>
|
||||
<img src='{{avatar}}'>
|
||||
</div>
|
||||
<div>
|
||||
<span>{{user}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="option">
|
||||
<p class="optionText" style="background-color:{{divColor 'mainColor'}};" onmouseover="$(this).css('box-shadow','inset 0 0 0 99999px rgba(0,0,0,0.2)');" onmouseleave="$(this).css('box-shadow','');">{{alias}}</p>
|
||||
</template>
|
||||
|
||||
<template name="workDisplay">
|
||||
<div id="workNameDiv">
|
||||
<span id="wName" class="info">{{work 'name'}}</span>
|
||||
</div>
|
||||
<div id="workInfo1">
|
||||
<div>
|
||||
<span class="workTitle">Class:</span><span style="font-size:2.2vh">{{work 'class'}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Due Date:</span><br>
|
||||
<span id="wDescription" class="info">{{work 'dueDate'}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Description:</span><br>
|
||||
<span id="wDueDate" class="info form-control">{{work 'description'}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Type:</span>
|
||||
<span id="wType" class="info">{{work 'type'}}</span>
|
||||
</div>
|
||||
<!-- <div id="workAttach">Attach other files</div>
|
||||
<div id="workAttachmentHolder">
|
||||
{{#each work 'attachments'}}
|
||||
<a href={{link}}>{{filename}}</a>
|
||||
{{/each}}
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="workDisplayEdit">
|
||||
<div id="workNameDiv">
|
||||
<input id="wName" class="clickModify restrict" style="color:{{divColor 'textColor'}}" value="{{work 'name'}}" placeholder="Name | Click here to edit..." tabindex="10" maxLength="50">
|
||||
<span class="resText">{{restrict 'wName'}}</span>
|
||||
</div>
|
||||
<div id="workInfo1">
|
||||
<div>
|
||||
<span class="workTitle">Class:</span><span style="font-size:2.2vh">{{work 'class'}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Due Date:</span><br>
|
||||
<input id="wDueDate" class="clickModify form-control" style="color:{{divColor 'textColor'}}" value="{{work 'dueDate'}}" tabindex="11" readonly="readonly">
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Description:</span><br>
|
||||
<textarea id="wDescription" class="clickModify restrict" style="color:{{divColor 'textColor'}}" placeholder="Click here to edit..." value="{{work 'description'}}" rows="5" tabindex="12" maxLength="300"></textarea>
|
||||
<span style="opacity:0">.</span>
|
||||
<span class="resText">{{restrict 'wDescription'}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="workTitle">Type:</span>
|
||||
<div id="typeWrapper">
|
||||
<div id="wType" class="clickModify dropdown" tabindex="13">
|
||||
<span>{{work 'type'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="optionHolder type">
|
||||
{{#each selectOptions 'type'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div id="workAttach">Attach other files</div>
|
||||
<div id="workAttachmentHolder">
|
||||
{{#each work 'attachments'}}
|
||||
<a href={{link}}>{{filename}}</a>
|
||||
{{/each}}
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="selectOptionMenu">
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions optionName}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</template>
|
||||
1486
hourglass/client/main/main.js
Normal file
613
hourglass/client/menus/menus.css
Normal file
@ -0,0 +1,613 @@
|
||||
.sectionTitle {
|
||||
font-weight: 200;
|
||||
font-size: 2vh;
|
||||
width: 100%;
|
||||
height: 6vh;
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
.sectionTitle h3 {
|
||||
font-weight: 200;
|
||||
font-size: 2vh;
|
||||
padding-left: 6%;
|
||||
line-height: 6vh;
|
||||
}
|
||||
|
||||
.sectionTitle.downOffset {
|
||||
margin-top: 6vh;
|
||||
}
|
||||
|
||||
.openable {
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.openable:hover {
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
.openable h3:first-child {
|
||||
font-weight: 200;
|
||||
display: inline-block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.openable .fa {
|
||||
padding: 6%;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#disableFilter {
|
||||
font-weight: 200;
|
||||
font-size: 90%;
|
||||
margin-left: 10%;
|
||||
padding: 4%;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
line-height: normal;
|
||||
pointer-events: all;
|
||||
z-index: 2;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#disableFilter:hover {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
#filterWrapper {
|
||||
width: 100%;
|
||||
height: 64vh;
|
||||
max-height: 64vh;
|
||||
}
|
||||
|
||||
#backgroundOverlay {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 5;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#colLeft, #colRight {
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#colLeft h2, #colRight h2 {
|
||||
padding: 3% 3% 0 4%;
|
||||
font-size: 2.3vw;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
#colLeft p, #colRight p {
|
||||
font-size: 1.1vw;
|
||||
margin: 0;
|
||||
padding: 0 2% 0 7%;
|
||||
}
|
||||
|
||||
#colLeft {
|
||||
width: 59%;
|
||||
}
|
||||
|
||||
#colRight {
|
||||
border-left: 1px solid #9C9C9C;
|
||||
float: right;
|
||||
width: 40%;
|
||||
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#settingClassWrapper {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
padding-top: 2%;
|
||||
}
|
||||
|
||||
#label {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
|
||||
display: table;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#classBody {
|
||||
height: 64vh;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#settingClassWrapper h3 {
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
.classBox {
|
||||
font-size: 1.3vw;
|
||||
width: 95%;
|
||||
margin-bottom: 3%;
|
||||
padding: 2%;
|
||||
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.classBox:hover {
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.classBox .fa {
|
||||
text-align: center;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
.classBox .fa-times:hover {
|
||||
color: #FF1A1A;
|
||||
}
|
||||
|
||||
.classBox .fa-plus:hover {
|
||||
color: #85E085;
|
||||
}
|
||||
|
||||
.owned {
|
||||
border: none !important;
|
||||
box-shadow: inset 0 0 0 99999px rgba(255,255,255,0.3);
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.owned:hover {
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.classText {
|
||||
margin-left: .5%;
|
||||
margin-right: 10%;
|
||||
display: table-cell;
|
||||
text-align: left;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.classBox .fa {
|
||||
font-size: 2.5vh !important;
|
||||
padding: 0 !important;
|
||||
display: table-cell !important;
|
||||
width: 5% !important;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.teacher {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.hour.classText, .subscribers.classText {
|
||||
width: 15%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.settingHeader div:first-child {
|
||||
width: 70%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.settingHeader div:last-child {
|
||||
float: right;
|
||||
margin: 2% 1% 1% 1%;
|
||||
vertical-align: bottom;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#colRight .settingHeader div:last-child {
|
||||
margin-top: 1%;
|
||||
}
|
||||
|
||||
#colRight .settingHeader {
|
||||
padding: 2% 2% 2% 3%;
|
||||
}
|
||||
|
||||
.circleIcon {
|
||||
width: 6vh;
|
||||
height: 6vh;
|
||||
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.circleIcon .fa {
|
||||
font-size: 2.5vh;
|
||||
margin-top: 0.2vh;
|
||||
width: 6vh;
|
||||
height: 6vh;
|
||||
line-height: 6vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#classInfoModeWrapper {
|
||||
width: 100%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#classInfoModeWrapper span {
|
||||
font-size: 2.5vh;
|
||||
width: 50%;
|
||||
padding: 1.5%;
|
||||
background-color: rgba(0,0,0,0.05);
|
||||
|
||||
text-align: center;
|
||||
display: table-cell;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease, border-bottom 0.25s ease;
|
||||
-moz-transition: background-color 0.5s ease, border-bottom 0.25s ease;
|
||||
-ms-transition: background-color 0.5s ease, border-bottom 0.25s ease;
|
||||
transition: background-color 0.5s ease, border-bottom 0.25s ease;
|
||||
}
|
||||
|
||||
#classInfoModeWrapper span:hover {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
#infoClassCont {
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
#infoClassCont .infoCard {
|
||||
margin: 2.5%;
|
||||
padding: 2.5%;
|
||||
width: 38%;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#infoClassCont h4 {
|
||||
font-size: 1.5vw;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#infoClassCont span {
|
||||
font-size: 1.4vw;
|
||||
margin-top: 5%;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#infoClassCont img {
|
||||
height: 4vh;
|
||||
margin-right: 1%;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#privacy {
|
||||
margin-bottom: 1%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#privacy span, #privacy .circleIcon {
|
||||
margin: 1%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#infoClassCont div .fa-files-o, #infoClassCont div .fa-pencil-square-o {
|
||||
font-size: 2vh;
|
||||
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
right: 5%;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
#code {
|
||||
margin: 0;
|
||||
padding: 2%;
|
||||
width: auto;
|
||||
|
||||
background-color: rgba(255,255,255,0.3);
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 37.5%;
|
||||
right: 1%;
|
||||
}
|
||||
|
||||
#copyHolder {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
|
||||
right: -500px;
|
||||
}
|
||||
|
||||
#changeAdminWrapper {
|
||||
margin-top: 1%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#changeAdminWrapper span {
|
||||
font-size: 2vh;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
#changeAdmin {
|
||||
width: 40%;
|
||||
margin: 0 1% 0 1%;
|
||||
font-size: 2vh;
|
||||
padding: 1%;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#adminSubmit {
|
||||
padding: 2%;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
display: inline-block;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#adminSubmit:hover {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#deleteClass {
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#deleteClass:hover {
|
||||
color: #FF1A1A;
|
||||
}
|
||||
|
||||
#deleteClass .fa {
|
||||
margin-top: 0;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
#infoClassCont .userAdder {
|
||||
border-bottom: 1px solid #FFF;
|
||||
}
|
||||
|
||||
.userAdder {
|
||||
width: 100%;
|
||||
margin-bottom: 3%;
|
||||
text-align: left;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.userAdder h4 {
|
||||
font-size: 2.3vh !important;
|
||||
width: 30%;
|
||||
text-align: left !important;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.userAdder input {
|
||||
font-size: 2vh;
|
||||
width: 53%;
|
||||
padding: 1%;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.userAdder .fa {
|
||||
width: auto;
|
||||
padding: 0 !important;
|
||||
margin: 3% !important;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
.userHolder {
|
||||
margin-bottom: 1%;
|
||||
}
|
||||
|
||||
.userDisp {
|
||||
width: 31%;
|
||||
padding: 1%;
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.userDisp span {
|
||||
font-size: 1.5vh !important;
|
||||
margin: 0 !important;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.userDisp .fa {
|
||||
font-size: 1.7vh;
|
||||
cursor: pointer;
|
||||
margin-left: 4.5%;
|
||||
|
||||
-webkit-transition: color 0.4s ease;
|
||||
-moz-transition: color 0.4s ease;
|
||||
-ms-transition: color 0.4s ease;
|
||||
transition: color 0.4s ease;
|
||||
}
|
||||
|
||||
.userDisp .fa:hover {
|
||||
color: #FF1A1A;
|
||||
}
|
||||
|
||||
#joinTop {
|
||||
margin: 2% 0 0 5%;
|
||||
}
|
||||
|
||||
#joinTop .-autocomplete-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#joinTop .fa {
|
||||
font-size: 2.5vh;
|
||||
}
|
||||
|
||||
#classSearch, #privateCode {
|
||||
font-size: 2vh;
|
||||
padding: 1% !important;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#private {
|
||||
font-size: 2.4vh;
|
||||
padding: 1.5%;
|
||||
margin: 0 2% 0 2%;
|
||||
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#private:hover {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#privateCode {
|
||||
width: 25%;
|
||||
display: none;
|
||||
|
||||
-webkit-animation: expand .7s ease 1;
|
||||
animation: expand .7s ease 1;
|
||||
}
|
||||
|
||||
@-webkit-keyframes expand {
|
||||
0% { width: 0%; }
|
||||
100% { width: 25%; }
|
||||
}
|
||||
|
||||
@keyframes expand {
|
||||
0% { width: 0%; }
|
||||
100% { width: 25%; }
|
||||
}
|
||||
|
||||
#createWrapper {
|
||||
margin: auto;
|
||||
margin-top: 3%;
|
||||
width: 80%;
|
||||
padding: 3%;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
#creRules p {
|
||||
font-size: 2vh;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.formDiv {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.formDiv:first-child {
|
||||
padding-top: 2%;
|
||||
}
|
||||
|
||||
.formDiv:last-child {
|
||||
padding-bottom: 2%;
|
||||
}
|
||||
|
||||
.formDiv input {
|
||||
font-size: 2vh;
|
||||
width: 98% !important;
|
||||
padding: 1%;
|
||||
}
|
||||
|
||||
.profTitle {
|
||||
font-size: 2vh;
|
||||
margin: 1% !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
#formContainer {
|
||||
margin: 2%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#creSubmit {
|
||||
font-weight: 200;
|
||||
width: 50%;
|
||||
padding: 2%;
|
||||
margin: auto;
|
||||
margin-top: 2%;
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#creSubmit:hover {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
514
hourglass/client/menus/menus.html
Normal file
@ -0,0 +1,514 @@
|
||||
<template name="sidebarMenuPlate">
|
||||
<div class="sectionTitle downOffset">
|
||||
<h3>Main</h3>
|
||||
</div>
|
||||
<div class="mode classes">
|
||||
<div class="status" style="background-color:{{modeStatus 'classes'}}"></div>
|
||||
<i class="fa fa-university" aria-hidden="true"></i>
|
||||
<h4>Classes</h4>
|
||||
</div>
|
||||
<div class="mode calendar">
|
||||
<div class="status" style="background-color:{{modeStatus 'calendar'}}"></div>
|
||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
||||
<h4>Calendar</h4>
|
||||
</div>
|
||||
<div id="filterHead" class="sectionTitle openable">
|
||||
<h3>Filters</h3>
|
||||
{{#if filterOn}}
|
||||
<h3 id="disableFilter">Disable All</h3>
|
||||
{{/if}}
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="filterWrapper">
|
||||
<div id="typeFilterWrapper" class="sectionTitle openable">
|
||||
<h3>By Type</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="classFilterHolder">
|
||||
{{#each types}}
|
||||
{{> sideTypeFilter}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="classFilterWrapper" class="sectionTitle openable">
|
||||
<h3>By Class</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="classListHolder">
|
||||
{{#each myClasses}}
|
||||
{{> sidebarClasses}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div id="exportDiv" class="mode">
|
||||
<i class="fa fa-download" aria-hidden="true"></i>
|
||||
<h4>Export</h4>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="sidebarOptionPlate">
|
||||
<div id="settingMode" class="sectionTitle openable downOffset">
|
||||
<h3>Classes</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="settingModeWrapper">
|
||||
<div class="mode manageClass">
|
||||
<div class="status" style="background-color:{{modeStatus 'manageClass'}}"></div>
|
||||
<i class="fa fa-tasks" aria-hidden="true"></i>
|
||||
<h4>Manage Classes</h4>
|
||||
</div>
|
||||
<div class="mode addClass">
|
||||
<div class="status" style="background-color:{{modeStatus 'addClass'}}"></div>
|
||||
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
|
||||
<h4>Join Classes</h4>
|
||||
</div>
|
||||
<div class="mode createClass">
|
||||
<div class="status" style="background-color:{{modeStatus 'createClass'}}"></div>
|
||||
<i class="fa fa-book" aria-hidden="true"></i>
|
||||
<h4>Create Classes</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div id="preferencesWrapper" class="sectionTitle openable">
|
||||
<h3>Preferences</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="prefCont">
|
||||
<div class="prefWrapper">
|
||||
<div class="sectionTitle prefText">
|
||||
<h3>Theme</h3>
|
||||
</div>
|
||||
<div id="theme" class="clickModify dropdown" tabindex="1">
|
||||
<span>{{pref 'theme'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{> selectOptionMenu optionName="theme"}}
|
||||
</div>
|
||||
<div class="prefWrapper">
|
||||
<div class="sectionTitle prefText">
|
||||
<h3>Default Mode</h3>
|
||||
</div>
|
||||
<div id="mode" class="clickModify dropdown" tabindex="2">
|
||||
<span>{{pref 'mode'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{> selectOptionMenu optionName="mode"}}
|
||||
</div>
|
||||
<div class="prefWrapper">
|
||||
<div class="sectionTitle prefText">
|
||||
<h3>Hide Homework</h3>
|
||||
</div>
|
||||
<div id="timeHide" class="clickModify dropdown" tabindex="3">
|
||||
<span>{{pref 'timeHide'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{> selectOptionMenu optionName="timeHide"}}
|
||||
</div>
|
||||
<div class="prefWrapper">
|
||||
<div class="sectionTitle prefText">
|
||||
<h3>Hide Done</h3>
|
||||
</div>
|
||||
<div id="done" class="clickModify dropdown" tabindex="4">
|
||||
<span>{{pref 'done'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{> selectOptionMenu optionName="done"}}
|
||||
</div>
|
||||
<div class="prefWrapper">
|
||||
<div class="sectionTitle prefText">
|
||||
<h3>Hide Reported</h3>
|
||||
</div>
|
||||
<div id="hideReport" class="clickModify dropdown" tabindex="5">
|
||||
<span>{{pref 'hideReport'}}</span>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{> selectOptionMenu optionName="hideReport"}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="sidebarRequestPlate">
|
||||
<div class="sectionTitle downOffset">
|
||||
<h3>Requests</h3>
|
||||
</div>
|
||||
<p class="sidebarDesc">Ask for help, submit a bug, or request a feature! We won't bite.</p>
|
||||
<textarea id="requestArea" class="restrict" rows="4" cols="50" maxlength="500" placeholder="Enter request here..." style="color:{{divColor 'textColor'}}"></textarea><br>
|
||||
<span id="requestRes" class="resText">{{restrict 'requestArea'}}</span>
|
||||
<span style="opacity:0">.</span>
|
||||
<div id="requestSubmit">
|
||||
<span>Send</span>
|
||||
<span style="display:none">Request sent!</span>
|
||||
<i class="fa fa-paper-plane" aria-hidden="true"></i>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="sidebarCreatePlate">
|
||||
<div class="sectionTitle downOffset">
|
||||
<h3>Classes</h3>
|
||||
</div>
|
||||
<p class="sidebarDesc">Pick a class to create work for.</p>
|
||||
{{#each myClasses}}
|
||||
{{> sidebarClasses}}
|
||||
{{/each}}
|
||||
</template>
|
||||
|
||||
<template name="manageClass">
|
||||
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
|
||||
<div id="colLeft">
|
||||
<div class="settingHeader">
|
||||
<div>
|
||||
<h2>My Classes</h2>
|
||||
<p>Manage Classes</p>
|
||||
</div>
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-tasks" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="settingClassWrapper">
|
||||
<div id="label" class="classBox">
|
||||
<span class="name classText">Class Name</span>
|
||||
<span class="teacher classText">Teacher</span>
|
||||
<span class="hour classText">Hour</span>
|
||||
<span class="subscriptions classText">Members</span>
|
||||
</div>
|
||||
<div id="classBody">
|
||||
{{#each myClasses}}
|
||||
{{> classDisplay}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="colRight" style="background-color:{{divColor 'sidebarColor'}}">
|
||||
<div class="settingHeader">
|
||||
<div>
|
||||
<h2>Class Information</h2>
|
||||
</div>
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-info" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="infoClassWrapper">
|
||||
<div id="classInfoModeWrapper">
|
||||
<span style="border-bottom: 3px solid {{classInfoMode 'general'}}">General</span>
|
||||
<span style="border-bottom: 3px solid {{classInfoMode 'users'}}">Users</span>
|
||||
</div>
|
||||
<div id="infoClassCont">
|
||||
{{#if classSelected}}
|
||||
{{#if classInfoMode 'general' 'a'}}
|
||||
{{> classInfoGeneral}}
|
||||
{{else}}
|
||||
{{> classInfoUsers}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p>Click on a class to see its info.</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="joinClass">
|
||||
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
|
||||
<div id="colLeft">
|
||||
<div class="settingHeader">
|
||||
<div>
|
||||
<h2>Available Classes</h2>
|
||||
<p>Join Classes</p>
|
||||
</div>
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="joinTop">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
{{> inputAutocomplete id="classSearch" settings=classSettings placeholder="Search..."}}
|
||||
<h4 id="private">Join Private Class</h4>
|
||||
<input id="privateCode" placeholder="Enter code here...">
|
||||
</div>
|
||||
<div id="settingClassWrapper">
|
||||
<div id="classHeader">
|
||||
<div id="label" class="classBox">
|
||||
<span class="name classText">Class Name</span>
|
||||
<span class="teacher classText">Teacher</span>
|
||||
<span class="hour classText">Hour</span>
|
||||
<span class="subscriptions classText">Members</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="classBody">
|
||||
{{#if notsearching}}
|
||||
{{#each classes}}
|
||||
{{> classDisplay}}
|
||||
{{/each}}
|
||||
{{#if noclass}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#each autocompleteClasses}}
|
||||
{{> classDisplay}}
|
||||
{{/each}}
|
||||
{{#if notfound}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="colRight" style="background-color:{{divColor 'sidebarColor'}}">
|
||||
<div class="settingHeader">
|
||||
<div>
|
||||
<h2>Class Information</h2>
|
||||
</div>
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-info" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="infoClassWrapper">
|
||||
<div id="classInfoModeWrapper">
|
||||
<span style="border-bottom: 3px solid {{classInfoMode 'general'}}">General</span>
|
||||
<span style="border-bottom: 3px solid {{classInfoMode 'users'}}">Users</span>
|
||||
</div>
|
||||
<div id="infoClassCont">
|
||||
{{#if classSelected}}
|
||||
{{#if classInfoMode 'general' 'a'}}
|
||||
{{> classInfoGeneral}}
|
||||
{{else}}
|
||||
{{> classInfoUsers}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<p>Click on a class to see its info!</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="createClass">
|
||||
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
|
||||
<div id="colLeft">
|
||||
<div class="settingHeader">
|
||||
<div>
|
||||
<h2>Create Classes</h2>
|
||||
</div>
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-book" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="createWrapper">
|
||||
<div id="creRules">
|
||||
<p>Submit a request for a class to be approved by an administrator.<br>
|
||||
You can have up to 8 unapproved classes at once.</p>
|
||||
</div>
|
||||
<div id="formContainer">
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**School:</p>
|
||||
<input id="school" class="creInput" type="text" form="school" value="{{pref 'school'}}" readonly>
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">Hour:</p>
|
||||
<input class="creInput" type="text" form="hour" placeholder="Hour">
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">Teacher:</p>
|
||||
{{> inputAutocomplete settings=teacherComplete class="form-control creInput" type="text" form="teacher" placeholder="Teacher | Ex: Marc DeZwaan" }}
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Class Name:</p>
|
||||
<input class="creInput" type="text" form="name" placeholder="**Class Name">
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Privacy:</p>
|
||||
<input id="creprivacy" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="privacy" placeholder="Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'privacy'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Category:</p>
|
||||
<input id="crecategory" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="category" placeholder="Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'category'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="creSubmit" style="border:1px solid {{divColor 'textColor'}}">Submit Request</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="classDisplay">
|
||||
<div class="classBox{{box}}" classid="{{_id}}" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<span class="name classText">{{name}}</span>
|
||||
<span class="teacher classText">{{teachershort}}</span>
|
||||
<span class="hour classText">{{hour}}</span>
|
||||
<span class="subscribers classText">{{subscribers}}</span>
|
||||
{{#if mine}}
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
{{else}}
|
||||
{{#if join}}
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{else}}
|
||||
<i class="fa fa-times" aria-hidden="true" style="visibility:hidden"></i>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="classInfoGeneral">
|
||||
<div id="privacy">
|
||||
{{#if classInfo 'privacy'}}
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-lock" aria-hidden="true"></i>
|
||||
</div>
|
||||
<span>Private</span>
|
||||
{{#unless classInfo 'personal'}}
|
||||
{{#if classInfo 'mine'}}
|
||||
<div id="deleteClass" class="circleIcon">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{else}}
|
||||
<div class="circleIcon">
|
||||
<i class="fa fa-unlock-alt" aria-hidden="true"></i>
|
||||
</div>
|
||||
<span>Public</span>
|
||||
{{#unless classInfo 'personal'}}
|
||||
{{#if classInfo 'mine'}}
|
||||
<div id="deleteClass" class="circleIcon">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Class Name</h4>
|
||||
<span>{{classInfo 'name'}}</span>
|
||||
</div>
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Hour</h4>
|
||||
<span>{{classInfo 'hour'}}</span>
|
||||
</div>
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Teacher</h4>
|
||||
<span>{{classInfo 'teacher'}}</span>
|
||||
</div>
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Category</h4>
|
||||
<span>{{classInfo 'category'}}</span>
|
||||
</div>
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Owner</h4>
|
||||
{{> classInfoUserDisp classInfo 'admin'}}
|
||||
{{#unless classInfo 'personal'}}
|
||||
{{#if classInfo 'mine'}}
|
||||
<i class="fa fa-pencil-square-o" aria-hidden="true" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
||||
{{> classInfoCode}}
|
||||
|
||||
<div id="changeAdminWrapper">
|
||||
<span>Change Admin: </span>
|
||||
<input id="changeAdmin">
|
||||
<div id="adminSubmit">Change</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="classInfoUsers">
|
||||
{{#if classInfo 'personal'}}
|
||||
<p>It's just you!</p>
|
||||
{{else}}
|
||||
<div>
|
||||
<div class="userAdder">
|
||||
<h4>Moderators:</h4>
|
||||
{{#if classInfo 'mine'}}
|
||||
<input class="userAddInput" type="text" placeholder="1234@abc.xyz">
|
||||
<i class="fa fa-plus" aria-hidden="true" user="moderators" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="userHolder">
|
||||
{{#each classInfo 'moderators'}}
|
||||
<div class="userDisp" userid="{{_id}}">
|
||||
{{> classInfoUserDisp}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="userAdder">
|
||||
<h4>Banned Users:</h4>
|
||||
{{#if classInfo 'mine'}}
|
||||
<input class="userAddInput" type="text" placeholder="1234@abc.xyz">
|
||||
<i class="fa fa-plus" aria-hidden="true" user="banned" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="userHolder">
|
||||
{{#each classInfo 'banned'}}
|
||||
<div class="userDisp" userid="{{_id}}">
|
||||
{{> classInfoUserDisp}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="userAdder">
|
||||
<h4>Subscribers:</h4>
|
||||
</div>
|
||||
<div class="userHolder">
|
||||
{{#each classInfo 'subscribers'}}
|
||||
<div class="userDisp" userid="{{_id}}">
|
||||
{{> classInfoUserDisp}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="classInfoUserDisp">
|
||||
<span>
|
||||
<img src="{{services.google.picture}}">
|
||||
{{profile.name}}
|
||||
{{#if delete}}
|
||||
{{#if classInfo 'mine'}}
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template name="classInfoCode">
|
||||
{{classInfo 'code'}}
|
||||
{{#if code 'exists'}}
|
||||
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
|
||||
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Code</h4>
|
||||
<span>{{code 'code'}}</span>
|
||||
<input id="copyHolder" value="{{code 'code'}}">
|
||||
<i class="fa fa-files-o" aria-hidden="true" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
|
||||
<div id="code">Copied!</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="classAutoList">
|
||||
<span class="name classText">{{name}}</span>
|
||||
<span class="teacher classText">{{teacher}}</span>
|
||||
<span class="hour classText">{{hour}}</span>
|
||||
<span class="subscribers classText">{{subscribers}}</span>
|
||||
<span class="subscribers classText">{{_id}}</span>
|
||||
</template>
|
||||
|
||||
<template name="schoolList">
|
||||
{{name}}
|
||||
</template>
|
||||
|
||||
<template name="teacherList">
|
||||
{{name}}
|
||||
</template>
|
||||
742
hourglass/client/menus/menus.js
Normal file
@ -0,0 +1,742 @@
|
||||
/* jshint esversion: 6 */
|
||||
Session.set("settingMode", "manageClass");
|
||||
Session.set("classInfoMode", "general");
|
||||
Session.set("notsearching", true); // If user isn't searching
|
||||
Session.set("noclass", null); // If user doesn't have classes.
|
||||
Session.set("notfound", null); // If no results for autocomplete.
|
||||
|
||||
var filterOpen = [true, true, true, true, true];
|
||||
var sidebarMode = [null, null];
|
||||
|
||||
Template.sidebarMenuPlate.rendered = function() {
|
||||
$(".menuWrapper").velocity("slideDown", 150);
|
||||
$("#classListHolder").slimScroll({
|
||||
width: '100%',
|
||||
height: '',
|
||||
touchScrollStep: 90
|
||||
});
|
||||
$("#filterWrapper.slimScrollBar").css("display", "none");
|
||||
};
|
||||
Template.sidebarOptionPlate.rendered = function() {
|
||||
$(".menuWrapper").velocity("slideDown", 150);
|
||||
};
|
||||
Template.sidebarRequestPlate.rendered = function() {
|
||||
$(".menuWrapper").velocity("slideDown", 150);
|
||||
};
|
||||
Template.sidebarCreatePlate.rendered = function() {
|
||||
$(".menuWrapper").velocity("slideDown", 150);
|
||||
};
|
||||
|
||||
Template.sidebarMenuPlate.helpers({
|
||||
modeStatus(status) { // Color status of display modes.
|
||||
return (Session.equals("mode", status)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
|
||||
},
|
||||
types() {
|
||||
var types = Object.keys(workColors);
|
||||
var array = [];
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
array.push({
|
||||
"type": types[i],
|
||||
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
|
||||
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
|
||||
});
|
||||
}
|
||||
return array;
|
||||
},
|
||||
filterOn() {
|
||||
return Session.get("classDisp").length !== 0 || Session.get("typeFilter").length !== 0;
|
||||
}
|
||||
});
|
||||
|
||||
Template.sidebarMenuPlate.events({
|
||||
'click .classes' () { // Click classes mode button.
|
||||
if (Session.equals("mode", "classes")) return;
|
||||
toggleToMode("classes");
|
||||
setTimeout(startDragula, 500);
|
||||
toggleToSidebar(false);
|
||||
},
|
||||
'click .calendar' () { // Click calendar mode button.
|
||||
if (Session.equals("mode", "calendar")) return;
|
||||
toggleToMode("calendar");
|
||||
toggleToSidebar(false);
|
||||
},
|
||||
'click #filterHead' (event) {
|
||||
if (event.target.id === "disableFilter") return;
|
||||
if (!filterOpen[0]) {
|
||||
$("#filterWrapper").velocity("slideDown", 150);
|
||||
} else {
|
||||
$("#filterWrapper").velocity("slideUp", 150);
|
||||
}
|
||||
filterOpen[0] = !filterOpen[0];
|
||||
},
|
||||
'click #typeFilterWrapper' () {
|
||||
if (!filterOpen[1]) {
|
||||
$("#classFilterHolder").velocity("slideDown", 150);
|
||||
$("#classListHolder").velocity({'max-height':'27.4507vh'},300);
|
||||
} else {
|
||||
$("#classFilterHolder").velocity("slideUp", 150);
|
||||
$("#classListHolder").velocity({'max-height':'52vh'},300);
|
||||
}
|
||||
filterOpen[1] = !filterOpen[1];
|
||||
},
|
||||
'click #classFilterWrapper' () {
|
||||
if (!filterOpen[2]) {
|
||||
var height = (88-100*$("#classFilterWrapper").offset().top / window.innerHeight) + "vh";
|
||||
$("#classListHolder").css('max-height',height);
|
||||
$("#classListHolder").velocity("slideDown", 150);
|
||||
} else {
|
||||
$("#classListHolder").velocity("slideUp", 150);
|
||||
}
|
||||
filterOpen[2] = !filterOpen[2];
|
||||
},
|
||||
// CLASS FILTERS
|
||||
'click .sideClass' (event) { // Click class list in sidebar.
|
||||
var classid = event.target.getAttribute("classid");
|
||||
var array = Session.get("classDisp");
|
||||
if (array.indexOf(classid) !== -1) {
|
||||
array.splice(array.indexOf(classid), 1);
|
||||
} else {
|
||||
array.push(classid);
|
||||
}
|
||||
Session.set("classDisp", array);
|
||||
filterWork();
|
||||
},
|
||||
'click .sideFilter' (event) {
|
||||
var type = event.target.getAttribute("type");
|
||||
var array = Session.get("typeFilter");
|
||||
if (array.indexOf(type) !== -1) {
|
||||
array.splice(array.indexOf(type), 1);
|
||||
} else {
|
||||
array.push(type);
|
||||
}
|
||||
Session.set("typeFilter", array);
|
||||
filterWork();
|
||||
},
|
||||
'click #disableFilter' () {
|
||||
Session.set("classDisp", []);
|
||||
Session.set("typeFilter", []);
|
||||
filterWork();
|
||||
},
|
||||
'mouseover .sideClass' (event) { // Highlight/scale filter on-hover.
|
||||
var div;
|
||||
if (event.target.className !== "sideClass") {
|
||||
div = event.target.parentNode;
|
||||
} else {
|
||||
div = event.target;
|
||||
}
|
||||
while (div.getAttribute("classid") === null) div = div.parentNode;
|
||||
var classid = div.getAttribute("classid");
|
||||
Session.set("classDispHover", classid);
|
||||
},
|
||||
'mouseleave .sideClass' (event) { // Turn off highlight/scale filter on-leave.
|
||||
if (event.target.className !== "sideClass") {
|
||||
var div = event.target.parentNode;
|
||||
if (div.contains(event.target)) return;
|
||||
}
|
||||
Session.set("classDispHover", null);
|
||||
},
|
||||
'mouseover .sideFilter' (event) {
|
||||
var div;
|
||||
if (event.target.className !== "sideFilter") {
|
||||
div = event.target.parentNode;
|
||||
} else {
|
||||
div = event.target;
|
||||
}
|
||||
while (div.getAttribute("type") === null) div = div.parentNode;
|
||||
var type = div.getAttribute("type");
|
||||
Session.set("typeFilterHover", type);
|
||||
},
|
||||
'mouseleave .sideFilter' (event) {
|
||||
if (event.target.className !== "sideFilter") {
|
||||
var div = event.target.parentNode;
|
||||
if (div.contains(event.target)) return;
|
||||
}
|
||||
Session.set("typeFilterHover", null);
|
||||
}
|
||||
});
|
||||
|
||||
Template.sidebarOptionPlate.helpers({
|
||||
modeStatus(status) { // Color status of display modes.
|
||||
return (Session.equals("settingMode", status)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
|
||||
},
|
||||
});
|
||||
|
||||
Template.sidebarOptionPlate.events({
|
||||
'click .manageClass' () { // Click classes mode button.
|
||||
if (Session.equals("settingMode", "manageClass")) return;
|
||||
toggleToMode("manageClass");
|
||||
},
|
||||
'click .addClass' () { // Click classes mode button.
|
||||
if (Session.equals("settingMode", "addClass")) return;
|
||||
if (Session.get("demo")) {
|
||||
sAlert.error("Not available in demo!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
toggleToMode("addClass");
|
||||
},
|
||||
'click .createClass' () { // Click classes mode button.
|
||||
if (Session.equals("settingMode", "createClass")) return;
|
||||
if (Session.get("demo")) {
|
||||
sAlert.error("Not available in demo!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
toggleToMode("createClass");
|
||||
},
|
||||
'click #settingMode' () {
|
||||
if (!filterOpen[3]) {
|
||||
$("#settingModeWrapper").velocity("slideDown", 150);
|
||||
} else {
|
||||
$("#settingModeWrapper").velocity("slideUp", 150);
|
||||
}
|
||||
filterOpen[3] = !filterOpen[3];
|
||||
},
|
||||
'click #preferencesWrapper' () {
|
||||
if (!filterOpen[4]) {
|
||||
$("#prefCont").velocity("slideDown", 150);
|
||||
} else {
|
||||
$("#prefCont").velocity("slideUp", 150);
|
||||
}
|
||||
filterOpen[4] = !filterOpen[4];
|
||||
}
|
||||
});
|
||||
|
||||
Template.sidebarCreatePlate.events({
|
||||
'click .sideClass' (event) { // Click class list in sidebar.
|
||||
var classid = event.target.getAttribute("classid");
|
||||
var newSetting = Session.get("currentWork");
|
||||
newSetting.class = classid;
|
||||
Session.set("newWork", true);
|
||||
Session.set("currentWork", newSetting);
|
||||
$(".overlay").velocity("fadeIn", 150);
|
||||
}
|
||||
});
|
||||
|
||||
Template.registerHelper("classInfo", (info) => {
|
||||
if(Session.get("demo")) {
|
||||
if(Session.equals("classInfo", "Personal")) var isYou = true;
|
||||
var thisClass = Session.get("myClasses").filter(function(obj) {
|
||||
return obj.name === Session.get("classInfo");
|
||||
})[0];
|
||||
} else {
|
||||
var thisClass = classes.findOne({
|
||||
_id: Session.get("classInfo")
|
||||
});
|
||||
if (thisClass === undefined) return;
|
||||
var isYou = Session.equals("classInfo", Meteor.userId());
|
||||
}
|
||||
switch (info) {
|
||||
case "name":
|
||||
return (isYou) ? "Personal" : thisClass.name;
|
||||
case "teacher":
|
||||
return (isYou) ? "None" : thisClass.teacher;
|
||||
case "hour":
|
||||
return (isYou) ? "None" : thisClass.hour;
|
||||
case "category":
|
||||
return (isYou) ? "Personal" : thisClass.category[0].toUpperCase() + thisClass.category.slice(1);
|
||||
case "privacy":
|
||||
return (isYou) ? true : thisClass.privacy;
|
||||
case "admin":
|
||||
if(Session.get("demo")) return "A. Robot";
|
||||
return Meteor.users.findOne({
|
||||
_id: (isYou) ? Meteor.userId() : thisClass.admin
|
||||
});
|
||||
case "code":
|
||||
if(isYou || Meteor.userId() !== thisClass.admin) return false;
|
||||
var exist;
|
||||
Meteor.call('getCode', thisClass._id, function(err, result) {
|
||||
Session.set("code", [(result === undefined || result === "") ? false : true, result]);
|
||||
});
|
||||
break;
|
||||
case "mine":
|
||||
return (isYou) ? true : Meteor.userId() === thisClass.admin;
|
||||
case "moderators":
|
||||
if (isYou || thisClass.moderators.length === 0) return [];
|
||||
var moderators = [];
|
||||
thisClass.moderators.forEach(function(ele) {
|
||||
var array = Meteor.users.findOne({
|
||||
_id: ele
|
||||
});
|
||||
array.delete = true;
|
||||
moderators.push(array);
|
||||
});
|
||||
return moderators;
|
||||
case "banned":
|
||||
if (isYou || thisClass.banned.length === 0) return [];
|
||||
var banned = [];
|
||||
thisClass.banned.forEach(function(ele) {
|
||||
var array = Meteor.users.findOne({
|
||||
_id: ele
|
||||
});
|
||||
array.delete = true;
|
||||
banned.push(array);
|
||||
});
|
||||
return banned;
|
||||
case "subscribers":
|
||||
if (isYou || thisClass.subscribers.length === 0) return [];
|
||||
var subscribers = [];
|
||||
thisClass.subscribers.forEach(function(ele) {
|
||||
subscribers.push(Meteor.users.findOne({
|
||||
_id: ele
|
||||
}));
|
||||
});
|
||||
return subscribers;
|
||||
case "personal":
|
||||
return isYou;
|
||||
}
|
||||
});
|
||||
|
||||
Template.registerHelper("classInfoMode", (mode, check) => {
|
||||
if (typeof check === "string") return Session.equals("classInfoMode", mode);
|
||||
return (Session.equals("classInfoMode", mode)) ? Session.get("user").preferences.theme.modeHighlight + ";background-color:rgba(0,0,0,0.1);" : "rgba(0,0,0,0)";
|
||||
});
|
||||
|
||||
Template.registerHelper("classSelected", () => {
|
||||
return !Session.equals("classInfo", null);
|
||||
});
|
||||
|
||||
Template.manageClass.rendered = function() {
|
||||
$("#classBody").slimScroll({
|
||||
width: '100%',
|
||||
height: '',
|
||||
touchScrollStep: 60,
|
||||
color: '#FFF',
|
||||
railOpacity: 0.7
|
||||
});
|
||||
}
|
||||
|
||||
Template.manageClass.events({
|
||||
'click .classBox' (event) {
|
||||
var classId = event.target.getAttribute("classid");
|
||||
if (Session.equals("classInfo", classId)) return;
|
||||
toggleToClassInfo(classId);
|
||||
},
|
||||
'click #classInfoModeWrapper span:first-child' () {
|
||||
if (Session.equals("classInfoMode", "general")) return;
|
||||
toggleToClassInfoMode("general");
|
||||
},
|
||||
'click #classInfoModeWrapper span:last-child' () {
|
||||
if (Session.equals("classInfoMode", "users")) return;
|
||||
if (Session.get("demo")) {
|
||||
sAlert.error("Not available in demo!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
toggleToClassInfoMode("users");
|
||||
},
|
||||
'click .infoCard .fa-pencil-square-o' () {
|
||||
$("#changeAdminWrapper").velocity("fadeIn", 150);
|
||||
},
|
||||
'click #adminSubmit' () {
|
||||
var input = document.getElementById("changeAdmin");
|
||||
var value = input.value;
|
||||
var classid = Session.get("classInfo");
|
||||
var user = Meteor.users.findOne({
|
||||
"services.google.email": value
|
||||
});
|
||||
if (!user) {
|
||||
sAlert.error("Invalid email!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
serverData = [
|
||||
user._id,
|
||||
classid
|
||||
];
|
||||
Session.set("confirmText", "Change ownership?");
|
||||
confirm = "changeAdmin";
|
||||
$("#confirmOverlay").velocity("fadeIn", 150);
|
||||
},
|
||||
'click #deleteClass' () {
|
||||
serverData = Session.get("classInfo");
|
||||
confirm = "deleteClass";
|
||||
Session.set("confirmText", "Delete this class?");
|
||||
$("#confirmOverlay").velocity("fadeIn", 150);
|
||||
},
|
||||
'click .classBox .fa-times' (event) {
|
||||
serverData = event.target.parentNode.getAttribute("classid");
|
||||
confirm = "leaveClass";
|
||||
Session.set("confirmText", "Leave this class?");
|
||||
$("#confirmOverlay").velocity("fadeIn", 150);
|
||||
}
|
||||
});
|
||||
|
||||
Template.joinClass.rendered = function() {
|
||||
$("#classBody").slimScroll({
|
||||
width: '100%',
|
||||
height: '',
|
||||
touchScrollStep: 60,
|
||||
color: '#FFF',
|
||||
railOpacity: 0.7
|
||||
});
|
||||
}
|
||||
|
||||
Template.joinClass.helpers({
|
||||
classes() { // Loads all of the possible classes ( Limit of twenty shown ) ( Sorts by class size ) ( Only your school)
|
||||
var array = classes.find({
|
||||
status: {
|
||||
$eq: true
|
||||
},
|
||||
privacy: {
|
||||
$eq: false
|
||||
},
|
||||
_id: {
|
||||
$nin: Session.get("user").classes
|
||||
},
|
||||
school: {
|
||||
$eq: Session.get("user").school
|
||||
}
|
||||
}, {
|
||||
sort: {
|
||||
subscribers: -1
|
||||
}
|
||||
}, {
|
||||
limit: 100
|
||||
}).fetch();
|
||||
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
array[i].join = true;
|
||||
array[i].subscribers = array[i].subscribers.length;
|
||||
array[i].teachershort = (array[i].teacher === undefined) ? "" : array[i].teacher.split(" ").slice(1);
|
||||
}
|
||||
if (array.length === 0) {
|
||||
Session.set("noclass", true);
|
||||
} else {
|
||||
Session.set("noclass", false);
|
||||
}
|
||||
return array;
|
||||
},
|
||||
classSettings() { // Returns autocomplete array for classes.
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 10,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: classes,
|
||||
template: Template.classAutoList,
|
||||
filter: {
|
||||
privacy: false,
|
||||
status: true
|
||||
},
|
||||
selector: (match) => {
|
||||
regex = new RegExp(match, 'i');
|
||||
return {
|
||||
$or: [{
|
||||
'name': regex
|
||||
}, {
|
||||
'teacher': regex
|
||||
}, {
|
||||
'hour': regex
|
||||
}]
|
||||
};
|
||||
}
|
||||
}]
|
||||
};
|
||||
},
|
||||
notsearching() { // Tells whether user is using the searchbox
|
||||
return Session.get("notsearching");
|
||||
},
|
||||
autocompleteClasses() { // Returns current auto-completes for classes
|
||||
return Session.get("autocompleteDivs");
|
||||
},
|
||||
notfound() { // Returns if autocomplete has no results.
|
||||
return Session.get("notfound");
|
||||
}
|
||||
});
|
||||
|
||||
Template.joinClass.events({
|
||||
'click .classBox' (event) {
|
||||
var classId = event.target.getAttribute("classid");
|
||||
if (Session.equals("classInfo", classId)) return;
|
||||
toggleToClassInfo(classId);
|
||||
},
|
||||
'click #classInfoModeWrapper span:first-child' () {
|
||||
if (Session.equals("classInfoMode", "general")) return;
|
||||
toggleToClassInfoMode("general");
|
||||
},
|
||||
'click #classInfoModeWrapper span:last-child' () {
|
||||
if (Session.equals("classInfoMode", "users")) return;
|
||||
toggleToClassInfoMode("users");
|
||||
},
|
||||
'input #classSearch' (event) { // Auto-complete updater
|
||||
if (event.target.value.length === 0) {
|
||||
Session.set("notsearching", true);
|
||||
} else {
|
||||
Session.set("notsearching", false);
|
||||
}
|
||||
Session.set("autocompleteDivs", null);
|
||||
var divs = [];
|
||||
try {
|
||||
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
|
||||
if(items[0].tagName === "I") {
|
||||
Session.set("notfound", true);
|
||||
return;
|
||||
} else {
|
||||
items = items[0].children;
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
var item = items[i].children;
|
||||
var id = item[4].textContent;
|
||||
if(Session.get("user").classes.indexOf(id) !== -1) continue;
|
||||
divs.push({
|
||||
name: item[0].textContent,
|
||||
teachershort: item[1].textContent.split(" ")[1],
|
||||
hour: item[2].textContent,
|
||||
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
|
||||
_id: id,
|
||||
join: true
|
||||
})
|
||||
}
|
||||
Session.set("autocompleteDivs", divs.sort(function(a, b) {
|
||||
return b.subscribers - a.subscribers;
|
||||
}));
|
||||
Session.set("notfound", false);
|
||||
return;
|
||||
}
|
||||
} catch(err) {}
|
||||
},
|
||||
'click .classBox .fa-plus' (event) {
|
||||
serverData = [event.target.parentNode.getAttribute("classid"), ""];
|
||||
confirm = "joinClass";
|
||||
Session.set("confirmText", "Join this class?");
|
||||
$("#confirmOverlay").velocity("fadeIn", 150);
|
||||
},
|
||||
'click #private' () {
|
||||
$("#privateCode").css('display', 'inline-block');
|
||||
var input = document.getElementById("privateCode");
|
||||
input.focus();
|
||||
if (input.value === "") return;
|
||||
Meteor.call("joinPrivateClass", input.value, function(error, result) {
|
||||
if (result) {
|
||||
sAlert.success("Joined!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 1500
|
||||
});
|
||||
$("#privateCode").velocity("fadeOut",100);
|
||||
} else {
|
||||
sAlert.error("Invalid code!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 1500
|
||||
});
|
||||
}
|
||||
Meteor.subscribe("classes");
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Template.createClass.helpers({
|
||||
schoolComplete() { // Returns autocomplete array for schools.
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 6,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: schools,
|
||||
field: 'name',
|
||||
matchAll: true,
|
||||
template: Template.schoolList
|
||||
}]
|
||||
};
|
||||
},
|
||||
teacherComplete() { // Returns autocomplete array for teachers.
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 1,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: teachers,
|
||||
field: 'name',
|
||||
template: Template.teacherList
|
||||
}]
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Template.createClass.events({
|
||||
'click #creSubmit' () {
|
||||
var inputs = document.getElementsByClassName("creInput");
|
||||
var required = ["school", "name", "privacy", "category"];
|
||||
var alert = checkComplete(required, inputs);
|
||||
var values = alert[2];
|
||||
if (!alert[0]) { // Check missing fields.
|
||||
sAlert.error("Missing " + alert[1], {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
values.privacy = (values.privacy === "Public") ? false : true;
|
||||
values.status = false;
|
||||
values.category = values.category.toLowerCase();
|
||||
values.code = "";
|
||||
serverData = values;
|
||||
|
||||
if(values.teacher !== "" && values.teacher.split(" ").length < 2) {
|
||||
sAlert.error("Please enter the full name of the teacher! Ex: Darrin Woods", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!teachers.findOne({
|
||||
name: values.teacher
|
||||
}) && values.teacher !== "") {
|
||||
Meteor.call("createTeacher", values.teacher, values.school, function(error, result) {
|
||||
if (error !== undefined) {
|
||||
sAlert.error(error.message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
} else {
|
||||
sendData("createClass");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sendData("createClass");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.classInfoCode.events({
|
||||
'click .fa' (event) {
|
||||
document.getElementById("copyHolder").select();
|
||||
document.execCommand("copy");
|
||||
$(event.target.parentNode.childNodes[9]).fadeIn(100, function() {
|
||||
setTimeout(function() {
|
||||
$(event.target.parentNode.childNodes[9]).velocity("fadeOut", 150);
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.classInfoCode.helpers({
|
||||
code(info) {
|
||||
try {
|
||||
if(info === "exists") {
|
||||
return Session.get("code")[0];
|
||||
} else {
|
||||
return Session.get("code")[1];
|
||||
}
|
||||
} catch(err) {}
|
||||
}
|
||||
})
|
||||
|
||||
Template.classInfoUsers.events({
|
||||
'click .userAdder .fa' (event) {
|
||||
var type = event.target.getAttribute("user");
|
||||
var input = event.target.parentNode.childNodes[4];
|
||||
var value = input.value;
|
||||
var classid = Session.get("classInfo");
|
||||
var user = Meteor.users.findOne({
|
||||
"services.google.email": value
|
||||
});
|
||||
if (!user) {
|
||||
sAlert.error("Invalid email!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
serverData = [
|
||||
user._id,
|
||||
classid,
|
||||
type,
|
||||
true
|
||||
];
|
||||
sendData("trackUserInClass");
|
||||
input.value = "";
|
||||
},
|
||||
'click .userDisp .fa' (event) {
|
||||
var outerInput = event.target.parentNode.parentNode.parentNode.parentNode.childNodes[1];
|
||||
var type = outerInput.childNodes[6].getAttribute("user");
|
||||
var userid = event.target.parentNode.parentNode.getAttribute("userid");
|
||||
if (!Meteor.users.findOne({
|
||||
_id: userid
|
||||
})) {
|
||||
sAlert.error("Stop hacking, reload the page.", {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
var classid = Session.get("classInfo");
|
||||
serverData = [
|
||||
userid,
|
||||
classid,
|
||||
type,
|
||||
false
|
||||
];
|
||||
sendData("trackUserInClass");
|
||||
}
|
||||
});
|
||||
|
||||
toggleToMode = function(mode) {
|
||||
$("#mainBody").fadeOut(150, function() {
|
||||
(Session.equals("sidebarMode", "option")) ? Session.set("settingMode", mode): Session.set("mode", mode);
|
||||
Session.set("classInfo", null);
|
||||
$("#mainBody").fadeIn(150);
|
||||
});
|
||||
};
|
||||
|
||||
toggleToSidebar = function(sidebar) {
|
||||
try {
|
||||
$("#backgroundOverlay").velocity("fadeOut", 200);
|
||||
} catch (err) {}
|
||||
if (Session.equals("sidebarMode", sidebar) || !sidebar) {
|
||||
$("#menuContainer").hide("slide", {
|
||||
direction: "left"
|
||||
}, 200);
|
||||
$("#divCenter").stop().velocity({
|
||||
left: '6vh'
|
||||
}, 200, function() {
|
||||
Session.set("sidebarMode", "");
|
||||
});
|
||||
} else {
|
||||
$("#menuContainer").show("slide", {
|
||||
direction: "left"
|
||||
}, 200);
|
||||
$("#divCenter").stop().velocity({
|
||||
left: '36vh'
|
||||
}, 200);
|
||||
$(".menuWrapper").fadeOut(200, function() {
|
||||
Session.set("sidebarMode", sidebar);
|
||||
});
|
||||
}
|
||||
filterOpen = [true, true, true, true, true];
|
||||
};
|
||||
|
||||
toggleToClassInfo = function(classId) {
|
||||
$("#changeAdminWrapper").velocity("fadeOut", 150);
|
||||
$("#infoClassCont").velocity("fadeOut", 150, function() {
|
||||
Session.set("classInfo", classId);
|
||||
Session.set("classInfoMode", "general");
|
||||
$(this).velocity("fadeIn", 150);
|
||||
});
|
||||
};
|
||||
|
||||
toggleToClassInfoMode = function(mode) {
|
||||
$("#infoClassCont").velocity("fadeOut", 150, function() {
|
||||
Session.set("classInfoMode", mode);
|
||||
$(this).velocity("fadeIn",150);
|
||||
});
|
||||
};
|
||||
529
hourglass/client/mobile/mobile.css
Normal file
@ -0,0 +1,529 @@
|
||||
#mobileHeader {
|
||||
border-bottom: 3px solid #999;
|
||||
position: relative;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#mobileHeader h2 {
|
||||
font-size: 5vw;
|
||||
font-weight: 200;
|
||||
|
||||
padding: 0;
|
||||
height: 13vw;
|
||||
|
||||
display: inline;
|
||||
|
||||
line-height: 13vw;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#mobileHeader .fa {
|
||||
font-size: 5vw;
|
||||
width: 10vw;
|
||||
height: 10vw;
|
||||
border: 0;
|
||||
line-height: 10vw;
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#mSidebarToggle {
|
||||
margin: 1.5vw 1vw 1.5vw 1vw;
|
||||
width: 10vw;
|
||||
height: 10vw;
|
||||
|
||||
background-color: rgba(255,255,255,0);
|
||||
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.selectText {
|
||||
margin: 0;
|
||||
margin-top: 10%;
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
#mobileBody {
|
||||
width: 100%;
|
||||
height: 91%;
|
||||
margin-bottom: 10%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.mClassContainer {
|
||||
border-bottom: 1px solid #AAA;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mobileClass {
|
||||
width: 100%;
|
||||
height: 20vw;
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.mClassContainer:last-child {
|
||||
margin-bottom: 20vw;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.mobileType {
|
||||
width: 2vw;
|
||||
height: 100%;
|
||||
|
||||
display: inline-block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mobileClassContent {
|
||||
width: 88vw;
|
||||
height: 12vw;
|
||||
padding: 4vw;
|
||||
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mobileClassContent h4 {
|
||||
font-size: 5vw;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.mobileClassContent div {
|
||||
position: absolute;
|
||||
right: 6%;
|
||||
bottom: 11%;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
|
||||
.minorHeader {
|
||||
font-size: 4vw !important;
|
||||
width: 96%;
|
||||
padding: 2%;
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
.mContTop {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mName {
|
||||
font-size: 4.3vw !important;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.mDate {
|
||||
font-size: 3.4vw !important;
|
||||
width: 28%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mClass {
|
||||
font-size: 3.5vw !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mDesc {
|
||||
width: 69%;
|
||||
font-size: 3.4vw !important;
|
||||
color: #BBB;
|
||||
}
|
||||
|
||||
#mainCircleButton {
|
||||
position: absolute;
|
||||
bottom: 6vw;
|
||||
right: 6vw;
|
||||
|
||||
background-color: rgb(255, 26, 26);
|
||||
}
|
||||
|
||||
.mCircleButton {
|
||||
width: 13vw;
|
||||
height: 13vw;
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
|
||||
|
||||
-webkit-filter: drop-shadow(3px 4px 4px #111);
|
||||
filter: drop-shadow(3px 4px 4px #111);
|
||||
}
|
||||
|
||||
.mCircleButton .fa {
|
||||
font-size: 5vw !important;
|
||||
padding: 0 !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
line-height: 13.1vw;
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mUndo {
|
||||
font-size: 4vw;
|
||||
width: 13vw;
|
||||
height: 13vw;
|
||||
|
||||
background-color: rgba(255,255,255, 0.1);
|
||||
|
||||
display: none;
|
||||
opacity: 0;
|
||||
|
||||
position: absolute;
|
||||
top: 3.75vw;
|
||||
right: 4vw;
|
||||
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.mUndo .fa {
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
|
||||
text-align: center;
|
||||
line-height: 9vw;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mUndo p {
|
||||
font-size: 3vw;
|
||||
width: 100%;
|
||||
height: 50%;
|
||||
margin: 0;
|
||||
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mUndoText {
|
||||
font-size: 4vw !important;
|
||||
height: 13vw;
|
||||
|
||||
display: none;
|
||||
opacity: 0;
|
||||
|
||||
position: absolute;
|
||||
top: 3.75vw;
|
||||
left: 8vw;
|
||||
|
||||
line-height: 13vw;
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#mOverlay {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
|
||||
display: none;
|
||||
opacity: 0;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
}
|
||||
|
||||
#mSidebar {
|
||||
height: 100%;
|
||||
width: 85%;
|
||||
|
||||
background-color: #fff;
|
||||
box-shadow: 2px 0px 1px 1px #222;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100vw;
|
||||
|
||||
overflow-y: auto;
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.mSectionTitle {
|
||||
width: 100%;
|
||||
height: 13vw;
|
||||
margin-top: 13vw;
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
.mSectionTitle h3 {
|
||||
font-weight: 200;
|
||||
font-size: 4vw;
|
||||
padding-left: 6%;
|
||||
line-height: 13vw;
|
||||
}
|
||||
|
||||
.mOpenable .fa {
|
||||
font-size: 4vw;
|
||||
height: 13vw;
|
||||
padding: 0;
|
||||
padding-right: 6%;
|
||||
float: right;
|
||||
line-height: 13vw;
|
||||
}
|
||||
|
||||
.mOpenable h3:first-child {
|
||||
font-weight: 200;
|
||||
display: inline-block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mSectionMode {
|
||||
font-size: 4vw !important;
|
||||
width: 100%;
|
||||
height: 13vw;
|
||||
display: table;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.mStatus {
|
||||
width: 2% !important;
|
||||
height: 100%;
|
||||
display: table-cell;
|
||||
|
||||
-webkit-transition: background-color 0.3s ease;
|
||||
-moz-transition: background-color 0.3s ease;
|
||||
-ms-transition: background-color 0.3s ease;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.mSectionMode .fa {
|
||||
font-size: 4vw;
|
||||
width: 10%;
|
||||
padding: 0 6% 0 6%;
|
||||
line-height: 13vw;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mSectionMode h4 {
|
||||
font-size: 3.5vw !important;
|
||||
width: 65%;
|
||||
padding-left: 5%;
|
||||
line-height: 13vw;
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#mFilterWrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mDisableFilter {
|
||||
font-weight: 200;
|
||||
font-size: 90%;
|
||||
margin-left: 30%;
|
||||
padding: 3%;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
|
||||
display: none;
|
||||
line-height: normal;
|
||||
pointer-events: all;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#mTypeFilterWrapper {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#mClassFilterWrapper {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mSideFilter, .mSideClass {
|
||||
width: 100%;
|
||||
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
display: table;
|
||||
}
|
||||
|
||||
.mSideTypeName {
|
||||
font-size: 3.5vw;
|
||||
width: 92%;
|
||||
margin: 0;
|
||||
padding: 5%;
|
||||
padding-left: 5%;
|
||||
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.mSideClass span {
|
||||
font-weight: 200;
|
||||
margin: 0;
|
||||
font-size: 3.5vw;
|
||||
padding: 5%;
|
||||
display: table-cell;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mSideClassName {
|
||||
width: 50%;
|
||||
padding-left: 5%;
|
||||
}
|
||||
|
||||
.mSideClassHour {
|
||||
width: 50%;
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
#mSettings, #mSignOut {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
#mSettings h3, #mSignOut h3 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#mSignOut {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mNoneText {
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
#dueDateCont, #typeCont {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#dueDateCont i, #typeCont i {
|
||||
position: absolute;
|
||||
top: calc(10% + 2vw);
|
||||
right: 4%;
|
||||
}
|
||||
|
||||
#name, #class, #dueDate, #type, #description {
|
||||
font-size: 3.7vw;
|
||||
width: 95%;
|
||||
padding: 2.5%;
|
||||
border-bottom: 1px solid #888;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#mRestrictText {
|
||||
width: 94%;
|
||||
text-align: right;
|
||||
padding: 3%;
|
||||
}
|
||||
|
||||
#mReport {
|
||||
position: absolute;
|
||||
bottom: 21vw;
|
||||
right: 6vw;
|
||||
|
||||
background-color: rgb(101, 101, 101);
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
#mConfirm {
|
||||
position: absolute;
|
||||
bottom: 36vw;
|
||||
right: 6vw;
|
||||
|
||||
background-color: rgb(101, 101, 101);
|
||||
|
||||
-webkit-transition: background-color 0.4s ease;
|
||||
-moz-transition: background-color 0.4s ease;
|
||||
-ms-transition: background-color 0.4s ease;
|
||||
transition: background-color 0.4s ease;
|
||||
}
|
||||
|
||||
.mNum {
|
||||
font-size: 4vw;
|
||||
width: 4vw;
|
||||
margin: 0;
|
||||
padding: 1.5%;
|
||||
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
text-align: center;
|
||||
background-color: rgba(255,255,255,0.3);
|
||||
}
|
||||
|
||||
#mConfirmNum {
|
||||
position: absolute;
|
||||
bottom: 38.5vw;
|
||||
right: 21vw;
|
||||
}
|
||||
|
||||
#mReportNum {
|
||||
position: absolute;
|
||||
bottom: 23.5vw;
|
||||
right: 21vw;
|
||||
}
|
||||
|
||||
#mDelete {
|
||||
padding: 3%;
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
|
||||
position: absolute;
|
||||
bottom: 7vw;
|
||||
left: 7vw;
|
||||
}
|
||||
|
||||
.mOption {
|
||||
font-size: 3.7vw;
|
||||
width: 92%;
|
||||
padding: 4%;
|
||||
border-bottom: 1px solid #888;
|
||||
background-color: rgba(255,255,255,0.05);
|
||||
display: table;
|
||||
}
|
||||
|
||||
.mOpTitle {
|
||||
margin: 0;
|
||||
width: 40%;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.mOpVal {
|
||||
width: 30%;
|
||||
display: table-cell;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mOptionText {
|
||||
font-size: 3.5vw;
|
||||
width: 92%;
|
||||
margin: 0;
|
||||
padding: 5%;
|
||||
padding-left: 7%;
|
||||
|
||||
display: table-cell;
|
||||
}
|
||||
268
hourglass/client/mobile/mobile.html
Normal file
@ -0,0 +1,268 @@
|
||||
<template name="mobile">
|
||||
<div class="noScroll" style="background-color: {{divColor 'mainColor'}}">
|
||||
<header id="mobileHeader" style="background-color:{{divColor 'mainColor'}}">
|
||||
<div id="mSidebarToggle">
|
||||
<i class="fa fa-{{buttonTypeHeader}}" style="color:{{iconStatus}}" aria-hidden="true"></i>
|
||||
</div>
|
||||
<h2>{{schoolName}}</h2>
|
||||
</header>
|
||||
<div id="mobileBody">
|
||||
{{#if showMode 'main'}}
|
||||
<h4 class="minorHeader">Main</h4>
|
||||
{{#each myWork}}
|
||||
{{> mobileClass}}
|
||||
{{/each}}
|
||||
<h3 class="mNoneText" style="display:{{noneText 'main'}}">Nothing left here!</h3>
|
||||
{{/if}}
|
||||
{{#if showMode 'done'}}
|
||||
<h4 class="minorHeader">Done</h4>
|
||||
{{#each myWork "done"}}
|
||||
{{> mobileClass}}
|
||||
{{/each}}
|
||||
<h3 class="mNoneText" style="display:{{noneText 'done'}}">You... should really get to work.</h3>
|
||||
{{/if}}
|
||||
{{#if showMode 'addWork'}}
|
||||
{{> mAddWork}}
|
||||
{{/if}}
|
||||
{{#if showMode 'editWork'}}
|
||||
{{> mEditWork}}
|
||||
{{/if}}
|
||||
{{#if showMode 'viewWork'}}
|
||||
{{> mViewWork}}
|
||||
{{/if}}
|
||||
{{#if showMode 'settings'}}
|
||||
{{> mSettings}}
|
||||
{{/if}}
|
||||
<div id="mainCircleButton" class="mCircleButton">
|
||||
<i class="fa fa-{{buttonType}}" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mOverlay"></div>
|
||||
<div id="mSidebar" style="background-color:{{divColor 'sidebarColor'}};border-left:3vw solid {{divColor 'sidebarColor'}}">
|
||||
{{#if select 'class'}}
|
||||
<p class="selectText">Pick a class to create work for</p>
|
||||
<div id="mClassFilterWrapper" class="mSectionTitle">
|
||||
<h3>Classes</h3>
|
||||
</div>
|
||||
<div id="mClassListHolder">
|
||||
{{#each myClasses}}
|
||||
{{> mSidebarClasses}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if select 'type'}}
|
||||
<p class="selectText">Pick a type for your work</p>
|
||||
<div id="mTypeFilterWrapper" class="mSectionTitle">
|
||||
<h3>Types</h3>
|
||||
</div>
|
||||
<div id="mClassFilterHolder">
|
||||
{{#each types}}
|
||||
{{> mSideTypeFilter}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if select 'options'}}
|
||||
<p class="selectText">Pick your new setting</p>
|
||||
<div id="mTypeFilterWrapper" class="mSectionTitle">
|
||||
<h3>{{optionInfo 'title'}}</h3>
|
||||
</div>
|
||||
<div id="mOptionHolder">
|
||||
{{#each optionInfo 'list'}}
|
||||
{{> mOptionCard}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if select 'none'}}
|
||||
{{> defaultSidebar}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{> sAlert}}
|
||||
{{> loginButtons}}
|
||||
</template>
|
||||
|
||||
<template name="mobileClass">
|
||||
<div class="mClassContainer" workid="{{_id}}">
|
||||
{{#if isDone}}
|
||||
<h4 class="mUndoText" workid="{{_id}}">Unmarked as done!</h4>
|
||||
{{else}}
|
||||
<h4 class="mUndoText" workid="{{_id}}">Marked as done!</h4>
|
||||
{{/if}}
|
||||
<div class="mUndo" workid="{{_id}}">
|
||||
<i class="fa fa-undo" aria-hidden="true"></i>
|
||||
<p>Undo</p>
|
||||
</div>
|
||||
<div class="mobileClass" style="background-color:{{divColor 'secondaryColor'}}" workid="{{_id}}">
|
||||
<div class="mobileType" style="background-color:{{typeColor}}"></div>
|
||||
<div class="mobileClassContent">
|
||||
<h4 class="mName">{{name}}</h4>
|
||||
<h4 class="mDate">{{dateWord}}</h4>
|
||||
<h4 class="mClass">{{className}}</h4>
|
||||
<h4 class="mDesc">{{shortdesc}}</h4>
|
||||
<div style="color:{{doneRatio}}">
|
||||
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
|
||||
<span>{{confirmationLength}}</span>
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||
<span>{{reportLength}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="defaultSidebar">
|
||||
<div class="mSectionTitle downOffset">
|
||||
<h3>Main</h3>
|
||||
</div>
|
||||
<div class="mSectionMode">
|
||||
<div class="mStatus" style="background-color:{{modeStatus 'main'}}"></div>
|
||||
<i class="fa fa-list-ul" aria-hidden="true"></i>
|
||||
<h4>Main Work</h4>
|
||||
</div>
|
||||
<div class="mSectionMode">
|
||||
<div class="mStatus" style="background-color:{{modeStatus 'done'}}"></div>
|
||||
<i class="fa fa-check-square" aria-hidden="true"></i>
|
||||
<h4>Done Work</h4>
|
||||
</div>
|
||||
<div id="mFilterHead" class="mSectionTitle mOpenable downOffset">
|
||||
<h3>Filters</h3>
|
||||
<h3 id="mDisableFilter" style="display:{{filterOn}}">Disable All</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="mFilterWrapper">
|
||||
<div id="mTypeFilterWrapper" class="mSectionTitle mOpenable">
|
||||
<h3>By Type</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="mClassFilterHolder">
|
||||
{{#each types}}
|
||||
{{> mSideTypeFilter}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="mClassFilterWrapper" class="mSectionTitle mOpenable">
|
||||
<h3>By Class</h3>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="mClassListHolder">
|
||||
{{#each myClasses}}
|
||||
{{> mSidebarClasses}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div id="mSettings" class="mSectionTitle mSectionMode">
|
||||
<i class="fa fa-cog" aria-hidden="true"></i>
|
||||
<h3>Settings</h3>
|
||||
</div>
|
||||
<div id="mSignOut" class="mSectionTitle mSectionMode">
|
||||
<i class="fa fa-sign-out" aria-hidden="true"></i>
|
||||
<h3>Sign out</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mSideTypeFilter">
|
||||
<div class="mSideFilter" type="{{type}}">
|
||||
<div class="mStatus" style="background-color:{{selected}}"></div>
|
||||
<span class="mSideTypeName">{{typeName}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mSidebarClasses">
|
||||
<div class="mSideClass" classid="{{_id}}">
|
||||
<div class="mStatus" style="background-color:{{selected}}"></div>
|
||||
<span class="mSideClassName">{{name}}</span>
|
||||
<span class="mSideClassHour">{{hour}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mOptionCard">
|
||||
<div class="mSideFilter">
|
||||
<span class="mOptionText">{{alias}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mAddWork">
|
||||
<h4 class="minorHeader">Add Work</h4>
|
||||
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name">
|
||||
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}">
|
||||
<div id="dueDateCont">
|
||||
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="typeCont">
|
||||
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description"></textarea>
|
||||
<div id="mRestrictText">
|
||||
<span class="resText">{{restrict 'name'}}</span>
|
||||
<span class="resText">{{restrict 'description'}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mEditWork">
|
||||
<h4 class="minorHeader">Edit Work</h4>
|
||||
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name" value="{{work 'name'}}">
|
||||
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}" onfocus="this.blur()" readonly>
|
||||
<div id="dueDateCont">
|
||||
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" value="{{work 'dueDate'}}" onfocus="this.blur()" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="typeCont">
|
||||
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" onfocus="this.blur()" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description" value="{{work 'description'}}"></textarea>
|
||||
<div id="mRestrictText">
|
||||
<span class="resText">{{restrict 'name'}}</span>
|
||||
<span class="resText">{{restrict 'description'}}</span>
|
||||
</div>
|
||||
<div id="mConfirm" class="mCircleButton" style="background-color:{{work 'userConfirm'}}">
|
||||
<i class="fa fa-thumbs-up" aria-hidden="true" ></i>
|
||||
</div>
|
||||
<p id="mConfirmNum" class="mNum">{{work 'confirmations'}}</p>
|
||||
<div id="mReport" class="mCircleButton" style="background-color:{{work 'userReport'}}">
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true" ></i>
|
||||
</div>
|
||||
<p id="mReportNum" class="mNum">{{work 'reports'}}</p>
|
||||
<!-- <h4 id="mDelete">Delete Work</h4> -->
|
||||
</template>
|
||||
|
||||
<template name="mViewWork">
|
||||
<h4 class="minorHeader">View Work</h4>
|
||||
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name" value="{{work 'name'}}" onfocus="this.blur()" readonly>
|
||||
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}" onfocus="this.blur()" readonly>
|
||||
<div id="dueDateCont">
|
||||
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" value="{{work 'dueDate'}}" onfocus="this.blur()" readonly>
|
||||
</div>
|
||||
<div id="typeCont">
|
||||
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" onfocus="this.blur()" readonly>
|
||||
</div>
|
||||
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description" value="{{work 'description'}}" onfocus="this.blur()" readonly></textarea>
|
||||
<div id="mRestrictText">
|
||||
<span class="resText">{{restrict 'name'}}</span>
|
||||
<span class="resText">{{restrict 'description'}}</span>
|
||||
</div>
|
||||
<div id="mConfirm" class="mCircleButton" style="background-color:{{work 'userConfirm'}}">
|
||||
<i class="fa fa-thumbs-up" aria-hidden="true" ></i>
|
||||
</div>
|
||||
<p id="mConfirmNum" class="mNum">{{work 'confirmations'}}</p>
|
||||
<div id="mReport" class="mCircleButton" style="background-color:{{work 'userReport'}}">
|
||||
<i class="fa fa-exclamation-triangle" aria-hidden="true" ></i>
|
||||
</div>
|
||||
<p id="mReportNum" class="mNum">{{work 'reports'}}</p>
|
||||
</template>
|
||||
|
||||
<template name="mSettings">
|
||||
<div id="theme" class="mOption">
|
||||
<p class="mOpTitle">Theme:</p>
|
||||
<p class="mOpVal">{{pref 'theme'}}</p>
|
||||
</div>
|
||||
<div id="timeHide" class="mOption">
|
||||
<p class="mOpTitle">Hide Homework:</p>
|
||||
<p class="mOpVal">{{pref 'timeHide'}}</p>
|
||||
</div>
|
||||
<div id="hideReport" class="mOption">
|
||||
<p class="mOpTitle">Hide Reported:</p>
|
||||
<p class="mOpVal">{{pref 'hideReport'}}</p>
|
||||
</div>
|
||||
</template>
|
||||
740
hourglass/client/mobile/mobile.js
Normal file
@ -0,0 +1,740 @@
|
||||
Session.set("mobileMode", "main");
|
||||
Session.set("classDisp", []);
|
||||
Session.set("typeFilter", []);
|
||||
Session.set("restrictText", {});
|
||||
Session.set("select", "none");
|
||||
Session.set("options", null);
|
||||
|
||||
var filterOpen = [false, true, true];
|
||||
var timeout;
|
||||
|
||||
Template.registerHelper('optionInfo', (type) => {
|
||||
var op = Session.get("options")
|
||||
if(type === "title") return op[1];
|
||||
if(type === "list") {
|
||||
return options[op[0]];
|
||||
}
|
||||
});
|
||||
|
||||
Template.mobile.created = function() {
|
||||
Session.set("myWork", []);
|
||||
Session.set("filterWork", []);
|
||||
getClasses(Session.get("user").classes);
|
||||
work.find().observeChanges({
|
||||
added: function (id, fields) {
|
||||
updateWork(id, fields, "added");
|
||||
filterWork();
|
||||
},
|
||||
changed: function (id, fields) {
|
||||
updateWork(id, fields, "changed");
|
||||
filterWork();
|
||||
},
|
||||
removed: function (id) {
|
||||
updateWork(id, null, "remove");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.mobile.rendered = function() {
|
||||
document.getElementsByTagName("body")[0].style.color = Session.get("user").preferences.theme.textColor;
|
||||
// Buttons
|
||||
addMobileButton($("#mainCircleButton")[0], 50, "color", function() {
|
||||
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
|
||||
Session.set("currentWork", null);
|
||||
Session.set("select", "class");
|
||||
toggleSidebar(true);
|
||||
} else if(Session.equals("mobileMode","addWork") || Session.equals("mobileMode", "editWork")) {
|
||||
var inputs = document.getElementsByClassName("mAddForm");
|
||||
var required = ["name", "dueDate", "class"];
|
||||
var alert = checkComplete(required, inputs);
|
||||
var values = alert[2];
|
||||
if(!alert[0]) {
|
||||
sAlert.error("Missing " + alert[1].replace("dueDate", "due date"), {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
values["class"] = Session.get("currentWork")["class"];
|
||||
values.type = Session.get("currentWork").type;
|
||||
values.dueDate = toDate(values["dueDate"]);
|
||||
|
||||
if(Session.equals("mobileMode","addWork")) {
|
||||
serverData = values;
|
||||
sendData("createWork");
|
||||
} else {
|
||||
values._id = Session.get("currentWork")._id;
|
||||
serverData = values;
|
||||
sendData("editWork");
|
||||
}
|
||||
|
||||
$("#mainCircleButton").velocity("fadeOut", 200);
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
Session.set("mobileMode", "main");
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
$("#mainCircleButton").velocity("fadeIn", 200);
|
||||
timedPushback(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
addMobileButton($("#mSidebarToggle")[0], 0.2, "brightness", function() {
|
||||
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
|
||||
toggleSidebar(true);
|
||||
} else {
|
||||
$("#mainCircleButton").velocity("fadeOut", 200);
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$("#mainCircleButton").velocity("fadeIn", 200);
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
Session.set("mobileMode", "main");
|
||||
timedPushback(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// FOR SIDEBAR SLIDEBACK
|
||||
var deltaX = 0;
|
||||
var sidebar = $("#mSidebar");
|
||||
new Hammer(sidebar[0], {
|
||||
domEvents: true
|
||||
});
|
||||
|
||||
sidebar.on('panmove', function(e) {
|
||||
var dX = deltaX + (e.originalEvent.gesture.deltaX);
|
||||
if(dX > 0) {
|
||||
$.Velocity.hook(sidebar, 'translateX', dX/70 + 'px');
|
||||
} else {
|
||||
$.Velocity.hook(sidebar, 'translateX', dX + 'px');
|
||||
}
|
||||
});
|
||||
|
||||
sidebar.on('panend', function(e) {
|
||||
deltaX += (e.originalEvent.gesture.deltaX);
|
||||
if(deltaX >= -window.innerWidth * 0.4) {
|
||||
deltaX = 0;
|
||||
sidebar.velocity({'translateX': "0px"}, 150);
|
||||
} else {
|
||||
deltaX = 0;
|
||||
toggleSidebar(false);
|
||||
|
||||
}
|
||||
});
|
||||
timedPushback(true);
|
||||
}
|
||||
|
||||
Template.mobile.events({
|
||||
'click #mOverlay' () {
|
||||
if(timeout) toggleSidebar(false);
|
||||
}
|
||||
});
|
||||
|
||||
Template.defaultSidebar.rendered = function() {
|
||||
addMobileButton($(".mSectionMode")[0], 0.2, "brightness", function() {
|
||||
if(Session.equals("mobileMode", "main")) {
|
||||
toggleSidebar(false);
|
||||
} else {
|
||||
Session.set("mobileMode","main");
|
||||
toggleSidebar(false);
|
||||
timedPushback(true);
|
||||
}
|
||||
});
|
||||
|
||||
addMobileButton($(".mSectionMode")[1], 0.2, "brightness", function() {
|
||||
if(Session.equals("mobileMode", "done")) {
|
||||
toggleSidebar(false);
|
||||
} else {
|
||||
Session.set("mobileMode","done");
|
||||
toggleSidebar(false);
|
||||
timedPushback(true);
|
||||
}
|
||||
});
|
||||
|
||||
addMobileButton($("#mSettings"), 0.1, "brightness" , function() {
|
||||
toggleSidebar(false);
|
||||
$("#mainCircleButton").velocity("fadeOut", 200);
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
Session.set("mobileMode", "settings");
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
addMobileButton($("#mSignOut"), 0.1, "brightness", function() {
|
||||
$(".noScroll").velocity("fadeOut", 50);
|
||||
document.getElementById('login-buttons-logout').click();
|
||||
})
|
||||
|
||||
addMobileButton($("#mFilterHead")[0], 0.1, "brightness", function() {
|
||||
if(event.target.id === "mDisableFilter") return;
|
||||
if (!filterOpen[0]) {
|
||||
$("#mFilterWrapper").slideDown(300);
|
||||
} else {
|
||||
$("#mFilterWrapper").slideUp(300);
|
||||
}
|
||||
filterOpen[0] = !filterOpen[0];
|
||||
});
|
||||
|
||||
addMobileButton($("#mTypeFilterWrapper")[0], 0.1, "brightness", function() {
|
||||
if (!filterOpen[1]) {
|
||||
$("#mClassFilterHolder").slideDown(300);
|
||||
} else {
|
||||
$("#mClassFilterHolder").slideUp(300);
|
||||
}
|
||||
filterOpen[1] = !filterOpen[1];
|
||||
});
|
||||
|
||||
addMobileButton($("#mClassFilterWrapper")[0], 0.1, "brightness", function() {
|
||||
if (!filterOpen[2]) {
|
||||
$("#mClassListHolder").slideDown(300);
|
||||
} else {
|
||||
$("#mClassListHolder").slideUp(300);
|
||||
}
|
||||
filterOpen[2] = !filterOpen[2];
|
||||
});
|
||||
|
||||
addMobileButton($("#mDisableFilter")[0], -0.1, "brightness", function() {
|
||||
Session.set("typeFilter", []);
|
||||
Session.set("classDisp", []);
|
||||
filterWork();
|
||||
timedPushback(true);
|
||||
});
|
||||
}
|
||||
|
||||
Template.defaultSidebar.helpers({
|
||||
modeStatus(mode) {
|
||||
return (Session.equals("mobileMode", mode)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
|
||||
},
|
||||
types() {
|
||||
var types = Object.keys(workColors);
|
||||
var array = [];
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
array.push({
|
||||
"type": types[i],
|
||||
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
|
||||
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
|
||||
});
|
||||
}
|
||||
return array;
|
||||
},
|
||||
filterOn() {
|
||||
return (Session.get("classDisp").length !== 0 || Session.get("typeFilter").length !== 0) ? "inline-block" : "none";
|
||||
}
|
||||
})
|
||||
|
||||
Template.mobileClass.rendered = function() {
|
||||
var deltaX = 0;
|
||||
var clearTile;
|
||||
let movable = jQuery(this.firstNode.children[2]);
|
||||
let undo = [jQuery(this.firstNode.children[0]), jQuery(this.firstNode.children[1])]
|
||||
|
||||
new Hammer(movable[0], {
|
||||
domEvents: true
|
||||
});
|
||||
|
||||
movable.on('panmove', function(e) {
|
||||
if(Math.abs(e.originalEvent.gesture.deltaY) >= 10) return;
|
||||
var dX = deltaX + (e.originalEvent.gesture.deltaX);
|
||||
if(dX < 0) {
|
||||
$.Velocity.hook(jQuery(e.target), 'translateX', dX/25 + 'px');
|
||||
} else {
|
||||
$.Velocity.hook(jQuery(e.target), 'translateX', dX + 'px');
|
||||
}
|
||||
});
|
||||
|
||||
movable.on('panend', function(e) {
|
||||
if(e.target === document.getElementById("mobileBody")) return;
|
||||
deltaX += (e.originalEvent.gesture.deltaX);
|
||||
var id = this.getAttribute("workid");
|
||||
if(deltaX >= window.innerWidth * 0.5) {
|
||||
deltaX = 0;
|
||||
jQuery(e.target).velocity(
|
||||
{
|
||||
translateX: window.innerWidth*1.2+"px"
|
||||
},
|
||||
{
|
||||
duration: 150,
|
||||
complete: function() {
|
||||
undo[0].velocity("fadeIn", {duration: 300});
|
||||
undo[1].velocity("fadeIn", {duration: 300});
|
||||
var container = $(".mClassContainer[workid="+id+"]");
|
||||
clearTile = setTimeout(function() {
|
||||
undo[0].velocity("fadeOut", {duration: 100});
|
||||
undo[1].velocity("fadeOut", {duration: 100});
|
||||
container.velocity(
|
||||
{
|
||||
height: 0
|
||||
},
|
||||
{
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
serverData = [container[0].getAttribute("workid"), "done"];
|
||||
sendData("toggleWork");
|
||||
container.remove();
|
||||
}
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
deltaX = 0;
|
||||
jQuery(e.target).velocity({translateX: "0px"},300);
|
||||
}
|
||||
});
|
||||
|
||||
addMobileButton(undo[1], -0.05, "brightness", function() {
|
||||
clearTimeout(clearTile);
|
||||
movable.velocity({translateX: "0px"},300);
|
||||
undo[0].velocity("fadeOut", {duration: 300});
|
||||
undo[1].velocity("fadeOut", {duration: 300});
|
||||
});
|
||||
|
||||
addMobileButton(movable, -10, "color", function() {
|
||||
Session.set("currentWork", work.findOne({_id: movable[0].getAttribute("workid")}));
|
||||
|
||||
var thisWork = work.findOne({
|
||||
_id: Session.get("currentWork")._id
|
||||
});
|
||||
var inRole = false;
|
||||
if (thisWork === undefined) return;
|
||||
var currClass = classes.findOne({
|
||||
_id: thisWork["class"]
|
||||
});
|
||||
if (Meteor.userId() === thisWork.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) {
|
||||
inRole = true;
|
||||
}
|
||||
|
||||
if(inRole) {
|
||||
$("#mainCircleButton").velocity("fadeOut", 200);
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$("#mainCircleButton").velocity("fadeIn", 200);
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
Session.set("mobileMode", "editWork");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#mainCircleButton").velocity("fadeOut", 200);
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
Session.set("mobileMode", "viewWork");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.mobileClass.helpers({
|
||||
inRole() { // Checks correct permissions.
|
||||
if(Session.equals("currentWork",null)) return;
|
||||
try {
|
||||
var thisWork = work.findOne({
|
||||
_id: Session.get("currentWork")._id
|
||||
});
|
||||
if (thisWork === undefined) return;
|
||||
var currClass = classes.findOne({
|
||||
_id: thisWork["class"]
|
||||
});
|
||||
if (Meteor.userId() === thisWork.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) return true;
|
||||
|
||||
} catch(err) {}
|
||||
}
|
||||
})
|
||||
|
||||
Template.mSidebarClasses.rendered = function() {
|
||||
let div = this.firstNode;
|
||||
addMobileButton(div, 0.1, "brightness", function() {
|
||||
var classid = div.getAttribute("classid");
|
||||
if(Session.equals("select", "class")) {
|
||||
var curr = Session.get("currentWork") || {};
|
||||
curr["class"] = classid;
|
||||
Session.set("currentWork", curr);
|
||||
toggleSidebar(false);
|
||||
if(!Session.equals("mobileMode", "addWork")) {
|
||||
$("#mobileBody").velocity("fadeOut", {
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
Session.set("mobileMode", "addWork");
|
||||
$("#mobileBody").velocity("fadeIn", 200);
|
||||
$("#mainCircleButton").velocity("fadeIn", 200);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
var array = Session.get("classDisp");
|
||||
if (array.indexOf(classid) !== -1) {
|
||||
array.splice(array.indexOf(classid), 1);
|
||||
} else {
|
||||
array.push(classid);
|
||||
}
|
||||
Session.set("classDisp", array);
|
||||
timedPushback(true);
|
||||
filterWork();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.mSideTypeFilter.rendered = function() {
|
||||
let div = this.firstNode;
|
||||
addMobileButton(div, 0.1, "brightness", function() {
|
||||
var type = div.getAttribute("type");
|
||||
if(Session.equals("select", "type")) {
|
||||
var curr = Session.get("currentWork") || {};
|
||||
curr["type"] = type;
|
||||
Session.set("currentWork", curr);
|
||||
toggleSidebar(false);
|
||||
} else {
|
||||
var array = Session.get("typeFilter");
|
||||
if (array.indexOf(type) !== -1) {
|
||||
array.splice(array.indexOf(type), 1);
|
||||
} else {
|
||||
array.push(type);
|
||||
}
|
||||
Session.set("typeFilter", array);
|
||||
timedPushback(true);
|
||||
filterWork();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Template.mobile.helpers({
|
||||
schoolName() { // Finds the name of the user's school.
|
||||
if (Session.get("user").school === undefined || Session.get("user").school === null) return;
|
||||
return Session.get("user").school;
|
||||
},
|
||||
iconStatus() {
|
||||
return (Session.get("sidebarMode") === "mobile") ? Session.get("user").preferences.theme.iconHighlight : "";
|
||||
},
|
||||
myWork(done) {
|
||||
return (done === "done") ?
|
||||
Session.get("myWork").filter(function(work) {
|
||||
return _.contains(work.done, Meteor.userId());
|
||||
}) :
|
||||
Session.get("myWork").filter(function(work) {
|
||||
return !_.contains(work.done, Meteor.userId());
|
||||
});
|
||||
},
|
||||
showMode(mode) {
|
||||
return Session.equals("mobileMode", mode);
|
||||
},
|
||||
types() {
|
||||
var types = Object.keys(workColors);
|
||||
var array = [];
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
array.push({
|
||||
"type": types[i],
|
||||
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
|
||||
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
|
||||
});
|
||||
}
|
||||
return array;
|
||||
},
|
||||
noneText(type) {
|
||||
return (type === "main") ?
|
||||
(Session.get("myWork").filter(function(work) {
|
||||
return !_.contains(work.done, Meteor.userId());
|
||||
}).length === 0) ? "block" : "none"
|
||||
:
|
||||
(Session.get("myWork").filter(function(work) {
|
||||
return _.contains(work.done, Meteor.userId());
|
||||
}).length === 0) ? "block" : "none";
|
||||
},
|
||||
buttonType() {
|
||||
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
|
||||
return "pencil";
|
||||
} else if(Session.equals("mobileMode","addWork")) {
|
||||
return "plus";
|
||||
} else if(Session.equals("mobileMode", "editWork")) {
|
||||
return "floppy-o";
|
||||
}
|
||||
},
|
||||
buttonTypeHeader() {
|
||||
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
|
||||
return "bars";
|
||||
} else if(Session.equals("mobileMode","addWork") || Session.equals("mobileMode","editWork")) {
|
||||
return "times";
|
||||
} else if(Session.equals("mobileMode", "viewWork") || Session.equals("mobileMode", "settings")) {
|
||||
return "arrow-left";
|
||||
}
|
||||
},
|
||||
select(type) {
|
||||
return Session.equals("select", type);
|
||||
}
|
||||
});
|
||||
|
||||
Template.mobileClass.helpers({
|
||||
isDone() {
|
||||
return Session.equals("mobileMode", "done");
|
||||
},
|
||||
})
|
||||
|
||||
Template.mAddWork.rendered = function() {
|
||||
addMobileButton($('#dueDate'), 0.2, "brightness", function() {
|
||||
$('#dueDate').datepicker({
|
||||
format: 'DD, MM d, yyyy',
|
||||
clickInput: true,
|
||||
startDate: 'd',
|
||||
todayHighlight: true,
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
});
|
||||
|
||||
addMobileButton($('#class'), 0.2, "brightness", function() {
|
||||
Session.set("select", "class");
|
||||
toggleSidebar(true);
|
||||
});
|
||||
|
||||
addMobileButton($('#type'), 0.2, "brightness", function() {
|
||||
Session.set("select", "type");
|
||||
toggleSidebar(true);
|
||||
});
|
||||
}
|
||||
|
||||
Template.mEditWork.rendered = function() {
|
||||
addMobileButton($('#dueDate'), 0.2, "brightness", function() {
|
||||
$('#dueDate').datepicker({
|
||||
format: 'DD, MM d, yyyy',
|
||||
clickInput: true,
|
||||
startDate: 'd',
|
||||
todayHighlight: true,
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
});
|
||||
|
||||
addMobileButton($('#class'), 0.2, "brightness", function() {});
|
||||
|
||||
addMobileButton($('#type'), 0.2, "brightness", function() {
|
||||
Session.set("select", "type");
|
||||
toggleSidebar(true);
|
||||
});
|
||||
|
||||
/*addMobileButton($("#mDelete"), 0.2, "brightness", function() {
|
||||
|
||||
})*/
|
||||
}
|
||||
|
||||
Template.mAddWork.events({
|
||||
'input .restrict' (event) {
|
||||
var restrict = event.target.maxLength;
|
||||
var chars = restrict - event.target.value.length;
|
||||
var newSetting = Session.get("restrictText");
|
||||
newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
|
||||
newSetting.selected = event.target.id;
|
||||
Session.set("restrictText", newSetting);
|
||||
}
|
||||
});
|
||||
|
||||
Template.mEditWork.events({
|
||||
'input .restrict' (event) {
|
||||
var restrict = event.target.maxLength;
|
||||
var chars = restrict - event.target.value.length;
|
||||
var newSetting = Session.get("restrictText");
|
||||
newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
|
||||
newSetting.selected = event.target.id;
|
||||
Session.set("restrictText", newSetting);
|
||||
},
|
||||
'click #mConfirm' () {
|
||||
serverData = [Session.get("currentWork")._id, "confirmations"];
|
||||
sendData("toggleWork");
|
||||
},
|
||||
'click #mReport' () {
|
||||
serverData = [Session.get("currentWork")._id, "reports"];
|
||||
sendData("toggleWork");
|
||||
}
|
||||
});
|
||||
|
||||
Template.mViewWork.events({
|
||||
'click #mConfirm' () {
|
||||
serverData = [Session.get("currentWork")._id, "confirmations"];
|
||||
sendData("toggleWork");
|
||||
},
|
||||
'click #mReport' () {
|
||||
serverData = [Session.get("currentWork")._id, "reports"];
|
||||
sendData("toggleWork");
|
||||
}
|
||||
});
|
||||
|
||||
Template.mSettings.rendered = function() {
|
||||
var options = ["theme", "timeHide", "done", "hideReport"];
|
||||
for(let i = 0; i < options.length; i++) {
|
||||
addMobileButton($("#"+options[i]), 0.05, "brightness", function() {
|
||||
Session.set("select", "options");
|
||||
Session.set("options", [options[i], $("#"+options[i])[0].children[0].innerHTML.replace(":","")]);
|
||||
toggleSidebar(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Template.mOptionCard.rendered = function() {
|
||||
var div = this.firstNode;
|
||||
addMobileButton(this.firstNode, 0.2, "brightness", function() {
|
||||
var newSetting = Session.get("user");
|
||||
var option = div.children[0].innerHTML;
|
||||
newSetting.preferences[Session.get("options")[0]] = (function() {
|
||||
var value = options[Session.get("options")[0]].filter(function(entry) {
|
||||
return option === entry.alias;
|
||||
})[0].val;
|
||||
return (Session.get("options")[0] === 'theme') ? themeColors[value] : value;
|
||||
})();
|
||||
Session.set("user", newSetting);
|
||||
serverData = Session.get("user");
|
||||
sendData("editProfile");
|
||||
toggleSidebar(false);
|
||||
});
|
||||
}
|
||||
|
||||
addMobileButton = function(element, lighten, animateType, completeFunction) {
|
||||
let add = lighten;
|
||||
let type = animateType;
|
||||
let ele = jQuery(element);
|
||||
let execute = completeFunction;
|
||||
let care = true;
|
||||
|
||||
let colors = [
|
||||
parseFloat($.Velocity.hook(ele, "backgroundColorRed")),
|
||||
parseFloat($.Velocity.hook(ele, "backgroundColorGreen")),
|
||||
parseFloat($.Velocity.hook(ele, "backgroundColorBlue")),
|
||||
parseFloat($.Velocity.hook(ele, "backgroundColorAlpha"))
|
||||
];
|
||||
|
||||
ele.on('touchstart', function(e) {
|
||||
care = true;
|
||||
switch(type) {
|
||||
case "color":
|
||||
ele.velocity(
|
||||
{
|
||||
backgroundColorRed: colors[0] + add,
|
||||
backgroundColorGreen: colors[1] + add,
|
||||
backgroundColorBlue: colors[2] + add
|
||||
},100);
|
||||
break;
|
||||
case "brightness":
|
||||
ele.velocity({backgroundColorAlpha: colors[3] + add},100);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
ele.on('touchend', function(e) {
|
||||
if(!care) return;
|
||||
ele.velocity("stop");
|
||||
timeout = false;
|
||||
setTimeout(function() {
|
||||
timeout = true;
|
||||
}, 100);
|
||||
switch(type) {
|
||||
case "color":
|
||||
ele.velocity(
|
||||
{
|
||||
backgroundColorRed: colors[0],
|
||||
backgroundColorGreen: colors[1],
|
||||
backgroundColorBlue: colors[2]
|
||||
},
|
||||
{
|
||||
duration: 200,
|
||||
complete: execute()
|
||||
});
|
||||
break;
|
||||
case "brightness":
|
||||
ele.velocity(
|
||||
{
|
||||
backgroundColorAlpha: colors[3]
|
||||
},
|
||||
{
|
||||
duration: 200,
|
||||
complete: execute()
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
ele.on('touchmove', function(e) {
|
||||
if (element !== document.elementFromPoint(e.originalEvent.touches[0].pageX,e.originalEvent.touches[0].pageY)) {
|
||||
ele.mouseleave();
|
||||
}
|
||||
})
|
||||
|
||||
ele.on('mouseleave', function(e) {
|
||||
if(!care) return;
|
||||
care = false;
|
||||
switch(type) {
|
||||
case "color":
|
||||
ele.velocity(
|
||||
{
|
||||
backgroundColorRed: colors[0],
|
||||
backgroundColorGreen: colors[1],
|
||||
backgroundColorBlue: colors[2]
|
||||
},200);
|
||||
break;
|
||||
case "brightness":
|
||||
ele.velocity({backgroundColorAlpha: colors[3]},200);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggleSidebar(open) {
|
||||
if(open) {
|
||||
$("#mOverlay").velocity("fadeIn", 300);
|
||||
$("#mSidebar").velocity({left: '-3vw'}, 300);
|
||||
} else {
|
||||
$("#mOverlay").velocity("fadeOut", 300);
|
||||
$("#mSidebar").velocity(
|
||||
{
|
||||
left: '-100vw'
|
||||
},
|
||||
{
|
||||
duration: 300,
|
||||
complete: function() {
|
||||
$.Velocity.hook($("#mSidebar"), 'translateX', '0px');
|
||||
Session.set("select", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function timedPushback(type) {
|
||||
var fadeTime = 10;
|
||||
$(".mClassContainer").velocity("stop", true);
|
||||
if(!type) {
|
||||
setTimeout(function() {
|
||||
$(".mClassContainer").velocity({opacity: 1}, 0);
|
||||
}, fadeTime);
|
||||
} else {
|
||||
$(".mClassContainer").velocity("fadeOut", fadeTime);
|
||||
setTimeout(function() {
|
||||
$(".mClassContainer").velocity({left: "-150vw"}, 0);
|
||||
$(".mClassContainer").velocity("fadeIn", 0);
|
||||
$(".mClassContainer").velocity({opacity: 1}, 0);
|
||||
var i = 0;
|
||||
var timer = setInterval(function() {
|
||||
$($(".mClassContainer")[i]).velocity({left: ""});
|
||||
if(i === $(".mClassContainer").length - 1) clearInterval(timer);
|
||||
i += 1;
|
||||
}, 100);
|
||||
}, fadeTime);
|
||||
}
|
||||
}
|
||||
179
hourglass/client/profile/mProfile.css
Normal file
@ -0,0 +1,179 @@
|
||||
#mProfWrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #282933;
|
||||
color: #FCF0F0 !important;
|
||||
position: absolute;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.mSelect {
|
||||
font-size: 4vw;
|
||||
width: 100%;
|
||||
padding: 4.5%;
|
||||
|
||||
border-bottom: 1px solid #888 !important;
|
||||
}
|
||||
|
||||
#mOpOverlay {
|
||||
color: #FCF0F0 !important;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
|
||||
display: none;
|
||||
opacity: 0;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#mProfMain {
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
#schoolCont, #gradeCont, #classCont {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#schoolCont .fa, #gradeCont .fa {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
right: 4%;
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#classCont .fa {
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 35%;
|
||||
right: 3%;
|
||||
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#mOpCont {
|
||||
width: 70%;
|
||||
margin: auto;
|
||||
margin-top: 30%;
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
#mOpCont h3 {
|
||||
font-weight: 200;
|
||||
padding: 4%;
|
||||
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
#mOpProfCont {
|
||||
max-height: 56vh;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.mOpCard2 {
|
||||
width: 90%;
|
||||
padding: 4% 4% 4% 6%;
|
||||
border-bottom: 1px solid #555;
|
||||
background-color: rgba(255,255,255,0.01);
|
||||
}
|
||||
|
||||
#mProfClass {
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
#classCont {
|
||||
padding: 3%;
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
#classCont h3 {
|
||||
font-weight: 100;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.mDisable {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.mClassBox {
|
||||
width: 90%;
|
||||
padding: 4% 4% 4% 6%;
|
||||
|
||||
border-bottom: 1px solid #555;
|
||||
background-color: rgba(255,255,255,0.01);
|
||||
|
||||
display: table;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.mProfClassDelete {
|
||||
width: 9vw;
|
||||
height: 9vw;
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.mClassBox .fa {
|
||||
font-size: 4vw !important;
|
||||
line-height: 9vw !important;
|
||||
}
|
||||
|
||||
#mProfClass .mClassBox {
|
||||
width: 94%;
|
||||
padding: 2% 2% 2% 4%;
|
||||
}
|
||||
|
||||
#mProfClass .name {
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
#mProfClassTitle {
|
||||
font-weight: 200;
|
||||
width: 92%;
|
||||
padding: 4%;
|
||||
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
|
||||
display: table;
|
||||
}
|
||||
|
||||
#mProfClassTitle h3 {
|
||||
width: 40%;
|
||||
background-color: rgba(0,0,0,0);
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
#mOpProfCont h3 {
|
||||
background-color: rgba(255,255,255,0);
|
||||
}
|
||||
|
||||
#mClassSearch {
|
||||
font-size: 3.5vw;
|
||||
width: 90%;
|
||||
padding: 5%;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#mProfWrapper .-autocomplete-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mProfSubmit {
|
||||
font-size: 4vw;
|
||||
width: 15vw;
|
||||
margin: 5vh auto 5vh auto;
|
||||
padding: 3%;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
text-align: center;
|
||||
|
||||
position: absolute;
|
||||
left: 42.5vw;
|
||||
}
|
||||
91
hourglass/client/profile/mProfile.html
Normal file
@ -0,0 +1,91 @@
|
||||
<template name="mProfile">
|
||||
<div class="noScroll mProfCont">
|
||||
<div id="mProfWrapper">
|
||||
<div id="mProfMain">
|
||||
<div id="schoolCont">
|
||||
<input class="mSelect" id="school" form="school" onfocus="this.blur()" placeholder="School" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="gradeCont">
|
||||
<input class="mSelect" id="grade" form="grade" onfocus="this.blur()" placeholder="Graduation Year" readonly>
|
||||
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mProfClass">
|
||||
<div id="classCont" class="mDisable">
|
||||
<h3>My Classes</h3>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{#each mProfClasses}}
|
||||
{{> mClassDisplay2}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<p id="mProfSubmit">Finish!</p>
|
||||
</div>
|
||||
<div id="mOpOverlay">
|
||||
<div id="mOpCont">
|
||||
{{#if mProfOp 'class'}}
|
||||
<div id="mProfClassTitle">
|
||||
<h3>Select</h3>
|
||||
{{> inputAutocomplete id="mClassSearch" settings=classSettings placeholder="Search..."}}
|
||||
</div>
|
||||
<div id="mOpProfCont">
|
||||
{{#if notsearching}}
|
||||
{{#each classes}}
|
||||
{{> mClassDisplay}}
|
||||
{{/each}}
|
||||
{{#if noclass}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#each autocompleteClasses}}
|
||||
{{> mClassDisplay}}
|
||||
{{/each}}
|
||||
{{#if notfound}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{else}}
|
||||
<h3>Select</h3>
|
||||
<div id="mOpProfCont">
|
||||
{{#if mProfOp 'school'}}
|
||||
{{#each selectOptions 'school'}}
|
||||
{{> mOptionCard2}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{#if mProfOp 'grade'}}
|
||||
{{#each selectOptions 'grade'}}
|
||||
{{> mOptionCard2}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{> sAlert}}
|
||||
</template>
|
||||
|
||||
<template name="mOptionCard2">
|
||||
<h4 class="mOpCard2">{{alias}}</h4>
|
||||
</template>
|
||||
|
||||
<template name="mClassDisplay">
|
||||
<div class="mClassBox" classid="{{_id}}">
|
||||
<span class="name classText">{{name}}</span>
|
||||
<span class="teacher classText">{{teachershort}}</span>
|
||||
<span class="hour classText">{{hour}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="mClassDisplay2">
|
||||
<div class="mClassBox" classid="{{_id}}">
|
||||
<span class="name classText">{{name}}</span>
|
||||
<span class="teacher classText">{{teachershort}}</span>
|
||||
<span class="hour classText">{{hour}}</span>
|
||||
<div class="mProfClassDelete mCircleButton">
|
||||
<i class="fa fa-times" aria-hidden="true" ></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
262
hourglass/client/profile/mProfile.js
Normal file
@ -0,0 +1,262 @@
|
||||
Session.set("profile", {classes: []});
|
||||
Session.set("notsearching", true); // If user isn't searching
|
||||
Session.set("noclass", null); // If user doesn't have classes.
|
||||
Session.set("autocompleteDivs", null);
|
||||
|
||||
Template.mProfile.rendered = function() {
|
||||
addMobileButton($("#school"), 0.2, "brightness", function() {
|
||||
Session.set("mProfOption", "school");
|
||||
$("#mOpOverlay").velocity("fadeIn", 200);
|
||||
});
|
||||
|
||||
addMobileButton($("#grade"), 0.2, "brightness", function() {
|
||||
Session.set("mProfOption", "grade");
|
||||
$("#mOpOverlay").velocity("fadeIn", 200);
|
||||
});
|
||||
|
||||
addMobileButton($("#classCont"), -0.1, "brightness", function() {
|
||||
if(Session.get("profile").school === undefined) return;
|
||||
Session.set("mProfOption", "class");
|
||||
$("#mOpOverlay").velocity("fadeIn", 200);
|
||||
});
|
||||
|
||||
addMobileButton($("#mProfSubmit"), -0.1, "brightness", function() {
|
||||
var myClasses = Session.get("profile").classes;
|
||||
var message = "Sorry, your profile couldn't be created. Please try again!";
|
||||
|
||||
var inputs = document.getElementsByClassName("mSelect");
|
||||
var required = ["school","grade"];
|
||||
var alert = checkComplete(required, inputs);
|
||||
var values = alert[2];
|
||||
if(!alert[0]) {
|
||||
sAlert.error("Missing " + alert[1], {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(myClasses.length === 0) {
|
||||
sAlert.error("Please enroll in a class!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
joinClass(0);
|
||||
|
||||
var profile = Session.get("profile");
|
||||
profile.complete = true;
|
||||
profile.preferences = Meteor.user().profile.preferences;
|
||||
profile.classes.push(Meteor.userId());
|
||||
Meteor.call("editProfile", profile, function(err, result) {
|
||||
if(err !== undefined) {
|
||||
sAlert.error(message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
Meteor.subscribe('classes');
|
||||
Meteor.subscribe('schools');
|
||||
Meteor.subscribe('teachers');
|
||||
Meteor.subscribe('work');
|
||||
Meteor.subscribe('requests');
|
||||
Meteor.subscribe("personalUser");
|
||||
Meteor.subscribe('users');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Template.mProfile.helpers({
|
||||
mProfOp(type) {
|
||||
return Session.equals("mProfOption", type);
|
||||
},
|
||||
classes() {
|
||||
var array = classes.find({
|
||||
status: {
|
||||
$eq: true
|
||||
},
|
||||
privacy: {
|
||||
$eq: false
|
||||
},
|
||||
_id: {
|
||||
$nin: Session.get("profile").classes
|
||||
},
|
||||
school: {
|
||||
$eq: Session.get("profile").school
|
||||
}
|
||||
}, {
|
||||
sort: {
|
||||
subscribers: -1
|
||||
}
|
||||
}, {
|
||||
limit: 20
|
||||
}).fetch();
|
||||
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
array[i].subscribers = array[i].subscribers.length;
|
||||
array[i].teachershort = array[i].teacher.split(" ").slice(1).reduce(function(a, b) {
|
||||
return a + " " + b;
|
||||
});
|
||||
}
|
||||
if (array.length === 0) {
|
||||
Session.set("noclass", true);
|
||||
} else {
|
||||
Session.set("noclass", false);
|
||||
}
|
||||
return array;
|
||||
},
|
||||
classSettings() {
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 10,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: classes,
|
||||
template: Template.classAutoList,
|
||||
filter: {
|
||||
privacy: false,
|
||||
status: true
|
||||
},
|
||||
selector: (match) => {
|
||||
regex = new RegExp(match, 'i');
|
||||
return {
|
||||
$or: [{
|
||||
'name': regex
|
||||
}, {
|
||||
'teacher': regex
|
||||
}, {
|
||||
'hour': regex
|
||||
}]
|
||||
};
|
||||
}
|
||||
}]
|
||||
};
|
||||
},
|
||||
notsearching() { // Tells whether user is using the searchbox
|
||||
return Session.get("notsearching");
|
||||
},
|
||||
autocompleteClasses() { // Returns current auto-completes for classes
|
||||
return Session.get("autocompleteDivs");
|
||||
},
|
||||
notfound() { // Returns if autocomplete has no results.
|
||||
return Session.get("notfound");
|
||||
},
|
||||
mProfClasses() {
|
||||
var array = [];
|
||||
var myClasses = Session.get("profile").classes;
|
||||
for(var i = 0; i < myClasses.length; i++) {
|
||||
var val = classes.findOne({_id: myClasses[i]});
|
||||
val.subscribers = val.subscribers.length;
|
||||
val.teachershort = val.teacher.split(" ").slice(1).reduce(function(a, b) {
|
||||
return a + " " + b;
|
||||
});
|
||||
array.push(val);
|
||||
|
||||
}
|
||||
return array;
|
||||
}
|
||||
});
|
||||
|
||||
Template.mProfile.events({
|
||||
'click #mOpOverlay' (event) {
|
||||
if(event.target.id === "mOpOverlay") {
|
||||
$("#mOpOverlay").velocity("fadeOut", 200);
|
||||
}
|
||||
},
|
||||
'input #mClassSearch' (event) { // Auto-complete updater
|
||||
if (event.target.value.length === 0) {
|
||||
Session.set("notsearching", true);
|
||||
} else {
|
||||
Session.set("notsearching", false);
|
||||
}
|
||||
Session.set("autocompleteDivs", null);
|
||||
var divs = [];
|
||||
try {
|
||||
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
|
||||
if(items[0].tagName === "I") {
|
||||
Session.set("notfound", true);
|
||||
return;
|
||||
} else {
|
||||
items = items[0].children;
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
var item = items[i].children;
|
||||
var id = item[4].textContent;
|
||||
if(Session.get("profile").classes.indexOf(id) !== -1) continue;
|
||||
divs.push({
|
||||
name: item[0].textContent,
|
||||
teachershort: item[1].textContent.split(" ")[1],
|
||||
hour: item[2].textContent,
|
||||
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
|
||||
_id: id,
|
||||
join: true
|
||||
})
|
||||
}
|
||||
Session.set("autocompleteDivs", divs.sort(function(a, b) {
|
||||
return b.subscribers - a.subscribers;
|
||||
}));
|
||||
Session.set("notfound", false);
|
||||
return;
|
||||
}
|
||||
} catch(err) {}
|
||||
},
|
||||
})
|
||||
|
||||
Template.mOptionCard2.rendered = function() {
|
||||
var div = this.firstNode;
|
||||
addMobileButton(div, 0.1, "brightness", function() {
|
||||
$("#"+Session.get("mProfOption"))[0].value = div.innerHTML;
|
||||
var newSetting = Session.get("profile");
|
||||
if(Session.equals("mProfOption", "school")) {
|
||||
$("#classCont").removeClass("mDisable");
|
||||
if(div.innerHTML !== Session.get("profile").school) {
|
||||
newSetting["classes"] = [];
|
||||
}
|
||||
newSetting[Session.get("mProfOption")] = div.innerHTML;
|
||||
} else {
|
||||
newSetting[Session.get("mProfOption")] = div.innerHTML;
|
||||
}
|
||||
Session.set("profile", newSetting);
|
||||
$("#mOpOverlay").velocity("fadeOut", 200);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Template.mClassDisplay.rendered = function() {
|
||||
var div = this.firstNode;
|
||||
addMobileButton(div, 0.1, "brightness", function() {
|
||||
var newSetting = Session.get("profile");
|
||||
newSetting.classes.push(div.getAttribute("classid"));
|
||||
Session.set("profile", newSetting);
|
||||
$("#mOpOverlay").velocity("fadeOut", 200);
|
||||
});
|
||||
}
|
||||
|
||||
Template.mClassDisplay2.rendered = function() {
|
||||
let div = this.firstNode.children[3];
|
||||
addMobileButton(div, 0.1, "brightness", function() {
|
||||
console.log(div);
|
||||
var newSetting = Session.get("profile");
|
||||
newSetting.classes.splice(newSetting.classes.indexOf(div.parentNode.getAttribute("classid")),1)
|
||||
Session.set("profile", newSetting);
|
||||
});
|
||||
}
|
||||
|
||||
function joinClass(num) {
|
||||
var joining = Session.get("profile").classes;
|
||||
if(joining.length === 0) return;
|
||||
Meteor.call("joinClass", [joining[num], ""], function(err, result) {
|
||||
if(err !== undefined) {
|
||||
sAlert.error(err.message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
joined++;
|
||||
if(joined !== joining.length) {
|
||||
joinClass(joined);
|
||||
}
|
||||
});
|
||||
}
|
||||
294
hourglass/client/profile/profile.css
Normal file
@ -0,0 +1,294 @@
|
||||
#profPageWrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #282933;
|
||||
color: #FCF0F0 !important;
|
||||
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#profPageWrapper input {
|
||||
color: #FCF0F0 !important;
|
||||
}
|
||||
|
||||
#profPageWrapper .optionText {
|
||||
background-color: #282933 !important;
|
||||
}
|
||||
|
||||
#profPageWrapper #classSearch {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
border: 0;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#profPageWrapper #classSearch:hover {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#profPageWrapper .classBox:not(#label) {
|
||||
border: 1px solid #FCF0F0 !important;
|
||||
}
|
||||
|
||||
#basicInfo {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 20%;
|
||||
}
|
||||
|
||||
#newUserWrapper {
|
||||
width: 25%;
|
||||
padding: 2%;
|
||||
margin: auto;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
#newUserWrapper .formDiv {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.opTitle {
|
||||
font-weight: 200;
|
||||
margin: 1%;
|
||||
}
|
||||
|
||||
#basicNext {
|
||||
font-weight: 200;
|
||||
padding: 2%;
|
||||
border: 1px solid #FCF0F0;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#basicNext:hover {
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
#backArrow {
|
||||
margin: auto;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
|
||||
position: relative;
|
||||
top: 5%;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#backArrow i {
|
||||
line-height: 5vh;
|
||||
}
|
||||
|
||||
#backArrow:hover {
|
||||
background-color: rgba(255,255,255,0.05);
|
||||
}
|
||||
|
||||
#forwardArrow {
|
||||
margin: auto;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
|
||||
position: relative;
|
||||
top: 85%;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#forwardArrow:hover {
|
||||
background-color: rgba(255,255,255,0.05);
|
||||
}
|
||||
|
||||
#enrollInfo {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 150%;
|
||||
}
|
||||
|
||||
#enrollUserWrapper {
|
||||
width: 60%;
|
||||
height: 60vh;
|
||||
margin: auto;
|
||||
padding: 1%;
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
#enrollUserWrapper #classBody {
|
||||
height: 40vh;
|
||||
}
|
||||
|
||||
#enrollClassList {
|
||||
width: 10%;
|
||||
height: 100%;
|
||||
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#enrollClassList h3 {
|
||||
font-weight: 300;
|
||||
margin: 0;
|
||||
padding: 10%;
|
||||
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
border: 0;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#enrollClassList h4 {
|
||||
font-weight: 300;
|
||||
margin: 0;
|
||||
width: 90%;
|
||||
padding: 10%;
|
||||
|
||||
display: table-cell;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#enrollClassList i {
|
||||
font-size: 2vh;
|
||||
width: 20%;
|
||||
display: table-cell;
|
||||
cursor: pointer;
|
||||
text-align: right;
|
||||
|
||||
-webkit-transition: color 0.5s ease;
|
||||
-moz-transition: color 0.5s ease;
|
||||
-ms-transition: color 0.5s ease;
|
||||
transition: color 0.5s ease;
|
||||
}
|
||||
|
||||
#enrollClassList i:hover {
|
||||
color: #FF1A1A;
|
||||
}
|
||||
|
||||
#ESCWrapper {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#ESCWrapper:hover {
|
||||
background-color: rgba(0,0,0,0.25);
|
||||
}
|
||||
|
||||
#createActivate {
|
||||
margin-right: 5%;
|
||||
padding: 1%;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#createActivate:hover {
|
||||
background-color: rgba(0,0,0,0.2)
|
||||
}
|
||||
|
||||
#createInfo {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 150%;
|
||||
}
|
||||
|
||||
#profPageWrapper #createWrapper {
|
||||
margin: auto;
|
||||
margin-top: -1%;
|
||||
padding: 3%;
|
||||
padding-top: 2%;
|
||||
padding-bottom: 1%;
|
||||
width: 30%;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
#profPageWrapper #creSubmit {
|
||||
margin-top: 5%;
|
||||
border: 1px solid #FCF0F0 !important;
|
||||
}
|
||||
|
||||
#profPageWrapper .profTitle {
|
||||
margin-bottom: 1%;
|
||||
}
|
||||
|
||||
#profPageWrapper input {
|
||||
margin: 0;
|
||||
padding: 2%;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#profileSubmit {
|
||||
font-weight: 300;
|
||||
font-size: 3vh;
|
||||
padding: 1.5%;
|
||||
|
||||
border-right: 5px solid #FCF0F0;
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
|
||||
display: none;
|
||||
position:absolute;
|
||||
top: 40%;
|
||||
right: 0;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-transition: background-color 0.5s ease;
|
||||
-moz-transition: background-color 0.5s ease;
|
||||
-ms-transition: background-color 0.5s ease;
|
||||
transition: background-color 0.5s ease;
|
||||
}
|
||||
|
||||
#profileSubmit span, #profileSubmit i {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#profileSubmit i {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#profileSubmit:hover {
|
||||
background-color: rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
#profPageWrapper #createInfo .formDiv:nth-child(5), #profPageWrapper #createInfo .formDiv:nth-child(6) {
|
||||
position: relative;
|
||||
}
|
||||
134
hourglass/client/profile/profile.html
Normal file
@ -0,0 +1,134 @@
|
||||
<template name="profile">
|
||||
{{> sAlert}}
|
||||
<div id="profPageWrapper">
|
||||
<div id="backArrow" class="circleIcon moveArrow" style="display:{{showArrow 'back'}}">
|
||||
<i class="fa fa-chevron-up" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="basicInfo">
|
||||
<div id="newUserWrapper">
|
||||
<div class="formDiv">
|
||||
<p class="opTitle">**School:</p>
|
||||
<input id="school" class="basicInfoField clickModify dropdown" type="text" form="school" placeholder=" Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'school'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="opTitle">**Graduation Year:</p>
|
||||
<input id="grade" class="basicInfoField clickModify dropdown" type="text" form="grade" placeholder="Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'grade'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="basicNext">Continue</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div id="enrollInfo">
|
||||
<div id="enrollUserWrapper">
|
||||
<div id="joinTop">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
{{> inputAutocomplete id="classSearch" settings=classSettings placeholder="Search..."}}
|
||||
<span id="createActivate">Class not here?</span>
|
||||
</div>
|
||||
<div id="settingClassWrapper">
|
||||
<div id="classHeader">
|
||||
<div id="label" class="classBox">
|
||||
<span class="name classText">Class Name</span>
|
||||
<span class="teacher classText">Teacher</span>
|
||||
<span class="hour classText">Hour</span>
|
||||
<span class="subscriptions classText">Members</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="classBody">
|
||||
{{#if notsearching}}
|
||||
{{#each classes}}
|
||||
{{> classDisplay}}
|
||||
{{/each}}
|
||||
{{#if noclass}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#each autocompleteClasses}}
|
||||
{{> classDisplay}}
|
||||
{{/each}}
|
||||
{{#if notfound}}
|
||||
<h3>No results found...</h3>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="enrollClassList">
|
||||
<h3>My Classes</h3>
|
||||
{{#each enrollClass}}
|
||||
{{> enrollSideClass}}
|
||||
{{/each}}
|
||||
</div>
|
||||
<div id="createInfo">
|
||||
<div id="createWrapper">
|
||||
<div id="creRules">
|
||||
<p>Submit a request for a class to be approved by an administrator.
|
||||
You can have up to 8 unapproved classes at once.</p>
|
||||
</div>
|
||||
<div id="formContainer">
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**School:</p>
|
||||
<input id="school" class="creInput" type="text" form="school" value="{{school}}" readonly>
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">Hour:</p>
|
||||
<input class="creInput" type="text" form="hour" placeholder="Hour">
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">Teacher:</p>
|
||||
{{> inputAutocomplete settings=teacherComplete class="form-control creInput" type="text" form="teacher" placeholder="Teacher | Ex: Marc DeZwaan" }}
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Class Name:</p>
|
||||
<input class="creInput" type="text" form="name" placeholder="**Class Name">
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Privacy:</p>
|
||||
<input id="creprivacy" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="privacy" placeholder="Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'privacy'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="formDiv">
|
||||
<p class="profTitle">**Category:</p>
|
||||
<input id="crecategory" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="category" placeholder="Click here to edit..." readonly>
|
||||
<div class="optionHolder">
|
||||
{{#each selectOptions 'category'}}
|
||||
{{> option}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="creSubmit" style="border:1px solid {{divColor 'textColor'}}">Submit Request</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="profileSubmit">
|
||||
<span>Finish!</span>
|
||||
<i class="fa fa-chevron-right" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div id="forwardArrow" class="circleIcon moveArrow" style="display:{{showArrow 'forward'}}">
|
||||
<i class="fa fa-chevron-down" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="enrollSideClass">
|
||||
<div id="ESCWrapper" classid="{{_id}}">
|
||||
<h4 class="enrollSideClass">{{name}}</h4>
|
||||
{{#if x}}
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
518
hourglass/client/profile/profile.js
Normal file
@ -0,0 +1,518 @@
|
||||
/* jshint esversion: 6 */
|
||||
import {
|
||||
Template
|
||||
} from 'meteor/templating';
|
||||
|
||||
Session.set("sections", [0,0]); // [Completed, Viewing]
|
||||
Session.set("profile", {classes: []});
|
||||
Session.set("newClasses", []);
|
||||
Session.set("autocompleteDivs", null);
|
||||
Session.set("notsearching", true); // If user isn't searching
|
||||
Session.set("noclass", null); // If user doesn't have classes.
|
||||
Session.set("notfound", null); // If no results for autocomplete.
|
||||
|
||||
Template.profile.helpers({
|
||||
showArrow(type) {
|
||||
var order = [
|
||||
{"back":false, "forward":true},
|
||||
{"back":true, "forward":true},
|
||||
{"back":true, "forward":false}
|
||||
];
|
||||
var section = Session.get("sections");
|
||||
if(type === "forward") {
|
||||
return (section[1]+1 <= section[0] && order[section[1]][type]) ? "block":"none";
|
||||
} else {
|
||||
return (order[section[1]][type]) ? "block":"none";
|
||||
}
|
||||
},
|
||||
classes() {
|
||||
var array = classes.find({
|
||||
status: {
|
||||
$eq: true
|
||||
},
|
||||
privacy: {
|
||||
$eq: false
|
||||
},
|
||||
_id: {
|
||||
$nin: Session.get("profile").classes
|
||||
},
|
||||
school: {
|
||||
$eq: Session.get("profile").school
|
||||
}
|
||||
}, {
|
||||
sort: {
|
||||
subscribers: -1
|
||||
}
|
||||
}, {
|
||||
limit: 20
|
||||
}).fetch();
|
||||
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
array[i].join = true;
|
||||
array[i].subscribers = array[i].subscribers.length;
|
||||
array[i].teachershort = (array[i].teacher === undefined) ? "" : array[i].teacher.split(" ").slice(1).reduce(function(a, b) {
|
||||
return a + " " + b;
|
||||
});
|
||||
}
|
||||
if (array.length === 0) {
|
||||
Session.set("noclass", true);
|
||||
} else {
|
||||
Session.set("noclass", false);
|
||||
}
|
||||
return array;
|
||||
},
|
||||
classSettings() {
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 10,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: classes,
|
||||
template: Template.classAutoList,
|
||||
filter: {
|
||||
privacy: false,
|
||||
status: true
|
||||
},
|
||||
selector: (match) => {
|
||||
regex = new RegExp(match, 'i');
|
||||
return {
|
||||
$or: [{
|
||||
'name': regex
|
||||
}, {
|
||||
'teacher': regex
|
||||
}, {
|
||||
'hour': regex
|
||||
}]
|
||||
};
|
||||
}
|
||||
}]
|
||||
};
|
||||
},
|
||||
schoolComplete() { // Returns autocomplete array for schools.
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 6,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: schools,
|
||||
field: 'name',
|
||||
matchAll: true,
|
||||
template: Template.schoolList
|
||||
}]
|
||||
};
|
||||
},
|
||||
teacherComplete() { // Returns autocomplete array for teachers.
|
||||
return {
|
||||
position: "bottom",
|
||||
limit: 1,
|
||||
rules: [{
|
||||
token: '',
|
||||
collection: teachers,
|
||||
field: 'name',
|
||||
template: Template.teacherList
|
||||
}]
|
||||
};
|
||||
},
|
||||
notsearching() { // Tells whether user is using the searchbox
|
||||
return Session.get("notsearching");
|
||||
},
|
||||
autocompleteClasses() { // Returns current auto-completes for classes
|
||||
return Session.get("autocompleteDivs");
|
||||
},
|
||||
notfound() { // Returns if autocomplete has no results.
|
||||
return Session.get("notfound");
|
||||
},
|
||||
enrollClass() {
|
||||
var myClasses = Session.get("profile").classes;
|
||||
var newClasses = Session.get("newClasses");
|
||||
if((myClasses === undefined || myClasses.length === 0) && newClasses.length === 0) return [{name:"Enroll!",x:false}];
|
||||
var array = myClasses.map(function(a) {
|
||||
return {name:classes.findOne({_id:a}).name,x:true,_id:a}
|
||||
});
|
||||
array.push.apply(array,newClasses.map(function(a){
|
||||
return {name:a.name,_id:(Math.floor(Math.random()*1000)).toString(),x:true};
|
||||
}));
|
||||
return array;
|
||||
},
|
||||
school() {
|
||||
return Session.get("profile").school;
|
||||
}
|
||||
});
|
||||
|
||||
Template.profile.events({
|
||||
'click' (event) { // Closes respective divs when clicking outside of them. Order matters.
|
||||
var e = event.target.className;
|
||||
|
||||
if(modifyingInput !== null && event.target !== document.getElementById(modifyingInput)) {
|
||||
if (!(e.includes("optionHolder") || e.includes("optionText"))) {
|
||||
toggleOptionMenu(false, modifyingInput);
|
||||
modifyingInput = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
'click #basicNext' () {
|
||||
var inputs = document.getElementsByClassName("basicInfoField");
|
||||
var required = ["school", "grade"];
|
||||
var alert = checkComplete(required, inputs);
|
||||
var values = alert[2];
|
||||
if(!alert[0]) {
|
||||
sAlert.error("Missing " + alert[1], {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
var profile = Session.get("profile");
|
||||
profile.school = values["school"];
|
||||
profile.grade = values["grade"];
|
||||
Session.set("profile", profile);
|
||||
Session.set("sections", [(Session.get("sections")[0] < 1) ? 1 : Session.get("sections")[0], Session.get("sections")[1]]);
|
||||
slideToField(1);
|
||||
$("#profileSubmit").fadeIn(200);
|
||||
},
|
||||
'click #createActivate' () {
|
||||
Session.set("sections", [(Session.get("sections")[0] < 2) ? 2 : Session.get("sections")[0], Session.get("sections")[1]]);
|
||||
slideToField(2);
|
||||
},
|
||||
'click #creSubmit' () {
|
||||
var inputs = document.getElementsByClassName("creInput");
|
||||
var required = ["school", "name", "privacy", "category"];
|
||||
var alert = checkComplete(required, inputs);
|
||||
var values = alert[2];
|
||||
if(!alert[0]) {
|
||||
sAlert.error("Missing " + alert[1], {
|
||||
effect: 'stackslide',
|
||||
position: 'top',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
values.privacy = (values.privacy === "Public") ? false : true;
|
||||
values.status = false;
|
||||
values.category = values.category.toLowerCase();
|
||||
values.code = "";
|
||||
|
||||
if(values.teacher !== "" && values.teacher.split(" ").length < 2) {
|
||||
sAlert.error("Please enter the full name of the teacher! Ex: Darrin Woods", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var newClasses = Session.get("newClasses");
|
||||
var duplicate = false;
|
||||
for(var i = 0; i < newClasses.length; i++) {
|
||||
if(JSON.stringify(newClasses[i]) === JSON.stringify(values)) duplicate = true;
|
||||
if(newClasses[i].school === values.school && newClasses[i].teacher === values.teacher && newClasses[i].hour === values.hour) {
|
||||
sAlert.error("This teacher is already teaching a class elsewhere!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!duplicate && newClasses.length < 8) newClasses.push(values);
|
||||
if(duplicate) {
|
||||
sAlert.error("You already created this class!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
}
|
||||
if(newClasses.length === 8) {
|
||||
sAlert.error("You already created 8 classes!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(classes.findOne({school: values.school, teacher: values.teacher, status: true, privacy: false, hour: values.hour}) || (values.teacher === "" && values.hour === "")) {
|
||||
sAlert.error("This teacher is already teaching a class elsewhere!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Session.set("newClasses", newClasses);
|
||||
$(".creInput").each(function(){$(this).val('');});
|
||||
$(".creInput")[0].value = Session.get("profile").school;
|
||||
slideToField(Session.get("sections")[1]-1);
|
||||
|
||||
},
|
||||
'click #backArrow' () {
|
||||
slideToField(Session.get("sections")[1]-1);
|
||||
},
|
||||
'click #forwardArrow' () {
|
||||
slideToField(Session.get("sections")[1]+1);
|
||||
},
|
||||
// HANDLING INPUT CHANGING
|
||||
'focus .clickModify' (event) {
|
||||
$(".optionHolder")
|
||||
.fadeOut(100);
|
||||
|
||||
if(modifyingInput !== null) {
|
||||
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) closeInput(modifyingInput);
|
||||
}
|
||||
modifyingInput = event.target.id;
|
||||
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) {
|
||||
event.target.select();
|
||||
event.target.style.cursor = "text";
|
||||
}
|
||||
},
|
||||
'keydown .dropdown' (event) {
|
||||
var first = $("#"+modifyingInput).next().children("p:first-child");
|
||||
var last = $("#"+modifyingInput).next().children("p:last-child");
|
||||
var next = $(".selectedOption").next();
|
||||
var prev = $(".selectedOption").prev();
|
||||
var lastSel = $(".selectedOption");
|
||||
|
||||
if (event.keyCode === 38) {
|
||||
event.preventDefault();
|
||||
if (lastSel === undefined) {
|
||||
last.addClass("selectedOption");
|
||||
} else {
|
||||
if (prev.length === 0) {
|
||||
last.addClass("selectedOption");
|
||||
lastSel.removeClass("selectedOption");
|
||||
} else {
|
||||
prev.addClass("selectedOption");
|
||||
lastSel.removeClass("selectedOption");
|
||||
}
|
||||
}
|
||||
} else if (event.keyCode === 40) {
|
||||
event.preventDefault();
|
||||
if (lastSel === undefined) {
|
||||
first.addClass("selectedOption");
|
||||
last.removeClass("selectedOption");
|
||||
} else {
|
||||
if (next.length === 0) {
|
||||
first.addClass("selectedOption");
|
||||
lastSel.removeClass("selectedOption");
|
||||
} else {
|
||||
next.addClass("selectedOption");
|
||||
lastSel.removeClass("selectedOption");
|
||||
}
|
||||
}
|
||||
} else if (event.keyCode === 13) {
|
||||
lastSel[0].click();
|
||||
$("#"+modifyingInput)[0].focus();
|
||||
}
|
||||
},
|
||||
'click .dropdown, focus .dropdown' (event) {
|
||||
if(clickDisabled) return;
|
||||
clickDisabled = true;
|
||||
if(event.target.id === optionOpen[0] && optionOpen[1]) {
|
||||
toggleOptionMenu(false, event.target.id);
|
||||
} else {
|
||||
toggleOptionMenu(true, event.target.id);
|
||||
}
|
||||
setTimeout(function(){clickDisabled = false;},130); // Prevents spamming and handles extra click events.
|
||||
},
|
||||
'click .optionText' (event) { // Click each preferences setting.
|
||||
var option = event.target.childNodes[0].nodeValue;
|
||||
document.getElementById(modifyingInput).value = option;
|
||||
toggleOptionMenu(false, modifyingInput);
|
||||
$(".selectedOption").removeClass("selectedOption");
|
||||
var newSetting = Session.get("profile");
|
||||
if(modifyingInput === "school") {
|
||||
if(option !== Session.get("profile").school) newSetting["classes"] = [];
|
||||
newSetting.school = option;
|
||||
} else if(modifyingInput === "grade") {
|
||||
newSetting = Session.get("profile");
|
||||
newSetting.grade = option;
|
||||
}
|
||||
Session.set("profile", newSetting);
|
||||
},
|
||||
'input #classSearch' (event) { // Auto-complete updater
|
||||
if (event.target.value.length === 0) {
|
||||
Session.set("notsearching", true);
|
||||
} else {
|
||||
Session.set("notsearching", false);
|
||||
}
|
||||
Session.set("autocompleteDivs", null);
|
||||
var divs = [];
|
||||
try {
|
||||
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
|
||||
if(items[0].tagName === "I") {
|
||||
Session.set("notfound", true);
|
||||
return;
|
||||
} else {
|
||||
items = items[0].children;
|
||||
for(var i = 0; i < items.length; i++) {
|
||||
var item = items[i].children;
|
||||
var id = item[4].textContent;
|
||||
if(Session.get("profile").classes.indexOf(id) !== -1) continue;
|
||||
divs.push({
|
||||
name: item[0].textContent,
|
||||
teachershort: item[1].textContent.split(" ")[1],
|
||||
hour: item[2].textContent,
|
||||
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
|
||||
_id: id,
|
||||
join: true
|
||||
})
|
||||
}
|
||||
Session.set("autocompleteDivs", divs.sort(function(a, b) {
|
||||
return b.subscribers - a.subscribers;
|
||||
}));
|
||||
Session.set("notfound", false);
|
||||
return;
|
||||
}
|
||||
} catch(err) {}
|
||||
},
|
||||
'click .classBox .fa-plus, click #classBody .classBox' (event) {
|
||||
var profile = Session.get("profile");
|
||||
while(event.target.getAttribute("classid") === null) event.target = event.target.parentNode;
|
||||
var id = event.target.getAttribute("classid");
|
||||
if(profile.classes.indexOf(id) === -1) {
|
||||
profile.classes.push(id);
|
||||
Session.set("profile", profile);
|
||||
if(Session.get("autocompleteDivs") === null) return;
|
||||
var divs = Session.get("autocompleteDivs");
|
||||
divs.splice(divs.map(function(a) {
|
||||
return a._id;
|
||||
}).indexOf(id),1);
|
||||
Session.set("autocompleteDivs", divs);
|
||||
}
|
||||
},
|
||||
'click #ESCWrapper .fa-times' (event) {
|
||||
var profile = Session.get("profile");
|
||||
var id = event.target.parentNode.getAttribute("classid");
|
||||
if(id.length < 17) {
|
||||
var newClasses = Session.get("newClasses");
|
||||
newClasses.splice(newClasses.map(function(a) {
|
||||
return a._id;
|
||||
}).indexOf(id),1);
|
||||
Session.set("newClasses", newClasses);
|
||||
return;
|
||||
}
|
||||
if(profile.classes.indexOf(id) !== -1) {
|
||||
profile.classes.splice(profile.classes.indexOf(id),1);
|
||||
Session.set("profile", profile);
|
||||
if(Session.get("autocompleteDivs") === null) return;
|
||||
var divs = Session.get("autocompleteDivs");
|
||||
var myClass = classes.findOne({_id: id});
|
||||
myClass.subscribers = myClass.subscribers.length;
|
||||
myClass.teachershort = myClass.teacher.split(" ")[1]
|
||||
myClass.join = true;
|
||||
divs.push(myClass);
|
||||
Session.set("autocompleteDivs", divs.sort(function(a, b) {
|
||||
return b.subscribers - a.subscribers;
|
||||
}));
|
||||
}
|
||||
},
|
||||
'click #profileSubmit' () {
|
||||
// clear html and make page uninteractable
|
||||
var myClasses = Session.get("profile").classes;
|
||||
var newClasses = Session.get("newClasses");
|
||||
var message = "Sorry, your profile couldn't be created. Please try again!";
|
||||
|
||||
if(myClasses.length === 0 && newClasses.length === 0) {
|
||||
sAlert.error("Please enroll in a class!", {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
joinClass(0);
|
||||
|
||||
_.each(newClasses, function(newClass) {
|
||||
if(!teachers.findOne({
|
||||
name: newClass.teacher
|
||||
})) {
|
||||
Meteor.call("createTeacher", newClass.teacher, newClass.school, function(error, result) {
|
||||
if (error !== undefined) {
|
||||
sAlert.error(message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
createClass(0);
|
||||
|
||||
var profile = Session.get("profile");
|
||||
profile.complete = true;
|
||||
profile.preferences = Meteor.user().profile.preferences;
|
||||
profile.classes.push(Meteor.userId());
|
||||
Meteor.call("editProfile", profile, function(err, result) {
|
||||
if(err !== undefined) {
|
||||
sAlert.error(message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
Meteor.subscribe('classes');
|
||||
Meteor.subscribe('schools');
|
||||
Meteor.subscribe('teachers');
|
||||
Meteor.subscribe('work');
|
||||
Meteor.subscribe('requests');
|
||||
Meteor.subscribe("personalUser");
|
||||
Meteor.subscribe('users');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function slideToField(field) {
|
||||
var order = ["basicInfo", "enrollInfo", "createInfo"];
|
||||
$(".moveArrow").animate({"opacity":0})
|
||||
if(field === 0) $("#enrollClassList").fadeOut(200);
|
||||
var viewing = Session.get("sections")[1]
|
||||
var move = (viewing-field < 0) ? "-100%" : "150%";
|
||||
$("#"+order[viewing]).animate({top: move});
|
||||
$("#"+order[field]).animate({
|
||||
top:"17%"
|
||||
},{
|
||||
complete: function() {
|
||||
Session.set("sections", [Session.get("sections")[0],field]);
|
||||
$(".moveArrow").animate({"opacity":1});
|
||||
if(field === 1) $("#enrollClassList").fadeIn(200);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var joined = 0;
|
||||
var created = 0;
|
||||
|
||||
function joinClass(num) {
|
||||
var joining = Session.get("profile").classes;
|
||||
if(joining.length === 0) return;
|
||||
Meteor.call("joinClass", [joining[num], ""], function(err, result) {
|
||||
if(err !== undefined) {
|
||||
sAlert.error(err.message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
joined++;
|
||||
if(joined !== joining.length) {
|
||||
joinClass(joined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createClass(num) {
|
||||
var creating = Session.get("newClasses");
|
||||
if(creating.length === 0) return;
|
||||
Meteor.call("createClass", creating[num], function(error, result) {
|
||||
if(error !== undefined) {
|
||||
sAlert.error(error.message, {
|
||||
effect: 'stackslide',
|
||||
position: 'top'
|
||||
});
|
||||
}
|
||||
created++;
|
||||
if(created !== creating.length) {
|
||||
createClass(created);
|
||||
}
|
||||
});
|
||||
}
|
||||
71
hourglass/client/standards/404.css
Normal file
@ -0,0 +1,71 @@
|
||||
#fourohfour {
|
||||
color: #FFF;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #222328;
|
||||
cursor: default;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#first {
|
||||
font-size: 20vh;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
|
||||
-webkit-filter: drop-shadow(7px 7px 5px #111);
|
||||
filter: drop-shadow(7px 7px 5px #111);
|
||||
}
|
||||
|
||||
#second {
|
||||
font-size: 5vh;
|
||||
font-weight: 200;
|
||||
margin: auto;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 7%;
|
||||
text-align: center;
|
||||
|
||||
-webkit-filter: drop-shadow(7px 7px 5px #111);
|
||||
filter: drop-shadow(7px 7px 5px #111);
|
||||
}
|
||||
|
||||
#third {
|
||||
background-color: auto;
|
||||
border: 1px solid white;
|
||||
border-radius: 6px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
font-size: 2.5vh;
|
||||
font-weight: 100;
|
||||
margin: auto;
|
||||
padding: 1vh 2vh 1vh 2vh;
|
||||
text-align: center;
|
||||
width: 12vh;
|
||||
|
||||
transition: 0.5s;
|
||||
}
|
||||
|
||||
#third:hover {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
#third h4 {
|
||||
font-weight: 100;
|
||||
margin-right: 0.5vh;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#foot {
|
||||
color: #888;
|
||||
font-size: 2vh;
|
||||
font-weight: 200;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
13
hourglass/client/standards/404.html
Normal file
@ -0,0 +1,13 @@
|
||||
<template name="NotFound">
|
||||
<div id="fourohfour">
|
||||
<h4 id="first">404</h4>
|
||||
<h4 id="second">Nothin' to see here!</h4>
|
||||
<div id="third" onclick="window.location.href = 'http://hourglass.ga';">
|
||||
<h4>Home</h4>
|
||||
<i class="fa fa-home" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 id="foot">Hackers: If you thought by typing in a sub-directory that you'd be able to hack us, you're sorely mistaken! Just stop.</h4>
|
||||
</div>
|
||||
</template>
|
||||
8
hourglass/client/standards/loading.css
Normal file
@ -0,0 +1,8 @@
|
||||
#loadCont {
|
||||
color: #FFF;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #222328;
|
||||
cursor: default;
|
||||
}
|
||||
4
hourglass/client/standards/loading.html
Normal file
@ -0,0 +1,4 @@
|
||||
<template name="loading">
|
||||
<div id="loadCont">
|
||||
</div>
|
||||
</template>
|
||||
78
hourglass/collections/main.js
Normal file
@ -0,0 +1,78 @@
|
||||
schools = new Mongo.Collection("Schools");
|
||||
teachers = new Mongo.Collection("Teachers");
|
||||
classes = new Mongo.Collection("Classes");
|
||||
work = new Mongo.Collection("Work");
|
||||
requests = new Mongo.Collection("Requests");
|
||||
admins = Meteor.users;
|
||||
|
||||
schools.schema = new SimpleSchema({
|
||||
name: {type: String}
|
||||
});
|
||||
|
||||
teachers.schema = new SimpleSchema({
|
||||
name: {type: String},
|
||||
school: {type: String},
|
||||
creator: {type: String, optional: true}
|
||||
|
||||
});
|
||||
|
||||
classes.schema = new SimpleSchema({
|
||||
school: {type: String},
|
||||
//icon: {type: String},
|
||||
name: {type: String, label: "Class Name"},
|
||||
hour: {type: String, optional: true},
|
||||
teacher: {type: String, optional: true},
|
||||
admin: {type: String, optional: true},
|
||||
status: {type: Boolean, defaultValue: false},
|
||||
code: {type: String, optional: true},
|
||||
privacy: {type: Boolean},
|
||||
category: {type: String},
|
||||
moderators: {type: [String], optional: true},
|
||||
banned: {type: [String], optional: true},
|
||||
subscribers: {type: [String], optional: true}
|
||||
});
|
||||
|
||||
work.schema = new SimpleSchema({
|
||||
name: {type: String},
|
||||
class: {type: String},
|
||||
dueDate: {type: Date},
|
||||
description: {type: String, optional: true},
|
||||
creator: {type: String},
|
||||
comments: {type: [Object], blackbox: true, optional: true},
|
||||
confirmations: {type: [String], optional: true},
|
||||
reports: {type: [String], optional: true},
|
||||
attachments: {type: [String], optional: true},
|
||||
done: {type: [String], optional: true},
|
||||
type: {type: String}
|
||||
});
|
||||
|
||||
requests.schema = new SimpleSchema({
|
||||
requestor: {type: String},
|
||||
request: {type: String},
|
||||
timeRequested: {type: Date},
|
||||
'info.users': {type: [Object], label: "Debug Users"},
|
||||
'info.userInfo': {type: Object, label: "Debug User Info"},
|
||||
'info.userClasses': {type: [Object], label: "Debug User Classes"}
|
||||
});
|
||||
|
||||
userSchema = new SimpleSchema({
|
||||
'profile.name': {type: String, label: "Name"},
|
||||
'profile.grade': {type: Number, label: "Graduation Year"},
|
||||
'profile.school': {type: String, label: "School"},
|
||||
'services.google.email': {type: String, label: "Email"},
|
||||
'services.google.picture': {type: String, label: "Icon URL"},
|
||||
'profile.classes': {type: [String], label: "Classes"},
|
||||
'profile.complete': {type: Boolean}
|
||||
});
|
||||
|
||||
teachers.schema = new SimpleSchema({
|
||||
name: {type: String},
|
||||
school: {type: String}
|
||||
});
|
||||
|
||||
schools.attachSchema(schools.schema);
|
||||
teachers.attachSchema(teachers.schema);
|
||||
classes.attachSchema(classes.schema);
|
||||
work.attachSchema(work.schema);
|
||||
requests.attachSchema(requests.schema);
|
||||
teachers.attachSchema(teachers.schema);
|
||||
122
hourglass/lib/adminConfig.js
Normal file
@ -0,0 +1,122 @@
|
||||
AdminConfig = {
|
||||
name: 'Hourglass',
|
||||
collections: {
|
||||
schools: {
|
||||
icon: 'university',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'Name', name: 'name' }
|
||||
],
|
||||
color: 'red',
|
||||
label: 'Schools'
|
||||
},
|
||||
teachers: {
|
||||
icon: 'book',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'Name', name: 'name' },
|
||||
{ label: 'School', name: 'school'}
|
||||
],
|
||||
color: 'orange',
|
||||
label: 'Teachers'
|
||||
},
|
||||
classes: {
|
||||
icon: 'graduation-cap',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'School', name: 'school' },
|
||||
{ label: 'Name', name: 'name' },
|
||||
{ label: 'Hour', name: 'hour' },
|
||||
{ label: 'Teacher', name: 'teacher' },
|
||||
{ label: 'Admin', name: 'admin', template: 'adminUserDisplay' },
|
||||
{ label: 'Status', name: 'status', template: 'statusButton'},
|
||||
{ label: 'Code', name: 'code' },
|
||||
{ label: 'Privacy', name: 'privacy' },
|
||||
{ label: 'Category', name: 'category' },
|
||||
{ label: 'Moderators', name: 'moderators', template: 'adminUserDisplay' },
|
||||
{ label: 'Banned', name: 'banned', template: 'adminUserDisplay' },
|
||||
{ label: 'Subscribers', name: 'subscribers', template: 'adminUserDisplay'}
|
||||
],
|
||||
color: 'blue',
|
||||
label: 'Classes'
|
||||
},
|
||||
work: {
|
||||
icon: 'pencil',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'Class', name: 'class' },
|
||||
{ label: 'Name', name: 'name' },
|
||||
{ label: 'Due Date', name: 'dueDate' },
|
||||
{ label: 'Description', name: 'description' },
|
||||
{ label: 'Creator', name: 'creator', template: 'adminUserDisplay' },
|
||||
{ label: 'Comments', name: 'comments' },
|
||||
{ label: 'Confirmations', name: 'confirmations', template: 'adminUserDisplay' },
|
||||
{ label: 'Reports', name: 'reports', template: 'adminUserDisplay' },
|
||||
{ label: 'Done', name: 'done', template: 'adminUserDisplay' },
|
||||
{ label: 'Type', name: 'type' }
|
||||
],
|
||||
color: 'yellow',
|
||||
label: 'Work'
|
||||
},
|
||||
requests: {
|
||||
icon: 'exclamation-triangle',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'User', name: 'requestor', template: 'adminUserDisplay' },
|
||||
{ label: 'Request', name: 'request' },
|
||||
{ label: 'Time', name: 'timeRequested' }
|
||||
],
|
||||
color: 'green',
|
||||
label: 'Requests'
|
||||
},
|
||||
'Meteor.users': {
|
||||
icon: 'user',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'Email', name: 'services.google.email' },
|
||||
{ label: 'Name', name: 'profile.name' },
|
||||
{ label: 'School', name: 'profile.school' },
|
||||
{ label: 'Graduation Year', name:'profile.grade' },
|
||||
{ label: 'Complete', name:'profile.complete'},
|
||||
{ label: 'Icon', name: '_id', template: 'adminUserDisplay' },
|
||||
],
|
||||
templates: {
|
||||
new: {
|
||||
name: 'disableUser'
|
||||
},
|
||||
edit: {
|
||||
name: 'userEditor'
|
||||
}
|
||||
},
|
||||
color: 'light-blue',
|
||||
label: 'Users'
|
||||
},
|
||||
admins: {
|
||||
icon: 'user-plus',
|
||||
tableColumns: [
|
||||
{ label: 'ID', name: '_id' },
|
||||
{ label: 'Email', name: 'services.google.email' },
|
||||
{ label: 'Name', name: 'profile.name' },
|
||||
{ label: 'School', name: 'profile.school' },
|
||||
{ label: 'Graduation Year', name:'profile.grade' },
|
||||
{ label: 'Complete', name:'profile.complete'},
|
||||
{ label: 'Icon', name: '_id', template: 'adminUserDisplay' },
|
||||
],
|
||||
templates: {
|
||||
new: {
|
||||
name: 'createAdmin'
|
||||
},
|
||||
edit: {
|
||||
name: 'disableUser'
|
||||
}
|
||||
},
|
||||
selector: function() {
|
||||
return {roles: {$elemMatch: {$eq: "admin"}}}
|
||||
},
|
||||
showEditColumn: false,
|
||||
color: 'purple',
|
||||
label: 'Admins'
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
132
hourglass/lib/constants.js
Normal file
@ -0,0 +1,132 @@
|
||||
version = "0.2.3";
|
||||
|
||||
themeColors = {
|
||||
"lux": {
|
||||
"background": "White.jpg",
|
||||
"mainColor": "#58758B",
|
||||
"secondaryColor": "#456487",
|
||||
"sidebarColor": "#5E88A8",
|
||||
"userDropdownColor": "#427EB4",
|
||||
"iconHighlight": "#39CAFF",
|
||||
"modeHighlight": "#F02C2C",
|
||||
"classCardColor":"#5D86A8",
|
||||
"textColor": "#FFF"
|
||||
},
|
||||
"nox": {
|
||||
"background": "Black.jpg",
|
||||
"mainColor": "#373A56",
|
||||
"secondaryColor": "#21273D",
|
||||
"sidebarColor": "#35435D",
|
||||
"userDropdownColor": "#373A56",
|
||||
"iconHighlight": "#33ADFF",
|
||||
"modeHighlight": "#FF1A1A",
|
||||
"classCardColor":"#46396E",
|
||||
"textColor": "#F6F6F6"
|
||||
},
|
||||
"requom": {
|
||||
"background": "RedBlack.jpg",
|
||||
"mainColor": "#302C36",
|
||||
"secondaryColor": "#B93A3A",
|
||||
"sidebarColor": "#302C36",
|
||||
"userDropdownColor": "#CC3333",
|
||||
"iconHighlight": "#CBDF58",
|
||||
"modeHighlight": "#C9FE62",
|
||||
"classCardColor":"#302C36",
|
||||
"textColor": "#FCF0F0"
|
||||
},
|
||||
"aequor": {
|
||||
"background": "Sea.jpg",
|
||||
"mainColor": "#1E926C",
|
||||
"secondaryColor": "#1C564F",
|
||||
"sidebarColor": "#1C7458",
|
||||
"userDropdownColor": "#2EA96A",
|
||||
"iconHighlight": "#61D9A3",
|
||||
"modeHighlight": "#C9FE62",
|
||||
"classCardColor":"#45729A",
|
||||
"textColor": "#FCF0F0"
|
||||
},
|
||||
"fresva": {
|
||||
"background": "Earth.jpg",
|
||||
"mainColor": "#DEA743",
|
||||
"secondaryColor": "#496234",
|
||||
"sidebarColor": "#6D9957",
|
||||
"userDropdownColor": "#89BB52",
|
||||
"iconHighlight": "#91EE61",
|
||||
"modeHighlight": "#B9F643",
|
||||
"classCardColor":"#C18311",
|
||||
"textColor": "#FCF0F0"
|
||||
},
|
||||
"atlaneon": {
|
||||
"background": "NeonBlue.jpg",
|
||||
"mainColor": "#1D1C23",
|
||||
"secondaryColor": "#1F212F",
|
||||
"sidebarColor": "#312E32",
|
||||
"userDropdownColor": "#2E312B",
|
||||
"iconHighlight": "#70E6E6",
|
||||
"modeHighlight": "#70E6E6",
|
||||
"classCardColor":"#32363C",
|
||||
"textColor": "#FCF0F0"
|
||||
}
|
||||
};
|
||||
|
||||
workColors = {
|
||||
"normal": "#2E4F74",
|
||||
"quiz": "#409333",
|
||||
"test": "#AD3C44",
|
||||
"project": "#D8831A",
|
||||
"other": "#852E6D"
|
||||
};
|
||||
|
||||
options = {
|
||||
"theme": [
|
||||
{"val": "lux", "alias": "Lux"},
|
||||
{"val": "nox", "alias": "Nox"},
|
||||
{"val": "requom", "alias": "Recoum"},
|
||||
{"val": "aequor", "alias": "Aequor"},
|
||||
{"val": "fresva", "alias": "Fresva"},
|
||||
{"val": "atlaneon", "alias": "Atlaneon"}
|
||||
],
|
||||
"mode": [
|
||||
{"val": "classes", "alias": "Classes"},
|
||||
{"val": "calendar", "alias": "Calendar"}
|
||||
],
|
||||
"timeHide": [
|
||||
{"val": 1, "alias": "1 Day"},
|
||||
{"val": 2, "alias": "2 Days"},
|
||||
{"val": 7, "alias": "1 Week"},
|
||||
{"val": 30, "alias": "1 Month"},
|
||||
{"val": 0, "alias": "Never"}
|
||||
],
|
||||
"done": [
|
||||
{"val": true, "alias": "Yes"},
|
||||
{"val": false, "alias": "No"}
|
||||
],
|
||||
"hideReport": [
|
||||
{"val": true, "alias": "Yes"},
|
||||
{"val": false, "alias": "No"}
|
||||
],
|
||||
"type": [
|
||||
{"val": "normal", "alias": "Normal"},
|
||||
{"val": "quiz", "alias": "Quiz"},
|
||||
{"val": "test", "alias": "Test"},
|
||||
{"val": "project", "alias": "Project"},
|
||||
{"val": "other", "alias": "Other"},
|
||||
],
|
||||
"privacy": [
|
||||
{"val": false, "alias": "Public"},
|
||||
{"val": true, "alias": "Private"}
|
||||
],
|
||||
"category": [
|
||||
{"val": "class", "alias": "Class"},
|
||||
{"val": "club", "alias": "Club"},
|
||||
{"val": "other", "alias": "Other"}
|
||||
]
|
||||
}
|
||||
|
||||
serverData = null;
|
||||
confirm = null;
|
||||
|
||||
//Input Handling
|
||||
modifyingInput = null;
|
||||
clickDisabled = false;
|
||||
optionOpen = false;
|
||||
119
hourglass/lib/router.js
Normal file
@ -0,0 +1,119 @@
|
||||
function completeProfile() {
|
||||
if (Meteor.user().profile.complete) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Router.route('/', {
|
||||
waitOn: function() {
|
||||
if(!Meteor.userId()) {
|
||||
return;
|
||||
} else if(Session.get("demo")) {
|
||||
return ["HIIII"];
|
||||
}
|
||||
return [
|
||||
Meteor.subscribe('classes', this.params._id),
|
||||
Meteor.subscribe('schools', this.params._id),
|
||||
Meteor.subscribe('teachers', this.params._id),
|
||||
Meteor.subscribe('work', this.params._id),
|
||||
Meteor.subscribe('requests', this.params._id),
|
||||
Meteor.subscribe('personalUser', this.params._id),
|
||||
Meteor.subscribe('users', this.params._id)
|
||||
];
|
||||
},
|
||||
action: function() {
|
||||
if(Session.get("demo")) {
|
||||
Session.set("user", {
|
||||
"school":"Robot Academy",
|
||||
"grade":"2018",
|
||||
"classes": ["History", "Math", "Biology", "Literature"],
|
||||
"preferences": {
|
||||
"theme": {
|
||||
"background":"NeonBlue.jpg",
|
||||
"mainColor":"#1D1C23",
|
||||
"secondaryColor":"#1F212F",
|
||||
"sidebarColor":"#312E32",
|
||||
"userDropdownColor":"#2E312B",
|
||||
"iconHighlight":"#70E6E6",
|
||||
"modeHighlight":"#70E6E6",
|
||||
"classCardColor":"#32363C",
|
||||
"textColor":"#FCF0F0"
|
||||
},
|
||||
"mode": "classes",
|
||||
"timeHide":0,
|
||||
"done": true,
|
||||
"hideReport": true},
|
||||
"name": "A. Robot",
|
||||
"complete": true
|
||||
});
|
||||
this.render("main");
|
||||
return;
|
||||
}
|
||||
if (!Meteor.userId() || !completeProfile()) {
|
||||
this.redirect('/login');
|
||||
} else {
|
||||
if(_.contains([null, undefined, ""], Meteor.user().profile.school ||
|
||||
_.contains([null, undefined, ""], Meteor.user().profile.grade))) {
|
||||
this.redirect('/profile');
|
||||
} else {
|
||||
Session.set("user", Meteor.user().profile);
|
||||
if(Meteor.Device.isPhone()) {
|
||||
this.render("mobile");
|
||||
} else {
|
||||
this.render("main");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/login', {
|
||||
action: function() {
|
||||
if(Session.get("demo")) {
|
||||
this.redirect('/');
|
||||
}
|
||||
if (!Meteor.userId()) {
|
||||
if(Meteor.Device.isPhone()) {
|
||||
this.render("mLogin");
|
||||
} else {
|
||||
this.render("login");
|
||||
}
|
||||
} else if (!completeProfile()) {
|
||||
this.redirect('/profile');
|
||||
} else {
|
||||
this.redirect('/');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/profile', {
|
||||
waitOn: function() {
|
||||
return [
|
||||
Meteor.subscribe('classes', this.params._id),
|
||||
Meteor.subscribe('schools', this.params._id),
|
||||
Meteor.subscribe('teachers', this.params._id),
|
||||
Meteor.subscribe('work', this.params._id),
|
||||
Meteor.subscribe('requests', this.params._id),
|
||||
Meteor.subscribe('personalUser', this.params._id),
|
||||
Meteor.subscribe('users', this.params._id)
|
||||
];
|
||||
},
|
||||
action: function() {
|
||||
if (!Meteor.userId() || completeProfile()) {
|
||||
this.redirect('/login');
|
||||
} else {
|
||||
if(Meteor.Device.isPhone()) {
|
||||
this.render("mProfile");
|
||||
} else {
|
||||
this.render("profile");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Router.configure({
|
||||
notFoundTemplate: "NotFound",
|
||||
loadingTemplate: "loading"
|
||||
});
|
||||
11
hourglass/package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Hourglass",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "meteor run"
|
||||
},
|
||||
"dependencies": {
|
||||
"bcrypt": "^0.8.7",
|
||||
"meteor-node-stubs": "~0.2.0"
|
||||
}
|
||||
}
|
||||
23
hourglass/packages/meteor-admin-lte/README.md
Normal file
@ -0,0 +1,23 @@
|
||||
AdminLTE dashboard theme
|
||||
========================
|
||||
|
||||
`meteor add mfactory:admin-lte`
|
||||
|
||||
## Usage ##
|
||||
|
||||
1. Get familiar with [AdminLTE](https://almsaeedstudio.com/AdminLTE) docs.
|
||||
2. Use `AdminLTE` template to load AdminLTE files.
|
||||
|
||||
```
|
||||
{{#AdminLTE skin="green"}}
|
||||
<!-- your html here -->
|
||||
{{/AdminLTE}}
|
||||
```
|
||||
|
||||
### Available options ###
|
||||
|
||||
**skin** - specifies which skin to use. Accepted values: `black black-light blue blue-light green green-light purple purple-light red red-light yellow yellow-light`. Defaults to 'blue'.
|
||||
|
||||
**fixed** - set to `true` to get fixed header and sidebar. Defaults to `false`.
|
||||
|
||||
**sidebarMini** - set to `true` to make sidebar small when collapsed. Defaults to `false`.
|
||||
17
hourglass/packages/meteor-admin-lte/admin-lte.html
Normal file
@ -0,0 +1,17 @@
|
||||
<template name="AdminLTE">
|
||||
<link rel="stylesheet" type="text/css" href="/bootstrap/bootstrap.min.css">
|
||||
<script type="text/javascript" src="/bootstrap/bootstrap.min.js"></script>
|
||||
{{#unless isReady}}
|
||||
{{> Template.dynamic template=loadingTemplate}}
|
||||
{{else}}
|
||||
<div class="skin-{{skin}}">
|
||||
<div class="wrapper">
|
||||
{{> UI.contentBlock}}
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</template>
|
||||
|
||||
<template name="AdminLTE_loading">
|
||||
<b>Loading</b>
|
||||
</template>
|
||||
182
hourglass/packages/meteor-admin-lte/admin-lte.js
Normal file
@ -0,0 +1,182 @@
|
||||
var screenSizes = {
|
||||
xs: 480,
|
||||
sm: 768,
|
||||
md: 992,
|
||||
lg: 1200
|
||||
};
|
||||
|
||||
Template.AdminLTE.onCreated(function () {
|
||||
var self = this;
|
||||
var skin = 'blue';
|
||||
var fixed = false;
|
||||
var sidebarMini = false;
|
||||
|
||||
if (this.data) {
|
||||
skin = this.data.skin || skin;
|
||||
fixed = this.data.fixed || fixed;
|
||||
sidebarMini = this.data.sidebarMini || sidebarMini;
|
||||
}
|
||||
|
||||
self.isReady = new ReactiveVar(false);
|
||||
self.style = waitOnCSS(cssUrl());
|
||||
self.skin = waitOnCSS(skinUrl(skin));
|
||||
|
||||
fixed && $('body').addClass('fixed');
|
||||
sidebarMini && $('body').addClass('sidebar-mini');
|
||||
self.removeClasses = function () {
|
||||
fixed && $('body').removeClass('fixed');
|
||||
sidebarMini && $('body').removeClass('sidebar-mini');
|
||||
}
|
||||
|
||||
this.autorun(function () {
|
||||
if (self.style.ready() && self.skin.ready()) {
|
||||
self.isReady.set(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.AdminLTE.onDestroyed(function () {
|
||||
this.removeClasses();
|
||||
this.style.remove();
|
||||
this.skin.remove();
|
||||
});
|
||||
|
||||
Template.AdminLTE.helpers({
|
||||
isReady: function () {
|
||||
return Template.instance().isReady.get();
|
||||
},
|
||||
|
||||
loadingTemplate: function () {
|
||||
return this.loadingTemplate || 'AdminLTE_loading';
|
||||
},
|
||||
|
||||
skin: function () {
|
||||
return this.skin || 'blue';
|
||||
}
|
||||
});
|
||||
|
||||
Template.AdminLTE.events({
|
||||
'click [data-toggle=offcanvas]': function (e, t) {
|
||||
e.preventDefault();
|
||||
|
||||
//Enable sidebar push menu
|
||||
if ($(window).width() > (screenSizes.sm - 1)) {
|
||||
$("body").toggleClass('sidebar-collapse');
|
||||
}
|
||||
//Handle sidebar push menu for small screens
|
||||
else {
|
||||
if ($("body").hasClass('sidebar-open')) {
|
||||
$("body").removeClass('sidebar-open');
|
||||
$("body").removeClass('sidebar-collapse')
|
||||
} else {
|
||||
$("body").addClass('sidebar-open');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'click .content-wrapper': function (e, t) {
|
||||
//Enable hide menu when clicking on the content-wrapper on small screens
|
||||
if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) {
|
||||
$("body").removeClass('sidebar-open');
|
||||
}
|
||||
},
|
||||
|
||||
'click .sidebar li a': function (e, t) {
|
||||
//Get the clicked link and the next element
|
||||
var $this = $(e.currentTarget);
|
||||
var checkElement = $this.next();
|
||||
|
||||
//Check if the next element is a menu and is visible
|
||||
if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible'))) {
|
||||
//Close the menu
|
||||
checkElement.slideUp('normal', function () {
|
||||
checkElement.removeClass('menu-open');
|
||||
});
|
||||
checkElement.parent("li").removeClass("active");
|
||||
}
|
||||
//If the menu is not visible
|
||||
else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) {
|
||||
//Get the parent menu
|
||||
var parent = $this.parents('ul').first();
|
||||
//Close all open menus within the parent
|
||||
var ul = parent.find('ul:visible').slideUp('normal');
|
||||
//Remove the menu-open class from the parent
|
||||
ul.removeClass('menu-open');
|
||||
//Get the parent li
|
||||
var parent_li = $this.parent("li");
|
||||
|
||||
//Open the target menu and add the menu-open class
|
||||
checkElement.slideDown('normal', function () {
|
||||
//Add the class active to the parent li
|
||||
checkElement.addClass('menu-open');
|
||||
parent.find('li.active').removeClass('active');
|
||||
parent_li.addClass('active');
|
||||
});
|
||||
}
|
||||
//if this isn't a link, prevent the page from being redirected
|
||||
if (checkElement.is('.treeview-menu')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function cssUrl () {
|
||||
return Meteor.absoluteUrl('packages/mfactory_admin-lte/css/AdminLTE.min.css');
|
||||
}
|
||||
|
||||
function skinUrl (name) {
|
||||
return Meteor.absoluteUrl(
|
||||
'packages/mfactory_admin-lte/css/skins/skin-' + name + '.min.css');
|
||||
}
|
||||
|
||||
function waitOnCSS (url, timeout) {
|
||||
var isLoaded = new ReactiveVar(false);
|
||||
timeout = timeout || 5000;
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = url;
|
||||
|
||||
link.onload = function () {
|
||||
isLoaded.set(true);
|
||||
};
|
||||
|
||||
if (link.addEventListener) {
|
||||
link.addEventListener('load', function () {
|
||||
isLoaded.set(true);
|
||||
}, false);
|
||||
}
|
||||
|
||||
link.onreadystatechange = function () {
|
||||
var state = link.readyState;
|
||||
if (state === 'loaded' || state === 'complete') {
|
||||
link.onreadystatechange = null;
|
||||
isLoaded.set(true);
|
||||
}
|
||||
};
|
||||
|
||||
var cssnum = document.styleSheets.length;
|
||||
var ti = setInterval(function () {
|
||||
if (document.styleSheets.length > cssnum) {
|
||||
isLoaded.set(true);
|
||||
clearInterval(ti);
|
||||
}
|
||||
}, 10);
|
||||
|
||||
setTimeout(function () {
|
||||
isLoaded.set(true);
|
||||
}, timeout);
|
||||
|
||||
$(document.head).append(link);
|
||||
|
||||
return {
|
||||
ready: function () {
|
||||
return isLoaded.get();
|
||||
},
|
||||
|
||||
remove: function () {
|
||||
$('link[href="' + url + '"]').remove();
|
||||
}
|
||||
};
|
||||
}
|
||||
7
hourglass/packages/meteor-admin-lte/css/AdminLTE.min.css
vendored
Normal file
1
hourglass/packages/meteor-admin-lte/css/skins/skin-black-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-black-light .main-header{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.skin-black-light .main-header .navbar-toggle{color:#333}.skin-black-light .main-header .navbar-brand{color:#333;border-right:1px solid #eee}.skin-black-light .main-header>.navbar{background-color:#fff}.skin-black-light .main-header>.navbar .nav>li>a{color:#333}.skin-black-light .main-header>.navbar .nav>li>a:hover,.skin-black-light .main-header>.navbar .nav>li>a:active,.skin-black-light .main-header>.navbar .nav>li>a:focus,.skin-black-light .main-header>.navbar .nav .open>a,.skin-black-light .main-header>.navbar .nav .open>a:hover,.skin-black-light .main-header>.navbar .nav .open>a:focus{background:#fff;color:#999}.skin-black-light .main-header>.navbar .sidebar-toggle{color:#333}.skin-black-light .main-header>.navbar .sidebar-toggle:hover{color:#999;background:#fff}.skin-black-light .main-header>.navbar>.sidebar-toggle{color:#333;border-right:1px solid #eee}.skin-black-light .main-header>.navbar .navbar-nav>li>a{border-right:1px solid #eee}.skin-black-light .main-header>.navbar .navbar-custom-menu .navbar-nav>li>a,.skin-black-light .main-header>.navbar .navbar-right>li>a{border-left:1px solid #eee;border-right-width:0}.skin-black-light .main-header>.logo{background-color:#fff;color:#333;border-bottom:0 solid transparent;border-right:1px solid #eee}.skin-black-light .main-header>.logo:hover{background-color:#fcfcfc}@media (max-width:767px){.skin-black-light .main-header>.logo{background-color:#222;color:#fff;border-bottom:0 solid transparent;border-right:none}.skin-black-light .main-header>.logo:hover{background-color:#1f1f1f}}.skin-black-light .main-header li.user-header{background-color:#222}.skin-black-light .content-header{background:transparent;box-shadow:none}.skin-black-light .wrapper,.skin-black-light .main-sidebar,.skin-black-light .left-side{background-color:#f9fafc}.skin-black-light .content-wrapper,.skin-black-light .main-footer{border-left:1px solid #d2d6de}.skin-black-light .user-panel>.info,.skin-black-light .user-panel>.info>a{color:#444}.skin-black-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-black-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-black-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-black-light .sidebar-menu>li:hover>a,.skin-black-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-black-light .sidebar-menu>li.active{border-left-color:#fff}.skin-black-light .sidebar-menu>li.active>a{font-weight:600}.skin-black-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-black-light .sidebar a{color:#444}.skin-black-light .sidebar a:hover{text-decoration:none}.skin-black-light .treeview-menu>li>a{color:#777}.skin-black-light .treeview-menu>li.active>a,.skin-black-light .treeview-menu>li>a:hover{color:#000}.skin-black-light .treeview-menu>li.active>a{font-weight:600}.skin-black-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-black-light .sidebar-form input[type="text"],.skin-black-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-black-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-black-light .sidebar-form input[type="text"]:focus,.skin-black-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-black-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-black.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-black .main-header{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.skin-black .main-header .navbar-toggle{color:#333}.skin-black .main-header .navbar-brand{color:#333;border-right:1px solid #eee}.skin-black .main-header>.navbar{background-color:#fff}.skin-black .main-header>.navbar .nav>li>a{color:#333}.skin-black .main-header>.navbar .nav>li>a:hover,.skin-black .main-header>.navbar .nav>li>a:active,.skin-black .main-header>.navbar .nav>li>a:focus,.skin-black .main-header>.navbar .nav .open>a,.skin-black .main-header>.navbar .nav .open>a:hover,.skin-black .main-header>.navbar .nav .open>a:focus{background:#fff;color:#999}.skin-black .main-header>.navbar .sidebar-toggle{color:#333}.skin-black .main-header>.navbar .sidebar-toggle:hover{color:#999;background:#fff}.skin-black .main-header>.navbar>.sidebar-toggle{color:#333;border-right:1px solid #eee}.skin-black .main-header>.navbar .navbar-nav>li>a{border-right:1px solid #eee}.skin-black .main-header>.navbar .navbar-custom-menu .navbar-nav>li>a,.skin-black .main-header>.navbar .navbar-right>li>a{border-left:1px solid #eee;border-right-width:0}.skin-black .main-header>.logo{background-color:#fff;color:#333;border-bottom:0 solid transparent;border-right:1px solid #eee}.skin-black .main-header>.logo:hover{background-color:#fcfcfc}@media (max-width:767px){.skin-black .main-header>.logo{background-color:#222;color:#fff;border-bottom:0 solid transparent;border-right:none}.skin-black .main-header>.logo:hover{background-color:#1f1f1f}}.skin-black .main-header li.user-header{background-color:#222}.skin-black .content-header{background:transparent;box-shadow:none}.skin-black .wrapper,.skin-black .main-sidebar,.skin-black .left-side{background-color:#222d32}.skin-black .user-panel>.info,.skin-black .user-panel>.info>a{color:#fff}.skin-black .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-black .sidebar-menu>li>a{border-left:3px solid transparent}.skin-black .sidebar-menu>li:hover>a,.skin-black .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#fff}.skin-black .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-black .sidebar a{color:#b8c7ce}.skin-black .sidebar a:hover{text-decoration:none}.skin-black .treeview-menu>li>a{color:#8aa4af}.skin-black .treeview-menu>li.active>a,.skin-black .treeview-menu>li>a:hover{color:#fff}.skin-black .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-black .sidebar-form input[type="text"],.skin-black .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-black .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-black .sidebar-form input[type="text"]:focus,.skin-black .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-blue-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav>li>a:hover,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:transparent}.skin-blue-light .wrapper,.skin-blue-light .main-sidebar,.skin-blue-light .left-side{background-color:#f9fafc}.skin-blue-light .content-wrapper,.skin-blue-light .main-footer{border-left:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li:hover>a,.skin-blue-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .sidebar a:hover{text-decoration:none}.skin-blue-light .treeview-menu>li>a{color:#777}.skin-blue-light .treeview-menu>li.active>a,.skin-blue-light .treeview-menu>li>a:hover{color:#000}.skin-blue-light .treeview-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-blue-light .sidebar-form input[type="text"],.skin-blue-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-blue-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-blue-light .sidebar-form input[type="text"]:focus,.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-blue.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-blue .main-header .navbar{background-color:#3c8dbc}.skin-blue .main-header .navbar .nav>li>a{color:#fff}.skin-blue .main-header .navbar .nav>li>a:hover,.skin-blue .main-header .navbar .nav>li>a:active,.skin-blue .main-header .navbar .nav>li>a:focus,.skin-blue .main-header .navbar .nav .open>a,.skin-blue .main-header .navbar .nav .open>a:hover,.skin-blue .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}.skin-blue .main-header .logo:hover{background-color:#357ca5}.skin-blue .main-header li.user-header{background-color:#3c8dbc}.skin-blue .content-header{background:transparent}.skin-blue .wrapper,.skin-blue .main-sidebar,.skin-blue .left-side{background-color:#222d32}.skin-blue .user-panel>.info,.skin-blue .user-panel>.info>a{color:#fff}.skin-blue .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-blue .sidebar-menu>li>a{border-left:3px solid transparent}.skin-blue .sidebar-menu>li:hover>a,.skin-blue .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#3c8dbc}.skin-blue .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-blue .sidebar a{color:#b8c7ce}.skin-blue .sidebar a:hover{text-decoration:none}.skin-blue .treeview-menu>li>a{color:#8aa4af}.skin-blue .treeview-menu>li.active>a,.skin-blue .treeview-menu>li>a:hover{color:#fff}.skin-blue .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-blue .sidebar-form input[type="text"],.skin-blue .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-blue .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-blue .sidebar-form input[type="text"]:focus,.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-green-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-green-light .main-header .navbar{background-color:#00a65a}.skin-green-light .main-header .navbar .nav>li>a{color:#fff}.skin-green-light .main-header .navbar .nav>li>a:hover,.skin-green-light .main-header .navbar .nav>li>a:active,.skin-green-light .main-header .navbar .nav>li>a:focus,.skin-green-light .main-header .navbar .nav .open>a,.skin-green-light .main-header .navbar .nav .open>a:hover,.skin-green-light .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-green-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-green-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-green-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-green-light .main-header .navbar .sidebar-toggle:hover{background-color:#008d4c}@media (max-width:767px){.skin-green-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-green-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-green-light .main-header .navbar .dropdown-menu li a:hover{background:#008d4c}}.skin-green-light .main-header .logo{background-color:#00a65a;color:#fff;border-bottom:0 solid transparent}.skin-green-light .main-header .logo:hover{background-color:#00a157}.skin-green-light .main-header li.user-header{background-color:#00a65a}.skin-green-light .content-header{background:transparent}.skin-green-light .wrapper,.skin-green-light .main-sidebar,.skin-green-light .left-side{background-color:#f9fafc}.skin-green-light .content-wrapper,.skin-green-light .main-footer{border-left:1px solid #d2d6de}.skin-green-light .user-panel>.info,.skin-green-light .user-panel>.info>a{color:#444}.skin-green-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-green-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-green-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-green-light .sidebar-menu>li:hover>a,.skin-green-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-green-light .sidebar-menu>li.active{border-left-color:#00a65a}.skin-green-light .sidebar-menu>li.active>a{font-weight:600}.skin-green-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-green-light .sidebar a{color:#444}.skin-green-light .sidebar a:hover{text-decoration:none}.skin-green-light .treeview-menu>li>a{color:#777}.skin-green-light .treeview-menu>li.active>a,.skin-green-light .treeview-menu>li>a:hover{color:#000}.skin-green-light .treeview-menu>li.active>a{font-weight:600}.skin-green-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-green-light .sidebar-form input[type="text"],.skin-green-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-green-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-green-light .sidebar-form input[type="text"]:focus,.skin-green-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-green-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-green-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-green-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-green.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-green .main-header .navbar{background-color:#00a65a}.skin-green .main-header .navbar .nav>li>a{color:#fff}.skin-green .main-header .navbar .nav>li>a:hover,.skin-green .main-header .navbar .nav>li>a:active,.skin-green .main-header .navbar .nav>li>a:focus,.skin-green .main-header .navbar .nav .open>a,.skin-green .main-header .navbar .nav .open>a:hover,.skin-green .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-green .main-header .navbar .sidebar-toggle{color:#fff}.skin-green .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-green .main-header .navbar .sidebar-toggle{color:#fff}.skin-green .main-header .navbar .sidebar-toggle:hover{background-color:#008d4c}@media (max-width:767px){.skin-green .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-green .main-header .navbar .dropdown-menu li a{color:#fff}.skin-green .main-header .navbar .dropdown-menu li a:hover{background:#008d4c}}.skin-green .main-header .logo{background-color:#008d4c;color:#fff;border-bottom:0 solid transparent}.skin-green .main-header .logo:hover{background-color:#008749}.skin-green .main-header li.user-header{background-color:#00a65a}.skin-green .content-header{background:transparent}.skin-green .wrapper,.skin-green .main-sidebar,.skin-green .left-side{background-color:#222d32}.skin-green .user-panel>.info,.skin-green .user-panel>.info>a{color:#fff}.skin-green .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-green .sidebar-menu>li>a{border-left:3px solid transparent}.skin-green .sidebar-menu>li:hover>a,.skin-green .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#00a65a}.skin-green .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-green .sidebar a{color:#b8c7ce}.skin-green .sidebar a:hover{text-decoration:none}.skin-green .treeview-menu>li>a{color:#8aa4af}.skin-green .treeview-menu>li.active>a,.skin-green .treeview-menu>li>a:hover{color:#fff}.skin-green .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-green .sidebar-form input[type="text"],.skin-green .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-green .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-green .sidebar-form input[type="text"]:focus,.skin-green .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-green .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-green .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-purple-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-purple-light .main-header .navbar{background-color:#605ca8}.skin-purple-light .main-header .navbar .nav>li>a{color:#fff}.skin-purple-light .main-header .navbar .nav>li>a:hover,.skin-purple-light .main-header .navbar .nav>li>a:active,.skin-purple-light .main-header .navbar .nav>li>a:focus,.skin-purple-light .main-header .navbar .nav .open>a,.skin-purple-light .main-header .navbar .nav .open>a:hover,.skin-purple-light .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-purple-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-purple-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple-light .main-header .navbar .sidebar-toggle:hover{background-color:#555299}@media (max-width:767px){.skin-purple-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-purple-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-purple-light .main-header .navbar .dropdown-menu li a:hover{background:#555299}}.skin-purple-light .main-header .logo{background-color:#605ca8;color:#fff;border-bottom:0 solid transparent}.skin-purple-light .main-header .logo:hover{background-color:#5d59a6}.skin-purple-light .main-header li.user-header{background-color:#605ca8}.skin-purple-light .content-header{background:transparent}.skin-purple-light .wrapper,.skin-purple-light .main-sidebar,.skin-purple-light .left-side{background-color:#f9fafc}.skin-purple-light .content-wrapper,.skin-purple-light .main-footer{border-left:1px solid #d2d6de}.skin-purple-light .user-panel>.info,.skin-purple-light .user-panel>.info>a{color:#444}.skin-purple-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-purple-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-purple-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-purple-light .sidebar-menu>li:hover>a,.skin-purple-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-purple-light .sidebar-menu>li.active{border-left-color:#605ca8}.skin-purple-light .sidebar-menu>li.active>a{font-weight:600}.skin-purple-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-purple-light .sidebar a{color:#444}.skin-purple-light .sidebar a:hover{text-decoration:none}.skin-purple-light .treeview-menu>li>a{color:#777}.skin-purple-light .treeview-menu>li.active>a,.skin-purple-light .treeview-menu>li>a:hover{color:#000}.skin-purple-light .treeview-menu>li.active>a{font-weight:600}.skin-purple-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-purple-light .sidebar-form input[type="text"],.skin-purple-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-purple-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-purple-light .sidebar-form input[type="text"]:focus,.skin-purple-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-purple-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-purple-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-purple-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-purple.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-purple .main-header .navbar{background-color:#605ca8}.skin-purple .main-header .navbar .nav>li>a{color:#fff}.skin-purple .main-header .navbar .nav>li>a:hover,.skin-purple .main-header .navbar .nav>li>a:active,.skin-purple .main-header .navbar .nav>li>a:focus,.skin-purple .main-header .navbar .nav .open>a,.skin-purple .main-header .navbar .nav .open>a:hover,.skin-purple .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-purple .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-purple .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple .main-header .navbar .sidebar-toggle:hover{background-color:#555299}@media (max-width:767px){.skin-purple .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-purple .main-header .navbar .dropdown-menu li a{color:#fff}.skin-purple .main-header .navbar .dropdown-menu li a:hover{background:#555299}}.skin-purple .main-header .logo{background-color:#555299;color:#fff;border-bottom:0 solid transparent}.skin-purple .main-header .logo:hover{background-color:#545096}.skin-purple .main-header li.user-header{background-color:#605ca8}.skin-purple .content-header{background:transparent}.skin-purple .wrapper,.skin-purple .main-sidebar,.skin-purple .left-side{background-color:#222d32}.skin-purple .user-panel>.info,.skin-purple .user-panel>.info>a{color:#fff}.skin-purple .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-purple .sidebar-menu>li>a{border-left:3px solid transparent}.skin-purple .sidebar-menu>li:hover>a,.skin-purple .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#605ca8}.skin-purple .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-purple .sidebar a{color:#b8c7ce}.skin-purple .sidebar a:hover{text-decoration:none}.skin-purple .treeview-menu>li>a{color:#8aa4af}.skin-purple .treeview-menu>li.active>a,.skin-purple .treeview-menu>li>a:hover{color:#fff}.skin-purple .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-purple .sidebar-form input[type="text"],.skin-purple .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-purple .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-purple .sidebar-form input[type="text"]:focus,.skin-purple .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-purple .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-purple .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-red-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-red-light .main-header .navbar{background-color:#dd4b39}.skin-red-light .main-header .navbar .nav>li>a{color:#fff}.skin-red-light .main-header .navbar .nav>li>a:hover,.skin-red-light .main-header .navbar .nav>li>a:active,.skin-red-light .main-header .navbar .nav>li>a:focus,.skin-red-light .main-header .navbar .nav .open>a,.skin-red-light .main-header .navbar .nav .open>a:hover,.skin-red-light .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-red-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-red-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-red-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-red-light .main-header .navbar .sidebar-toggle:hover{background-color:#d73925}@media (max-width:767px){.skin-red-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-red-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-red-light .main-header .navbar .dropdown-menu li a:hover{background:#d73925}}.skin-red-light .main-header .logo{background-color:#dd4b39;color:#fff;border-bottom:0 solid transparent}.skin-red-light .main-header .logo:hover{background-color:#dc4735}.skin-red-light .main-header li.user-header{background-color:#dd4b39}.skin-red-light .content-header{background:transparent}.skin-red-light .wrapper,.skin-red-light .main-sidebar,.skin-red-light .left-side{background-color:#f9fafc}.skin-red-light .content-wrapper,.skin-red-light .main-footer{border-left:1px solid #d2d6de}.skin-red-light .user-panel>.info,.skin-red-light .user-panel>.info>a{color:#444}.skin-red-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-red-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-red-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-red-light .sidebar-menu>li:hover>a,.skin-red-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-red-light .sidebar-menu>li.active{border-left-color:#dd4b39}.skin-red-light .sidebar-menu>li.active>a{font-weight:600}.skin-red-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-red-light .sidebar a{color:#444}.skin-red-light .sidebar a:hover{text-decoration:none}.skin-red-light .treeview-menu>li>a{color:#777}.skin-red-light .treeview-menu>li.active>a,.skin-red-light .treeview-menu>li>a:hover{color:#000}.skin-red-light .treeview-menu>li.active>a{font-weight:600}.skin-red-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-red-light .sidebar-form input[type="text"],.skin-red-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-red-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-red-light .sidebar-form input[type="text"]:focus,.skin-red-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-red-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-red-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-red-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-red.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-red .main-header .navbar{background-color:#dd4b39}.skin-red .main-header .navbar .nav>li>a{color:#fff}.skin-red .main-header .navbar .nav>li>a:hover,.skin-red .main-header .navbar .nav>li>a:active,.skin-red .main-header .navbar .nav>li>a:focus,.skin-red .main-header .navbar .nav .open>a,.skin-red .main-header .navbar .nav .open>a:hover,.skin-red .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-red .main-header .navbar .sidebar-toggle{color:#fff}.skin-red .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-red .main-header .navbar .sidebar-toggle{color:#fff}.skin-red .main-header .navbar .sidebar-toggle:hover{background-color:#d73925}@media (max-width:767px){.skin-red .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-red .main-header .navbar .dropdown-menu li a{color:#fff}.skin-red .main-header .navbar .dropdown-menu li a:hover{background:#d73925}}.skin-red .main-header .logo{background-color:#d73925;color:#fff;border-bottom:0 solid transparent}.skin-red .main-header .logo:hover{background-color:#d33724}.skin-red .main-header li.user-header{background-color:#dd4b39}.skin-red .content-header{background:transparent}.skin-red .wrapper,.skin-red .main-sidebar,.skin-red .left-side{background-color:#222d32}.skin-red .user-panel>.info,.skin-red .user-panel>.info>a{color:#fff}.skin-red .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-red .sidebar-menu>li>a{border-left:3px solid transparent}.skin-red .sidebar-menu>li:hover>a,.skin-red .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#dd4b39}.skin-red .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-red .sidebar a{color:#b8c7ce}.skin-red .sidebar a:hover{text-decoration:none}.skin-red .treeview-menu>li>a{color:#8aa4af}.skin-red .treeview-menu>li.active>a,.skin-red .treeview-menu>li>a:hover{color:#fff}.skin-red .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-red .sidebar-form input[type="text"],.skin-red .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-red .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-red .sidebar-form input[type="text"]:focus,.skin-red .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-red .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-red .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-yellow-light.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-yellow-light .main-header .navbar{background-color:#f39c12}.skin-yellow-light .main-header .navbar .nav>li>a{color:#fff}.skin-yellow-light .main-header .navbar .nav>li>a:hover,.skin-yellow-light .main-header .navbar .nav>li>a:active,.skin-yellow-light .main-header .navbar .nav>li>a:focus,.skin-yellow-light .main-header .navbar .nav .open>a,.skin-yellow-light .main-header .navbar .nav .open>a:hover,.skin-yellow-light .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-yellow-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-yellow-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow-light .main-header .navbar .sidebar-toggle:hover{background-color:#e08e0b}@media (max-width:767px){.skin-yellow-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-yellow-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-yellow-light .main-header .navbar .dropdown-menu li a:hover{background:#e08e0b}}.skin-yellow-light .main-header .logo{background-color:#f39c12;color:#fff;border-bottom:0 solid transparent}.skin-yellow-light .main-header .logo:hover{background-color:#f39a0d}.skin-yellow-light .main-header li.user-header{background-color:#f39c12}.skin-yellow-light .content-header{background:transparent}.skin-yellow-light .wrapper,.skin-yellow-light .main-sidebar,.skin-yellow-light .left-side{background-color:#f9fafc}.skin-yellow-light .content-wrapper,.skin-yellow-light .main-footer{border-left:1px solid #d2d6de}.skin-yellow-light .user-panel>.info,.skin-yellow-light .user-panel>.info>a{color:#444}.skin-yellow-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-yellow-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-yellow-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-yellow-light .sidebar-menu>li:hover>a,.skin-yellow-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-yellow-light .sidebar-menu>li.active{border-left-color:#f39c12}.skin-yellow-light .sidebar-menu>li.active>a{font-weight:600}.skin-yellow-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-yellow-light .sidebar a{color:#444}.skin-yellow-light .sidebar a:hover{text-decoration:none}.skin-yellow-light .treeview-menu>li>a{color:#777}.skin-yellow-light .treeview-menu>li.active>a,.skin-yellow-light .treeview-menu>li>a:hover{color:#000}.skin-yellow-light .treeview-menu>li.active>a{font-weight:600}.skin-yellow-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-yellow-light .sidebar-form input[type="text"],.skin-yellow-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-yellow-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-yellow-light .sidebar-form input[type="text"]:focus,.skin-yellow-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-yellow-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-yellow-light .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}@media (min-width:768px){.skin-yellow-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}
|
||||
1
hourglass/packages/meteor-admin-lte/css/skins/skin-yellow.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.skin-yellow .main-header .navbar{background-color:#f39c12}.skin-yellow .main-header .navbar .nav>li>a{color:#fff}.skin-yellow .main-header .navbar .nav>li>a:hover,.skin-yellow .main-header .navbar .nav>li>a:active,.skin-yellow .main-header .navbar .nav>li>a:focus,.skin-yellow .main-header .navbar .nav .open>a,.skin-yellow .main-header .navbar .nav .open>a:hover,.skin-yellow .main-header .navbar .nav .open>a:focus{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-yellow .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-yellow .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow .main-header .navbar .sidebar-toggle:hover{background-color:#e08e0b}@media (max-width:767px){.skin-yellow .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-yellow .main-header .navbar .dropdown-menu li a{color:#fff}.skin-yellow .main-header .navbar .dropdown-menu li a:hover{background:#e08e0b}}.skin-yellow .main-header .logo{background-color:#e08e0b;color:#fff;border-bottom:0 solid transparent}.skin-yellow .main-header .logo:hover{background-color:#db8b0b}.skin-yellow .main-header li.user-header{background-color:#f39c12}.skin-yellow .content-header{background:transparent}.skin-yellow .wrapper,.skin-yellow .main-sidebar,.skin-yellow .left-side{background-color:#222d32}.skin-yellow .user-panel>.info,.skin-yellow .user-panel>.info>a{color:#fff}.skin-yellow .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-yellow .sidebar-menu>li>a{border-left:3px solid transparent}.skin-yellow .sidebar-menu>li:hover>a,.skin-yellow .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#f39c12}.skin-yellow .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-yellow .sidebar a{color:#b8c7ce}.skin-yellow .sidebar a:hover{text-decoration:none}.skin-yellow .treeview-menu>li>a{color:#8aa4af}.skin-yellow .treeview-menu>li.active>a,.skin-yellow .treeview-menu>li>a:hover{color:#fff}.skin-yellow .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-yellow .sidebar-form input[type="text"],.skin-yellow .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.skin-yellow .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important;border-bottom-left-radius:2px !important}.skin-yellow .sidebar-form input[type="text"]:focus,.skin-yellow .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-yellow .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-yellow .sidebar-form .btn{color:#999;border-top-left-radius:0 !important;border-top-right-radius:2px !important;border-bottom-right-radius:2px !important;border-bottom-left-radius:0 !important}
|
||||
37
hourglass/packages/meteor-admin-lte/package.js
Normal file
@ -0,0 +1,37 @@
|
||||
Package.describe({
|
||||
name: 'mfactory:admin-lte',
|
||||
version: '0.0.2',
|
||||
summary: 'AdminLTE dashboard theme',
|
||||
git: 'https://github.com/meteor-factory/meteor-admin-lte.git',
|
||||
documentation: 'README.md'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.versionsFrom('1.1.0.2');
|
||||
|
||||
api.use([
|
||||
'templating',
|
||||
'reactive-var'
|
||||
], 'client');
|
||||
|
||||
api.addFiles([
|
||||
'admin-lte.html',
|
||||
'admin-lte.js'
|
||||
], 'client');
|
||||
|
||||
api.addFiles([
|
||||
'css/AdminLTE.min.css',
|
||||
'css/skins/skin-black-light.min.css',
|
||||
'css/skins/skin-black.min.css',
|
||||
'css/skins/skin-blue-light.min.css',
|
||||
'css/skins/skin-blue.min.css',
|
||||
'css/skins/skin-green-light.min.css',
|
||||
'css/skins/skin-green.min.css',
|
||||
'css/skins/skin-purple-light.min.css',
|
||||
'css/skins/skin-purple.min.css',
|
||||
'css/skins/skin-red-light.min.css',
|
||||
'css/skins/skin-red.min.css',
|
||||
'css/skins/skin-yellow-light.min.css',
|
||||
'css/skins/skin-yellow.min.css'
|
||||
], 'client', { isAsset: true });
|
||||
});
|
||||
674
hourglass/packages/meteor-admin/LICENSE
Normal 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:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
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>.
|
||||
@ -0,0 +1,77 @@
|
||||
AdminDashboard =
|
||||
schemas: {}
|
||||
sidebarItems: []
|
||||
collectionItems: []
|
||||
alertSuccess: (message)->
|
||||
Session.set 'adminSuccess', message
|
||||
alertFailure: (message)->
|
||||
Session.set 'adminError', message
|
||||
|
||||
checkAdmin: ->
|
||||
if not Roles.userIsInRole Meteor.userId(), ['admin']
|
||||
Meteor.call 'adminCheckAdmin'
|
||||
if (typeof AdminConfig?.nonAdminRedirectRoute == "string")
|
||||
Router.go AdminConfig.nonAdminRedirectRoute
|
||||
if typeof @.next == 'function'
|
||||
@next()
|
||||
adminRoutes: ['adminDashboard','adminDashboardUsersNew','adminDashboardUsersEdit','adminDashboardView','adminDashboardNew','adminDashboardEdit']
|
||||
collectionLabel: (collection)->
|
||||
if collection == 'Users'
|
||||
'Users'
|
||||
else if collection? and typeof AdminConfig.collections[collection]?.label == 'string'
|
||||
AdminConfig.collections[collection].label
|
||||
else Session.get 'admin_collection_name'
|
||||
|
||||
addSidebarItem: (title, url, options) ->
|
||||
item = title: title
|
||||
if _.isObject(url) and typeof options == 'undefined'
|
||||
item.options = url
|
||||
else
|
||||
item.url = url
|
||||
item.options = options
|
||||
|
||||
@sidebarItems.push item
|
||||
|
||||
extendSidebarItem: (title, urls) ->
|
||||
if _.isObject(urls) then urls = [urls]
|
||||
|
||||
existing = _.find @sidebarItems, (item) -> item.title == title
|
||||
if existing
|
||||
existing.options.urls = _.union existing.options.urls, urls
|
||||
|
||||
addCollectionItem: (fn) ->
|
||||
@collectionItems.push fn
|
||||
|
||||
path: (s) ->
|
||||
path = '/admin'
|
||||
if typeof s == 'string' and s.length > 0
|
||||
path += (if s[0] == '/' then '' else '/') + s
|
||||
path
|
||||
|
||||
|
||||
AdminDashboard.schemas.newUser = new SimpleSchema
|
||||
email:
|
||||
type: String
|
||||
label: "Email address"
|
||||
chooseOwnPassword:
|
||||
type: Boolean
|
||||
label: 'Let this user choose their own password with an email'
|
||||
defaultValue: true
|
||||
password:
|
||||
type: String
|
||||
label: 'Password'
|
||||
optional: true
|
||||
sendPassword:
|
||||
type: Boolean
|
||||
label: 'Send this user their password by email'
|
||||
optional: true
|
||||
|
||||
AdminDashboard.schemas.sendResetPasswordEmail = new SimpleSchema
|
||||
_id:
|
||||
type: String
|
||||
|
||||
AdminDashboard.schemas.changePassword = new SimpleSchema
|
||||
_id:
|
||||
type: String
|
||||
password:
|
||||
type: String
|
||||
@ -0,0 +1 @@
|
||||
@AdminCollectionsCount = new Mongo.Collection 'adminCollectionsCount'
|
||||
80
hourglass/packages/meteor-admin/lib/both/router.coffee
Normal file
@ -0,0 +1,80 @@
|
||||
@AdminController = RouteController.extend
|
||||
layoutTemplate: 'AdminLayout'
|
||||
waitOn: ->
|
||||
[
|
||||
Meteor.subscribe 'adminUsers'
|
||||
Meteor.subscribe 'adminUser'
|
||||
Meteor.subscribe 'adminCollectionsCount'
|
||||
]
|
||||
onBeforeAction: ->
|
||||
Session.set 'adminSuccess', null
|
||||
Session.set 'adminError', null
|
||||
|
||||
Session.set 'admin_title', ''
|
||||
Session.set 'admin_subtitle', ''
|
||||
Session.set 'admin_collection_page', null
|
||||
Session.set 'admin_collection_name', null
|
||||
Session.set 'admin_id', null
|
||||
Session.set 'admin_doc', null
|
||||
|
||||
if not Roles.userIsInRole Meteor.userId(), ['admin']
|
||||
Meteor.call 'adminCheckAdmin'
|
||||
if typeof AdminConfig?.nonAdminRedirectRoute == 'string'
|
||||
Router.go AdminConfig.nonAdminRedirectRoute
|
||||
|
||||
@next()
|
||||
|
||||
|
||||
Router.route "adminDashboard",
|
||||
path: "/admin"
|
||||
template: "AdminDashboard"
|
||||
controller: "AdminController"
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', 'Dashboard'
|
||||
Session.set 'admin_collection_name', ''
|
||||
Session.set 'admin_collection_page', ''
|
||||
|
||||
Router.route "adminDashboardUsersView",
|
||||
path: "/admin/Users"
|
||||
template: "AdminDashboardView"
|
||||
controller: "AdminController"
|
||||
action: ->
|
||||
@render()
|
||||
data: ->
|
||||
admin_table: AdminTables.Users
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', 'Users'
|
||||
Session.set 'admin_subtitle', 'View'
|
||||
Session.set 'admin_collection_name', 'Users'
|
||||
|
||||
Router.route "adminDashboardUsersNew",
|
||||
path: "/admin/Users/new"
|
||||
template: "AdminDashboardUsersNew"
|
||||
controller: 'AdminController'
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', 'Users'
|
||||
Session.set 'admin_subtitle', 'Create new user'
|
||||
Session.set 'admin_collection_page', 'New'
|
||||
Session.set 'admin_collection_name', 'Users'
|
||||
|
||||
Router.route "adminDashboardUsersEdit",
|
||||
path: "/admin/Users/:_id/edit"
|
||||
template: "AdminDashboardUsersEdit"
|
||||
controller: "AdminController"
|
||||
data: ->
|
||||
user: Meteor.users.find(@params._id).fetch()
|
||||
roles: Roles.getRolesForUser @params._id
|
||||
otherRoles: _.difference _.map(Meteor.roles.find().fetch(), (role) -> role.name), Roles.getRolesForUser(@params._id)
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', 'Users'
|
||||
Session.set 'admin_subtitle', 'Edit user ' + @params._id
|
||||
Session.set 'admin_collection_page', 'edit'
|
||||
Session.set 'admin_collection_name', 'Users'
|
||||
Session.set 'admin_id', @params._id
|
||||
Session.set 'admin_doc', Meteor.users.findOne({_id:@params._id})
|
||||
211
hourglass/packages/meteor-admin/lib/both/startup.coffee
Normal file
@ -0,0 +1,211 @@
|
||||
@AdminTables = {}
|
||||
|
||||
adminTablesDom = '<"box"<"box-header"<"box-toolbar"<"pull-left"<lf>><"pull-right"p>>><"box-body"t>><r>'
|
||||
|
||||
adminEditButton = {
|
||||
data: '_id'
|
||||
title: 'Edit'
|
||||
createdCell: (node, cellData, rowData) ->
|
||||
$(node).html(Blaze.toHTMLWithData Template.adminEditBtn, {_id: cellData})
|
||||
width: '40px'
|
||||
orderable: false
|
||||
}
|
||||
adminDelButton = {
|
||||
data: '_id'
|
||||
title: 'Delete'
|
||||
createdCell: (node, cellData, rowData) ->
|
||||
$(node).html(Blaze.toHTMLWithData Template.adminDeleteBtn, {_id: cellData})
|
||||
width: '40px'
|
||||
orderable: false
|
||||
}
|
||||
|
||||
adminEditDelButtons = [
|
||||
adminEditButton,
|
||||
adminDelButton
|
||||
]
|
||||
|
||||
defaultColumns = () -> [
|
||||
data: '_id',
|
||||
title: 'ID'
|
||||
]
|
||||
|
||||
adminTablePubName = (collection) ->
|
||||
"admin_tabular_#{collection}"
|
||||
|
||||
adminCreateTables = (collections) ->
|
||||
_.each AdminConfig?.collections, (collection, name) ->
|
||||
_.defaults collection, {
|
||||
showEditColumn: true
|
||||
showDelColumn: true
|
||||
showInSideBar: true
|
||||
}
|
||||
|
||||
columns = _.map collection.tableColumns, (column) ->
|
||||
if column.template
|
||||
createdCell = (node, cellData, rowData) ->
|
||||
$(node).html ''
|
||||
Blaze.renderWithData(Template[column.template], {value: cellData, doc: rowData}, node)
|
||||
|
||||
data: column.name
|
||||
title: column.label
|
||||
createdCell: createdCell
|
||||
|
||||
if columns.length == 0
|
||||
columns = defaultColumns()
|
||||
|
||||
if collection.showEditColumn
|
||||
columns.push(adminEditButton)
|
||||
if collection.showDelColumn
|
||||
columns.push(adminDelButton)
|
||||
|
||||
AdminTables[name] = new Tabular.Table
|
||||
name: name
|
||||
collection: adminCollectionObject(name)
|
||||
pub: collection.children and adminTablePubName(name)
|
||||
sub: collection.sub
|
||||
columns: columns
|
||||
extraFields: collection.extraFields
|
||||
dom: adminTablesDom
|
||||
selector: collection.selector || ->
|
||||
return {}
|
||||
|
||||
adminCreateRoutes = (collections) ->
|
||||
_.each collections, adminCreateRouteView
|
||||
_.each collections, adminCreateRouteNew
|
||||
_.each collections, adminCreateRouteEdit
|
||||
|
||||
adminCreateRouteView = (collection, collectionName) ->
|
||||
Router.route "adminDashboard#{collectionName}View",
|
||||
adminCreateRouteViewOptions collection, collectionName
|
||||
|
||||
adminCreateRouteViewOptions = (collection, collectionName) ->
|
||||
options =
|
||||
path: "/admin/#{collectionName}"
|
||||
template: "AdminDashboardViewWrapper"
|
||||
controller: "AdminController"
|
||||
data: ->
|
||||
admin_table: AdminTables[collectionName]
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', collectionName
|
||||
Session.set 'admin_subtitle', 'View'
|
||||
Session.set 'admin_collection_name', collectionName
|
||||
collection.routes?.view?.onAfterAction
|
||||
_.defaults options, collection.routes?.view
|
||||
|
||||
adminCreateRouteNew = (collection, collectionName) ->
|
||||
Router.route "adminDashboard#{collectionName}New",
|
||||
adminCreateRouteNewOptions collection, collectionName
|
||||
|
||||
adminCreateRouteNewOptions = (collection, collectionName) ->
|
||||
options =
|
||||
path: "/admin/#{collectionName}/new"
|
||||
template: "AdminDashboardNew"
|
||||
controller: "AdminController"
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', AdminDashboard.collectionLabel collectionName
|
||||
Session.set 'admin_subtitle', 'Create new'
|
||||
Session.set 'admin_collection_page', 'new'
|
||||
Session.set 'admin_collection_name', collectionName
|
||||
collection.routes?.new?.onAfterAction
|
||||
data: ->
|
||||
admin_collection: adminCollectionObject collectionName
|
||||
_.defaults options, collection.routes?.new
|
||||
|
||||
adminCreateRouteEdit = (collection, collectionName) ->
|
||||
Router.route "adminDashboard#{collectionName}Edit",
|
||||
adminCreateRouteEditOptions collection, collectionName
|
||||
|
||||
adminCreateRouteEditOptions = (collection, collectionName) ->
|
||||
options =
|
||||
path: "/admin/#{collectionName}/:_id/edit"
|
||||
template: "AdminDashboardEdit"
|
||||
controller: "AdminController"
|
||||
waitOn: ->
|
||||
Meteor.subscribe 'adminCollectionDoc', collectionName, parseID(@params._id)
|
||||
collection.routes?.edit?.waitOn
|
||||
action: ->
|
||||
@render()
|
||||
onAfterAction: ->
|
||||
Session.set 'admin_title', AdminDashboard.collectionLabel collectionName
|
||||
Session.set 'admin_subtitle', 'Edit ' + @params._id
|
||||
Session.set 'admin_collection_page', 'edit'
|
||||
Session.set 'admin_collection_name', collectionName
|
||||
Session.set 'admin_id', parseID(@params._id)
|
||||
Session.set 'admin_doc', adminCollectionObject(collectionName).findOne _id : parseID(@params._id)
|
||||
collection.routes?.edit?.onAfterAction
|
||||
data: ->
|
||||
admin_collection: adminCollectionObject collectionName
|
||||
_.defaults options, collection.routes?.edit
|
||||
|
||||
adminPublishTables = (collections) ->
|
||||
_.each collections, (collection, name) ->
|
||||
if not collection.children then return undefined
|
||||
Meteor.publishComposite adminTablePubName(name), (tableName, ids, fields) ->
|
||||
check tableName, String
|
||||
check ids, Array
|
||||
check fields, Match.Optional Object
|
||||
|
||||
extraFields = _.reduce collection.extraFields, (fields, name) ->
|
||||
fields[name] = 1
|
||||
fields
|
||||
, {}
|
||||
_.extend fields, extraFields
|
||||
|
||||
@unblock()
|
||||
|
||||
find: ->
|
||||
@unblock()
|
||||
adminCollectionObject(name).find {_id: {$in: ids}}, {fields: fields}
|
||||
children: collection.children
|
||||
|
||||
Meteor.startup ->
|
||||
adminCreateTables AdminConfig?.collections
|
||||
adminCreateRoutes AdminConfig?.collections
|
||||
adminPublishTables AdminConfig?.collections if Meteor.isServer
|
||||
|
||||
if AdminTables.Users then return undefined
|
||||
|
||||
AdminTables.Users = new Tabular.Table
|
||||
# Modify selector to allow search by email
|
||||
changeSelector: (selector, userId) ->
|
||||
$or = selector['$or']
|
||||
$or and selector['$or'] = _.map $or, (exp) ->
|
||||
if exp.emails?['$regex']?
|
||||
emails: $elemMatch: address: exp.emails
|
||||
else
|
||||
exp
|
||||
selector
|
||||
|
||||
name: 'Users'
|
||||
collection: Meteor.users
|
||||
columns: _.union [
|
||||
{
|
||||
data: '_id'
|
||||
title: 'Admin'
|
||||
# TODO: use `tmpl`
|
||||
createdCell: (node, cellData, rowData) ->
|
||||
$(node).html(Blaze.toHTMLWithData Template.adminUsersIsAdmin, {_id: cellData})
|
||||
width: '40px'
|
||||
}
|
||||
{
|
||||
data: 'emails'
|
||||
title: 'Email'
|
||||
render: (value) ->
|
||||
value[0].address
|
||||
searchable: true
|
||||
}
|
||||
{
|
||||
data: 'emails'
|
||||
title: 'Mail'
|
||||
# TODO: use `tmpl`
|
||||
createdCell: (node, cellData, rowData) ->
|
||||
$(node).html(Blaze.toHTMLWithData Template.adminUsersMailBtn, {emails: cellData})
|
||||
width: '40px'
|
||||
}
|
||||
{ data: 'createdAt', title: 'Joined' }
|
||||
], adminEditDelButtons
|
||||
dom: adminTablesDom
|
||||
38
hourglass/packages/meteor-admin/lib/both/utils.coffee
Normal file
@ -0,0 +1,38 @@
|
||||
@adminCollectionObject = (collection) ->
|
||||
if typeof AdminConfig.collections[collection] != 'undefined' and typeof AdminConfig.collections[collection].collectionObject != 'undefined'
|
||||
AdminConfig.collections[collection].collectionObject
|
||||
else
|
||||
lookup collection
|
||||
|
||||
@adminCallback = (name, args, callback) ->
|
||||
stop = false
|
||||
if typeof AdminConfig?.callbacks?[name] == 'function'
|
||||
stop = AdminConfig.callbacks[name](args...) is false
|
||||
if typeof callback == 'function'
|
||||
callback args... unless stop
|
||||
|
||||
@lookup = (obj, root, required=true) ->
|
||||
if typeof root == 'undefined'
|
||||
root = if Meteor.isServer then global else window
|
||||
if typeof obj == 'string'
|
||||
ref = root
|
||||
arr = obj.split '.'
|
||||
continue while arr.length and (ref = ref[arr.shift()])
|
||||
if not ref and required
|
||||
throw new Error(obj + ' is not in the ' + root.toString())
|
||||
else
|
||||
return ref
|
||||
return obj
|
||||
|
||||
@parseID = (id) ->
|
||||
if typeof id == 'string'
|
||||
if(id.indexOf("ObjectID") > -1)
|
||||
return new Mongo.ObjectID(id.slice(id.indexOf('"') + 1,id.lastIndexOf('"')))
|
||||
else
|
||||
return id
|
||||
else
|
||||
return id
|
||||
|
||||
@parseIDs = (ids) ->
|
||||
return _.map ids, (id) ->
|
||||
parseID id
|
||||
@ -0,0 +1,97 @@
|
||||
.admin-alert
|
||||
{
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
.admin-layout
|
||||
{
|
||||
th.admin-sortable
|
||||
{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.dataTables_wrapper {
|
||||
position: relative !important;
|
||||
|
||||
table.dataTable {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr > td {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
table.dataTable > thead:first-child > tr:first-child > th,
|
||||
table.dataTable > tbody > tr:nth-child(even) > td {
|
||||
background-color: #f3f4f5 !important;
|
||||
}
|
||||
|
||||
table.dataTable > thead:first-child > tr:first-child > th {
|
||||
border-bottom: none !important;
|
||||
padding: 8px
|
||||
}
|
||||
|
||||
table.dataTable > thead > tr:first-child > th,
|
||||
table.dataTable > tbody > tr > td {
|
||||
border-top: 1px solid #ddd !important;
|
||||
}
|
||||
|
||||
.box-body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.box > .box-header {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.box-toolbar {
|
||||
padding: 10px;
|
||||
|
||||
.pull-left {
|
||||
min-width: 310px;
|
||||
}
|
||||
|
||||
.dataTables_filter,
|
||||
.dataTables_length {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.dataTables_filter input {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
div.dataTables_processing {
|
||||
position: absolute !important;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99999991;
|
||||
line-height: 100%;
|
||||
font-size: 0;
|
||||
|
||||
&:after {
|
||||
content: 'Loading...';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 35px;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<template name="AdminHeader">
|
||||
<header class="main-header">
|
||||
<a href="/admin" class="logo">
|
||||
{{#if AdminConfig.name}}
|
||||
{{AdminConfig.name}}
|
||||
{{else}}
|
||||
Admin
|
||||
{{/if}}
|
||||
</a>
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
{{#if AdminConfig.dashboard.homeUrl}}
|
||||
<a href="{{AdminConfig.dashboard.homeUrl}}">Home</a>
|
||||
{{else}}
|
||||
<a href="/">Home</a>
|
||||
{{/if}}
|
||||
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span>Admin<i class="caret"></i></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="">
|
||||
<a href="{{pathFor 'adminDashboardUsersEdit' _id=currentUser._id}}">
|
||||
Your profile
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#" class="btn-sign-out">Sign out
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
</template>
|
||||
@ -0,0 +1,102 @@
|
||||
<template name="AdminLayout">
|
||||
{{#if AdminConfig}}
|
||||
{{#if isInRole 'admin'}}
|
||||
<div class="admin-layout">
|
||||
{{# AdminLTE skin=admin_skin }}
|
||||
{{> AdminHeader }}
|
||||
{{> AdminSidebar }}
|
||||
<div class="content-wrapper" style="min-height: {{minHeight}}">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
{{adminCollectionLabel admin_collection_name}}
|
||||
<small>{{$.Session.get 'admin_subtitle'}}</small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/admin/">Dashboard</a></li>
|
||||
{{#if $.Session.get 'admin_collection_name'}}
|
||||
<li><a href="/admin/{{$.Session.get 'admin_collection_name'}}/">
|
||||
{{adminCollectionLabel admin_collection_name}}
|
||||
</a></li>
|
||||
{{/if}}
|
||||
|
||||
{{#if $.Session.equals 'admin_collection_page' 'new'}}
|
||||
<li>New</li>
|
||||
{{/if}}
|
||||
|
||||
{{#if $.Session.equals 'admin_collection_page' 'edit'}}
|
||||
<li>Edit</li>
|
||||
{{/if}}
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
{{> yield }}
|
||||
</section>
|
||||
</div>
|
||||
{{/ AdminLTE }}
|
||||
</div>
|
||||
{{> AdminDeleteModal }}
|
||||
{{else}}
|
||||
{{> NotAdmin}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{> NoConfig}}
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="AdminDeleteModal">
|
||||
<div class="modal fade" id="admin-delete-modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Confirm delete</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to delete this?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" id="confirm-delete" class="btn btn-danger">Delete</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</template>
|
||||
|
||||
<template name="NotAdmin">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<p class="alert alert-info" style="margin-top:100px;">
|
||||
You need to be an admin to view this page
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="NoConfig">
|
||||
<p class="alert alert-info">
|
||||
You need to define an AdminConfig object to use the admin dashboard.
|
||||
<br/>
|
||||
A basic config to manage the 'Posts' and 'Comments' collection would look like this:
|
||||
<br/>
|
||||
<code>
|
||||
AdminConfig = {
|
||||
<br/>
|
||||
adminEmails: [' ben@code2create.com'],
|
||||
<br/>
|
||||
collections:
|
||||
<br/>
|
||||
{
|
||||
<br/>
|
||||
Posts: {},
|
||||
<br/>
|
||||
Comments: {}
|
||||
<br/>
|
||||
}
|
||||
<br/>
|
||||
}
|
||||
</code>
|
||||
</p>
|
||||
</template>
|
||||
@ -0,0 +1,66 @@
|
||||
<template name="AdminSidebar">
|
||||
<aside class="main-sidebar">
|
||||
<div class="sidebar">
|
||||
<ul class="sidebar-menu">
|
||||
<li class="{{isActiveRoute 'adminDashboard'}}">
|
||||
<a href="{{pathFor 'adminDashboard'}}">
|
||||
<i class="fa fa-dashboard"></i> <span>Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
{{#each admin_collections}}
|
||||
{{#unless $eq showInSideBar false}}
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-{{this.icon}}"></i>
|
||||
<span>{{this.label}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li class="{{isActivePath path=newPath}}"><a href="{{newPath}}"><i class="fa fa-angle-double-right"></i> New</a></li>
|
||||
<li class="{{isActivePath path=viewPath}}"><a href="{{viewPath}}"><i class="fa fa-angle-double-right"></i> View All</a></li>
|
||||
{{#each admin_collection_items}}
|
||||
<li class="{{isActivePath path=url}}"><a href="{{url}}"><i class="fa fa-angle-double-right"></i> {{title}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</li>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each admin_sidebar_items}}
|
||||
{{#if options.urls}}
|
||||
{{> adminSidebarItemTree}}
|
||||
{{else}}
|
||||
{{> adminSidebarItem}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<template name="adminSidebarItem">
|
||||
<li class="{{isActivePath path=url}}">
|
||||
<a href="{{url}}">
|
||||
{{#if options.icon}}
|
||||
<i class="fa fa-{{options.icon}}"></i>
|
||||
{{/if}}
|
||||
<span>{{title}}</span>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<template name="adminSidebarItemTree">
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
{{#if options.icon}}
|
||||
<i class="fa fa-{{options.icon}}"></i>
|
||||
{{/if}}
|
||||
<span>{{title}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
{{#each options.urls}}
|
||||
<li class="{{isActivePath path=url}}"><a href="{{url}}"><i class="fa fa-angle-double-right"></i>{{title}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
@ -0,0 +1,166 @@
|
||||
<template name="AdminDashboard">
|
||||
{{#each adminWidgets}}
|
||||
{{> UI.dynamic template=template data=data}}
|
||||
{{else}}
|
||||
{{> adminDefaultWidgets}}
|
||||
{{/each}}
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardNew">
|
||||
{{> adminAlert}}
|
||||
{{#if adminTemplate admin_collection_name 'new'}}
|
||||
{{#with adminTemplate admin_collection_name 'new'}}
|
||||
{{> UI.dynamic template=name data=data }}
|
||||
{{/with}}
|
||||
{{else}}
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
{{> quickForm id="admin_insert" collection=admin_collection fields=admin_fields omitFields=admin_omit_fields buttonContent='Create'}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardEdit">
|
||||
{{> adminAlert}}
|
||||
{{#if adminTemplate admin_collection_name 'edit'}}
|
||||
{{#with adminTemplate admin_collection_name 'edit'}}
|
||||
{{> UI.dynamic template=name data=data }}
|
||||
{{/with}}
|
||||
{{else}}
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
{{#if admin_current_doc}}
|
||||
{{> quickForm id="admin_update" collection=admin_collection doc=admin_current_doc fields=admin_fields omitFields=admin_omit_fields buttonContent='Update'}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardViewWrapper">
|
||||
<div></div>
|
||||
{{! This template is used to manually re-render AdminDashboardView on route transition }}
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardView">
|
||||
{{> adminAlert}}
|
||||
{{#if adminTemplate admin_collection_name 'view'}}
|
||||
{{#with adminTemplate admin_collection_name 'view'}}
|
||||
{{> UI.dynamic template=name data=data }}
|
||||
{{/with}}
|
||||
{{else}}
|
||||
{{#if hasDocuments}}
|
||||
{{> tabular table=admin_table class="table dataTable"}}
|
||||
{{else}}
|
||||
<div class="alert alert-info">
|
||||
<p>There are no visible items in this collection.</p>
|
||||
<p><a href="{{newPath}}" class="btn btn-primary"><i class="fa fa-plus"></i> Add one</a></p>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardUsersNew">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
{{> adminAlert}}
|
||||
{{# autoForm id="adminNewUser" schema=AdminSchemas.newUser type="method" meteormethod="adminNewUser"}}
|
||||
|
||||
{{>afQuickField name="email"}}
|
||||
{{>afQuickField name="chooseOwnPassword"}}
|
||||
|
||||
{{#if afFieldValueIs name="chooseOwnPassword" value=false}}
|
||||
|
||||
{{>afQuickField name="password"}}
|
||||
{{>afQuickField name="sendPassword"}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
<button type="submit" class="btn btn-primary">Add User</button>
|
||||
|
||||
{{/autoForm}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="AdminDashboardUsersEdit">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
{{> adminAlert}}
|
||||
{{#if adminGetUserSchema}}
|
||||
{{> quickForm id="adminUpdateUser" buttonContent="Update" buttonClasses="btn btn-primary btn-sm" collection=adminGetUsers schema=adminGetUserSchema doc=admin_current_doc omitFields="roles,services"}}
|
||||
<hr/>
|
||||
{{/if}}
|
||||
|
||||
<h4>User Roles</h4>
|
||||
{{#each roles}}
|
||||
<button class="btn btn-primary btn-xs btn-remove-role" role="{{this}}" user="{{admin_current_id}}">{{this}}</button>
|
||||
{{/each}}
|
||||
{{#each otherRoles}}
|
||||
<button class="btn btn-default btn-xs btn-add-role" role="{{this}}" user="{{admin_current_id}}">{{this}}</button>
|
||||
{{/each}}
|
||||
{{#if roles}}
|
||||
<p style="margin-top:5px;">Click a role to toggle it.</p>
|
||||
{{else}}
|
||||
<p>User not in any roles. Click a role to add it to a user.</p>
|
||||
{{/if}}
|
||||
|
||||
<hr/>
|
||||
<h4>Reset Password</h4>
|
||||
{{#autoForm id="adminSendResetPasswordEmail" schema=AdminSchemas.sendResetPasswordEmail type="method" meteormethod="adminSendResetPasswordEmail"}}
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label" for="title">ID</label>
|
||||
<input value="{{admin_current_id}}" type="text" name="_id" omitfields="createdAtupdatedAt" required="" data-schema-key="_id" class="form-control" autocomplete="off" />
|
||||
<span class="help-block"></span>
|
||||
</div>
|
||||
<p>Send a reset password email to {{admin_current_doc.emails.[0].address}}</p>
|
||||
<button type="submit" class="btn btn-primary btn-sm">Send Email</button>
|
||||
{{/autoForm}}
|
||||
|
||||
<hr/>
|
||||
<h4>Change Password</h4>
|
||||
{{#autoForm id="adminChangePassword" schema=AdminSchemas.changePassword type="method" meteormethod="adminChangePassword"}}
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label" for="title">ID</label>
|
||||
<input value="{{admin_current_id}}" type="text" name="_id" omitfields="createdAtupdatedAt" required="" data-schema-key="_id" class="form-control" autocomplete="off" />
|
||||
<span class="help-block"></span>
|
||||
</div>
|
||||
{{>afQuickField name="password"}}
|
||||
<button type="submit" class="btn btn-primary btn-sm">Change Password</button>
|
||||
{{/autoForm}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template name="adminAlert">
|
||||
{{#if $.Session.get 'adminSuccess'}}
|
||||
<div class="alert alert-success admin-alert">
|
||||
{{$.Session.get 'adminSuccess'}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if $.Session.get 'adminError'}}
|
||||
<div class="alert alert-danger admin-alert">
|
||||
{{$.Session.get 'adminError'}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="adminUsersIsAdmin">
|
||||
{{#if adminIsUserInRole this._id 'admin'}}<i class="fa fa-check"></i>{{/if}}
|
||||
</template>
|
||||
|
||||
<template name="adminUsersMailBtn">
|
||||
<a href="mailto:{{adminUserEmail this}}" class="btn btn-default btn-xs"><i class="fa fa-envelope"></i></a>
|
||||
</template>
|
||||
|
||||
<template name="adminEditBtn">
|
||||
<a href="{{path}}" class="hidden-xs btn btn-xs btn-primary"><i class="fa fa-pencil"></i></a>
|
||||
<a href="{{path}}" class="visible-xs btn btn-sm btn-primary"><i class="fa fa-pencil"></i> Edit</a>
|
||||
</template>
|
||||
|
||||
<template name="adminDeleteBtn">
|
||||
<a data-toggle="modal" doc="{{_id}}" href='#admin-delete-modal' class="hidden-xs btn btn-xs btn-danger btn-delete"><i class="fa fa-times" doc="{{_id}}"></i></a>
|
||||
<a data-toggle="modal" doc="{{_id}}" href='#admin-delete-modal' class="visible-xs btn btn-sm btn-danger btn-delete"><i class="fa fa-times" doc="{{_id}}"></i> Delete</a>
|
||||
</template>
|
||||
@ -0,0 +1,32 @@
|
||||
<template name="adminDefaultWidgets">
|
||||
{{#each admin_collections}}
|
||||
{{#unless $eq showWidget false}}
|
||||
{{> adminCollectionWidget collection=name}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</template>
|
||||
|
||||
<template name="adminCollectionWidget">
|
||||
<div class="{{#if class}}{{class}}{{else}}col-lg-3 col-xs-6{{/if}}">
|
||||
{{#with adminGetCollection collection}}
|
||||
<a href="/admin/{{this.name}}">
|
||||
<div class="small-box bg-{{color}}">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
{{adminCollectionCount name}}
|
||||
</h3>
|
||||
<p>
|
||||
{{this.label}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fa fa-{{this.icon}}"></i>
|
||||
</div>
|
||||
<a class="small-box-footer">
|
||||
See all <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</a>
|
||||
{{/with}}
|
||||
</div>
|
||||
</template>
|
||||
@ -0,0 +1,52 @@
|
||||
Template.AdminLayout.created = function () {
|
||||
var self = this;
|
||||
|
||||
self.minHeight = new ReactiveVar(
|
||||
$(window).height() - $('.main-header').height());
|
||||
|
||||
$(window).resize(function () {
|
||||
self.minHeight.set($(window).height() - $('.main-header').height());
|
||||
});
|
||||
|
||||
$('body').addClass('fixed');
|
||||
};
|
||||
|
||||
Template.AdminLayout.destroyed = function () {
|
||||
$('body').removeClass('fixed');
|
||||
};
|
||||
|
||||
Template.AdminLayout.helpers({
|
||||
minHeight: function () {
|
||||
return Template.instance().minHeight.get() + 'px'
|
||||
}
|
||||
});
|
||||
|
||||
/* This helper is copied from https://github.com/yogiben/meteor-admin/blob/master/lib/client/js/helpers.coffee.
|
||||
I used this to remove the (irrelevant) Meteor.users collection from the dashboard and sidebar (the routes still exist).
|
||||
TODO: Maybe a future version of yogiben:admin could allow this without monkey-patching?
|
||||
*/
|
||||
UI.registerHelper("admin_collections", function() {
|
||||
var collections = {};
|
||||
if (typeof AdminConfig !== 'undefined' && typeof AdminConfig.collections === 'object')
|
||||
collections = AdminConfig.collections;
|
||||
// remove Meteor.users collection (see above)
|
||||
delete collections.Users;
|
||||
return _.map(collections, function(obj, key) {
|
||||
obj = _.extend(obj, { name: key });
|
||||
obj = _.defaults(obj, { label: key, icon: 'plus', color: 'blue' });
|
||||
return obj = _.extend(obj, {
|
||||
viewPath: Router.path("adminDashboard" + key + "View"),
|
||||
newPath: Router.path("adminDashboard" + key + "New")
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
dataTableOptions = {
|
||||
"aaSorting": [],
|
||||
"bPaginate": true,
|
||||
"bLengthChange": false,
|
||||
"bFilter": true,
|
||||
"bSort": true,
|
||||
"bInfo": true,
|
||||
"bAutoWidth": false
|
||||
};
|
||||
@ -0,0 +1,64 @@
|
||||
# Add hooks used by many forms
|
||||
AutoForm.addHooks [
|
||||
'admin_insert',
|
||||
'admin_update',
|
||||
'adminNewUser',
|
||||
'adminUpdateUser',
|
||||
'adminSendResetPasswordEmail',
|
||||
'adminChangePassword'],
|
||||
beginSubmit: ->
|
||||
$('.btn-primary').addClass('disabled')
|
||||
endSubmit: ->
|
||||
$('.btn-primary').removeClass('disabled')
|
||||
onError: (formType, error)->
|
||||
AdminDashboard.alertFailure error.message
|
||||
|
||||
AutoForm.hooks
|
||||
admin_insert:
|
||||
onSubmit: (insertDoc, updateDoc, currentDoc)->
|
||||
hook = @
|
||||
Meteor.call 'adminInsertDoc', insertDoc, Session.get('admin_collection_name'), (e,r)->
|
||||
if e
|
||||
hook.done(e)
|
||||
else
|
||||
adminCallback 'onInsert', [Session.get 'admin_collection_name', insertDoc, updateDoc, currentDoc], (collection) ->
|
||||
hook.done null, collection
|
||||
return false
|
||||
onSuccess: (formType, collection)->
|
||||
AdminDashboard.alertSuccess 'Successfully created'
|
||||
Router.go "/admin/#{collection}"
|
||||
|
||||
admin_update:
|
||||
onSubmit: (insertDoc, updateDoc, currentDoc)->
|
||||
hook = @
|
||||
Meteor.call 'adminUpdateDoc', updateDoc, Session.get('admin_collection_name'), Session.get('admin_id'), (e,r)->
|
||||
if e
|
||||
hook.done(e)
|
||||
else
|
||||
adminCallback 'onUpdate', [Session.get 'admin_collection_name', insertDoc, updateDoc, currentDoc], (collection) ->
|
||||
hook.done null, collection
|
||||
return false
|
||||
onSuccess: (formType, collection)->
|
||||
AdminDashboard.alertSuccess 'Successfully updated'
|
||||
Router.go "/admin/#{collection}"
|
||||
|
||||
adminNewUser:
|
||||
onSuccess: (formType, result)->
|
||||
AdminDashboard.alertSuccess 'Created user'
|
||||
Router.go '/admin/Users'
|
||||
|
||||
adminUpdateUser:
|
||||
onSubmit: (insertDoc, updateDoc, currentDoc)->
|
||||
Meteor.call 'adminUpdateUser', updateDoc, Session.get('admin_id'), @done
|
||||
return false
|
||||
onSuccess: (formType, result)->
|
||||
AdminDashboard.alertSuccess 'Updated user'
|
||||
Router.go '/admin/Users'
|
||||
|
||||
adminSendResetPasswordEmail:
|
||||
onSuccess: (formType, result)->
|
||||
AdminDashboard.alertSuccess 'Email sent'
|
||||
|
||||
adminChangePassword:
|
||||
onSuccess: (operation, result, template)->
|
||||
AdminDashboard.alertSuccess 'Password reset'
|
||||
36
hourglass/packages/meteor-admin/lib/client/js/events.coffee
Normal file
@ -0,0 +1,36 @@
|
||||
Template.AdminLayout.events
|
||||
'click .btn-delete': (e,t) ->
|
||||
_id = $(e.target).attr('doc')
|
||||
if Session.equals 'admin_collection_name', 'Users'
|
||||
Session.set 'admin_id', _id
|
||||
Session.set 'admin_doc', Meteor.users.findOne(_id)
|
||||
else
|
||||
Session.set 'admin_id', parseID(_id)
|
||||
Session.set 'admin_doc', adminCollectionObject(Session.get('admin_collection_name')).findOne(parseID(_id))
|
||||
|
||||
Template.AdminDeleteModal.events
|
||||
'click #confirm-delete': () ->
|
||||
collection = Session.get 'admin_collection_name'
|
||||
_id = Session.get 'admin_id'
|
||||
if collection == 'classes'
|
||||
Meteor.call 'deleteClass', _id, (e,r) ->
|
||||
$('#admin-delete-modal').modal('hide')
|
||||
else if collection == 'admins'
|
||||
Meteor.call 'deleteAdmin', _id, (e,r) ->
|
||||
$('#admin-delete-modal').modal('hide')
|
||||
else
|
||||
Meteor.call 'adminRemoveDoc', collection, _id, (e,r)->
|
||||
$('#admin-delete-modal').modal('hide')
|
||||
|
||||
Template.AdminDashboardUsersEdit.events
|
||||
'click .btn-add-role': (e,t) ->
|
||||
console.log 'adding user'
|
||||
Meteor.call 'adminAddUserToRole', $(e.target).attr('user'), $(e.target).attr('role')
|
||||
'click .btn-remove-role': (e,t) ->
|
||||
console.log 'removing user'
|
||||
Meteor.call 'adminRemoveUserToRole', $(e.target).attr('user'), $(e.target).attr('role')
|
||||
|
||||
Template.AdminHeader.events
|
||||
'click .btn-sign-out': () ->
|
||||
Meteor.logout ->
|
||||
Router.go(AdminConfig?.logoutRedirect or '/')
|
||||
114
hourglass/packages/meteor-admin/lib/client/js/helpers.coffee
Normal file
@ -0,0 +1,114 @@
|
||||
Template.registerHelper('AdminTables', AdminTables);
|
||||
|
||||
adminCollections = ->
|
||||
collections = {}
|
||||
|
||||
if typeof AdminConfig != 'undefined' and typeof AdminConfig.collections == 'object'
|
||||
collections = AdminConfig.collections
|
||||
|
||||
collections.Users =
|
||||
collectionObject: Meteor.users
|
||||
icon: 'user'
|
||||
label: 'Users'
|
||||
|
||||
_.map collections, (obj, key) ->
|
||||
obj = _.extend obj, {name: key}
|
||||
obj = _.defaults obj, {label: key, icon: 'plus', color: 'blue'}
|
||||
obj = _.extend obj,
|
||||
viewPath: Router.path "adminDashboard#{key}View"
|
||||
newPath: Router.path "adminDashboard#{key}New"
|
||||
|
||||
UI.registerHelper 'AdminConfig', ->
|
||||
AdminConfig if typeof AdminConfig != 'undefined'
|
||||
|
||||
UI.registerHelper 'admin_skin', ->
|
||||
AdminConfig?.skin or 'blue'
|
||||
|
||||
UI.registerHelper 'admin_collection_name', ->
|
||||
Session.get 'admin_collection_name'
|
||||
|
||||
UI.registerHelper 'admin_current_id', ->
|
||||
Session.get 'admin_id'
|
||||
|
||||
UI.registerHelper 'admin_current_doc', ->
|
||||
Session.get 'admin_doc'
|
||||
|
||||
UI.registerHelper 'admin_is_users_collection', ->
|
||||
Session.get('admin_collection_name') == 'Users'
|
||||
|
||||
UI.registerHelper 'admin_sidebar_items', ->
|
||||
AdminDashboard.sidebarItems
|
||||
|
||||
UI.registerHelper 'admin_collection_items', ->
|
||||
items = []
|
||||
_.each AdminDashboard.collectionItems, (fn) =>
|
||||
item = fn @name, '/admin/' + @name
|
||||
if item?.title and item?.url
|
||||
items.push item
|
||||
items
|
||||
|
||||
UI.registerHelper 'admin_omit_fields', ->
|
||||
if typeof AdminConfig.autoForm != 'undefined' and typeof AdminConfig.autoForm.omitFields == 'object'
|
||||
global = AdminConfig.autoForm.omitFields
|
||||
if not Session.equals('admin_collection_name','Users') and typeof AdminConfig != 'undefined' and typeof AdminConfig.collections[Session.get 'admin_collection_name'].omitFields == 'object'
|
||||
collection = AdminConfig.collections[Session.get 'admin_collection_name'].omitFields
|
||||
if typeof global == 'object' and typeof collection == 'object'
|
||||
_.union global, collection
|
||||
else if typeof global == 'object'
|
||||
global
|
||||
else if typeof collection == 'object'
|
||||
collection
|
||||
|
||||
UI.registerHelper 'AdminSchemas', ->
|
||||
AdminDashboard.schemas
|
||||
|
||||
UI.registerHelper 'adminGetSkin', ->
|
||||
if typeof AdminConfig.dashboard != 'undefined' and typeof AdminConfig.dashboard.skin == 'string'
|
||||
AdminConfig.dashboard.skin
|
||||
else
|
||||
'blue'
|
||||
|
||||
UI.registerHelper 'adminIsUserInRole', (_id,role)->
|
||||
Roles.userIsInRole _id, role
|
||||
|
||||
UI.registerHelper 'adminGetUsers', ->
|
||||
Meteor.users
|
||||
|
||||
UI.registerHelper 'adminGetUserSchema', ->
|
||||
if _.has(AdminConfig, 'userSchema')
|
||||
schema = AdminConfig.userSchema
|
||||
else if typeof Meteor.users._c2 == 'object'
|
||||
schema = Meteor.users.simpleSchema()
|
||||
|
||||
return schema
|
||||
|
||||
UI.registerHelper 'adminCollectionLabel', (collection)->
|
||||
AdminDashboard.collectionLabel(collection) if collection?
|
||||
|
||||
UI.registerHelper 'adminCollectionCount', (collection)->
|
||||
if collection == 'Users'
|
||||
Meteor.users.find().count()
|
||||
else if collection == 'admins'
|
||||
Meteor.users.find({roles: {$elemMatch: {$eq: "admin"}}}).count()
|
||||
else
|
||||
AdminCollectionsCount.findOne({collection: collection})?.count
|
||||
|
||||
UI.registerHelper 'adminTemplate', (collection, mode)->
|
||||
if collection?.toLowerCase() != 'users' && typeof AdminConfig?.collections?[collection]?.templates != 'undefined'
|
||||
AdminConfig.collections[collection].templates[mode]
|
||||
|
||||
UI.registerHelper 'adminGetCollection', (collection)->
|
||||
_.find adminCollections(), (item) -> item.name == collection
|
||||
|
||||
UI.registerHelper 'adminWidgets', ->
|
||||
if typeof AdminConfig.dashboard != 'undefined' and typeof AdminConfig.dashboard.widgets != 'undefined'
|
||||
AdminConfig.dashboard.widgets
|
||||
|
||||
UI.registerHelper 'adminUserEmail', (user) ->
|
||||
if user && user.emails && user.emails[0] && user.emails[0].address
|
||||
user.emails[0].address
|
||||
else if user && user.services && user.services.facebook && user.services.facebook.email
|
||||
user.services.facebook.email
|
||||
else if user && user.services && user.services.google && user.services.google.email
|
||||
user.services.google.email
|
||||
|
||||
16
hourglass/packages/meteor-admin/lib/client/js/slim_scroll.js
Normal file
@ -0,0 +1,16 @@
|
||||
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* Version: 1.3.0
|
||||
*
|
||||
*/
|
||||
(function(f){jQuery.fn.extend({slimScroll:function(h){var a=f.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},h);this.each(function(){function r(d){if(s){d=d||
|
||||
window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,f,h){k=!1;var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0<d?Math.ceil(e):Math.floor(e),c.css({top:e+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());
|
||||
e=l*(b[0].scrollHeight-b.outerHeight());h&&(e=d,d=e/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),g),c.css({top:d+"px"}));b.scrollTop(e);b.trigger("slimscrolling",~~e);v();p()}function C(){window.addEventListener?(this.addEventListener("DOMMouseScroll",r,!1),this.addEventListener("mousewheel",r,!1),this.addEventListener("MozMousePixelScroll",r,!1)):document.attachEvent("onmousewheel",r)}function w(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),D);c.css({height:u+"px"});
|
||||
var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function v(){w();clearTimeout(A);l==~~l?(k=a.allowPageScroll,B!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;B=l;u>=b.outerHeight()?k=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&g.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(A=setTimeout(function(){a.disableFadeOut&&s||(x||y)||(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var s,x,y,A,z,u,l,B,D=30,k=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),
|
||||
c=b.parent().find("."+a.barClass),g=b.parent().find("."+a.railClass);w();if(f.isPlainObject(h)){if("height"in h&&"auto"==h.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",q);b.css("height",q)}if("scrollTo"in h)n=parseInt(a.scrollTo);else if("scrollBy"in h)n+=parseInt(a.scrollBy);else if("destroy"in h){c.remove();g.remove();b.unwrap();return}m(n,!1,!0)}}else{a.height="auto"==a.height?b.parent().height():a.height;n=f("<div></div>").addClass(a.wrapperClass).css({position:"relative",
|
||||
overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var g=f("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?
|
||||
"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?{right:a.distance}:{left:a.distance};g.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(g);a.railDraggable&&c.bind("mousedown",function(a){var b=f(document);y=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});
|
||||
b.bind("mouseup.slimscroll",function(a){y=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});g.hover(function(){v()},function(){p()});c.hover(function(){x=!0},function(){x=!1});b.hover(function(){s=!0;v();p()},function(){s=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(z=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&
|
||||
(m((z-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),z=b.originalEvent.touches[0].pageY)});w();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),m(0,!0)):"top"!==a.start&&(m(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());C()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);
|
||||
@ -0,0 +1,55 @@
|
||||
Template.AdminDashboardViewWrapper.rendered = ->
|
||||
node = @firstNode
|
||||
|
||||
@autorun ->
|
||||
data = Template.currentData()
|
||||
|
||||
if data.view then Blaze.remove data.view
|
||||
while node.firstChild
|
||||
node.removeChild node.firstChild
|
||||
|
||||
data.view = Blaze.renderWithData Template.AdminDashboardView, data, node
|
||||
|
||||
Template.AdminDashboardViewWrapper.destroyed = ->
|
||||
Blaze.remove @data.view
|
||||
|
||||
Template.AdminDashboardView.rendered = ->
|
||||
table = @$('.dataTable').DataTable();
|
||||
filter = @$('.dataTables_filter')
|
||||
length = @$('.dataTables_length')
|
||||
|
||||
filter.html '
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control input-sm" placeholder="Search"></input>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
'
|
||||
|
||||
length.html '
|
||||
<select class="form-control input-sm">
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
'
|
||||
|
||||
filter.find('input').on 'keyup', ->
|
||||
table.search(@value).draw()
|
||||
|
||||
length.find('select').on 'change', ->
|
||||
table.page.len(parseInt @value).draw()
|
||||
|
||||
Template.AdminDashboardView.helpers
|
||||
hasDocuments: ->
|
||||
AdminCollectionsCount.findOne({collection: Session.get 'admin_collection_name'})?.count > 0
|
||||
newPath: ->
|
||||
Router.path 'adminDashboard' + Session.get('admin_collection_name') + 'New'
|
||||
|
||||
Template.adminEditBtn.helpers
|
||||
path: ->
|
||||
Router.path "adminDashboard" + Session.get('admin_collection_name') + "Edit", _id: @_id
|
||||
101
hourglass/packages/meteor-admin/lib/server/methods.coffee
Normal file
@ -0,0 +1,101 @@
|
||||
Meteor.methods
|
||||
adminInsertDoc: (doc,collection)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
this.unblock()
|
||||
result = adminCollectionObject(collection).insert doc
|
||||
|
||||
return result
|
||||
|
||||
adminUpdateDoc: (modifier,collection,_id)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
this.unblock()
|
||||
result = adminCollectionObject(collection).update {_id:_id},modifier
|
||||
return result
|
||||
|
||||
adminRemoveDoc: (collection,_id)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
if collection == 'Users'
|
||||
Meteor.users.remove {_id:_id}
|
||||
else
|
||||
# global[collection].remove {_id:_id}
|
||||
adminCollectionObject(collection).remove {_id: _id}
|
||||
|
||||
|
||||
adminNewUser: (doc) ->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
emails = doc.email.split(',')
|
||||
_.each emails, (email)->
|
||||
user = {}
|
||||
user.email = email
|
||||
unless doc.chooseOwnPassword
|
||||
user.password = doc.password
|
||||
|
||||
_id = Accounts.createUser user
|
||||
|
||||
if doc.sendPassword and AdminConfig.fromEmail?
|
||||
Email.send
|
||||
to: user.email
|
||||
from: AdminConfig.fromEmail
|
||||
subject: 'Your account has been created'
|
||||
html: 'You\'ve just had an account created for ' + Meteor.absoluteUrl() + ' with password ' + doc.password
|
||||
|
||||
if not doc.sendPassword
|
||||
Accounts.sendEnrollmentEmail _id
|
||||
|
||||
adminUpdateUser: (modifier,_id)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
this.unblock()
|
||||
result = Meteor.users.update {_id:_id}, modifier
|
||||
return result
|
||||
|
||||
adminSendResetPasswordEmail: (doc)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
console.log 'Changing password for user ' + doc._id
|
||||
Accounts.sendResetPasswordEmail(doc._id)
|
||||
|
||||
adminChangePassword: (doc)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
console.log 'Changing password for user ' + doc._id
|
||||
Accounts.setPassword(doc._id, doc.password)
|
||||
label: 'Email user their new password'
|
||||
|
||||
adminCheckAdmin: ->
|
||||
check arguments, [Match.Any]
|
||||
user = Meteor.users.findOne(_id:this.userId)
|
||||
if this.userId and !Roles.userIsInRole(this.userId, ['admin']) and (user.emails.length > 0)
|
||||
email = user.emails[0].address
|
||||
if typeof Meteor.settings.adminEmails != 'undefined'
|
||||
adminEmails = Meteor.settings.adminEmails
|
||||
if adminEmails.indexOf(email) > -1
|
||||
console.log 'Adding admin user: ' + email
|
||||
Roles.addUsersToRoles this.userId, ['admin'], Roles.GLOBAL_GROUP
|
||||
else if typeof AdminConfig != 'undefined' and typeof AdminConfig.adminEmails == 'object'
|
||||
adminEmails = AdminConfig.adminEmails
|
||||
if adminEmails.indexOf(email) > -1
|
||||
console.log 'Adding admin user: ' + email
|
||||
Roles.addUsersToRoles this.userId, ['admin'], Roles.GLOBAL_GROUP
|
||||
else if this.userId == Meteor.users.findOne({},{sort:{createdAt:1}})._id
|
||||
console.log 'Making first user admin: ' + email
|
||||
Roles.addUsersToRoles this.userId, ['admin']
|
||||
|
||||
adminAddUserToRole: (_id,role)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
Roles.addUsersToRoles _id, role, Roles.GLOBAL_GROUP
|
||||
|
||||
adminRemoveUserToRole: (_id,role)->
|
||||
check arguments, [Match.Any]
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
Roles.removeUsersFromRoles _id, role, Roles.GLOBAL_GROUP
|
||||
|
||||
adminSetCollectionSort: (collection, _sort) ->
|
||||
check arguments, [Match.Any]
|
||||
global.AdminPages[collection].set
|
||||
sort: _sort
|
||||
46
hourglass/packages/meteor-admin/lib/server/publish.coffee
Normal file
@ -0,0 +1,46 @@
|
||||
Meteor.publishComposite 'adminCollectionDoc', (collection, id) ->
|
||||
check collection, String
|
||||
check id, Match.OneOf(String, Mongo.ObjectID)
|
||||
if Roles.userIsInRole this.userId, ['admin']
|
||||
find: ->
|
||||
adminCollectionObject(collection).find(id)
|
||||
children: AdminConfig?.collections?[collection]?.children or []
|
||||
else
|
||||
@ready()
|
||||
|
||||
Meteor.publish 'adminUsers', ->
|
||||
if Roles.userIsInRole @userId, ['admin']
|
||||
Meteor.users.find()
|
||||
else
|
||||
@ready()
|
||||
|
||||
Meteor.publish 'adminUser', ->
|
||||
Meteor.users.find @userId
|
||||
|
||||
Meteor.publish 'adminCollectionsCount', ->
|
||||
handles = []
|
||||
self = @
|
||||
|
||||
_.each AdminTables, (table, name) ->
|
||||
id = new Mongo.ObjectID
|
||||
count = 0
|
||||
table = AdminTables[name]
|
||||
ready = false
|
||||
selector = if table.selector then table.selector(self.userId) else {}
|
||||
handles.push table.collection.find().observeChanges
|
||||
added: ->
|
||||
count += 1
|
||||
ready and self.changed 'adminCollectionsCount', id, {count: count}
|
||||
removed: ->
|
||||
count -= 1
|
||||
ready and self.changed 'adminCollectionsCount', id, {count: count}
|
||||
ready = true
|
||||
|
||||
self.added 'adminCollectionsCount', id, {collection: name, count: count}
|
||||
|
||||
self.onStop ->
|
||||
_.each handles, (handle) -> handle.stop()
|
||||
self.ready()
|
||||
|
||||
Meteor.publish null, ->
|
||||
Meteor.roles.find({})
|
||||
66
hourglass/packages/meteor-admin/package.js
Normal file
@ -0,0 +1,66 @@
|
||||
Package.describe({
|
||||
name: "yogiben:admin-edit",
|
||||
summary: "A complete admin dashboard solution",
|
||||
version: "1.2.8",
|
||||
git: "https://github.com/yogiben/meteor-admin"
|
||||
});
|
||||
|
||||
Package.on_use(function(api){
|
||||
|
||||
both = ['client','server']
|
||||
|
||||
api.versionsFrom('METEOR@1.0');
|
||||
|
||||
api.use(
|
||||
['iron:router@1.0.9',
|
||||
'coffeescript',
|
||||
'underscore',
|
||||
'reactive-var',
|
||||
'check',
|
||||
'aldeed:collection2@2.5.0',
|
||||
'aldeed:autoform@5.5.1',
|
||||
'aldeed:template-extension@4.0.0',
|
||||
'alanning:roles@1.2.13',
|
||||
'raix:handlebar-helpers@0.2.5',
|
||||
'reywood:publish-composite@1.4.2',
|
||||
'momentjs:moment@2.10.6',
|
||||
'aldeed:tabular@1.4.0',
|
||||
'meteorhacks:unblock@1.1.0',
|
||||
'zimme:active-route@2.3.2'
|
||||
],
|
||||
both);
|
||||
|
||||
api.use(['less@1.0.0 || 2.5.0','session','jquery','templating'],'client')
|
||||
|
||||
api.use(['email'],'server')
|
||||
|
||||
api.add_files([
|
||||
'lib/both/AdminDashboard.coffee',
|
||||
'lib/both/router.coffee',
|
||||
'lib/both/utils.coffee',
|
||||
'lib/both/startup.coffee',
|
||||
'lib/both/collections.coffee'
|
||||
], both);
|
||||
|
||||
api.add_files([
|
||||
'lib/client/html/admin_templates.html',
|
||||
'lib/client/html/admin_widgets.html',
|
||||
'lib/client/html/admin_layouts.html',
|
||||
'lib/client/html/admin_sidebar.html',
|
||||
'lib/client/html/admin_header.html',
|
||||
'lib/client/css/admin-custom.less',
|
||||
'lib/client/js/admin_layout.js',
|
||||
'lib/client/js/helpers.coffee',
|
||||
'lib/client/js/templates.coffee',
|
||||
'lib/client/js/events.coffee',
|
||||
'lib/client/js/slim_scroll.js',
|
||||
'lib/client/js/autoForm.coffee'
|
||||
], 'client');
|
||||
|
||||
api.add_files([
|
||||
'lib/server/publish.coffee',
|
||||
'lib/server/methods.coffee'
|
||||
], 'server');
|
||||
|
||||
api.export('AdminDashboard',both)
|
||||
});
|
||||
275
hourglass/packages/meteor-admin/versions.json
Normal file
@ -0,0 +1,275 @@
|
||||
{
|
||||
"dependencies": [
|
||||
[
|
||||
"accounts-base",
|
||||
"1.1.2"
|
||||
],
|
||||
[
|
||||
"accounts-password",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"alanning:roles",
|
||||
"1.2.13"
|
||||
],
|
||||
[
|
||||
"aldeed:autoform",
|
||||
"4.0.7"
|
||||
],
|
||||
[
|
||||
"aldeed:collection2",
|
||||
"2.2.0"
|
||||
],
|
||||
[
|
||||
"aldeed:simple-schema",
|
||||
"1.1.0"
|
||||
],
|
||||
[
|
||||
"aldeed:template-extension",
|
||||
"4.0.0"
|
||||
],
|
||||
[
|
||||
"alethes:pages",
|
||||
"1.7.1"
|
||||
],
|
||||
[
|
||||
"application-configuration",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"base64",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"binary-heap",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"blaze",
|
||||
"2.0.3"
|
||||
],
|
||||
[
|
||||
"blaze-tools",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"boilerplate-generator",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"callback-hook",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"check",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"coffeescript",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"ddp",
|
||||
"1.0.11"
|
||||
],
|
||||
[
|
||||
"deps",
|
||||
"1.0.5"
|
||||
],
|
||||
[
|
||||
"ejson",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"email",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"follower-livedata",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"geojson-utils",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"html-tools",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"htmljs",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"id-map",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"iron:controller",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:core",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:dynamic-template",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:layout",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:location",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:middleware-stack",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:router",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"iron:url",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"jquery",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"json",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"less",
|
||||
"1.0.11"
|
||||
],
|
||||
[
|
||||
"livedata",
|
||||
"1.0.11"
|
||||
],
|
||||
[
|
||||
"localstorage",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"logging",
|
||||
"1.0.5"
|
||||
],
|
||||
[
|
||||
"meteor",
|
||||
"1.1.3"
|
||||
],
|
||||
[
|
||||
"minifiers",
|
||||
"1.1.2"
|
||||
],
|
||||
[
|
||||
"minimongo",
|
||||
"1.0.5"
|
||||
],
|
||||
[
|
||||
"mongo",
|
||||
"1.0.8"
|
||||
],
|
||||
[
|
||||
"mongo-livedata",
|
||||
"1.0.6"
|
||||
],
|
||||
[
|
||||
"mrt:moment",
|
||||
"2.8.1"
|
||||
],
|
||||
[
|
||||
"npm-bcrypt",
|
||||
"0.7.7"
|
||||
],
|
||||
[
|
||||
"observe-sequence",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"ordered-dict",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"raix:handlebar-helpers",
|
||||
"0.1.3"
|
||||
],
|
||||
[
|
||||
"random",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"reactive-dict",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"reactive-var",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"retry",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"routepolicy",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"service-configuration",
|
||||
"1.0.2"
|
||||
],
|
||||
[
|
||||
"session",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"sha",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"spacebars",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"spacebars-compiler",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"srp",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"templating",
|
||||
"1.0.9"
|
||||
],
|
||||
[
|
||||
"tracker",
|
||||
"1.0.3"
|
||||
],
|
||||
[
|
||||
"ui",
|
||||
"1.0.4"
|
||||
],
|
||||
[
|
||||
"underscore",
|
||||
"1.0.1"
|
||||
],
|
||||
[
|
||||
"webapp",
|
||||
"1.1.4"
|
||||
],
|
||||
[
|
||||
"webapp-hashing",
|
||||
"1.0.1"
|
||||
]
|
||||
],
|
||||
"pluginDependencies": [],
|
||||
"toolVersion": "meteor-tool@1.0.35",
|
||||
"format": "1.0"
|
||||
}
|
||||
BIN
hourglass/public/Backgrounds/Black.jpg
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
hourglass/public/Backgrounds/Earth.jpg
Normal file
|
After Width: | Height: | Size: 299 KiB |
BIN
hourglass/public/Backgrounds/NeonBlue.jpg
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
hourglass/public/Backgrounds/RedBlack.jpg
Normal file
|
After Width: | Height: | Size: 262 KiB |
BIN
hourglass/public/Backgrounds/Sea.jpg
Normal file
|
After Width: | Height: | Size: 279 KiB |
BIN
hourglass/public/Backgrounds/White.jpg
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
hourglass/public/Banners/defaultcover.jpg
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
hourglass/public/HG.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
hourglass/public/Logos/ColoredLogo.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
hourglass/public/Logos/ColoredLogoOutline.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
hourglass/public/Logos/LogoBackPlate.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
hourglass/public/Logos/LogoInvert.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
hourglass/public/Logos/LogoNoColor.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
hourglass/public/Logos/LogoText.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
hourglass/public/Logos/LogoTextSmall.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
hourglass/public/MDBackgrounds/MDBlack.jpg
Normal file
|
After Width: | Height: | Size: 142 KiB |
BIN
hourglass/public/MDBackgrounds/MDEarth.jpg
Normal file
|
After Width: | Height: | Size: 149 KiB |
BIN
hourglass/public/MDBackgrounds/MDNeonBlue.jpg
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
hourglass/public/MDBackgrounds/MDRedBlack.jpg
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
hourglass/public/MDBackgrounds/MDSea.jpg
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
hourglass/public/MDBackgrounds/MDWhite.jpg
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
hourglass/public/MDBackgrounds/Old/MDBlack.jpg
Normal file
|
After Width: | Height: | Size: 181 KiB |