@ -0,0 +1,10 @@ |
|||||||
|
# Site specific files |
||||||
|
cherrypy.config |
||||||
|
appdir.py |
||||||
|
# local dev folders |
||||||
|
future |
||||||
|
# The usual suspects |
||||||
|
*.pyc |
||||||
|
*.swp |
||||||
|
*~ |
||||||
|
README.html |
@ -0,0 +1,6 @@ |
|||||||
|
[submodule "dependencies/functioncache"] |
||||||
|
path = dependencies/functioncache |
||||||
|
url = https://github.com/thedod/functioncache.git |
||||||
|
[submodule "dependencies/python-bitcoinrpc"] |
||||||
|
path = dependencies/python-bitcoinrpc |
||||||
|
url = https://github.com/thedod/python-bitcoinrpc.git |
@ -0,0 +1,664 @@ |
|||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE |
||||||
|
Version 3, 19 November 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 Affero General Public License is a free, copyleft license for |
||||||
|
software and other kinds of works, specifically designed to ensure |
||||||
|
cooperation with the community in the case of network server software. |
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed |
||||||
|
to take away your freedom to share and change the works. By contrast, |
||||||
|
our General Public Licenses are intended to guarantee your freedom to |
||||||
|
share and change all versions of a program--to make sure it remains free |
||||||
|
software for all its users. |
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not |
||||||
|
price. Our General Public Licenses are designed to make sure that you |
||||||
|
have the freedom to distribute copies of free software (and charge for |
||||||
|
them if you wish), that you receive source code or can get it if you |
||||||
|
want it, that you can change the software or use pieces of it in new |
||||||
|
free programs, and that you know you can do these things. |
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights |
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer |
||||||
|
you this License which gives you legal permission to copy, distribute |
||||||
|
and/or modify the software. |
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that |
||||||
|
improvements made in alternate versions of the program, if they |
||||||
|
receive widespread use, become available for other developers to |
||||||
|
incorporate. Many developers of free software are heartened and |
||||||
|
encouraged by the resulting cooperation. However, in the case of |
||||||
|
software used on network servers, this result may fail to come about. |
||||||
|
The GNU General Public License permits making a modified version and |
||||||
|
letting the public access it on a server without ever releasing its |
||||||
|
source code to the public. |
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to |
||||||
|
ensure that, in such cases, the modified source code becomes available |
||||||
|
to the community. It requires the operator of a network server to |
||||||
|
provide the source code of the modified version running there to the |
||||||
|
users of that server. Therefore, public use of a modified version, on |
||||||
|
a publicly accessible server, gives the public access to the source |
||||||
|
code of the modified version. |
||||||
|
|
||||||
|
An older license, called the Affero General Public License and |
||||||
|
published by Affero, was designed to accomplish similar goals. This is |
||||||
|
a different license, not a version of the Affero GPL, but Affero has |
||||||
|
released a new version of the Affero GPL which permits relicensing under |
||||||
|
this license. |
||||||
|
|
||||||
|
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. |
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the |
||||||
|
Program, your modified version must prominently offer all users |
||||||
|
interacting with it remotely through a computer network (if your version |
||||||
|
supports such interaction) an opportunity to receive the Corresponding |
||||||
|
Source of your version by providing access to the Corresponding Source |
||||||
|
from a network server at no charge, through some standard or customary |
||||||
|
means of facilitating copying of software. This Corresponding Source |
||||||
|
shall include the Corresponding Source for any work covered by version 3 |
||||||
|
of the GNU General Public License that is incorporated pursuant to the |
||||||
|
following paragraph. |
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have |
||||||
|
permission to link or combine any covered work with a work licensed |
||||||
|
under version 3 of the GNU General Public License into a single |
||||||
|
combined work, and to convey the resulting work. The terms of this |
||||||
|
License will continue to apply to the part which is the covered work, |
||||||
|
but the work with which it is combined will remain governed by version |
||||||
|
3 of the GNU General Public License. |
||||||
|
|
||||||
|
14. Revised Versions of this License. |
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of |
||||||
|
the GNU Affero General Public License from time to time. Such new versions |
||||||
|
will be similar in spirit to the present version, but may differ in detail to |
||||||
|
address new problems or concerns. |
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the |
||||||
|
Program specifies that a certain numbered version of the GNU Affero General |
||||||
|
Public License "or any later version" applies to it, you have the |
||||||
|
option of following the terms and conditions either of that numbered |
||||||
|
version or of any later version published by the Free Software |
||||||
|
Foundation. If the Program does not specify a version number of the |
||||||
|
GNU Affero General Public License, you may choose any version ever published |
||||||
|
by the Free Software Foundation. |
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future |
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's |
||||||
|
public statement of acceptance of a version permanently authorizes you |
||||||
|
to choose that version for the Program. |
||||||
|
|
||||||
|
Later license versions may give you additional or different |
||||||
|
permissions. However, no additional obligations are imposed on any |
||||||
|
author or copyright holder as a result of your choosing to follow a |
||||||
|
later version. |
||||||
|
|
||||||
|
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 Affero General Public License as published by |
||||||
|
the Free Software Foundation, either version 3 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Affero General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License |
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail. |
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer |
||||||
|
network, you should also make sure that it provides a way for users to |
||||||
|
get its source. For example, if your program is a web application, its |
||||||
|
interface could display a "Source" link that leads users to an archive |
||||||
|
of the code. There are many ways you could offer source, and different |
||||||
|
solutions will be better for different programs; see section 13 for the |
||||||
|
specific requirements. |
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school, |
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary. |
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see |
||||||
|
<http://www.gnu.org/licenses/>. |
||||||
|
|
||||||
|
---- |
||||||
|
Source: http://www.gnu.org/licenses/agpl-3.0.txt |
@ -0,0 +1,48 @@ |
|||||||
|
![Stupid cartoon. Robots, ignore this (or are you too stupid to understand me? What? You're gonna start crying now? OK. You're intelligent).](graphics/swizzler-disclaimer.jpg) |
||||||
|
|
||||||
|
### Goals |
||||||
|
Provide a [twister](twister.net.co) web client that: |
||||||
|
|
||||||
|
* is *[#NoJS](http://rys.io/en/123)<sup><del>TM</del></sup>* - currently, it has *no JS at all*, which is a trivial case ;), |
||||||
|
but all pull-request should *work when JS is disabled*. That's the only "rule". |
||||||
|
* Is simple enough for people to fork and try other front-ends or features (I have a few in mind. I'm sure you have others). |
||||||
|
|
||||||
|
In short: it's a "twister-client constructor kit". Even if what you do doesn't get merged upstream, who says we should all run the same client? Diversity is fun. |
||||||
|
### Roadmap |
||||||
|
|
||||||
|
The following functionality is missing before Swizzler becomes a full read-only version |
||||||
|
|
||||||
|
* Direct messages - currently, there are links to that (look like an envelope) but they're 404 ;) |
||||||
|
* Search box - for hashtags and users by prefix |
||||||
|
* Basic auth - we don't want trojans to read our direct messages, so I guess this is top priority ;) |
||||||
|
|
||||||
|
I believe this should take a few days. |
||||||
|
|
||||||
|
#### Future |
||||||
|
|
||||||
|
* *To be defined* |
||||||
|
* Then we take Berlin |
||||||
|
|
||||||
|
---------------- |
||||||
|
|
||||||
|
### Dependencies |
||||||
|
|
||||||
|
* [CherryPy](https://pypi.python.org/pypi/CherryPy/) |
||||||
|
* [Pystache](https://pypi.python.org/pypi/pystache/) |
||||||
|
* [twitter-text-python](https://pypi.python.org/pypi/twitter-text-python/) |
||||||
|
|
||||||
|
You also need tweaked versios |
||||||
|
of [python-bitcoinrpc](https://github.com/thedod/python-bitcoinrpc/tree/for-twister) |
||||||
|
and [functioncache](https://github.com/thedod/functioncache/tree/skip-cache) |
||||||
|
but these are defined as git submodules, so `install.sh` takes care of them. |
||||||
|
|
||||||
|
### To install |
||||||
|
|
||||||
|
* Install dependencies mentioned above |
||||||
|
* Run `./install.sh` to create `cherrypy.conf` and `appdir.py` |
||||||
|
* Edit `cherrypy.conf` (at least edit the user:password@ at the rpc url) |
||||||
|
|
||||||
|
### To run |
||||||
|
* `python swizzler.py` |
||||||
|
* It should say `ENGINE Serving on 127.0.0.1:7919` (or whatever host and port you've defined at `cherrypy.conf`) |
||||||
|
* Browse to that address |
@ -0,0 +1,20 @@ |
|||||||
|
[global] |
||||||
|
server.socket_host: '127.0.0.1' |
||||||
|
server.socket_port: 7919 # SWIZ on a phone keypad :) |
||||||
|
|
||||||
|
[swizzler] |
||||||
|
rpc_url: 'http://user:pwd@127.0.0.1:28332' # change to rpcuser and rpcpassword from ~/.twister/twister.conf |
||||||
|
num_messages: 23 # number of messages per page |
||||||
|
num_trending_tags: 42 # let's party |
||||||
|
hash_salt: 'RANDOM' |
||||||
|
|
||||||
|
[/] |
||||||
|
tools.staticdir.root: "/PATH/HERE/static" |
||||||
|
|
||||||
|
[/favicon.ico] |
||||||
|
tools.staticfile.on: True |
||||||
|
tools.staticfile.filename: "/PATH/HERE/static/favicon.ico" |
||||||
|
|
||||||
|
[/assets] |
||||||
|
tools.staticdir.on: True |
||||||
|
tools.staticdir.dir: "assets" |
@ -0,0 +1 @@ |
|||||||
|
Subproject commit 71a313b789bb79faf30b380248d68fac07f2d864 |
@ -0,0 +1 @@ |
|||||||
|
Subproject commit ad74dce5d7efb5195bfb8569b7694ae08a314edf |
@ -0,0 +1,6 @@ |
|||||||
|
Here you can find an xcf file of the logo and the components it is made of (martini glass and tornado) |
||||||
|
|
||||||
|
Credits: |
||||||
|
|
||||||
|
* The [martini glass](martini_glass_k_yager_10r.png) image comes from [openclipart.org](https://openclipart.org/detail/martini-glass-k-yager-10r-by-anonymous). |
||||||
|
* The [tornado](tornado.svg) image comes from [i2clipart.com](http://www.i2clipart.com/clipart-tornado-82fc). |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 309 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,13 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# Note: python-bitcoinrpc and functioncache are twister-specific branches |
||||||
|
# Perhaps their pull-requests will get merged upstream one day (and we'll rebase when it happens) |
||||||
|
# but we can't let it stop us :) |
||||||
|
git submodule update --init |
||||||
|
if [ -f cherrypy.config ] ; then |
||||||
|
echo you already have cherrypy.config |
||||||
|
else |
||||||
|
sed -e "s:/PATH/HERE:`pwd`:" \ |
||||||
|
-e "s/RANDOM/$(python -c "import random; print random._urandom(60).encode('base_64').strip().replace('\n','').replace('/','')")/" \ |
||||||
|
< cherrypy.config.example > cherrypy.config |
||||||
|
echo "created cherrypy.config. Now edit it to taste ;)" |
||||||
|
fi |
@ -0,0 +1,412 @@ |
|||||||
|
{ |
||||||
|
"vars": { |
||||||
|
"@gray-darker": "lighten(#000, 13.5%)", |
||||||
|
"@gray-dark": "lighten(#000, 20%)", |
||||||
|
"@gray": "lighten(#000, 33.5%)", |
||||||
|
"@gray-light": "lighten(#000, 60%)", |
||||||
|
"@gray-lighter": "lighten(#000, 93.5%)", |
||||||
|
"@brand-primary": "#428bca", |
||||||
|
"@brand-success": "#5cb85c", |
||||||
|
"@brand-info": "#5bc0de", |
||||||
|
"@brand-warning": "#f0ad4e", |
||||||
|
"@brand-danger": "#d9534f", |
||||||
|
"@body-bg": "#fff", |
||||||
|
"@text-color": "@gray-dark", |
||||||
|
"@link-color": "@brand-primary", |
||||||
|
"@link-hover-color": "darken(@link-color, 15%)", |
||||||
|
"@font-family-sans-serif": "\"Helvetica Neue\", Helvetica, Arial, sans-serif", |
||||||
|
"@font-family-serif": "Georgia, \"Times New Roman\", Times, serif", |
||||||
|
"@font-family-monospace": "Menlo, Monaco, Consolas, \"Courier New\", monospace", |
||||||
|
"@font-family-base": "@font-family-sans-serif", |
||||||
|
"@font-size-base": "14px", |
||||||
|
"@font-size-large": "ceil((@font-size-base * 1.25))", |
||||||
|
"@font-size-small": "ceil((@font-size-base * 0.85))", |
||||||
|
"@font-size-h1": "floor((@font-size-base * 2.6))", |
||||||
|
"@font-size-h2": "floor((@font-size-base * 2.15))", |
||||||
|
"@font-size-h3": "ceil((@font-size-base * 1.7))", |
||||||
|
"@font-size-h4": "ceil((@font-size-base * 1.25))", |
||||||
|
"@font-size-h5": "@font-size-base", |
||||||
|
"@font-size-h6": "ceil((@font-size-base * 0.85))", |
||||||
|
"@line-height-base": "1.428571429", |
||||||
|
"@line-height-computed": "floor((@font-size-base * @line-height-base))", |
||||||
|
"@headings-font-family": "inherit", |
||||||
|
"@headings-font-weight": "500", |
||||||
|
"@headings-line-height": "1.1", |
||||||
|
"@headings-color": "inherit", |
||||||
|
"@padding-base-vertical": "6px", |
||||||
|
"@padding-base-horizontal": "12px", |
||||||
|
"@padding-large-vertical": "10px", |
||||||
|
"@padding-large-horizontal": "16px", |
||||||
|
"@padding-small-vertical": "5px", |
||||||
|
"@padding-small-horizontal": "10px", |
||||||
|
"@padding-xs-vertical": "1px", |
||||||
|
"@padding-xs-horizontal": "5px", |
||||||
|
"@line-height-large": "1.33", |
||||||
|
"@line-height-small": "1.5", |
||||||
|
"@border-radius-base": "4px", |
||||||
|
"@border-radius-large": "6px", |
||||||
|
"@border-radius-small": "3px", |
||||||
|
"@component-active-color": "#fff", |
||||||
|
"@component-active-bg": "@brand-primary", |
||||||
|
"@caret-width-base": "4px", |
||||||
|
"@caret-width-large": "5px", |
||||||
|
"@table-cell-padding": "8px", |
||||||
|
"@table-condensed-cell-padding": "5px", |
||||||
|
"@table-bg": "transparent", |
||||||
|
"@table-bg-accent": "#f9f9f9", |
||||||
|
"@table-bg-hover": "#f5f5f5", |
||||||
|
"@table-bg-active": "@table-bg-hover", |
||||||
|
"@table-border-color": "#ddd", |
||||||
|
"@btn-font-weight": "normal", |
||||||
|
"@btn-default-color": "#333", |
||||||
|
"@btn-default-bg": "#fff", |
||||||
|
"@btn-default-border": "#ccc", |
||||||
|
"@btn-primary-color": "#fff", |
||||||
|
"@btn-primary-bg": "@brand-primary", |
||||||
|
"@btn-primary-border": "darken(@btn-primary-bg, 5%)", |
||||||
|
"@btn-success-color": "#fff", |
||||||
|
"@btn-success-bg": "@brand-success", |
||||||
|
"@btn-success-border": "darken(@btn-success-bg, 5%)", |
||||||
|
"@btn-info-color": "#fff", |
||||||
|
"@btn-info-bg": "@brand-info", |
||||||
|
"@btn-info-border": "darken(@btn-info-bg, 5%)", |
||||||
|
"@btn-warning-color": "#fff", |
||||||
|
"@btn-warning-bg": "@brand-warning", |
||||||
|
"@btn-warning-border": "darken(@btn-warning-bg, 5%)", |
||||||
|
"@btn-danger-color": "#fff", |
||||||
|
"@btn-danger-bg": "@brand-danger", |
||||||
|
"@btn-danger-border": "darken(@btn-danger-bg, 5%)", |
||||||
|
"@btn-link-disabled-color": "@gray-light", |
||||||
|
"@input-bg": "#fff", |
||||||
|
"@input-bg-disabled": "@gray-lighter", |
||||||
|
"@input-color": "@gray", |
||||||
|
"@input-border": "#ccc", |
||||||
|
"@input-border-radius": "@border-radius-base", |
||||||
|
"@input-border-focus": "#66afe9", |
||||||
|
"@input-color-placeholder": "@gray-light", |
||||||
|
"@input-height-base": "(@line-height-computed + (@padding-base-vertical * 2) + 2)", |
||||||
|
"@input-height-large": "(ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2)", |
||||||
|
"@input-height-small": "(floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2)", |
||||||
|
"@legend-color": "@gray-dark", |
||||||
|
"@legend-border-color": "#e5e5e5", |
||||||
|
"@input-group-addon-bg": "@gray-lighter", |
||||||
|
"@input-group-addon-border-color": "@input-border", |
||||||
|
"@dropdown-bg": "#fff", |
||||||
|
"@dropdown-border": "rgba(0,0,0,.15)", |
||||||
|
"@dropdown-fallback-border": "#ccc", |
||||||
|
"@dropdown-divider-bg": "#e5e5e5", |
||||||
|
"@dropdown-link-color": "@gray-dark", |
||||||
|
"@dropdown-link-hover-color": "darken(@gray-dark, 5%)", |
||||||
|
"@dropdown-link-hover-bg": "#f5f5f5", |
||||||
|
"@dropdown-link-active-color": "@component-active-color", |
||||||
|
"@dropdown-link-active-bg": "@component-active-bg", |
||||||
|
"@dropdown-link-disabled-color": "@gray-light", |
||||||
|
"@dropdown-header-color": "@gray-light", |
||||||
|
"@dropdown-caret-color": "#000", |
||||||
|
"@screen-xs": "480px", |
||||||
|
"@screen-xs-min": "@screen-xs", |
||||||
|
"@screen-phone": "@screen-xs-min", |
||||||
|
"@screen-sm": "768px", |
||||||
|
"@screen-sm-min": "@screen-sm", |
||||||
|
"@screen-tablet": "@screen-sm-min", |
||||||
|
"@screen-md": "992px", |
||||||
|
"@screen-md-min": "@screen-md", |
||||||
|
"@screen-desktop": "@screen-md-min", |
||||||
|
"@screen-lg": "1200px", |
||||||
|
"@screen-lg-min": "@screen-lg", |
||||||
|
"@screen-lg-desktop": "@screen-lg-min", |
||||||
|
"@screen-xs-max": "(@screen-sm-min - 1)", |
||||||
|
"@screen-sm-max": "(@screen-md-min - 1)", |
||||||
|
"@screen-md-max": "(@screen-lg-min - 1)", |
||||||
|
"@grid-columns": "12", |
||||||
|
"@grid-gutter-width": "30px", |
||||||
|
"@grid-float-breakpoint": "@screen-sm-min", |
||||||
|
"@grid-float-breakpoint-max": "(@grid-float-breakpoint - 1)", |
||||||
|
"@container-tablet": "((720px + @grid-gutter-width))", |
||||||
|
"@container-sm": "@container-tablet", |
||||||
|
"@container-desktop": "((940px + @grid-gutter-width))", |
||||||
|
"@container-md": "@container-desktop", |
||||||
|
"@container-large-desktop": "((1140px + @grid-gutter-width))", |
||||||
|
"@container-lg": "@container-large-desktop", |
||||||
|
"@navbar-height": "50px", |
||||||
|
"@navbar-margin-bottom": "@line-height-computed", |
||||||
|
"@navbar-border-radius": "@border-radius-base", |
||||||
|
"@navbar-padding-horizontal": "floor((@grid-gutter-width / 2))", |
||||||
|
"@navbar-padding-vertical": "((@navbar-height - @line-height-computed) / 2)", |
||||||
|
"@navbar-collapse-max-height": "340px", |
||||||
|
"@navbar-default-color": "#777", |
||||||
|
"@navbar-default-bg": "#f8f8f8", |
||||||
|
"@navbar-default-border": "darken(@navbar-default-bg, 6.5%)", |
||||||
|
"@navbar-default-link-color": "#777", |
||||||
|
"@navbar-default-link-hover-color": "#333", |
||||||
|
"@navbar-default-link-hover-bg": "transparent", |
||||||
|
"@navbar-default-link-active-color": "#555", |
||||||
|
"@navbar-default-link-active-bg": "darken(@navbar-default-bg, 6.5%)", |
||||||
|
"@navbar-default-link-disabled-color": "#ccc", |
||||||
|
"@navbar-default-link-disabled-bg": "transparent", |
||||||
|
"@navbar-default-brand-color": "@navbar-default-link-color", |
||||||
|
"@navbar-default-brand-hover-color": "darken(@navbar-default-brand-color, 10%)", |
||||||
|
"@navbar-default-brand-hover-bg": "transparent", |
||||||
|
"@navbar-default-toggle-hover-bg": "#ddd", |
||||||
|
"@navbar-default-toggle-icon-bar-bg": "#888", |
||||||
|
"@navbar-default-toggle-border-color": "#ddd", |
||||||
|
"@navbar-inverse-color": "@gray-light", |
||||||
|
"@navbar-inverse-bg": "#222", |
||||||
|
"@navbar-inverse-border": "darken(@navbar-inverse-bg, 10%)", |
||||||
|
"@navbar-inverse-link-color": "@gray-light", |
||||||
|
"@navbar-inverse-link-hover-color": "#fff", |
||||||
|
"@navbar-inverse-link-hover-bg": "transparent", |
||||||
|
"@navbar-inverse-link-active-color": "@navbar-inverse-link-hover-color", |
||||||
|
"@navbar-inverse-link-active-bg": "darken(@navbar-inverse-bg, 10%)", |
||||||
|
"@navbar-inverse-link-disabled-color": "#444", |
||||||
|
"@navbar-inverse-link-disabled-bg": "transparent", |
||||||
|
"@navbar-inverse-brand-color": "@navbar-inverse-link-color", |
||||||
|
"@navbar-inverse-brand-hover-color": "#fff", |
||||||
|
"@navbar-inverse-brand-hover-bg": "transparent", |
||||||
|
"@navbar-inverse-toggle-hover-bg": "#333", |
||||||
|
"@navbar-inverse-toggle-icon-bar-bg": "#fff", |
||||||
|
"@navbar-inverse-toggle-border-color": "#333", |
||||||
|
"@nav-link-padding": "10px 15px", |
||||||
|
"@nav-link-hover-bg": "@gray-lighter", |
||||||
|
"@nav-disabled-link-color": "@gray-light", |
||||||
|
"@nav-disabled-link-hover-color": "@gray-light", |
||||||
|
"@nav-open-link-hover-color": "#fff", |
||||||
|
"@nav-tabs-border-color": "#ddd", |
||||||
|
"@nav-tabs-link-hover-border-color": "@gray-lighter", |
||||||
|
"@nav-tabs-active-link-hover-bg": "@body-bg", |
||||||
|
"@nav-tabs-active-link-hover-color": "@gray", |
||||||
|
"@nav-tabs-active-link-hover-border-color": "#ddd", |
||||||
|
"@nav-tabs-justified-link-border-color": "#ddd", |
||||||
|
"@nav-tabs-justified-active-link-border-color": "@body-bg", |
||||||
|
"@nav-pills-border-radius": "@border-radius-base", |
||||||
|
"@nav-pills-active-link-hover-bg": "@component-active-bg", |
||||||
|
"@nav-pills-active-link-hover-color": "@component-active-color", |
||||||
|
"@pagination-color": "@link-color", |
||||||
|
"@pagination-bg": "#fff", |
||||||
|
"@pagination-border": "#ddd", |
||||||
|
"@pagination-hover-color": "@link-hover-color", |
||||||
|
"@pagination-hover-bg": "@gray-lighter", |
||||||
|
"@pagination-hover-border": "#ddd", |
||||||
|
"@pagination-active-color": "#fff", |
||||||
|
"@pagination-active-bg": "@brand-primary", |
||||||
|
"@pagination-active-border": "@brand-primary", |
||||||
|
"@pagination-disabled-color": "@gray-light", |
||||||
|
"@pagination-disabled-bg": "#fff", |
||||||
|
"@pagination-disabled-border": "#ddd", |
||||||
|
"@pager-bg": "@pagination-bg", |
||||||
|
"@pager-border": "@pagination-border", |
||||||
|
"@pager-border-radius": "15px", |
||||||
|
"@pager-hover-bg": "@pagination-hover-bg", |
||||||
|
"@pager-active-bg": "@pagination-active-bg", |
||||||
|
"@pager-active-color": "@pagination-active-color", |
||||||
|
"@pager-disabled-color": "@pagination-disabled-color", |
||||||
|
"@jumbotron-padding": "30px", |
||||||
|
"@jumbotron-color": "inherit", |
||||||
|
"@jumbotron-bg": "@gray-lighter", |
||||||
|
"@jumbotron-heading-color": "inherit", |
||||||
|
"@jumbotron-font-size": "ceil((@font-size-base * 1.5))", |
||||||
|
"@state-success-text": "#3c763d", |
||||||
|
"@state-success-bg": "#dff0d8", |
||||||
|
"@state-success-border": "darken(spin(@state-success-bg, -10), 5%)", |
||||||
|
"@state-info-text": "#31708f", |
||||||
|
"@state-info-bg": "#d9edf7", |
||||||
|
"@state-info-border": "darken(spin(@state-info-bg, -10), 7%)", |
||||||
|
"@state-warning-text": "#8a6d3b", |
||||||
|
"@state-warning-bg": "#fcf8e3", |
||||||
|
"@state-warning-border": "darken(spin(@state-warning-bg, -10), 5%)", |
||||||
|
"@state-danger-text": "#a94442", |
||||||
|
"@state-danger-bg": "#f2dede", |
||||||
|
"@state-danger-border": "darken(spin(@state-danger-bg, -10), 5%)", |
||||||
|
"@tooltip-max-width": "200px", |
||||||
|
"@tooltip-color": "#fff", |
||||||
|
"@tooltip-bg": "#000", |
||||||
|
"@tooltip-opacity": ".9", |
||||||
|
"@tooltip-arrow-width": "5px", |
||||||
|
"@tooltip-arrow-color": "@tooltip-bg", |
||||||
|
"@popover-bg": "#fff", |
||||||
|
"@popover-max-width": "276px", |
||||||
|
"@popover-border-color": "rgba(0,0,0,.2)", |
||||||
|
"@popover-fallback-border-color": "#ccc", |
||||||
|
"@popover-title-bg": "darken(@popover-bg, 3%)", |
||||||
|
"@popover-arrow-width": "10px", |
||||||
|
"@popover-arrow-color": "#fff", |
||||||
|
"@popover-arrow-outer-width": "(@popover-arrow-width + 1)", |
||||||
|
"@popover-arrow-outer-color": "fadein(@popover-border-color, 5%)", |
||||||
|
"@popover-arrow-outer-fallback-color": "darken(@popover-fallback-border-color, 20%)", |
||||||
|
"@label-default-bg": "@gray-light", |
||||||
|
"@label-primary-bg": "@brand-primary", |
||||||
|
"@label-success-bg": "@brand-success", |
||||||
|
"@label-info-bg": "@brand-info", |
||||||
|
"@label-warning-bg": "@brand-warning", |
||||||
|
"@label-danger-bg": "@brand-danger", |
||||||
|
"@label-color": "#fff", |
||||||
|
"@label-link-hover-color": "#fff", |
||||||
|
"@modal-inner-padding": "20px", |
||||||
|
"@modal-title-padding": "15px", |
||||||
|
"@modal-title-line-height": "@line-height-base", |
||||||
|
"@modal-content-bg": "#fff", |
||||||
|
"@modal-content-border-color": "rgba(0,0,0,.2)", |
||||||
|
"@modal-content-fallback-border-color": "#999", |
||||||
|
"@modal-backdrop-bg": "#000", |
||||||
|
"@modal-backdrop-opacity": ".5", |
||||||
|
"@modal-header-border-color": "#e5e5e5", |
||||||
|
"@modal-footer-border-color": "@modal-header-border-color", |
||||||
|
"@modal-lg": "900px", |
||||||
|
"@modal-md": "600px", |
||||||
|
"@modal-sm": "300px", |
||||||
|
"@alert-padding": "15px", |
||||||
|
"@alert-border-radius": "@border-radius-base", |
||||||
|
"@alert-link-font-weight": "bold", |
||||||
|
"@alert-success-bg": "@state-success-bg", |
||||||
|
"@alert-success-text": "@state-success-text", |
||||||
|
"@alert-success-border": "@state-success-border", |
||||||
|
"@alert-info-bg": "@state-info-bg", |
||||||
|
"@alert-info-text": "@state-info-text", |
||||||
|
"@alert-info-border": "@state-info-border", |
||||||
|
"@alert-warning-bg": "@state-warning-bg", |
||||||
|
"@alert-warning-text": "@state-warning-text", |
||||||
|
"@alert-warning-border": "@state-warning-border", |
||||||
|
"@alert-danger-bg": "@state-danger-bg", |
||||||
|
"@alert-danger-text": "@state-danger-text", |
||||||
|
"@alert-danger-border": "@state-danger-border", |
||||||
|
"@progress-bg": "#f5f5f5", |
||||||
|
"@progress-bar-color": "#fff", |
||||||
|
"@progress-bar-bg": "@brand-primary", |
||||||
|
"@progress-bar-success-bg": "@brand-success", |
||||||
|
"@progress-bar-warning-bg": "@brand-warning", |
||||||
|
"@progress-bar-danger-bg": "@brand-danger", |
||||||
|
"@progress-bar-info-bg": "@brand-info", |
||||||
|
"@list-group-bg": "#fff", |
||||||
|
"@list-group-border": "#ddd", |
||||||
|
"@list-group-border-radius": "@border-radius-base", |
||||||
|
"@list-group-hover-bg": "#f5f5f5", |
||||||
|
"@list-group-active-color": "@component-active-color", |
||||||
|
"@list-group-active-bg": "@component-active-bg", |
||||||
|
"@list-group-active-border": "@list-group-active-bg", |
||||||
|
"@list-group-active-text-color": "lighten(@list-group-active-bg, 40%)", |
||||||
|
"@list-group-link-color": "#555", |
||||||
|
"@list-group-link-heading-color": "#333", |
||||||
|
"@panel-bg": "#fff", |
||||||
|
"@panel-body-padding": "15px", |
||||||
|
"@panel-border-radius": "@border-radius-base", |
||||||
|
"@panel-inner-border": "#ddd", |
||||||
|
"@panel-footer-bg": "#f5f5f5", |
||||||
|
"@panel-default-text": "@gray-dark", |
||||||
|
"@panel-default-border": "#ddd", |
||||||
|
"@panel-default-heading-bg": "#f5f5f5", |
||||||
|
"@panel-primary-text": "#fff", |
||||||
|
"@panel-primary-border": "@brand-primary", |
||||||
|
"@panel-primary-heading-bg": "@brand-primary", |
||||||
|
"@panel-success-text": "@state-success-text", |
||||||
|
"@panel-success-border": "@state-success-border", |
||||||
|
"@panel-success-heading-bg": "@state-success-bg", |
||||||
|
"@panel-info-text": "@state-info-text", |
||||||
|
"@panel-info-border": "@state-info-border", |
||||||
|
"@panel-info-heading-bg": "@state-info-bg", |
||||||
|
"@panel-warning-text": "@state-warning-text", |
||||||
|
"@panel-warning-border": "@state-warning-border", |
||||||
|
"@panel-warning-heading-bg": "@state-warning-bg", |
||||||
|
"@panel-danger-text": "@state-danger-text", |
||||||
|
"@panel-danger-border": "@state-danger-border", |
||||||
|
"@panel-danger-heading-bg": "@state-danger-bg", |
||||||
|
"@thumbnail-padding": "4px", |
||||||
|
"@thumbnail-bg": "@body-bg", |
||||||
|
"@thumbnail-border": "#ddd", |
||||||
|
"@thumbnail-border-radius": "@border-radius-base", |
||||||
|
"@thumbnail-caption-color": "@text-color", |
||||||
|
"@thumbnail-caption-padding": "9px", |
||||||
|
"@well-bg": "#f5f5f5", |
||||||
|
"@well-border": "darken(@well-bg, 7%)", |
||||||
|
"@badge-color": "#fff", |
||||||
|
"@badge-link-hover-color": "#fff", |
||||||
|
"@badge-bg": "@gray-light", |
||||||
|
"@badge-active-color": "@link-color", |
||||||
|
"@badge-active-bg": "#fff", |
||||||
|
"@badge-font-weight": "bold", |
||||||
|
"@badge-border-radius": "10px", |
||||||
|
"@breadcrumb-padding-vertical": "8px", |
||||||
|
"@breadcrumb-padding-horizontal": "15px", |
||||||
|
"@breadcrumb-bg": "#f5f5f5", |
||||||
|
"@breadcrumb-color": "#ccc", |
||||||
|
"@breadcrumb-active-color": "@gray-light", |
||||||
|
"@breadcrumb-separator": "\"/\"", |
||||||
|
"@carousel-text-shadow": "0 1px 2px rgba(0,0,0,.6)", |
||||||
|
"@carousel-control-color": "#fff", |
||||||
|
"@carousel-control-width": "15%", |
||||||
|
"@carousel-control-opacity": ".5", |
||||||
|
"@carousel-control-font-size": "20px", |
||||||
|
"@carousel-indicator-active-bg": "#fff", |
||||||
|
"@carousel-indicator-border-color": "#fff", |
||||||
|
"@carousel-caption-color": "#fff", |
||||||
|
"@close-font-weight": "bold", |
||||||
|
"@close-color": "#000", |
||||||
|
"@close-text-shadow": "0 1px 0 #fff", |
||||||
|
"@code-color": "#c7254e", |
||||||
|
"@code-bg": "#f9f2f4", |
||||||
|
"@kbd-color": "#fff", |
||||||
|
"@kbd-bg": "#333", |
||||||
|
"@pre-bg": "#f5f5f5", |
||||||
|
"@pre-color": "@gray-dark", |
||||||
|
"@pre-border-color": "#ccc", |
||||||
|
"@pre-scrollable-max-height": "340px", |
||||||
|
"@text-muted": "@gray-light", |
||||||
|
"@abbr-border-color": "@gray-light", |
||||||
|
"@headings-small-color": "@gray-light", |
||||||
|
"@blockquote-small-color": "@gray-light", |
||||||
|
"@blockquote-font-size": "(@font-size-base * 1.25)", |
||||||
|
"@blockquote-border-color": "@gray-lighter", |
||||||
|
"@page-header-border-color": "@gray-lighter", |
||||||
|
"@hr-border": "@gray-lighter", |
||||||
|
"@component-offset-horizontal": "180px" |
||||||
|
}, |
||||||
|
"css": [ |
||||||
|
"print.less", |
||||||
|
"type.less", |
||||||
|
"code.less", |
||||||
|
"grid.less", |
||||||
|
"tables.less", |
||||||
|
"forms.less", |
||||||
|
"buttons.less", |
||||||
|
"glyphicons.less", |
||||||
|
"button-groups.less", |
||||||
|
"input-groups.less", |
||||||
|
"navs.less", |
||||||
|
"navbar.less", |
||||||
|
"breadcrumbs.less", |
||||||
|
"pagination.less", |
||||||
|
"pager.less", |
||||||
|
"labels.less", |
||||||
|
"badges.less", |
||||||
|
"jumbotron.less", |
||||||
|
"thumbnails.less", |
||||||
|
"alerts.less", |
||||||
|
"progress-bars.less", |
||||||
|
"media.less", |
||||||
|
"list-group.less", |
||||||
|
"panels.less", |
||||||
|
"wells.less", |
||||||
|
"close.less", |
||||||
|
"component-animations.less", |
||||||
|
"dropdowns.less", |
||||||
|
"tooltip.less", |
||||||
|
"popovers.less", |
||||||
|
"modals.less", |
||||||
|
"carousel.less", |
||||||
|
"utilities.less", |
||||||
|
"responsive-utilities.less" |
||||||
|
], |
||||||
|
"js": [ |
||||||
|
"alert.js", |
||||||
|
"button.js", |
||||||
|
"carousel.js", |
||||||
|
"dropdown.js", |
||||||
|
"modal.js", |
||||||
|
"tooltip.js", |
||||||
|
"popover.js", |
||||||
|
"tab.js", |
||||||
|
"affix.js", |
||||||
|
"collapse.js", |
||||||
|
"scrollspy.js", |
||||||
|
"transition.js" |
||||||
|
] |
||||||
|
} |
@ -0,0 +1,346 @@ |
|||||||
|
/*! |
||||||
|
* Bootstrap v3.1.1 (http://getbootstrap.com) |
||||||
|
* Copyright 2011-2014 Twitter, Inc. |
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
||||||
|
*/ |
||||||
|
|
||||||
|
.btn-default, |
||||||
|
.btn-primary, |
||||||
|
.btn-success, |
||||||
|
.btn-info, |
||||||
|
.btn-warning, |
||||||
|
.btn-danger { |
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); |
||||||
|
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); |
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); |
||||||
|
} |
||||||
|
.btn-default:active, |
||||||
|
.btn-primary:active, |
||||||
|
.btn-success:active, |
||||||
|
.btn-info:active, |
||||||
|
.btn-warning:active, |
||||||
|
.btn-danger:active, |
||||||
|
.btn-default.active, |
||||||
|
.btn-primary.active, |
||||||
|
.btn-success.active, |
||||||
|
.btn-info.active, |
||||||
|
.btn-warning.active, |
||||||
|
.btn-danger.active { |
||||||
|
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); |
||||||
|
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); |
||||||
|
} |
||||||
|
.btn:active, |
||||||
|
.btn.active { |
||||||
|
background-image: none; |
||||||
|
} |
||||||
|
.btn-default { |
||||||
|
background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); |
||||||
|
background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #dbdbdb; |
||||||
|
text-shadow: 0 1px 0 #fff; |
||||||
|
border-color: #ccc; |
||||||
|
} |
||||||
|
.btn-default:hover, |
||||||
|
.btn-default:focus { |
||||||
|
background-color: #e0e0e0; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-default:active, |
||||||
|
.btn-default.active { |
||||||
|
background-color: #e0e0e0; |
||||||
|
border-color: #dbdbdb; |
||||||
|
} |
||||||
|
.btn-primary { |
||||||
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%); |
||||||
|
background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #2b669a; |
||||||
|
} |
||||||
|
.btn-primary:hover, |
||||||
|
.btn-primary:focus { |
||||||
|
background-color: #2d6ca2; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-primary:active, |
||||||
|
.btn-primary.active { |
||||||
|
background-color: #2d6ca2; |
||||||
|
border-color: #2b669a; |
||||||
|
} |
||||||
|
.btn-success { |
||||||
|
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); |
||||||
|
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #3e8f3e; |
||||||
|
} |
||||||
|
.btn-success:hover, |
||||||
|
.btn-success:focus { |
||||||
|
background-color: #419641; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-success:active, |
||||||
|
.btn-success.active { |
||||||
|
background-color: #419641; |
||||||
|
border-color: #3e8f3e; |
||||||
|
} |
||||||
|
.btn-info { |
||||||
|
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); |
||||||
|
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #28a4c9; |
||||||
|
} |
||||||
|
.btn-info:hover, |
||||||
|
.btn-info:focus { |
||||||
|
background-color: #2aabd2; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-info:active, |
||||||
|
.btn-info.active { |
||||||
|
background-color: #2aabd2; |
||||||
|
border-color: #28a4c9; |
||||||
|
} |
||||||
|
.btn-warning { |
||||||
|
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #e38d13; |
||||||
|
} |
||||||
|
.btn-warning:hover, |
||||||
|
.btn-warning:focus { |
||||||
|
background-color: #eb9316; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-warning:active, |
||||||
|
.btn-warning.active { |
||||||
|
background-color: #eb9316; |
||||||
|
border-color: #e38d13; |
||||||
|
} |
||||||
|
.btn-danger { |
||||||
|
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); |
||||||
|
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
background-repeat: repeat-x; |
||||||
|
border-color: #b92c28; |
||||||
|
} |
||||||
|
.btn-danger:hover, |
||||||
|
.btn-danger:focus { |
||||||
|
background-color: #c12e2a; |
||||||
|
background-position: 0 -15px; |
||||||
|
} |
||||||
|
.btn-danger:active, |
||||||
|
.btn-danger.active { |
||||||
|
background-color: #c12e2a; |
||||||
|
border-color: #b92c28; |
||||||
|
} |
||||||
|
.thumbnail, |
||||||
|
.img-thumbnail { |
||||||
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); |
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); |
||||||
|
} |
||||||
|
.dropdown-menu > li > a:hover, |
||||||
|
.dropdown-menu > li > a:focus { |
||||||
|
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||||
|
background-color: #e8e8e8; |
||||||
|
} |
||||||
|
.dropdown-menu > .active > a, |
||||||
|
.dropdown-menu > .active > a:hover, |
||||||
|
.dropdown-menu > .active > a:focus { |
||||||
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); |
||||||
|
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); |
||||||
|
background-color: #357ebd; |
||||||
|
} |
||||||
|
.navbar-default { |
||||||
|
background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%); |
||||||
|
background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
border-radius: 4px; |
||||||
|
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); |
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075); |
||||||
|
} |
||||||
|
.navbar-default .navbar-nav > .active > a { |
||||||
|
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); |
||||||
|
background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0); |
||||||
|
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); |
||||||
|
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075); |
||||||
|
} |
||||||
|
.navbar-brand, |
||||||
|
.navbar-nav > li > a { |
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); |
||||||
|
} |
||||||
|
.navbar-inverse { |
||||||
|
background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%); |
||||||
|
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); |
||||||
|
} |
||||||
|
.navbar-inverse .navbar-nav > .active > a { |
||||||
|
background-image: -webkit-linear-gradient(top, #222222 0%, #282828 100%); |
||||||
|
background-image: linear-gradient(to bottom, #222222 0%, #282828 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0); |
||||||
|
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); |
||||||
|
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25); |
||||||
|
} |
||||||
|
.navbar-inverse .navbar-brand, |
||||||
|
.navbar-inverse .navbar-nav > li > a { |
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); |
||||||
|
} |
||||||
|
.navbar-static-top, |
||||||
|
.navbar-fixed-top, |
||||||
|
.navbar-fixed-bottom { |
||||||
|
border-radius: 0; |
||||||
|
} |
||||||
|
.alert { |
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); |
||||||
|
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); |
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
.alert-success { |
||||||
|
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); |
||||||
|
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); |
||||||
|
border-color: #b2dba1; |
||||||
|
} |
||||||
|
.alert-info { |
||||||
|
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); |
||||||
|
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); |
||||||
|
border-color: #9acfea; |
||||||
|
} |
||||||
|
.alert-warning { |
||||||
|
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); |
||||||
|
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); |
||||||
|
border-color: #f5e79e; |
||||||
|
} |
||||||
|
.alert-danger { |
||||||
|
background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); |
||||||
|
border-color: #dca7a7; |
||||||
|
} |
||||||
|
.progress { |
||||||
|
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); |
||||||
|
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); |
||||||
|
} |
||||||
|
.progress-bar { |
||||||
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); |
||||||
|
background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); |
||||||
|
} |
||||||
|
.progress-bar-success { |
||||||
|
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); |
||||||
|
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); |
||||||
|
} |
||||||
|
.progress-bar-info { |
||||||
|
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); |
||||||
|
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); |
||||||
|
} |
||||||
|
.progress-bar-warning { |
||||||
|
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); |
||||||
|
} |
||||||
|
.progress-bar-danger { |
||||||
|
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); |
||||||
|
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); |
||||||
|
} |
||||||
|
.list-group { |
||||||
|
border-radius: 4px; |
||||||
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); |
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075); |
||||||
|
} |
||||||
|
.list-group-item.active, |
||||||
|
.list-group-item.active:hover, |
||||||
|
.list-group-item.active:focus { |
||||||
|
text-shadow: 0 -1px 0 #3071a9; |
||||||
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); |
||||||
|
background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); |
||||||
|
border-color: #3278b3; |
||||||
|
} |
||||||
|
.panel { |
||||||
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); |
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); |
||||||
|
} |
||||||
|
.panel-default > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); |
||||||
|
} |
||||||
|
.panel-primary > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); |
||||||
|
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); |
||||||
|
} |
||||||
|
.panel-success > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); |
||||||
|
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); |
||||||
|
} |
||||||
|
.panel-info > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); |
||||||
|
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); |
||||||
|
} |
||||||
|
.panel-warning > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); |
||||||
|
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); |
||||||
|
} |
||||||
|
.panel-danger > .panel-heading { |
||||||
|
background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); |
||||||
|
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); |
||||||
|
} |
||||||
|
.well { |
||||||
|
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); |
||||||
|
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); |
||||||
|
background-repeat: repeat-x; |
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); |
||||||
|
border-color: #dcdcdc; |
||||||
|
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); |
||||||
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1); |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
body {padding-top:8px; background:#eef url(/assets/img/swizzler-128.png) no-repeat fixed right bottom} |
||||||
|
.avatar {max-width:64px; max-height:64px} |
||||||
|
.avatars32 .avatar {max-width:32px; max-height:32px} |
||||||
|
.panel, .list-group-item { background-color: rgba(255,255,255,0.33) } /* I should be doing this by customizing bootstrap. Later :) */ |
||||||
|
#footer {z-index:115;position:fixed;right:123px;bottom:0} |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 529 B |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,142 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
import cherrypy, pystache |
||||||
|
from twister import Twister |
||||||
|
from appdir import APPDIR |
||||||
|
|
||||||
|
stache = pystache.Renderer( |
||||||
|
search_dirs='{0}/templates'.format(APPDIR),file_encoding='utf-8',string_encoding='utf-8',file_extension='html') |
||||||
|
|
||||||
|
### twistparser (format users, urls, etc. in text). Subclasses twitter-text-python |
||||||
|
|
||||||
|
from ttp import ttp |
||||||
|
class TwistParser(ttp.Parser): |
||||||
|
def format_tag(self, tag, text): |
||||||
|
'''Return formatted HTML for a hashtag.''' |
||||||
|
return '<a href="/tag/{0}">{1}{2}</a>'.format( |
||||||
|
ttp.urllib.quote(text.lower().encode('utf-8')), tag, text) |
||||||
|
|
||||||
|
def format_username(self, at_char, user): |
||||||
|
'''Return formatted HTML for a username.''' |
||||||
|
return '<a href="/user/{0}">{1}{2}</a>'.format( |
||||||
|
user, at_char, user.lower()) |
||||||
|
|
||||||
|
def format_list(self, at_char, user, list_name): |
||||||
|
'''We don't have lists, so we see it as @user followed /something''' |
||||||
|
return '<a href="/user/{0}">{1}{2}</a>/{3}'.format( |
||||||
|
user, at_char, user.lower(), list_name) |
||||||
|
|
||||||
|
def format_url(self, url, text): |
||||||
|
'''Return formatted HTML for a url.''' |
||||||
|
return '<a target="_blank" rel="nofollow" href="{0}">{1}</a>'.format(ttp.escape(url), text) |
||||||
|
|
||||||
|
twistparser = TwistParser() |
||||||
|
|
||||||
|
def format_twist(message): |
||||||
|
return twistparser.parse(message).html |
||||||
|
|
||||||
|
def format_trending(twister,num_messages=8): |
||||||
|
# ttp would only parse (for example) "#two" in "#two-words". rsplit removes the "-words" (sucks a bit less) |
||||||
|
return [html.rsplit('>',1)[0]+'>' for html in [ |
||||||
|
format_twist(u'#{0}'.format(t)) for t in twister.get_trending_tags(num_messages) |
||||||
|
] if html.find('>')>0] # the if is because ttf doesn't do unicode tags (TODO: find a better ttp fork or find/write some other lib) |
||||||
|
|
||||||
|
### The Swizzler app |
||||||
|
class SwizzlerApp(object): |
||||||
|
@cherrypy.expose |
||||||
|
def twist(self,username,k): |
||||||
|
conf = cherrypy.request.app.config['swizzler'] |
||||||
|
twister = Twister(conf['rpc_url'],format_twist) |
||||||
|
twist = twister.get_twist(username,k) |
||||||
|
rts = twister.get_twist_rts(username,k) |
||||||
|
print rts |
||||||
|
result = { |
||||||
|
'is_twist':True, |
||||||
|
'title':u"@{0}: {1} - Swizzler".format(twist['user']['username'],twist['time']), |
||||||
|
'twist':twist, |
||||||
|
'in_reply_to':twist.get('reply') and twister.get_twist(twist['reply']['user']['username'],twist['reply']['k']) or None, |
||||||
|
'replies':twister.get_twist_replies(username,k), |
||||||
|
'rts':rts, |
||||||
|
'any_rts':not not rts, |
||||||
|
'local_users':twister.local_user_menu()['users'], |
||||||
|
'trending':format_trending(twister,conf['num_messages']) |
||||||
|
} |
||||||
|
return stache.render(stache.load_template('twist'),result) |
||||||
|
@cherrypy.expose |
||||||
|
def user(self,username): |
||||||
|
conf = cherrypy.request.app.config['swizzler'] |
||||||
|
twister = Twister(conf['rpc_url'],format_twist) |
||||||
|
user = twister.get_user_info(username) |
||||||
|
result = { |
||||||
|
'is_user':True, |
||||||
|
'title':u"{0} (@{1}): Profile - Swizzler".format(user['fullname'],user['username']), |
||||||
|
'subject':user, |
||||||
|
'messages':twister.get_user_posts(username,conf['num_messages']), |
||||||
|
'local_users':twister.local_user_menu()['users'], |
||||||
|
#the filter avoids some utf etc. that ttf can't handle (TODO: fix or replace format_twist) |
||||||
|
'trending':format_trending(twister,conf['num_messages']) |
||||||
|
} |
||||||
|
return stache.render(stache.load_template('standard'),result) |
||||||
|
@cherrypy.expose |
||||||
|
def tag(self,tag): |
||||||
|
conf = cherrypy.request.app.config['swizzler'] |
||||||
|
twister = Twister(conf['rpc_url'],format_twist) |
||||||
|
result = { |
||||||
|
'is_tag':True, |
||||||
|
'title':u"#{0} - Swizzler".format(tag), |
||||||
|
'subject':{"fullname":tag}, |
||||||
|
'messages':twister.get_tag_posts(tag), |
||||||
|
'local_users':twister.local_user_menu()['users'], |
||||||
|
#the filter avoids some utf etc. that ttf can't handle (TODO: fix or replace format_twist) |
||||||
|
'trending':format_trending(twister,conf['num_messages']) |
||||||
|
} |
||||||
|
return stache.render(stache.load_template('standard'),result) |
||||||
|
@cherrypy.expose |
||||||
|
def home(self,localusername,mode='feed'): |
||||||
|
conf = cherrypy.request.app.config['swizzler'] |
||||||
|
twister = Twister(conf['rpc_url'],format_twist) |
||||||
|
menu = twister.local_user_menu(localusername) |
||||||
|
if mode=='mentions': |
||||||
|
messages = twister.get_user_mentions(localusername) |
||||||
|
else: |
||||||
|
messages = twister.get_user_feed(localusername,conf['num_messages']) |
||||||
|
result = { |
||||||
|
'is_home':True, |
||||||
|
'is_mentions':mode=='mentions', |
||||||
|
'is_feed':mode!='mentions', |
||||||
|
'title':u"{0} (@{1}): Home - Swizzler".format(menu['active']['fullname'],menu['active']['username']), |
||||||
|
'local_users':menu['users'], |
||||||
|
'subject':menu['active'], |
||||||
|
'messages':messages, |
||||||
|
#the filter avoids some utf etc. that ttf can't handle (TODO: fix or replace format_twist) |
||||||
|
'trending':format_trending(twister,conf['num_messages']) |
||||||
|
} |
||||||
|
return stache.render(stache.load_template('standard'),result) |
||||||
|
@cherrypy.expose |
||||||
|
def index(self): |
||||||
|
conf = cherrypy.request.app.config['swizzler'] |
||||||
|
twister = Twister(conf['rpc_url'],format_twist) |
||||||
|
result = { |
||||||
|
'is_user':True, # i.e. we want to display "bio" and not mentions/DMs/profile buttons |
||||||
|
'title':"Welcome to Swizzler", |
||||||
|
'local_users':twister.local_user_menu('')['users'], # '' means: "Nobody" is active |
||||||
|
'subject':{ # pseudo-user describing sponsored posts |
||||||
|
'fullname':'Sponsored posts', |
||||||
|
'bio':format_twist(""" |
||||||
|
Mining the twister blockchain protects the #twister-verse from attacks like http://twister.net.co/?p=236 |
||||||
|
but unlike doge, we don't have shiny coins to offer "our protectors". |
||||||
|
Instead, they enjoy occasional minutes of fame in the form of the sponsored posts you see here. |
||||||
|
We #Respect their their hard earned crypto-graffiti by appreciating them on coffee/spliff/soy-milk/etc. breaks, because that's how we roll yo. |
||||||
|
Start mining today, and all this (AND moral satisfaction) can be yours.""") |
||||||
|
}, |
||||||
|
'messages':twister.get_sponsored_posts(conf['num_messages']), |
||||||
|
#the filter avoids some utf etc. that ttf can't handle (TODO: fix or replace format_twist) |
||||||
|
'trending':format_trending(twister,conf['num_messages']) |
||||||
|
} |
||||||
|
return stache.render(stache.load_template('standard'),result) |
||||||
|
|
||||||
|
if __name__ == '__main__': |
||||||
|
cherrypy.config.update('{0}/cherrypy.config'.format(APPDIR)) |
||||||
|
app = SwizzlerApp() |
||||||
|
cherrypy.tree.mount(app,'/',config='{0}/cherrypy.config'.format(APPDIR)) |
||||||
|
cherrypy.engine.start() |
||||||
|
cherrypy.engine.block() |
@ -0,0 +1,3 @@ |
|||||||
|
<footer id="footer"> |
||||||
|
<div class="alert alert-info"><a target="_blank" href="https://github.com/thedod/swizzler"><strong>Fork</strong></a> this. Swizzler is <a target="_blank" href="http://www.gnu.org/licenses/agpl-3.0.html"><strong>AGPLV3</strong></a>.</span> |
||||||
|
</footer> |
@ -0,0 +1,45 @@ |
|||||||
|
<li class="list-group-item media"> |
||||||
|
{{#user}} |
||||||
|
{{#username}} |
||||||
|
<a class="pull-left thumbnail" href="/user/{{.}}" title="@{{.}}'s profile"> |
||||||
|
<img class="media-object avatar" src="{{#avatar}}{{.}}{{/avatar}}{{^avatar}}/assets/img/genericPerson.png{{/avatar}}" alt="{{fullname}}"> |
||||||
|
</a> |
||||||
|
{{/username}} |
||||||
|
{{^username}} |
||||||
|
<a class="pull-left thumbnail" href="#"> |
||||||
|
<img class="media-object avatar" src="/assets/img/twister-64.jpg" alt="{{fullname}}"> |
||||||
|
</a> |
||||||
|
{{/username}} |
||||||
|
{{/user}} |
||||||
|
<div class="media-body"> |
||||||
|
{{#user}} |
||||||
|
{{#username}} |
||||||
|
<h5 class="media-heading"> |
||||||
|
<span class="pull-right small"> |
||||||
|
<a title="View twist details" href="/twist/{{.}}/{{k}}">{{time}}</a> |
||||||
|
</span> |
||||||
|
{{#rt_user}} |
||||||
|
<small> |
||||||
|
<a href="/user/{{username}}" title="@{{username}}'s profile">{{fullname}}</a> |
||||||
|
<span class="glyphicon glyphicon-retweet"></span> |
||||||
|
</small> |
||||||
|
{{/rt_user}} |
||||||
|
<a href="/user/{{.}}" title="@{{.}}'s profile"><strong>{{fullname}}</strong></a> |
||||||
|
{{^is_twist}}{{#reply}} |
||||||
|
<small> |
||||||
|
<span class="glyphicon glyphicon-share-alt"></span> |
||||||
|
{{#user}}<a title="Re: @{{username}}'s twist" href="/twist/{{username}}/{{k}}">{{fullname}}</a>{{/user}} |
||||||
|
</small> |
||||||
|
{{/reply}}{{/is_twist}} |
||||||
|
</h5> |
||||||
|
{{/username}} |
||||||
|
{{^username}} |
||||||
|
<h5 class="media-heading"> |
||||||
|
<span class="pull-right small">{{time}}</span> |
||||||
|
<a href="/">{{fullname}}</a> |
||||||
|
</h5> |
||||||
|
{{/username}} |
||||||
|
{{/user}} |
||||||
|
{{{message}}} |
||||||
|
</div> |
||||||
|
</li> |
@ -0,0 +1,38 @@ |
|||||||
|
<div class="panel panel-primary"> |
||||||
|
<div class="panel-heading"><h3 class="panel-title"><span class="glyphicon glyphicon-home"></span> Local users</h3></div> |
||||||
|
<ul class="panel-body list-group media-list"> |
||||||
|
{{#local_users}} |
||||||
|
<li class="media list-group-item avatars32{{#active}} active{{/active}}"> |
||||||
|
<a {{#username}}title="@{{username}}'s home" {{/username}}class="pull-left thumbnail" href="/{{#username}}home/{{.}}{{/username}}"> |
||||||
|
<img class="media-object avatar" src="{{#avatar}}{{.}}{{/avatar}}{{^avatar}}/assets/img/twister-64.jpg{{/avatar}}" alt="{{fullname}}"> |
||||||
|
</a> |
||||||
|
<div class="media-body"> |
||||||
|
<h5 class="media-heading"> |
||||||
|
{{^active}} |
||||||
|
<a {{#username}}title="@{{username}}'s home"{{/username}} |
||||||
|
href="/{{#username}}home/{{.}}{{/username}}">{{/active}}{{fullname}}{{^active}}</a> |
||||||
|
{{/active}} |
||||||
|
</h5> |
||||||
|
{{^active}} |
||||||
|
{{#username}} |
||||||
|
<a href="/home/{{.}}" title="@{{.}}'s home"><span class="glyphicon glyphicon-home"></span></a> |
||||||
|
<a href="/home/{{.}}/mentions" title="mentions of @{{.}}"><span class="glyphicon glyphicon-bell"></span></a> |
||||||
|
<a href="/messages/{{.}}" title="direct messages from/to @{{.}}"><span class="glyphicon glyphicon-envelope"></span></a> |
||||||
|
<a href="/user/{{.}}" title="@{{.}}'s profile"><span class="glyphicon glyphicon-user"></span></a> |
||||||
|
{{/username}} |
||||||
|
{{^username}} |
||||||
|
(view sponsored posts) |
||||||
|
{{/username}} |
||||||
|
{{/active}} |
||||||
|
</div> |
||||||
|
</li> |
||||||
|
{{/local_users}} |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="panel panel-primary"> |
||||||
|
<div class="panel-heading"><h3 class="panel-title"><span class="glyphicon glyphicon-tags"></span> Trending tags</h3></div> |
||||||
|
<ul class="panel-body list-group media-list"> |
||||||
|
{{#trending}}<li class="list-group-item">{{{.}}}</li>{{/trending}} |
||||||
|
{{^trending}}<li class="list-group-item"><h2><span class="glyphicon glyphicon-trash"></span>The internet is rubbish today</h2>{{/trending}} |
||||||
|
</ul> |
||||||
|
</div> |
@ -0,0 +1,85 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html language="{{lang}}"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||||
|
<title>{{title}}</title> |
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico"> |
||||||
|
<link href="/assets/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/bootstrap-theme.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/swizzler.css" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="container"> |
||||||
|
<div class="row"> |
||||||
|
<div id="main" class="col-md-8"> |
||||||
|
<div class="row"> |
||||||
|
<div id="header" class="col-md-12 well"> |
||||||
|
{{#subject}} |
||||||
|
<div class="media"> |
||||||
|
<a class="pull-left thumbnail" href="{{#username}}/user/{{.}}{{/username}}{{^username}}#{{/username}}"> |
||||||
|
<img class="media-object avatar" src="{{#avatar}}{{.}}{{/avatar}}{{^avatar}}/assets/img/twister-64.jpg{{/avatar}}" alt="{{fullname}}"> |
||||||
|
</a> |
||||||
|
<div class="media-body"> |
||||||
|
{{#is_home}} |
||||||
|
{{#username}} |
||||||
|
<h4 class="media-heading"> |
||||||
|
{{#is_feed}} |
||||||
|
<a href="/home/{{.}}" title="@{{.}}'s home"><span class="glyphicon glyphicon-home"></span></a> {{fullname}} |
||||||
|
{{/is_feed}} |
||||||
|
{{#is_mentions}} |
||||||
|
<a href="/home/{{.}}/mentions" title="@{{.}}'s home"><span class="glyphicon glyphicon-bell"></span></a> {{fullname}} |
||||||
|
{{/is_mentions}} |
||||||
|
{{#is_messages}} |
||||||
|
<a href="/messages/{{.}}" title="@{{.}}'s home"><span class="glyphicon glyphicon-envelope"></span></a> {{fullname}} |
||||||
|
{{/is_messages}} |
||||||
|
</h4> |
||||||
|
{{^is_feed}} |
||||||
|
<a href="/home/{{.}}" title="@{{.}}'s home"><span class="glyphicon glyphicon-home"></span></a> |
||||||
|
{{/is_feed}} |
||||||
|
{{^is_mentions}} |
||||||
|
<a href="/home/{{.}}/mentions" title="mentions of @{{.}}"><span class="glyphicon glyphicon-bell"></span></a> |
||||||
|
{{/is_mentions}} |
||||||
|
{{^is_messages}} |
||||||
|
<a href="/messages/{{.}}" title="direct messages from/to @{{.}}"><span class="glyphicon glyphicon-envelope"></span></a> |
||||||
|
{{/is_messages}} |
||||||
|
<a href="/user/{{.}}" title="@{{.}}'s profile"><span class="glyphicon glyphicon-user"></span></a> |
||||||
|
{{/username}} |
||||||
|
{{/is_home}} |
||||||
|
{{#is_user}} |
||||||
|
<h4 class="media-heading"> |
||||||
|
{{#location}}<span class="pull-right small">{{.}}</span>{{/location}} |
||||||
|
{{fullname}} |
||||||
|
{{#url}}<small><a href="{{.}}">{{.}}</a></small>{{/url}}</h4> |
||||||
|
{{{bio}}} |
||||||
|
{{/is_user}} |
||||||
|
{{#is_tag}} |
||||||
|
<h2 class="media-heading"> |
||||||
|
<small><span class="glyphicon glyphicon-tag"></span> Latest twists containing the tag:</small><br> |
||||||
|
#{{fullname}} |
||||||
|
</h2> |
||||||
|
{{/is_tag}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{/subject}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="row"> |
||||||
|
<div id="messages" class="col-md-12"> |
||||||
|
{{#messages}}<ul class="list-group media-list">{{> message}}</ul>{{/messages}} |
||||||
|
{{^messages}} |
||||||
|
<h4><small>Nothing. Nada. Rien de rien. 😭</small></h4> |
||||||
|
{{/messages}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="sidebar" class="col-md-4"> |
||||||
|
{{> sidebar}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{> footer}} |
||||||
|
</div> <!-- /container --> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
|
@ -0,0 +1,58 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html language="{{lang}}"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||||
|
<title>{{title}}</title> |
||||||
|
<link rel="icon" type="image/x-icon" href="/favicon.ico"> |
||||||
|
<link href="/assets/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/bootstrap-theme.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/swizzler.css" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="container"> |
||||||
|
<div class="row"> |
||||||
|
<div id="main" class="col-md-8"> |
||||||
|
<div class="panel panel-default"> |
||||||
|
{{#in_reply_to}} |
||||||
|
<div class="panel-heading avatars32"> |
||||||
|
<ul class="list-group media-list">{{> message}}</ul> |
||||||
|
</div> |
||||||
|
{{/in_reply_to}} |
||||||
|
<div class="panel-body"> |
||||||
|
{{#twist}} |
||||||
|
<div class="lead well"> |
||||||
|
<ul class="list-group media-list">{{> message}}</ul> |
||||||
|
</div> |
||||||
|
{{#any_rts}} |
||||||
|
<div class="avatars32"> |
||||||
|
<h5 class="pull-left"><span class="glyphicon glyphicon-retweet"></span> Retwists: </h5>{{! I know it's ugly. I suck at CSS !}} |
||||||
|
{{#rts}}{{#rt_user}} |
||||||
|
<div class="thumbnail pull-left"> |
||||||
|
<a href="/user/{{username}}" title="Retwisted by {{fullname}} (@{{username}})"> |
||||||
|
<img class="media-object avatar" src="{{#avatar}}{{.}}{{/avatar}}{{^avatar}}/assets/img/genericPerson.png{{/avatar}}" |
||||||
|
alt="Retwisted by {{fullname}} (@{{username}})"> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
{{/rt_user}}{{/rts}} |
||||||
|
</div> |
||||||
|
{{/any_rts}} |
||||||
|
{{/twist}} |
||||||
|
</div> |
||||||
|
{{#replies}} |
||||||
|
<div class="panel-footer avatars32"> |
||||||
|
<ul class="list-group media-list">{{> message}}</ul> |
||||||
|
</div> |
||||||
|
{{/replies}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="sidebar" class="col-md-4"> |
||||||
|
{{> sidebar}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{> footer}} |
||||||
|
</div> <!-- /container --> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
|
@ -0,0 +1,130 @@ |
|||||||
|
import time |
||||||
|
from bitcoinrpc.authproxy import AuthServiceProxy |
||||||
|
from functioncache import functioncache,SkipCache |
||||||
|
|
||||||
|
def timestamp2iso(t): |
||||||
|
return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(t)) |
||||||
|
|
||||||
|
class Twister: |
||||||
|
def __init__(self,url='http://change:me@127.0.0.1:28332',formatter=None): |
||||||
|
self.twister = AuthServiceProxy(url) |
||||||
|
self.formatter = formatter |
||||||
|
def _format_message(self,message): |
||||||
|
return self.formatter and self.formatter(message) or message |
||||||
|
def clear_cache(self): #doesn't always work :( Need to figure this out. |
||||||
|
db = self.get_user_info._db # It doesn't matter which method. It's the same handler |
||||||
|
db.setup(self.get_user_info) # It needs the function to locate know which db (module's name) |
||||||
|
db.shelve.clear() |
||||||
|
db.shelve.sync() |
||||||
|
def _format_reply(self,r): |
||||||
|
"gracefully fails if reply is empty" |
||||||
|
return r and {"user":self.get_user_info(r['n']),'k':r['k']} or {} |
||||||
|
def _format_post_info(self,p): |
||||||
|
result = { |
||||||
|
"height":p['userpost']['height'], |
||||||
|
"k":p['userpost']['k'], |
||||||
|
"time":timestamp2iso(p['userpost']['time']), |
||||||
|
} |
||||||
|
if p['userpost'].has_key('rt'): |
||||||
|
result.update({ |
||||||
|
"message":self._format_message(p['userpost']['rt']['msg']), |
||||||
|
"user":self.get_user_info(p['userpost']['rt']['n']), |
||||||
|
"k":p['userpost']['rt']['k'], |
||||||
|
"rt_user":self.get_user_info(p['userpost']['n']), |
||||||
|
"reply":self._format_reply(p['userpost']['rt'].get('reply',{})), |
||||||
|
}) |
||||||
|
else: |
||||||
|
result.update({ |
||||||
|
"message":self._format_message(p['userpost']['msg']), |
||||||
|
"user":self.get_user_info(p['userpost']['n']), |
||||||
|
"k":p['userpost']['k'], |
||||||
|
"reply":self._format_reply(p['userpost'].get('reply',{})), |
||||||
|
}) |
||||||
|
return result |
||||||
|
@functioncache(ignore_instance=True) # cache forever. not supposed to change |
||||||
|
def get_twist(self,username,k): |
||||||
|
p = self.twister.dhtget(username,'post{0}'.format(k),'s') |
||||||
|
if p: |
||||||
|
return self._format_post_info(p[0]['p']['v']) |
||||||
|
raise SkipCache("Twist not found @{0}/{1}".format(username,k),{ |
||||||
|
"user":self.get_user_info('nobody'), |
||||||
|
"k":0, # maybe something needs this |
||||||
|
"lastk":0, # or this |
||||||
|
"message":"Twist not found (maybe it's private?) 😭", |
||||||
|
"time":"Never" |
||||||
|
}) |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_twist_replies(self,username,k): |
||||||
|
return reversed([self._format_post_info(r['p']['v']) for r in self.twister.dhtget(username,'replies{0}'.format(k),'m')]) # We show them oldest first |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_twist_rts(self,username,k): |
||||||
|
return [self._format_post_info(r['p']['v']) for r in self.twister.dhtget(username,'rts{0}'.format(k),'m')] |
||||||
|
@functioncache(60*15,ignore_instance=True) |
||||||
|
def get_user_info(self,username): |
||||||
|
if username == 'nobody': |
||||||
|
return {"username":"","fullname":"Nobody"} # Username is empty. Easier for mustache. |
||||||
|
result = self.twister.dhtget(username,'profile','s') |
||||||
|
if not result: |
||||||
|
raise SkipCache("user not found: @{0}".format(username), {"username":username,"fullname":"???"}) |
||||||
|
user = result[0]['p']['v'] |
||||||
|
user['username'] = username # handy |
||||||
|
if not user.get('fullname'): # happens |
||||||
|
user['fullname'] = username.capitalize() # Buddha is in the details |
||||||
|
user['bio']=self._format_message(user.get('bio','')) |
||||||
|
try: |
||||||
|
user['avatar'] = self.twister.dhtget(username,'avatar','s')[0]['p']['v'] |
||||||
|
if user['avatar']=='img/genericPerson.png': # ugly patch |
||||||
|
user['avatar'] = '/assets/img/genericPerson.png' |
||||||
|
except: |
||||||
|
user['avatar'] = None |
||||||
|
raise SkipCache("couldn't get avatar for @{0}, not caching".format(username),user) |
||||||
|
return user |
||||||
|
@functioncache(60*5,ignore_instance=True) |
||||||
|
def local_user_menu(self,active_user=None): |
||||||
|
users = [{'username':'','fullname':'Nobody','active':active_user==''}] |
||||||
|
if active_user=='': |
||||||
|
active = users[0] |
||||||
|
else: |
||||||
|
active = None |
||||||
|
for u in self.twister.listwalletusers(): |
||||||
|
user = self.get_user_info(u) |
||||||
|
if active_user==u: |
||||||
|
user.update({'active':True}) |
||||||
|
active = user |
||||||
|
users.append(user) |
||||||
|
return {"users":users,"active":active} |
||||||
|
@functioncache(60*5,ignore_instance=True) |
||||||
|
def get_following(self,localusername): |
||||||
|
return [{"username":u} for u in self.twister.getfollowing(localusername)] |
||||||
|
@functioncache(60*5,ignore_instance=True) |
||||||
|
def get_sponsored_posts(self,num=8): |
||||||
|
return reversed([self._format_post_info(p) for p in self.twister.getspamposts(num)]) # Don't ask me why reversed :) |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_tag_posts(self,tag): |
||||||
|
return [self._format_post_info(p['p']['v']) for p in self.twister.dhtget(tag,'hashtag','m')] |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_user_feed(self,localusername,num=8): |
||||||
|
return [self._format_post_info(p) for p in self.twister.getposts(num,self.get_following(localusername))] |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_user_mentions(self,localusername): |
||||||
|
return [self._format_post_info(p['p']['v']) for p in self.twister.dhtget(localusername,'mention','m')] |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_user_posts(self,username,num=8): |
||||||
|
result = [self._format_post_info(p) for p in self.twister.getposts(num,[{'username':username}])] |
||||||
|
if result: |
||||||
|
return result |
||||||
|
else: # We're not following. Let's "knit" the best timeline we can |
||||||
|
result = self.twister.dhtget(username,'status','s') |
||||||
|
while True: |
||||||
|
try: |
||||||
|
lastk = result[-1]['p']['v']['userpost']['lastk'] |
||||||
|
last = lastk and self.twister.dhtget(username,'post{0}'.format(result[-1]['p']['v']['userpost']['lastk']),'s') |
||||||
|
except: |
||||||
|
break |
||||||
|
if not last: |
||||||
|
break |
||||||
|
result.append(last[0]) |
||||||
|
return [self._format_post_info(s['p']['v']) for s in result] |
||||||
|
@functioncache(60,ignore_instance=True) |
||||||
|
def get_trending_tags(self,num=8): |
||||||
|
return self.twister.gettrendinghashtags(num) |