Repository: jfmcbrayer/brutaldon Branch: master Commit: e6c5273a2f91 Files: 111 Total size: 534.2 KB Directory structure: gitextract_zqo918d7/ ├── .gitignore ├── INSTALL.md ├── LICENSE ├── Pipfile ├── README.md ├── brutaldon/ │ ├── __init__.py │ ├── context_processors.py │ ├── forms.py │ ├── middleware/ │ │ └── timezone.py │ ├── migrations/ │ │ ├── 0001_initial.py │ │ ├── 0002_account.py │ │ ├── 0003_auto_20180424_1255.py │ │ ├── 0004_auto_20180424_1424.py │ │ ├── 0005_auto_20180618_2103.py │ │ ├── 0006_auto_20180618_2112.py │ │ ├── 0007_auto_20180618_2115.py │ │ ├── 0008_auto_20180618_2140.py │ │ ├── 0009_auto_20180824_2241.py │ │ ├── 0010_auto_20180825_1009.py │ │ ├── 0011_auto_20180825_1017.py │ │ ├── 0012_auto_20180826_1853.py │ │ ├── 0013_auto_20180826_1935.py │ │ ├── 0014_account_note_seen.py │ │ ├── 0015_auto_20181001_1812.py │ │ ├── 0016_auto_20181009_1805.py │ │ ├── 0017_preference_poll_frequency.py │ │ ├── 0018_preference_filter_notifications.py │ │ ├── 0019_auto_20190124_0813.py │ │ ├── 0020_auto_20190127_2159.py │ │ ├── 0021_client_version.py │ │ ├── 0022_auto_20190506_0938.py │ │ ├── 0023_preference_bundle_notifications.py │ │ ├── 0024_auto_20200601_0945.py │ │ ├── 0025_preference_preview_sensitive.py │ │ └── __init__.py │ ├── models.py │ ├── settings.py │ ├── static/ │ │ ├── css/ │ │ │ ├── brutaldon-dark.css │ │ │ ├── brutaldon-material.css │ │ │ ├── brutaldon.css │ │ │ ├── brutstrap-tweaks.css │ │ │ ├── brutstrap.css │ │ │ ├── fullbrutalism.css │ │ │ ├── magnific-popup.css │ │ │ ├── minimal-dark.css │ │ │ ├── minimal-large.css │ │ │ ├── minimal-small.css │ │ │ ├── vt240don-amber.css │ │ │ └── vt240don-green.css │ │ ├── js/ │ │ │ ├── brutaldon-enhancements.js │ │ │ ├── intercooler.js │ │ │ └── jquery.magnific-popup.js │ │ ├── manifest.webmanifest │ │ └── offline.html │ ├── templates/ │ │ ├── about.html │ │ ├── accounts/ │ │ │ ├── account_partial.html │ │ │ └── list.html │ │ ├── base.html │ │ ├── comma.html │ │ ├── error.html │ │ ├── filters/ │ │ │ ├── create.html │ │ │ ├── delete.html │ │ │ ├── edit.html │ │ │ └── list.html │ │ ├── intercooler/ │ │ │ ├── block.html │ │ │ ├── boost.html │ │ │ ├── fav.html │ │ │ ├── follow.html │ │ │ ├── mute.html │ │ │ ├── notes.html │ │ │ ├── post.html │ │ │ ├── search.html │ │ │ └── users.html │ │ ├── main/ │ │ │ ├── block.html │ │ │ ├── boost.html │ │ │ ├── delete.html │ │ │ ├── emoji.html │ │ │ ├── fav.html │ │ │ ├── follow.html │ │ │ ├── home_timeline.html │ │ │ ├── local_timeline.html │ │ │ ├── mute.html │ │ │ ├── notifications.html │ │ │ ├── post.html │ │ │ ├── post_minimal_partial.html │ │ │ ├── post_partial.html │ │ │ ├── public_timeline.html │ │ │ ├── redraft.html │ │ │ ├── reply.html │ │ │ ├── search.html │ │ │ ├── search_results.html │ │ │ ├── thread.html │ │ │ ├── timeline.html │ │ │ ├── toot_partial.html │ │ │ └── user.html │ │ ├── polls/ │ │ │ ├── completed_partial.html │ │ │ └── new_partial.html │ │ ├── privacy.html │ │ ├── requests/ │ │ │ ├── list.html │ │ │ └── request_partial.html │ │ └── setup/ │ │ ├── login-oauth.html │ │ ├── login.html │ │ └── settings.html │ ├── templatetags/ │ │ ├── __init__.py │ │ ├── humanetime.py │ │ └── taglinks.py │ ├── urls.py │ ├── views.py │ └── wsgi.py ├── manage.py └── package.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log .static_storage/ .media/ local_settings.py # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ bin db.sqlite3 include/ lib64 pip-selfcheck.json /Pipfile.lock /dev_https node_modules /TAGS .vscode package-lock.json yarn.lock ================================================ FILE: INSTALL.md ================================================ Installing brutaldon ==================== Brutaldon is a perfectly normal Django app, so if you've ever installed a Django app, it should be straightforward. It will work either as a local application, or installed on a server. For either case, you will need Python 3 installed to start with, including pip. Common steps --------------------------------------------------------- If you haven't already, you need to install [Pipenv][pe], a tool for managing Python virtual environments. You can install it just with `pip install pipenv`. [pe]: https://github.com/pypa/pipenv/ Development or local install ------------------------------------------------ In the top brutaldon directory, run `pipenv install`. This will install all the dependencies. Then run `pipenv run python ./manage.py migrate`. That will create a SQLite database the application needs. Then run `pipenv run python ./manage.py runserver`. That will start a local server on http://localhost:8000/. Point your browser to that address and log in to your instance. You will have to log in with the alternate (username and password) method. Server installation ---------------------------------------- This will depend on your server setup, and you should consult [Deploying Django][dd]. Be sure to read the [Deployment checklist][dc], because some things in it are security critical. You will also want to set up a database. Brutaldon doesn't use the database very heavily, so if you only have a few users, the default SQLite is probably fine and doesn't require any additional setup. One common step would be to install dependencies like this: `PIPENV_VENV_IN_PROJECT=1 pipenv install`. This will install dependencies within the project folder. Then edit brutaldon/settings.py. You definitely need to change the values of SECRET_KEY and ALLOWED_HOSTS. Also edit the database parameters to match the database you chose. Then run `pipenv run python ./manage.py migrate` to populate the database. I installed brutaldon with Apache and mod_wsgi. If you installed brutaldon in /usr/local/share/, you'd add config lines something like this to the virtual host brutaldon is installed in. ``` Alias /brutaldon/static /usr/local/share/brutaldon/brutaldon/static Require all granted WSGIScriptAlias /brutaldon /usr/local/share/brutaldon/brutaldon/wsgi.py WSGIDaemonProcess brutaldon python-path=/usr/local/share/brutaldon python-home=/usr/local/share/brutaldon/.venv Require all granted ``` Be sure you serve the entire site over https only. [dd]: https://docs.djangoproject.com/en/2.0/howto/deployment/ [dc]: https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ ================================================ FILE: LICENSE ================================================ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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 . ================================================ FILE: Pipfile ================================================ [[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi" [packages] "beautifulsoup4" = "*" bleach = "*" certifi = "*" chardet = "*" decorator = "*" django-markdownify = "*" django-widget-tweaks = "*" "html5lib" = "*" idna = "*" markdown = "*" "mastodon.py" = ">=1.4.2" python-dateutil = "*" pytz = "*" requests = "*" six = "*" "urllib3" = "*" webencodings = "*" Django = "*" django-html_sanitizer = "*" inscriptis = "*" lxml = "*" [dev-packages] ================================================ FILE: README.md ================================================ # Brutaldon Note: If you are seeing this on Github, this repo is a mirror that may not be up-to-date. Please go to https://git.carcosa.net/jmcbray/brutaldon for the latest code. Brutaldon is a [brutalist][0], [Web 1.0][0.5] web interface for [Mastodon][1] and [Pleroma][p]. It is not a Mastodon-compatible social networking server; rather, it is just a client, like the Android or iOS client for Mastodon you may already be using, but it runs in a web server, and is accessed through a web browser. It works great in text-mode browsers such as [Lynx][2], [w3m][3], or [elinks][4], and also in more heavy-weight graphical browsers, such as Firefox. It works completely without JavaScript, but if JavaScript is available and enabled, it will be used to unobtrusively enhance the user experience. [0]:http://brutalistwebsites.com/ [0.5]: https://en.wikipedia.org/wiki/Web_2.0#%22Web_1.0%22 [1]: https://joinmastodon.org/ [2]: https://lynx.browser.org/ [3]: https://w3m.sourceforge.net/ [4]: http://elinks.or.cz/ [p]: https://pleroma.social/ There is a hosted instance at [brutaldon.online][hosted] which you can use to log in to any instance. However, you are also encouraged to run your own, either locally or on a public server. [hosted]: https://brutaldon.online/ Brutaldon is ready for day to day use, and is my main way of interacting with the fediverse. It is still missing some features you might want, like lists, filters, and editing your own profile. Please see the issues tracker. ## Screenshots People love screenshots, whatever the project, so here we are. These screenshots are relatively old.
Brutaldon in Lynx Brutaldon in Firefox
Brutaldon in Firefox (2) Brutaldon in Firefox - Full Brutalism Brutaldon in Firefox - Full Brutalism (2)
## Roadmap * [X] Single user read-only access; log in and read home timeline * [X] Fix edge cases of toot display (CW, media, boosts) * [X] Multi-user, multi-instance support * [X] Add support for reading local and federated timelines, notifications, favorites, threads * [X] Add support for tag timelines * [X] Add support for viewing profiles * [X] Add support for posting. * [X] Add support for posting media. * [X] Add support for favoriting and boosting toots. * [X] Add support for following, blocking, and muting users. ## Aesthetic No automatic page updates: refresh the page to see new toots. No endless scroll: there's a "next page" link. No autocompletion of anything: use another lynx process in another screen window to look things up. UTF8 clean. ## Tip Jar You can buy me a coffee to give me energy to work on this, but only if you have it to spare. [![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/D1D7QBZC) ================================================ FILE: brutaldon/__init__.py ================================================ ================================================ FILE: brutaldon/context_processors.py ================================================ from django.urls import reverse def bookmarklet_url(request): share_url = request.build_absolute_uri(reverse("share")) return { "bookmarklet_url": f"javascript:location.href='{share_url}?url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title)" } ================================================ FILE: brutaldon/forms.py ================================================ from django import forms from django.conf import settings from django.utils.translation import gettext as _ from pytz import common_timezones from .models import Theme, Preference PRIVACY_CHOICES = ( ("public", _("Public")), ("unlisted", _("Unlisted")), ("private", _("Private")), ("direct", _("Direct")), ) timezones = [(tz, tz) for tz in common_timezones] class LoginForm(forms.Form): instance = forms.CharField(label=_("Instance"), max_length=256) email = forms.EmailField(label=_("Email")) password = forms.CharField(widget=forms.PasswordInput()) class OAuthLoginForm(forms.Form): instance = forms.CharField(label=_("Instance"), max_length=256) class PreferencesForm(forms.ModelForm): class Meta: model = Preference fields = Preference._fields class PostForm(forms.Form): """def status_post(self, status, in_reply_to_id=None, media_ids=None, sensitive=False, visibility=None, spoiler_text=None):""" status = forms.CharField(label="Toot", widget=forms.Textarea) visibility = forms.ChoiceField( label=_("Toot visibility"), choices=PRIVACY_CHOICES, required=False ) spoiler_text = forms.CharField(label=_("CW or Subject"), required=False) media_file_1 = forms.FileField(label=_("Media 1"), required=False) media_text_1 = forms.CharField(label=_("Describe media 1."), required=False) media_file_2 = forms.FileField(label=_("Media 2"), required=False) media_text_2 = forms.CharField(label=_("Describe media 2."), required=False) media_file_3 = forms.FileField(label=_("Media 3"), required=False) media_text_3 = forms.CharField(label=_("Describe media 3."), required=False) media_file_4 = forms.FileField(label=_("Media 4"), required=False) media_text_4 = forms.CharField(label=_("Describe media 4."), required=False) media_sensitive = forms.BooleanField(label=_("Sensitive media?"), required=False) class FilterForm(forms.Form): phrase = forms.CharField(label=_("Word or phrase to filter")) context_home = forms.BooleanField( label=_("In home timeline"), required=False, initial=True ) context_public = forms.BooleanField( label=_("In public timelines"), required=False, initial=True ) context_notes = forms.BooleanField( label=_("In notifications"), required=False, initial=True ) context_thread = forms.BooleanField( label=_("In thread contexts"), required=False, initial=True ) whole_word = forms.BooleanField( label=_("Whole words only"), required=False, initial=True ) expires_in = forms.TypedChoiceField( label=_("Expires in"), choices=( ("", "Never"), ("1800", "30 minutes"), ("3600", "1 hour"), ("21600", "6 hours"), ("43200", "12 hours"), ("86400", "1 day"), ("604800", "1 week"), ), coerce=int, required=False, ) ================================================ FILE: brutaldon/middleware/timezone.py ================================================ import pytz from django.utils import timezone from django.utils.deprecation import MiddlewareMixin class TimezoneMiddleware(MiddlewareMixin): def process_request(self, request): tzname = request.session.get("timezone", "UTC") if tzname: timezone.activate(pytz.timezone(tzname)) else: timezone.deactivate() ================================================ FILE: brutaldon/migrations/0001_initial.py ================================================ # Generated by Django 2.0.1 on 2018-04-23 18:25 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Client", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("name", models.TextField(default="brutaldon")), ("api_base_id", models.URLField(default="mastodon.social")), ("client_id", models.TextField(blank=True, null=True)), ("client_secret", models.TextField(blank=True, null=True)), ], ) ] ================================================ FILE: brutaldon/migrations/0002_account.py ================================================ # Generated by Django 2.0.1 on 2018-04-23 21:34 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("brutaldon", "0001_initial"), ] operations = [ migrations.CreateModel( name="Account", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("username", models.CharField(max_length=80)), ("access_token", models.TextField(blank=True, null=True)), ( "django_user", models.ForeignKey( null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], ) ] ================================================ FILE: brutaldon/migrations/0003_auto_20180424_1255.py ================================================ # Generated by Django 2.0.4 on 2018-04-24 16:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [("brutaldon", "0002_account")] operations = [ migrations.AddField( model_name="account", name="client", field=models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, to="brutaldon.Client", ), ), migrations.AlterField( model_name="client", name="api_base_id", field=models.URLField(default="https://mastodon.social"), ), ] ================================================ FILE: brutaldon/migrations/0004_auto_20180424_1424.py ================================================ # Generated by Django 2.0.4 on 2018-04-24 18:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0003_auto_20180424_1255")] operations = [ migrations.AlterField( model_name="account", name="username", field=models.EmailField(max_length=254), ) ] ================================================ FILE: brutaldon/migrations/0005_auto_20180618_2103.py ================================================ # Generated by Django 2.0.6 on 2018-06-19 01:03 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [("brutaldon", "0004_auto_20180424_1424")] operations = [ migrations.CreateModel( name="Preference", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("data_saver", models.BooleanField(default=False)), ("fix_emojos", models.BooleanField(default=False)), ], ), migrations.CreateModel( name="Theme", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("name", models.TextField(max_length=80)), ("main_css", models.TextField(max_length=1024)), ( "tweaks_css", models.TextField(blank=True, max_length=1024, null=True), ), ("is_brutalist", models.BooleanField(default=False)), ], ), migrations.AddField( model_name="preference", name="theme", field=models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, to="brutaldon.Theme", ), ), migrations.AddField( model_name="account", name="preferences", field=models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, to="brutaldon.Preference", ), ), ] ================================================ FILE: brutaldon/migrations/0006_auto_20180618_2112.py ================================================ # Generated by Django 2.0.6 on 2018-06-19 01:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0005_auto_20180618_2103")] operations = [ migrations.AlterField( model_name="theme", name="main_css", field=models.TextField( blank=True, default="css/fullbrutalism.css", max_length=1024, null=True ), ) ] ================================================ FILE: brutaldon/migrations/0007_auto_20180618_2115.py ================================================ # Generated by Django 2.0.6 on 2018-06-19 01:03 from django.db import migrations def set_up_default_themes(apps, schema_editor): Theme = apps.get_model("brutaldon", "Theme") default = Theme( name="default", main_css="css/bulma.min.css", tweaks_css="css/brutaldon.css", is_brutalist=False, ) default.save() dark = Theme( name="default dark", main_css="css/bulmaswatch-darkly.min.css", tweaks_css="css/brutaldon-dark.css", is_brutalist=False, ) dark.save() lux = Theme( name="Lux", main_css="css/bulmaswatch-lux.min.css", tweaks_css="css/brutaldon.css", is_brutalist=False, ) lux.save() solar = Theme( name="Solar", main_css="css/bulmaswatch-solar.min.css", tweaks_css="css/brutaldon.css", is_brutalist=False, ) solar.save() material = Theme( name="Material", main_css="css/bulmaswatch-materia.min.css", tweaks_css="css/brutaldon-material.css", is_brutalist=False, ) material.save() brutalism = Theme( name="FULLBRUTALISM", main_css="css/fullbrutalism.css", is_brutalist=True ) brutalism.save() brutstrap = Theme( name="Brutstrap", main_css="css/brutstrap.css", is_brutalist=True, tweaks_css="css/brutstrap-tweaks.css", ) brutstrap.save() large = Theme( name="Minimalist Large", main_css="css/minimal-large.css", is_brutalist=True ) large.save() small = Theme( name="Minimalist Small", main_css="css/minimal-small.css", is_brutalist=True ) small.save() dark2 = Theme( name="Minimalist Dark", main_css="css/minimal-dark.css", is_brutalist=True ) dark2.save() vt240 = Theme( name="vt240 amber", main_css="css/vt240don-amber.css", is_brutalist=True ) vt240.save() vt240_green = Theme( name="vt240 green", main_css="css/vt240don-green.css", is_brutalist=True ) vt240_green.save() minimal = Theme(name="No styling at all", main_css=None, is_brutalist=True) minimal.save() def delete_themes(apps, schema_editor): Theme = apps.get_model("brutaldon" "Theme") for theme in Theme.objects.all(): theme.delete() class Migration(migrations.Migration): dependencies = [("brutaldon", "0006_auto_20180618_2112")] operations = [migrations.RunPython(set_up_default_themes, delete_themes)] ================================================ FILE: brutaldon/migrations/0008_auto_20180618_2140.py ================================================ # Generated by Django 2.0.6 on 2018-06-19 01:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0007_auto_20180618_2115")] operations = [ migrations.AlterField( model_name="theme", name="name", field=models.TextField(max_length=80, unique=True), ) ] ================================================ FILE: brutaldon/migrations/0009_auto_20180824_2241.py ================================================ # Generated by Django 2.1 on 2018-08-25 02:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0008_auto_20180618_2140")] operations = [ migrations.RemoveField(model_name="preference", name="data_saver"), migrations.RemoveField(model_name="preference", name="fix_emojos"), migrations.AddField( model_name="account", name="email", field=models.EmailField(blank=True, max_length=254, null=True), ), migrations.AddField( model_name="preference", name="filter_boosts", field=models.BooleanField(default=False), ), migrations.AddField( model_name="preference", name="filter_replies", field=models.BooleanField(default=False), ), migrations.AddField( model_name="preference", name="timezone", field=models.TextField( blank=True, choices=[ ("Africa/Abidjan", "Africa/Abidjan"), ("Africa/Accra", "Africa/Accra"), ("Africa/Addis_Ababa", "Africa/Addis_Ababa"), ("Africa/Algiers", "Africa/Algiers"), ("Africa/Asmara", "Africa/Asmara"), ("Africa/Bamako", "Africa/Bamako"), ("Africa/Bangui", "Africa/Bangui"), ("Africa/Banjul", "Africa/Banjul"), ("Africa/Bissau", "Africa/Bissau"), ("Africa/Blantyre", "Africa/Blantyre"), ("Africa/Brazzaville", "Africa/Brazzaville"), ("Africa/Bujumbura", "Africa/Bujumbura"), ("Africa/Cairo", "Africa/Cairo"), ("Africa/Casablanca", "Africa/Casablanca"), ("Africa/Ceuta", "Africa/Ceuta"), ("Africa/Conakry", "Africa/Conakry"), ("Africa/Dakar", "Africa/Dakar"), ("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"), ("Africa/Djibouti", "Africa/Djibouti"), ("Africa/Douala", "Africa/Douala"), ("Africa/El_Aaiun", "Africa/El_Aaiun"), ("Africa/Freetown", "Africa/Freetown"), ("Africa/Gaborone", "Africa/Gaborone"), ("Africa/Harare", "Africa/Harare"), ("Africa/Johannesburg", "Africa/Johannesburg"), ("Africa/Juba", "Africa/Juba"), ("Africa/Kampala", "Africa/Kampala"), ("Africa/Khartoum", "Africa/Khartoum"), ("Africa/Kigali", "Africa/Kigali"), ("Africa/Kinshasa", "Africa/Kinshasa"), ("Africa/Lagos", "Africa/Lagos"), ("Africa/Libreville", "Africa/Libreville"), ("Africa/Lome", "Africa/Lome"), ("Africa/Luanda", "Africa/Luanda"), ("Africa/Lubumbashi", "Africa/Lubumbashi"), ("Africa/Lusaka", "Africa/Lusaka"), ("Africa/Malabo", "Africa/Malabo"), ("Africa/Maputo", "Africa/Maputo"), ("Africa/Maseru", "Africa/Maseru"), ("Africa/Mbabane", "Africa/Mbabane"), ("Africa/Mogadishu", "Africa/Mogadishu"), ("Africa/Monrovia", "Africa/Monrovia"), ("Africa/Nairobi", "Africa/Nairobi"), ("Africa/Ndjamena", "Africa/Ndjamena"), ("Africa/Niamey", "Africa/Niamey"), ("Africa/Nouakchott", "Africa/Nouakchott"), ("Africa/Ouagadougou", "Africa/Ouagadougou"), ("Africa/Porto-Novo", "Africa/Porto-Novo"), ("Africa/Sao_Tome", "Africa/Sao_Tome"), ("Africa/Tripoli", "Africa/Tripoli"), ("Africa/Tunis", "Africa/Tunis"), ("Africa/Windhoek", "Africa/Windhoek"), ("America/Adak", "America/Adak"), ("America/Anchorage", "America/Anchorage"), ("America/Anguilla", "America/Anguilla"), ("America/Antigua", "America/Antigua"), ("America/Araguaina", "America/Araguaina"), ( "America/Argentina/Buenos_Aires", "America/Argentina/Buenos_Aires", ), ("America/Argentina/Catamarca", "America/Argentina/Catamarca"), ("America/Argentina/Cordoba", "America/Argentina/Cordoba"), ("America/Argentina/Jujuy", "America/Argentina/Jujuy"), ("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"), ("America/Argentina/Mendoza", "America/Argentina/Mendoza"), ( "America/Argentina/Rio_Gallegos", "America/Argentina/Rio_Gallegos", ), ("America/Argentina/Salta", "America/Argentina/Salta"), ("America/Argentina/San_Juan", "America/Argentina/San_Juan"), ("America/Argentina/San_Luis", "America/Argentina/San_Luis"), ("America/Argentina/Tucuman", "America/Argentina/Tucuman"), ("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"), ("America/Aruba", "America/Aruba"), ("America/Asuncion", "America/Asuncion"), ("America/Atikokan", "America/Atikokan"), ("America/Bahia", "America/Bahia"), ("America/Bahia_Banderas", "America/Bahia_Banderas"), ("America/Barbados", "America/Barbados"), ("America/Belem", "America/Belem"), ("America/Belize", "America/Belize"), ("America/Blanc-Sablon", "America/Blanc-Sablon"), ("America/Boa_Vista", "America/Boa_Vista"), ("America/Bogota", "America/Bogota"), ("America/Boise", "America/Boise"), ("America/Cambridge_Bay", "America/Cambridge_Bay"), ("America/Campo_Grande", "America/Campo_Grande"), ("America/Cancun", "America/Cancun"), ("America/Caracas", "America/Caracas"), ("America/Cayenne", "America/Cayenne"), ("America/Cayman", "America/Cayman"), ("America/Chicago", "America/Chicago"), ("America/Chihuahua", "America/Chihuahua"), ("America/Costa_Rica", "America/Costa_Rica"), ("America/Creston", "America/Creston"), ("America/Cuiaba", "America/Cuiaba"), ("America/Curacao", "America/Curacao"), ("America/Danmarkshavn", "America/Danmarkshavn"), ("America/Dawson", "America/Dawson"), ("America/Dawson_Creek", "America/Dawson_Creek"), ("America/Denver", "America/Denver"), ("America/Detroit", "America/Detroit"), ("America/Dominica", "America/Dominica"), ("America/Edmonton", "America/Edmonton"), ("America/Eirunepe", "America/Eirunepe"), ("America/El_Salvador", "America/El_Salvador"), ("America/Fort_Nelson", "America/Fort_Nelson"), ("America/Fortaleza", "America/Fortaleza"), ("America/Glace_Bay", "America/Glace_Bay"), ("America/Godthab", "America/Godthab"), ("America/Goose_Bay", "America/Goose_Bay"), ("America/Grand_Turk", "America/Grand_Turk"), ("America/Grenada", "America/Grenada"), ("America/Guadeloupe", "America/Guadeloupe"), ("America/Guatemala", "America/Guatemala"), ("America/Guayaquil", "America/Guayaquil"), ("America/Guyana", "America/Guyana"), ("America/Halifax", "America/Halifax"), ("America/Havana", "America/Havana"), ("America/Hermosillo", "America/Hermosillo"), ("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"), ("America/Indiana/Knox", "America/Indiana/Knox"), ("America/Indiana/Marengo", "America/Indiana/Marengo"), ("America/Indiana/Petersburg", "America/Indiana/Petersburg"), ("America/Indiana/Tell_City", "America/Indiana/Tell_City"), ("America/Indiana/Vevay", "America/Indiana/Vevay"), ("America/Indiana/Vincennes", "America/Indiana/Vincennes"), ("America/Indiana/Winamac", "America/Indiana/Winamac"), ("America/Inuvik", "America/Inuvik"), ("America/Iqaluit", "America/Iqaluit"), ("America/Jamaica", "America/Jamaica"), ("America/Juneau", "America/Juneau"), ("America/Kentucky/Louisville", "America/Kentucky/Louisville"), ("America/Kentucky/Monticello", "America/Kentucky/Monticello"), ("America/Kralendijk", "America/Kralendijk"), ("America/La_Paz", "America/La_Paz"), ("America/Lima", "America/Lima"), ("America/Los_Angeles", "America/Los_Angeles"), ("America/Lower_Princes", "America/Lower_Princes"), ("America/Maceio", "America/Maceio"), ("America/Managua", "America/Managua"), ("America/Manaus", "America/Manaus"), ("America/Marigot", "America/Marigot"), ("America/Martinique", "America/Martinique"), ("America/Matamoros", "America/Matamoros"), ("America/Mazatlan", "America/Mazatlan"), ("America/Menominee", "America/Menominee"), ("America/Merida", "America/Merida"), ("America/Metlakatla", "America/Metlakatla"), ("America/Mexico_City", "America/Mexico_City"), ("America/Miquelon", "America/Miquelon"), ("America/Moncton", "America/Moncton"), ("America/Monterrey", "America/Monterrey"), ("America/Montevideo", "America/Montevideo"), ("America/Montserrat", "America/Montserrat"), ("America/Nassau", "America/Nassau"), ("America/New_York", "America/New_York"), ("America/Nipigon", "America/Nipigon"), ("America/Nome", "America/Nome"), ("America/Noronha", "America/Noronha"), ("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"), ("America/North_Dakota/Center", "America/North_Dakota/Center"), ( "America/North_Dakota/New_Salem", "America/North_Dakota/New_Salem", ), ("America/Ojinaga", "America/Ojinaga"), ("America/Panama", "America/Panama"), ("America/Pangnirtung", "America/Pangnirtung"), ("America/Paramaribo", "America/Paramaribo"), ("America/Phoenix", "America/Phoenix"), ("America/Port-au-Prince", "America/Port-au-Prince"), ("America/Port_of_Spain", "America/Port_of_Spain"), ("America/Porto_Velho", "America/Porto_Velho"), ("America/Puerto_Rico", "America/Puerto_Rico"), ("America/Punta_Arenas", "America/Punta_Arenas"), ("America/Rainy_River", "America/Rainy_River"), ("America/Rankin_Inlet", "America/Rankin_Inlet"), ("America/Recife", "America/Recife"), ("America/Regina", "America/Regina"), ("America/Resolute", "America/Resolute"), ("America/Rio_Branco", "America/Rio_Branco"), ("America/Santarem", "America/Santarem"), ("America/Santiago", "America/Santiago"), ("America/Santo_Domingo", "America/Santo_Domingo"), ("America/Sao_Paulo", "America/Sao_Paulo"), ("America/Scoresbysund", "America/Scoresbysund"), ("America/Sitka", "America/Sitka"), ("America/St_Barthelemy", "America/St_Barthelemy"), ("America/St_Johns", "America/St_Johns"), ("America/St_Kitts", "America/St_Kitts"), ("America/St_Lucia", "America/St_Lucia"), ("America/St_Thomas", "America/St_Thomas"), ("America/St_Vincent", "America/St_Vincent"), ("America/Swift_Current", "America/Swift_Current"), ("America/Tegucigalpa", "America/Tegucigalpa"), ("America/Thule", "America/Thule"), ("America/Thunder_Bay", "America/Thunder_Bay"), ("America/Tijuana", "America/Tijuana"), ("America/Toronto", "America/Toronto"), ("America/Tortola", "America/Tortola"), ("America/Vancouver", "America/Vancouver"), ("America/Whitehorse", "America/Whitehorse"), ("America/Winnipeg", "America/Winnipeg"), ("America/Yakutat", "America/Yakutat"), ("America/Yellowknife", "America/Yellowknife"), ("Antarctica/Casey", "Antarctica/Casey"), ("Antarctica/Davis", "Antarctica/Davis"), ("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"), ("Antarctica/Macquarie", "Antarctica/Macquarie"), ("Antarctica/Mawson", "Antarctica/Mawson"), ("Antarctica/McMurdo", "Antarctica/McMurdo"), ("Antarctica/Palmer", "Antarctica/Palmer"), ("Antarctica/Rothera", "Antarctica/Rothera"), ("Antarctica/Syowa", "Antarctica/Syowa"), ("Antarctica/Troll", "Antarctica/Troll"), ("Antarctica/Vostok", "Antarctica/Vostok"), ("Arctic/Longyearbyen", "Arctic/Longyearbyen"), ("Asia/Aden", "Asia/Aden"), ("Asia/Almaty", "Asia/Almaty"), ("Asia/Amman", "Asia/Amman"), ("Asia/Anadyr", "Asia/Anadyr"), ("Asia/Aqtau", "Asia/Aqtau"), ("Asia/Aqtobe", "Asia/Aqtobe"), ("Asia/Ashgabat", "Asia/Ashgabat"), ("Asia/Atyrau", "Asia/Atyrau"), ("Asia/Baghdad", "Asia/Baghdad"), ("Asia/Bahrain", "Asia/Bahrain"), ("Asia/Baku", "Asia/Baku"), ("Asia/Bangkok", "Asia/Bangkok"), ("Asia/Barnaul", "Asia/Barnaul"), ("Asia/Beirut", "Asia/Beirut"), ("Asia/Bishkek", "Asia/Bishkek"), ("Asia/Brunei", "Asia/Brunei"), ("Asia/Chita", "Asia/Chita"), ("Asia/Choibalsan", "Asia/Choibalsan"), ("Asia/Colombo", "Asia/Colombo"), ("Asia/Damascus", "Asia/Damascus"), ("Asia/Dhaka", "Asia/Dhaka"), ("Asia/Dili", "Asia/Dili"), ("Asia/Dubai", "Asia/Dubai"), ("Asia/Dushanbe", "Asia/Dushanbe"), ("Asia/Famagusta", "Asia/Famagusta"), ("Asia/Gaza", "Asia/Gaza"), ("Asia/Hebron", "Asia/Hebron"), ("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"), ("Asia/Hong_Kong", "Asia/Hong_Kong"), ("Asia/Hovd", "Asia/Hovd"), ("Asia/Irkutsk", "Asia/Irkutsk"), ("Asia/Jakarta", "Asia/Jakarta"), ("Asia/Jayapura", "Asia/Jayapura"), ("Asia/Jerusalem", "Asia/Jerusalem"), ("Asia/Kabul", "Asia/Kabul"), ("Asia/Kamchatka", "Asia/Kamchatka"), ("Asia/Karachi", "Asia/Karachi"), ("Asia/Kathmandu", "Asia/Kathmandu"), ("Asia/Khandyga", "Asia/Khandyga"), ("Asia/Kolkata", "Asia/Kolkata"), ("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"), ("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"), ("Asia/Kuching", "Asia/Kuching"), ("Asia/Kuwait", "Asia/Kuwait"), ("Asia/Macau", "Asia/Macau"), ("Asia/Magadan", "Asia/Magadan"), ("Asia/Makassar", "Asia/Makassar"), ("Asia/Manila", "Asia/Manila"), ("Asia/Muscat", "Asia/Muscat"), ("Asia/Nicosia", "Asia/Nicosia"), ("Asia/Novokuznetsk", "Asia/Novokuznetsk"), ("Asia/Novosibirsk", "Asia/Novosibirsk"), ("Asia/Omsk", "Asia/Omsk"), ("Asia/Oral", "Asia/Oral"), ("Asia/Phnom_Penh", "Asia/Phnom_Penh"), ("Asia/Pontianak", "Asia/Pontianak"), ("Asia/Pyongyang", "Asia/Pyongyang"), ("Asia/Qatar", "Asia/Qatar"), ("Asia/Qyzylorda", "Asia/Qyzylorda"), ("Asia/Riyadh", "Asia/Riyadh"), ("Asia/Sakhalin", "Asia/Sakhalin"), ("Asia/Samarkand", "Asia/Samarkand"), ("Asia/Seoul", "Asia/Seoul"), ("Asia/Shanghai", "Asia/Shanghai"), ("Asia/Singapore", "Asia/Singapore"), ("Asia/Srednekolymsk", "Asia/Srednekolymsk"), ("Asia/Taipei", "Asia/Taipei"), ("Asia/Tashkent", "Asia/Tashkent"), ("Asia/Tbilisi", "Asia/Tbilisi"), ("Asia/Tehran", "Asia/Tehran"), ("Asia/Thimphu", "Asia/Thimphu"), ("Asia/Tokyo", "Asia/Tokyo"), ("Asia/Tomsk", "Asia/Tomsk"), ("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"), ("Asia/Urumqi", "Asia/Urumqi"), ("Asia/Ust-Nera", "Asia/Ust-Nera"), ("Asia/Vientiane", "Asia/Vientiane"), ("Asia/Vladivostok", "Asia/Vladivostok"), ("Asia/Yakutsk", "Asia/Yakutsk"), ("Asia/Yangon", "Asia/Yangon"), ("Asia/Yekaterinburg", "Asia/Yekaterinburg"), ("Asia/Yerevan", "Asia/Yerevan"), ("Atlantic/Azores", "Atlantic/Azores"), ("Atlantic/Bermuda", "Atlantic/Bermuda"), ("Atlantic/Canary", "Atlantic/Canary"), ("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"), ("Atlantic/Faroe", "Atlantic/Faroe"), ("Atlantic/Madeira", "Atlantic/Madeira"), ("Atlantic/Reykjavik", "Atlantic/Reykjavik"), ("Atlantic/South_Georgia", "Atlantic/South_Georgia"), ("Atlantic/St_Helena", "Atlantic/St_Helena"), ("Atlantic/Stanley", "Atlantic/Stanley"), ("Australia/Adelaide", "Australia/Adelaide"), ("Australia/Brisbane", "Australia/Brisbane"), ("Australia/Broken_Hill", "Australia/Broken_Hill"), ("Australia/Currie", "Australia/Currie"), ("Australia/Darwin", "Australia/Darwin"), ("Australia/Eucla", "Australia/Eucla"), ("Australia/Hobart", "Australia/Hobart"), ("Australia/Lindeman", "Australia/Lindeman"), ("Australia/Lord_Howe", "Australia/Lord_Howe"), ("Australia/Melbourne", "Australia/Melbourne"), ("Australia/Perth", "Australia/Perth"), ("Australia/Sydney", "Australia/Sydney"), ("Canada/Atlantic", "Canada/Atlantic"), ("Canada/Central", "Canada/Central"), ("Canada/Eastern", "Canada/Eastern"), ("Canada/Mountain", "Canada/Mountain"), ("Canada/Newfoundland", "Canada/Newfoundland"), ("Canada/Pacific", "Canada/Pacific"), ("Europe/Amsterdam", "Europe/Amsterdam"), ("Europe/Andorra", "Europe/Andorra"), ("Europe/Astrakhan", "Europe/Astrakhan"), ("Europe/Athens", "Europe/Athens"), ("Europe/Belgrade", "Europe/Belgrade"), ("Europe/Berlin", "Europe/Berlin"), ("Europe/Bratislava", "Europe/Bratislava"), ("Europe/Brussels", "Europe/Brussels"), ("Europe/Bucharest", "Europe/Bucharest"), ("Europe/Budapest", "Europe/Budapest"), ("Europe/Busingen", "Europe/Busingen"), ("Europe/Chisinau", "Europe/Chisinau"), ("Europe/Copenhagen", "Europe/Copenhagen"), ("Europe/Dublin", "Europe/Dublin"), ("Europe/Gibraltar", "Europe/Gibraltar"), ("Europe/Guernsey", "Europe/Guernsey"), ("Europe/Helsinki", "Europe/Helsinki"), ("Europe/Isle_of_Man", "Europe/Isle_of_Man"), ("Europe/Istanbul", "Europe/Istanbul"), ("Europe/Jersey", "Europe/Jersey"), ("Europe/Kaliningrad", "Europe/Kaliningrad"), ("Europe/Kiev", "Europe/Kiev"), ("Europe/Kirov", "Europe/Kirov"), ("Europe/Lisbon", "Europe/Lisbon"), ("Europe/Ljubljana", "Europe/Ljubljana"), ("Europe/London", "Europe/London"), ("Europe/Luxembourg", "Europe/Luxembourg"), ("Europe/Madrid", "Europe/Madrid"), ("Europe/Malta", "Europe/Malta"), ("Europe/Mariehamn", "Europe/Mariehamn"), ("Europe/Minsk", "Europe/Minsk"), ("Europe/Monaco", "Europe/Monaco"), ("Europe/Moscow", "Europe/Moscow"), ("Europe/Oslo", "Europe/Oslo"), ("Europe/Paris", "Europe/Paris"), ("Europe/Podgorica", "Europe/Podgorica"), ("Europe/Prague", "Europe/Prague"), ("Europe/Riga", "Europe/Riga"), ("Europe/Rome", "Europe/Rome"), ("Europe/Samara", "Europe/Samara"), ("Europe/San_Marino", "Europe/San_Marino"), ("Europe/Sarajevo", "Europe/Sarajevo"), ("Europe/Saratov", "Europe/Saratov"), ("Europe/Simferopol", "Europe/Simferopol"), ("Europe/Skopje", "Europe/Skopje"), ("Europe/Sofia", "Europe/Sofia"), ("Europe/Stockholm", "Europe/Stockholm"), ("Europe/Tallinn", "Europe/Tallinn"), ("Europe/Tirane", "Europe/Tirane"), ("Europe/Ulyanovsk", "Europe/Ulyanovsk"), ("Europe/Uzhgorod", "Europe/Uzhgorod"), ("Europe/Vaduz", "Europe/Vaduz"), ("Europe/Vatican", "Europe/Vatican"), ("Europe/Vienna", "Europe/Vienna"), ("Europe/Vilnius", "Europe/Vilnius"), ("Europe/Volgograd", "Europe/Volgograd"), ("Europe/Warsaw", "Europe/Warsaw"), ("Europe/Zagreb", "Europe/Zagreb"), ("Europe/Zaporozhye", "Europe/Zaporozhye"), ("Europe/Zurich", "Europe/Zurich"), ("GMT", "GMT"), ("Indian/Antananarivo", "Indian/Antananarivo"), ("Indian/Chagos", "Indian/Chagos"), ("Indian/Christmas", "Indian/Christmas"), ("Indian/Cocos", "Indian/Cocos"), ("Indian/Comoro", "Indian/Comoro"), ("Indian/Kerguelen", "Indian/Kerguelen"), ("Indian/Mahe", "Indian/Mahe"), ("Indian/Maldives", "Indian/Maldives"), ("Indian/Mauritius", "Indian/Mauritius"), ("Indian/Mayotte", "Indian/Mayotte"), ("Indian/Reunion", "Indian/Reunion"), ("Pacific/Apia", "Pacific/Apia"), ("Pacific/Auckland", "Pacific/Auckland"), ("Pacific/Bougainville", "Pacific/Bougainville"), ("Pacific/Chatham", "Pacific/Chatham"), ("Pacific/Chuuk", "Pacific/Chuuk"), ("Pacific/Easter", "Pacific/Easter"), ("Pacific/Efate", "Pacific/Efate"), ("Pacific/Enderbury", "Pacific/Enderbury"), ("Pacific/Fakaofo", "Pacific/Fakaofo"), ("Pacific/Fiji", "Pacific/Fiji"), ("Pacific/Funafuti", "Pacific/Funafuti"), ("Pacific/Galapagos", "Pacific/Galapagos"), ("Pacific/Gambier", "Pacific/Gambier"), ("Pacific/Guadalcanal", "Pacific/Guadalcanal"), ("Pacific/Guam", "Pacific/Guam"), ("Pacific/Honolulu", "Pacific/Honolulu"), ("Pacific/Kiritimati", "Pacific/Kiritimati"), ("Pacific/Kosrae", "Pacific/Kosrae"), ("Pacific/Kwajalein", "Pacific/Kwajalein"), ("Pacific/Majuro", "Pacific/Majuro"), ("Pacific/Marquesas", "Pacific/Marquesas"), ("Pacific/Midway", "Pacific/Midway"), ("Pacific/Nauru", "Pacific/Nauru"), ("Pacific/Niue", "Pacific/Niue"), ("Pacific/Norfolk", "Pacific/Norfolk"), ("Pacific/Noumea", "Pacific/Noumea"), ("Pacific/Pago_Pago", "Pacific/Pago_Pago"), ("Pacific/Palau", "Pacific/Palau"), ("Pacific/Pitcairn", "Pacific/Pitcairn"), ("Pacific/Pohnpei", "Pacific/Pohnpei"), ("Pacific/Port_Moresby", "Pacific/Port_Moresby"), ("Pacific/Rarotonga", "Pacific/Rarotonga"), ("Pacific/Saipan", "Pacific/Saipan"), ("Pacific/Tahiti", "Pacific/Tahiti"), ("Pacific/Tarawa", "Pacific/Tarawa"), ("Pacific/Tongatapu", "Pacific/Tongatapu"), ("Pacific/Wake", "Pacific/Wake"), ("Pacific/Wallis", "Pacific/Wallis"), ("US/Alaska", "US/Alaska"), ("US/Arizona", "US/Arizona"), ("US/Central", "US/Central"), ("US/Eastern", "US/Eastern"), ("US/Hawaii", "US/Hawaii"), ("US/Mountain", "US/Mountain"), ("US/Pacific", "US/Pacific"), ("UTC", "UTC"), ], max_length=80, null=True, ), ), migrations.AddField( model_name="theme", name="prefix", field=models.TextField(default="default", max_length=40, null=True), ), ] ================================================ FILE: brutaldon/migrations/0010_auto_20180825_1009.py ================================================ # Generated by Django 2.1 on 2018-08-25 14:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0009_auto_20180824_2241")] operations = [ migrations.AlterField( model_name="account", name="access_token", field=models.CharField(blank=True, max_length=2048, null=True), ), migrations.AlterField( model_name="client", name="client_id", field=models.CharField(blank=True, max_length=2048, null=True), ), migrations.AlterField( model_name="client", name="client_secret", field=models.CharField(blank=True, max_length=2048, null=True), ), migrations.AlterField( model_name="client", name="name", field=models.CharField(default="brutaldon", max_length=80), ), migrations.AlterField( model_name="preference", name="timezone", field=models.CharField( blank=True, choices=[ ("Africa/Abidjan", "Africa/Abidjan"), ("Africa/Accra", "Africa/Accra"), ("Africa/Addis_Ababa", "Africa/Addis_Ababa"), ("Africa/Algiers", "Africa/Algiers"), ("Africa/Asmara", "Africa/Asmara"), ("Africa/Bamako", "Africa/Bamako"), ("Africa/Bangui", "Africa/Bangui"), ("Africa/Banjul", "Africa/Banjul"), ("Africa/Bissau", "Africa/Bissau"), ("Africa/Blantyre", "Africa/Blantyre"), ("Africa/Brazzaville", "Africa/Brazzaville"), ("Africa/Bujumbura", "Africa/Bujumbura"), ("Africa/Cairo", "Africa/Cairo"), ("Africa/Casablanca", "Africa/Casablanca"), ("Africa/Ceuta", "Africa/Ceuta"), ("Africa/Conakry", "Africa/Conakry"), ("Africa/Dakar", "Africa/Dakar"), ("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"), ("Africa/Djibouti", "Africa/Djibouti"), ("Africa/Douala", "Africa/Douala"), ("Africa/El_Aaiun", "Africa/El_Aaiun"), ("Africa/Freetown", "Africa/Freetown"), ("Africa/Gaborone", "Africa/Gaborone"), ("Africa/Harare", "Africa/Harare"), ("Africa/Johannesburg", "Africa/Johannesburg"), ("Africa/Juba", "Africa/Juba"), ("Africa/Kampala", "Africa/Kampala"), ("Africa/Khartoum", "Africa/Khartoum"), ("Africa/Kigali", "Africa/Kigali"), ("Africa/Kinshasa", "Africa/Kinshasa"), ("Africa/Lagos", "Africa/Lagos"), ("Africa/Libreville", "Africa/Libreville"), ("Africa/Lome", "Africa/Lome"), ("Africa/Luanda", "Africa/Luanda"), ("Africa/Lubumbashi", "Africa/Lubumbashi"), ("Africa/Lusaka", "Africa/Lusaka"), ("Africa/Malabo", "Africa/Malabo"), ("Africa/Maputo", "Africa/Maputo"), ("Africa/Maseru", "Africa/Maseru"), ("Africa/Mbabane", "Africa/Mbabane"), ("Africa/Mogadishu", "Africa/Mogadishu"), ("Africa/Monrovia", "Africa/Monrovia"), ("Africa/Nairobi", "Africa/Nairobi"), ("Africa/Ndjamena", "Africa/Ndjamena"), ("Africa/Niamey", "Africa/Niamey"), ("Africa/Nouakchott", "Africa/Nouakchott"), ("Africa/Ouagadougou", "Africa/Ouagadougou"), ("Africa/Porto-Novo", "Africa/Porto-Novo"), ("Africa/Sao_Tome", "Africa/Sao_Tome"), ("Africa/Tripoli", "Africa/Tripoli"), ("Africa/Tunis", "Africa/Tunis"), ("Africa/Windhoek", "Africa/Windhoek"), ("America/Adak", "America/Adak"), ("America/Anchorage", "America/Anchorage"), ("America/Anguilla", "America/Anguilla"), ("America/Antigua", "America/Antigua"), ("America/Araguaina", "America/Araguaina"), ( "America/Argentina/Buenos_Aires", "America/Argentina/Buenos_Aires", ), ("America/Argentina/Catamarca", "America/Argentina/Catamarca"), ("America/Argentina/Cordoba", "America/Argentina/Cordoba"), ("America/Argentina/Jujuy", "America/Argentina/Jujuy"), ("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"), ("America/Argentina/Mendoza", "America/Argentina/Mendoza"), ( "America/Argentina/Rio_Gallegos", "America/Argentina/Rio_Gallegos", ), ("America/Argentina/Salta", "America/Argentina/Salta"), ("America/Argentina/San_Juan", "America/Argentina/San_Juan"), ("America/Argentina/San_Luis", "America/Argentina/San_Luis"), ("America/Argentina/Tucuman", "America/Argentina/Tucuman"), ("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"), ("America/Aruba", "America/Aruba"), ("America/Asuncion", "America/Asuncion"), ("America/Atikokan", "America/Atikokan"), ("America/Bahia", "America/Bahia"), ("America/Bahia_Banderas", "America/Bahia_Banderas"), ("America/Barbados", "America/Barbados"), ("America/Belem", "America/Belem"), ("America/Belize", "America/Belize"), ("America/Blanc-Sablon", "America/Blanc-Sablon"), ("America/Boa_Vista", "America/Boa_Vista"), ("America/Bogota", "America/Bogota"), ("America/Boise", "America/Boise"), ("America/Cambridge_Bay", "America/Cambridge_Bay"), ("America/Campo_Grande", "America/Campo_Grande"), ("America/Cancun", "America/Cancun"), ("America/Caracas", "America/Caracas"), ("America/Cayenne", "America/Cayenne"), ("America/Cayman", "America/Cayman"), ("America/Chicago", "America/Chicago"), ("America/Chihuahua", "America/Chihuahua"), ("America/Costa_Rica", "America/Costa_Rica"), ("America/Creston", "America/Creston"), ("America/Cuiaba", "America/Cuiaba"), ("America/Curacao", "America/Curacao"), ("America/Danmarkshavn", "America/Danmarkshavn"), ("America/Dawson", "America/Dawson"), ("America/Dawson_Creek", "America/Dawson_Creek"), ("America/Denver", "America/Denver"), ("America/Detroit", "America/Detroit"), ("America/Dominica", "America/Dominica"), ("America/Edmonton", "America/Edmonton"), ("America/Eirunepe", "America/Eirunepe"), ("America/El_Salvador", "America/El_Salvador"), ("America/Fort_Nelson", "America/Fort_Nelson"), ("America/Fortaleza", "America/Fortaleza"), ("America/Glace_Bay", "America/Glace_Bay"), ("America/Godthab", "America/Godthab"), ("America/Goose_Bay", "America/Goose_Bay"), ("America/Grand_Turk", "America/Grand_Turk"), ("America/Grenada", "America/Grenada"), ("America/Guadeloupe", "America/Guadeloupe"), ("America/Guatemala", "America/Guatemala"), ("America/Guayaquil", "America/Guayaquil"), ("America/Guyana", "America/Guyana"), ("America/Halifax", "America/Halifax"), ("America/Havana", "America/Havana"), ("America/Hermosillo", "America/Hermosillo"), ("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"), ("America/Indiana/Knox", "America/Indiana/Knox"), ("America/Indiana/Marengo", "America/Indiana/Marengo"), ("America/Indiana/Petersburg", "America/Indiana/Petersburg"), ("America/Indiana/Tell_City", "America/Indiana/Tell_City"), ("America/Indiana/Vevay", "America/Indiana/Vevay"), ("America/Indiana/Vincennes", "America/Indiana/Vincennes"), ("America/Indiana/Winamac", "America/Indiana/Winamac"), ("America/Inuvik", "America/Inuvik"), ("America/Iqaluit", "America/Iqaluit"), ("America/Jamaica", "America/Jamaica"), ("America/Juneau", "America/Juneau"), ("America/Kentucky/Louisville", "America/Kentucky/Louisville"), ("America/Kentucky/Monticello", "America/Kentucky/Monticello"), ("America/Kralendijk", "America/Kralendijk"), ("America/La_Paz", "America/La_Paz"), ("America/Lima", "America/Lima"), ("America/Los_Angeles", "America/Los_Angeles"), ("America/Lower_Princes", "America/Lower_Princes"), ("America/Maceio", "America/Maceio"), ("America/Managua", "America/Managua"), ("America/Manaus", "America/Manaus"), ("America/Marigot", "America/Marigot"), ("America/Martinique", "America/Martinique"), ("America/Matamoros", "America/Matamoros"), ("America/Mazatlan", "America/Mazatlan"), ("America/Menominee", "America/Menominee"), ("America/Merida", "America/Merida"), ("America/Metlakatla", "America/Metlakatla"), ("America/Mexico_City", "America/Mexico_City"), ("America/Miquelon", "America/Miquelon"), ("America/Moncton", "America/Moncton"), ("America/Monterrey", "America/Monterrey"), ("America/Montevideo", "America/Montevideo"), ("America/Montserrat", "America/Montserrat"), ("America/Nassau", "America/Nassau"), ("America/New_York", "America/New_York"), ("America/Nipigon", "America/Nipigon"), ("America/Nome", "America/Nome"), ("America/Noronha", "America/Noronha"), ("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"), ("America/North_Dakota/Center", "America/North_Dakota/Center"), ( "America/North_Dakota/New_Salem", "America/North_Dakota/New_Salem", ), ("America/Ojinaga", "America/Ojinaga"), ("America/Panama", "America/Panama"), ("America/Pangnirtung", "America/Pangnirtung"), ("America/Paramaribo", "America/Paramaribo"), ("America/Phoenix", "America/Phoenix"), ("America/Port-au-Prince", "America/Port-au-Prince"), ("America/Port_of_Spain", "America/Port_of_Spain"), ("America/Porto_Velho", "America/Porto_Velho"), ("America/Puerto_Rico", "America/Puerto_Rico"), ("America/Punta_Arenas", "America/Punta_Arenas"), ("America/Rainy_River", "America/Rainy_River"), ("America/Rankin_Inlet", "America/Rankin_Inlet"), ("America/Recife", "America/Recife"), ("America/Regina", "America/Regina"), ("America/Resolute", "America/Resolute"), ("America/Rio_Branco", "America/Rio_Branco"), ("America/Santarem", "America/Santarem"), ("America/Santiago", "America/Santiago"), ("America/Santo_Domingo", "America/Santo_Domingo"), ("America/Sao_Paulo", "America/Sao_Paulo"), ("America/Scoresbysund", "America/Scoresbysund"), ("America/Sitka", "America/Sitka"), ("America/St_Barthelemy", "America/St_Barthelemy"), ("America/St_Johns", "America/St_Johns"), ("America/St_Kitts", "America/St_Kitts"), ("America/St_Lucia", "America/St_Lucia"), ("America/St_Thomas", "America/St_Thomas"), ("America/St_Vincent", "America/St_Vincent"), ("America/Swift_Current", "America/Swift_Current"), ("America/Tegucigalpa", "America/Tegucigalpa"), ("America/Thule", "America/Thule"), ("America/Thunder_Bay", "America/Thunder_Bay"), ("America/Tijuana", "America/Tijuana"), ("America/Toronto", "America/Toronto"), ("America/Tortola", "America/Tortola"), ("America/Vancouver", "America/Vancouver"), ("America/Whitehorse", "America/Whitehorse"), ("America/Winnipeg", "America/Winnipeg"), ("America/Yakutat", "America/Yakutat"), ("America/Yellowknife", "America/Yellowknife"), ("Antarctica/Casey", "Antarctica/Casey"), ("Antarctica/Davis", "Antarctica/Davis"), ("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"), ("Antarctica/Macquarie", "Antarctica/Macquarie"), ("Antarctica/Mawson", "Antarctica/Mawson"), ("Antarctica/McMurdo", "Antarctica/McMurdo"), ("Antarctica/Palmer", "Antarctica/Palmer"), ("Antarctica/Rothera", "Antarctica/Rothera"), ("Antarctica/Syowa", "Antarctica/Syowa"), ("Antarctica/Troll", "Antarctica/Troll"), ("Antarctica/Vostok", "Antarctica/Vostok"), ("Arctic/Longyearbyen", "Arctic/Longyearbyen"), ("Asia/Aden", "Asia/Aden"), ("Asia/Almaty", "Asia/Almaty"), ("Asia/Amman", "Asia/Amman"), ("Asia/Anadyr", "Asia/Anadyr"), ("Asia/Aqtau", "Asia/Aqtau"), ("Asia/Aqtobe", "Asia/Aqtobe"), ("Asia/Ashgabat", "Asia/Ashgabat"), ("Asia/Atyrau", "Asia/Atyrau"), ("Asia/Baghdad", "Asia/Baghdad"), ("Asia/Bahrain", "Asia/Bahrain"), ("Asia/Baku", "Asia/Baku"), ("Asia/Bangkok", "Asia/Bangkok"), ("Asia/Barnaul", "Asia/Barnaul"), ("Asia/Beirut", "Asia/Beirut"), ("Asia/Bishkek", "Asia/Bishkek"), ("Asia/Brunei", "Asia/Brunei"), ("Asia/Chita", "Asia/Chita"), ("Asia/Choibalsan", "Asia/Choibalsan"), ("Asia/Colombo", "Asia/Colombo"), ("Asia/Damascus", "Asia/Damascus"), ("Asia/Dhaka", "Asia/Dhaka"), ("Asia/Dili", "Asia/Dili"), ("Asia/Dubai", "Asia/Dubai"), ("Asia/Dushanbe", "Asia/Dushanbe"), ("Asia/Famagusta", "Asia/Famagusta"), ("Asia/Gaza", "Asia/Gaza"), ("Asia/Hebron", "Asia/Hebron"), ("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"), ("Asia/Hong_Kong", "Asia/Hong_Kong"), ("Asia/Hovd", "Asia/Hovd"), ("Asia/Irkutsk", "Asia/Irkutsk"), ("Asia/Jakarta", "Asia/Jakarta"), ("Asia/Jayapura", "Asia/Jayapura"), ("Asia/Jerusalem", "Asia/Jerusalem"), ("Asia/Kabul", "Asia/Kabul"), ("Asia/Kamchatka", "Asia/Kamchatka"), ("Asia/Karachi", "Asia/Karachi"), ("Asia/Kathmandu", "Asia/Kathmandu"), ("Asia/Khandyga", "Asia/Khandyga"), ("Asia/Kolkata", "Asia/Kolkata"), ("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"), ("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"), ("Asia/Kuching", "Asia/Kuching"), ("Asia/Kuwait", "Asia/Kuwait"), ("Asia/Macau", "Asia/Macau"), ("Asia/Magadan", "Asia/Magadan"), ("Asia/Makassar", "Asia/Makassar"), ("Asia/Manila", "Asia/Manila"), ("Asia/Muscat", "Asia/Muscat"), ("Asia/Nicosia", "Asia/Nicosia"), ("Asia/Novokuznetsk", "Asia/Novokuznetsk"), ("Asia/Novosibirsk", "Asia/Novosibirsk"), ("Asia/Omsk", "Asia/Omsk"), ("Asia/Oral", "Asia/Oral"), ("Asia/Phnom_Penh", "Asia/Phnom_Penh"), ("Asia/Pontianak", "Asia/Pontianak"), ("Asia/Pyongyang", "Asia/Pyongyang"), ("Asia/Qatar", "Asia/Qatar"), ("Asia/Qyzylorda", "Asia/Qyzylorda"), ("Asia/Riyadh", "Asia/Riyadh"), ("Asia/Sakhalin", "Asia/Sakhalin"), ("Asia/Samarkand", "Asia/Samarkand"), ("Asia/Seoul", "Asia/Seoul"), ("Asia/Shanghai", "Asia/Shanghai"), ("Asia/Singapore", "Asia/Singapore"), ("Asia/Srednekolymsk", "Asia/Srednekolymsk"), ("Asia/Taipei", "Asia/Taipei"), ("Asia/Tashkent", "Asia/Tashkent"), ("Asia/Tbilisi", "Asia/Tbilisi"), ("Asia/Tehran", "Asia/Tehran"), ("Asia/Thimphu", "Asia/Thimphu"), ("Asia/Tokyo", "Asia/Tokyo"), ("Asia/Tomsk", "Asia/Tomsk"), ("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"), ("Asia/Urumqi", "Asia/Urumqi"), ("Asia/Ust-Nera", "Asia/Ust-Nera"), ("Asia/Vientiane", "Asia/Vientiane"), ("Asia/Vladivostok", "Asia/Vladivostok"), ("Asia/Yakutsk", "Asia/Yakutsk"), ("Asia/Yangon", "Asia/Yangon"), ("Asia/Yekaterinburg", "Asia/Yekaterinburg"), ("Asia/Yerevan", "Asia/Yerevan"), ("Atlantic/Azores", "Atlantic/Azores"), ("Atlantic/Bermuda", "Atlantic/Bermuda"), ("Atlantic/Canary", "Atlantic/Canary"), ("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"), ("Atlantic/Faroe", "Atlantic/Faroe"), ("Atlantic/Madeira", "Atlantic/Madeira"), ("Atlantic/Reykjavik", "Atlantic/Reykjavik"), ("Atlantic/South_Georgia", "Atlantic/South_Georgia"), ("Atlantic/St_Helena", "Atlantic/St_Helena"), ("Atlantic/Stanley", "Atlantic/Stanley"), ("Australia/Adelaide", "Australia/Adelaide"), ("Australia/Brisbane", "Australia/Brisbane"), ("Australia/Broken_Hill", "Australia/Broken_Hill"), ("Australia/Currie", "Australia/Currie"), ("Australia/Darwin", "Australia/Darwin"), ("Australia/Eucla", "Australia/Eucla"), ("Australia/Hobart", "Australia/Hobart"), ("Australia/Lindeman", "Australia/Lindeman"), ("Australia/Lord_Howe", "Australia/Lord_Howe"), ("Australia/Melbourne", "Australia/Melbourne"), ("Australia/Perth", "Australia/Perth"), ("Australia/Sydney", "Australia/Sydney"), ("Canada/Atlantic", "Canada/Atlantic"), ("Canada/Central", "Canada/Central"), ("Canada/Eastern", "Canada/Eastern"), ("Canada/Mountain", "Canada/Mountain"), ("Canada/Newfoundland", "Canada/Newfoundland"), ("Canada/Pacific", "Canada/Pacific"), ("Europe/Amsterdam", "Europe/Amsterdam"), ("Europe/Andorra", "Europe/Andorra"), ("Europe/Astrakhan", "Europe/Astrakhan"), ("Europe/Athens", "Europe/Athens"), ("Europe/Belgrade", "Europe/Belgrade"), ("Europe/Berlin", "Europe/Berlin"), ("Europe/Bratislava", "Europe/Bratislava"), ("Europe/Brussels", "Europe/Brussels"), ("Europe/Bucharest", "Europe/Bucharest"), ("Europe/Budapest", "Europe/Budapest"), ("Europe/Busingen", "Europe/Busingen"), ("Europe/Chisinau", "Europe/Chisinau"), ("Europe/Copenhagen", "Europe/Copenhagen"), ("Europe/Dublin", "Europe/Dublin"), ("Europe/Gibraltar", "Europe/Gibraltar"), ("Europe/Guernsey", "Europe/Guernsey"), ("Europe/Helsinki", "Europe/Helsinki"), ("Europe/Isle_of_Man", "Europe/Isle_of_Man"), ("Europe/Istanbul", "Europe/Istanbul"), ("Europe/Jersey", "Europe/Jersey"), ("Europe/Kaliningrad", "Europe/Kaliningrad"), ("Europe/Kiev", "Europe/Kiev"), ("Europe/Kirov", "Europe/Kirov"), ("Europe/Lisbon", "Europe/Lisbon"), ("Europe/Ljubljana", "Europe/Ljubljana"), ("Europe/London", "Europe/London"), ("Europe/Luxembourg", "Europe/Luxembourg"), ("Europe/Madrid", "Europe/Madrid"), ("Europe/Malta", "Europe/Malta"), ("Europe/Mariehamn", "Europe/Mariehamn"), ("Europe/Minsk", "Europe/Minsk"), ("Europe/Monaco", "Europe/Monaco"), ("Europe/Moscow", "Europe/Moscow"), ("Europe/Oslo", "Europe/Oslo"), ("Europe/Paris", "Europe/Paris"), ("Europe/Podgorica", "Europe/Podgorica"), ("Europe/Prague", "Europe/Prague"), ("Europe/Riga", "Europe/Riga"), ("Europe/Rome", "Europe/Rome"), ("Europe/Samara", "Europe/Samara"), ("Europe/San_Marino", "Europe/San_Marino"), ("Europe/Sarajevo", "Europe/Sarajevo"), ("Europe/Saratov", "Europe/Saratov"), ("Europe/Simferopol", "Europe/Simferopol"), ("Europe/Skopje", "Europe/Skopje"), ("Europe/Sofia", "Europe/Sofia"), ("Europe/Stockholm", "Europe/Stockholm"), ("Europe/Tallinn", "Europe/Tallinn"), ("Europe/Tirane", "Europe/Tirane"), ("Europe/Ulyanovsk", "Europe/Ulyanovsk"), ("Europe/Uzhgorod", "Europe/Uzhgorod"), ("Europe/Vaduz", "Europe/Vaduz"), ("Europe/Vatican", "Europe/Vatican"), ("Europe/Vienna", "Europe/Vienna"), ("Europe/Vilnius", "Europe/Vilnius"), ("Europe/Volgograd", "Europe/Volgograd"), ("Europe/Warsaw", "Europe/Warsaw"), ("Europe/Zagreb", "Europe/Zagreb"), ("Europe/Zaporozhye", "Europe/Zaporozhye"), ("Europe/Zurich", "Europe/Zurich"), ("GMT", "GMT"), ("Indian/Antananarivo", "Indian/Antananarivo"), ("Indian/Chagos", "Indian/Chagos"), ("Indian/Christmas", "Indian/Christmas"), ("Indian/Cocos", "Indian/Cocos"), ("Indian/Comoro", "Indian/Comoro"), ("Indian/Kerguelen", "Indian/Kerguelen"), ("Indian/Mahe", "Indian/Mahe"), ("Indian/Maldives", "Indian/Maldives"), ("Indian/Mauritius", "Indian/Mauritius"), ("Indian/Mayotte", "Indian/Mayotte"), ("Indian/Reunion", "Indian/Reunion"), ("Pacific/Apia", "Pacific/Apia"), ("Pacific/Auckland", "Pacific/Auckland"), ("Pacific/Bougainville", "Pacific/Bougainville"), ("Pacific/Chatham", "Pacific/Chatham"), ("Pacific/Chuuk", "Pacific/Chuuk"), ("Pacific/Easter", "Pacific/Easter"), ("Pacific/Efate", "Pacific/Efate"), ("Pacific/Enderbury", "Pacific/Enderbury"), ("Pacific/Fakaofo", "Pacific/Fakaofo"), ("Pacific/Fiji", "Pacific/Fiji"), ("Pacific/Funafuti", "Pacific/Funafuti"), ("Pacific/Galapagos", "Pacific/Galapagos"), ("Pacific/Gambier", "Pacific/Gambier"), ("Pacific/Guadalcanal", "Pacific/Guadalcanal"), ("Pacific/Guam", "Pacific/Guam"), ("Pacific/Honolulu", "Pacific/Honolulu"), ("Pacific/Kiritimati", "Pacific/Kiritimati"), ("Pacific/Kosrae", "Pacific/Kosrae"), ("Pacific/Kwajalein", "Pacific/Kwajalein"), ("Pacific/Majuro", "Pacific/Majuro"), ("Pacific/Marquesas", "Pacific/Marquesas"), ("Pacific/Midway", "Pacific/Midway"), ("Pacific/Nauru", "Pacific/Nauru"), ("Pacific/Niue", "Pacific/Niue"), ("Pacific/Norfolk", "Pacific/Norfolk"), ("Pacific/Noumea", "Pacific/Noumea"), ("Pacific/Pago_Pago", "Pacific/Pago_Pago"), ("Pacific/Palau", "Pacific/Palau"), ("Pacific/Pitcairn", "Pacific/Pitcairn"), ("Pacific/Pohnpei", "Pacific/Pohnpei"), ("Pacific/Port_Moresby", "Pacific/Port_Moresby"), ("Pacific/Rarotonga", "Pacific/Rarotonga"), ("Pacific/Saipan", "Pacific/Saipan"), ("Pacific/Tahiti", "Pacific/Tahiti"), ("Pacific/Tarawa", "Pacific/Tarawa"), ("Pacific/Tongatapu", "Pacific/Tongatapu"), ("Pacific/Wake", "Pacific/Wake"), ("Pacific/Wallis", "Pacific/Wallis"), ("US/Alaska", "US/Alaska"), ("US/Arizona", "US/Arizona"), ("US/Central", "US/Central"), ("US/Eastern", "US/Eastern"), ("US/Hawaii", "US/Hawaii"), ("US/Mountain", "US/Mountain"), ("US/Pacific", "US/Pacific"), ("UTC", "UTC"), ], max_length=80, null=True, ), ), migrations.AlterField( model_name="theme", name="main_css", field=models.CharField( blank=True, default="css/fullbrutalism.css", max_length=1024, null=True ), ), migrations.AlterField( model_name="theme", name="name", field=models.CharField(max_length=80, unique=True), ), migrations.AlterField( model_name="theme", name="prefix", field=models.CharField(default="default", max_length=40, null=True), ), migrations.AlterField( model_name="theme", name="tweaks_css", field=models.CharField(blank=True, max_length=1024, null=True), ), ] ================================================ FILE: brutaldon/migrations/0011_auto_20180825_1017.py ================================================ # Generated by Django 2.1 on 2018-08-25 14:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0010_auto_20180825_1009")] operations = [ migrations.AlterField( model_name="preference", name="timezone", field=models.CharField( blank=True, choices=[ ("Africa/Abidjan", "Africa/Abidjan"), ("Africa/Accra", "Africa/Accra"), ("Africa/Addis_Ababa", "Africa/Addis_Ababa"), ("Africa/Algiers", "Africa/Algiers"), ("Africa/Asmara", "Africa/Asmara"), ("Africa/Bamako", "Africa/Bamako"), ("Africa/Bangui", "Africa/Bangui"), ("Africa/Banjul", "Africa/Banjul"), ("Africa/Bissau", "Africa/Bissau"), ("Africa/Blantyre", "Africa/Blantyre"), ("Africa/Brazzaville", "Africa/Brazzaville"), ("Africa/Bujumbura", "Africa/Bujumbura"), ("Africa/Cairo", "Africa/Cairo"), ("Africa/Casablanca", "Africa/Casablanca"), ("Africa/Ceuta", "Africa/Ceuta"), ("Africa/Conakry", "Africa/Conakry"), ("Africa/Dakar", "Africa/Dakar"), ("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"), ("Africa/Djibouti", "Africa/Djibouti"), ("Africa/Douala", "Africa/Douala"), ("Africa/El_Aaiun", "Africa/El_Aaiun"), ("Africa/Freetown", "Africa/Freetown"), ("Africa/Gaborone", "Africa/Gaborone"), ("Africa/Harare", "Africa/Harare"), ("Africa/Johannesburg", "Africa/Johannesburg"), ("Africa/Juba", "Africa/Juba"), ("Africa/Kampala", "Africa/Kampala"), ("Africa/Khartoum", "Africa/Khartoum"), ("Africa/Kigali", "Africa/Kigali"), ("Africa/Kinshasa", "Africa/Kinshasa"), ("Africa/Lagos", "Africa/Lagos"), ("Africa/Libreville", "Africa/Libreville"), ("Africa/Lome", "Africa/Lome"), ("Africa/Luanda", "Africa/Luanda"), ("Africa/Lubumbashi", "Africa/Lubumbashi"), ("Africa/Lusaka", "Africa/Lusaka"), ("Africa/Malabo", "Africa/Malabo"), ("Africa/Maputo", "Africa/Maputo"), ("Africa/Maseru", "Africa/Maseru"), ("Africa/Mbabane", "Africa/Mbabane"), ("Africa/Mogadishu", "Africa/Mogadishu"), ("Africa/Monrovia", "Africa/Monrovia"), ("Africa/Nairobi", "Africa/Nairobi"), ("Africa/Ndjamena", "Africa/Ndjamena"), ("Africa/Niamey", "Africa/Niamey"), ("Africa/Nouakchott", "Africa/Nouakchott"), ("Africa/Ouagadougou", "Africa/Ouagadougou"), ("Africa/Porto-Novo", "Africa/Porto-Novo"), ("Africa/Sao_Tome", "Africa/Sao_Tome"), ("Africa/Tripoli", "Africa/Tripoli"), ("Africa/Tunis", "Africa/Tunis"), ("Africa/Windhoek", "Africa/Windhoek"), ("America/Adak", "America/Adak"), ("America/Anchorage", "America/Anchorage"), ("America/Anguilla", "America/Anguilla"), ("America/Antigua", "America/Antigua"), ("America/Araguaina", "America/Araguaina"), ( "America/Argentina/Buenos_Aires", "America/Argentina/Buenos_Aires", ), ("America/Argentina/Catamarca", "America/Argentina/Catamarca"), ("America/Argentina/Cordoba", "America/Argentina/Cordoba"), ("America/Argentina/Jujuy", "America/Argentina/Jujuy"), ("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"), ("America/Argentina/Mendoza", "America/Argentina/Mendoza"), ( "America/Argentina/Rio_Gallegos", "America/Argentina/Rio_Gallegos", ), ("America/Argentina/Salta", "America/Argentina/Salta"), ("America/Argentina/San_Juan", "America/Argentina/San_Juan"), ("America/Argentina/San_Luis", "America/Argentina/San_Luis"), ("America/Argentina/Tucuman", "America/Argentina/Tucuman"), ("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"), ("America/Aruba", "America/Aruba"), ("America/Asuncion", "America/Asuncion"), ("America/Atikokan", "America/Atikokan"), ("America/Bahia", "America/Bahia"), ("America/Bahia_Banderas", "America/Bahia_Banderas"), ("America/Barbados", "America/Barbados"), ("America/Belem", "America/Belem"), ("America/Belize", "America/Belize"), ("America/Blanc-Sablon", "America/Blanc-Sablon"), ("America/Boa_Vista", "America/Boa_Vista"), ("America/Bogota", "America/Bogota"), ("America/Boise", "America/Boise"), ("America/Cambridge_Bay", "America/Cambridge_Bay"), ("America/Campo_Grande", "America/Campo_Grande"), ("America/Cancun", "America/Cancun"), ("America/Caracas", "America/Caracas"), ("America/Cayenne", "America/Cayenne"), ("America/Cayman", "America/Cayman"), ("America/Chicago", "America/Chicago"), ("America/Chihuahua", "America/Chihuahua"), ("America/Costa_Rica", "America/Costa_Rica"), ("America/Creston", "America/Creston"), ("America/Cuiaba", "America/Cuiaba"), ("America/Curacao", "America/Curacao"), ("America/Danmarkshavn", "America/Danmarkshavn"), ("America/Dawson", "America/Dawson"), ("America/Dawson_Creek", "America/Dawson_Creek"), ("America/Denver", "America/Denver"), ("America/Detroit", "America/Detroit"), ("America/Dominica", "America/Dominica"), ("America/Edmonton", "America/Edmonton"), ("America/Eirunepe", "America/Eirunepe"), ("America/El_Salvador", "America/El_Salvador"), ("America/Fort_Nelson", "America/Fort_Nelson"), ("America/Fortaleza", "America/Fortaleza"), ("America/Glace_Bay", "America/Glace_Bay"), ("America/Godthab", "America/Godthab"), ("America/Goose_Bay", "America/Goose_Bay"), ("America/Grand_Turk", "America/Grand_Turk"), ("America/Grenada", "America/Grenada"), ("America/Guadeloupe", "America/Guadeloupe"), ("America/Guatemala", "America/Guatemala"), ("America/Guayaquil", "America/Guayaquil"), ("America/Guyana", "America/Guyana"), ("America/Halifax", "America/Halifax"), ("America/Havana", "America/Havana"), ("America/Hermosillo", "America/Hermosillo"), ("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"), ("America/Indiana/Knox", "America/Indiana/Knox"), ("America/Indiana/Marengo", "America/Indiana/Marengo"), ("America/Indiana/Petersburg", "America/Indiana/Petersburg"), ("America/Indiana/Tell_City", "America/Indiana/Tell_City"), ("America/Indiana/Vevay", "America/Indiana/Vevay"), ("America/Indiana/Vincennes", "America/Indiana/Vincennes"), ("America/Indiana/Winamac", "America/Indiana/Winamac"), ("America/Inuvik", "America/Inuvik"), ("America/Iqaluit", "America/Iqaluit"), ("America/Jamaica", "America/Jamaica"), ("America/Juneau", "America/Juneau"), ("America/Kentucky/Louisville", "America/Kentucky/Louisville"), ("America/Kentucky/Monticello", "America/Kentucky/Monticello"), ("America/Kralendijk", "America/Kralendijk"), ("America/La_Paz", "America/La_Paz"), ("America/Lima", "America/Lima"), ("America/Los_Angeles", "America/Los_Angeles"), ("America/Lower_Princes", "America/Lower_Princes"), ("America/Maceio", "America/Maceio"), ("America/Managua", "America/Managua"), ("America/Manaus", "America/Manaus"), ("America/Marigot", "America/Marigot"), ("America/Martinique", "America/Martinique"), ("America/Matamoros", "America/Matamoros"), ("America/Mazatlan", "America/Mazatlan"), ("America/Menominee", "America/Menominee"), ("America/Merida", "America/Merida"), ("America/Metlakatla", "America/Metlakatla"), ("America/Mexico_City", "America/Mexico_City"), ("America/Miquelon", "America/Miquelon"), ("America/Moncton", "America/Moncton"), ("America/Monterrey", "America/Monterrey"), ("America/Montevideo", "America/Montevideo"), ("America/Montserrat", "America/Montserrat"), ("America/Nassau", "America/Nassau"), ("America/New_York", "America/New_York"), ("America/Nipigon", "America/Nipigon"), ("America/Nome", "America/Nome"), ("America/Noronha", "America/Noronha"), ("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"), ("America/North_Dakota/Center", "America/North_Dakota/Center"), ( "America/North_Dakota/New_Salem", "America/North_Dakota/New_Salem", ), ("America/Ojinaga", "America/Ojinaga"), ("America/Panama", "America/Panama"), ("America/Pangnirtung", "America/Pangnirtung"), ("America/Paramaribo", "America/Paramaribo"), ("America/Phoenix", "America/Phoenix"), ("America/Port-au-Prince", "America/Port-au-Prince"), ("America/Port_of_Spain", "America/Port_of_Spain"), ("America/Porto_Velho", "America/Porto_Velho"), ("America/Puerto_Rico", "America/Puerto_Rico"), ("America/Punta_Arenas", "America/Punta_Arenas"), ("America/Rainy_River", "America/Rainy_River"), ("America/Rankin_Inlet", "America/Rankin_Inlet"), ("America/Recife", "America/Recife"), ("America/Regina", "America/Regina"), ("America/Resolute", "America/Resolute"), ("America/Rio_Branco", "America/Rio_Branco"), ("America/Santarem", "America/Santarem"), ("America/Santiago", "America/Santiago"), ("America/Santo_Domingo", "America/Santo_Domingo"), ("America/Sao_Paulo", "America/Sao_Paulo"), ("America/Scoresbysund", "America/Scoresbysund"), ("America/Sitka", "America/Sitka"), ("America/St_Barthelemy", "America/St_Barthelemy"), ("America/St_Johns", "America/St_Johns"), ("America/St_Kitts", "America/St_Kitts"), ("America/St_Lucia", "America/St_Lucia"), ("America/St_Thomas", "America/St_Thomas"), ("America/St_Vincent", "America/St_Vincent"), ("America/Swift_Current", "America/Swift_Current"), ("America/Tegucigalpa", "America/Tegucigalpa"), ("America/Thule", "America/Thule"), ("America/Thunder_Bay", "America/Thunder_Bay"), ("America/Tijuana", "America/Tijuana"), ("America/Toronto", "America/Toronto"), ("America/Tortola", "America/Tortola"), ("America/Vancouver", "America/Vancouver"), ("America/Whitehorse", "America/Whitehorse"), ("America/Winnipeg", "America/Winnipeg"), ("America/Yakutat", "America/Yakutat"), ("America/Yellowknife", "America/Yellowknife"), ("Antarctica/Casey", "Antarctica/Casey"), ("Antarctica/Davis", "Antarctica/Davis"), ("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"), ("Antarctica/Macquarie", "Antarctica/Macquarie"), ("Antarctica/Mawson", "Antarctica/Mawson"), ("Antarctica/McMurdo", "Antarctica/McMurdo"), ("Antarctica/Palmer", "Antarctica/Palmer"), ("Antarctica/Rothera", "Antarctica/Rothera"), ("Antarctica/Syowa", "Antarctica/Syowa"), ("Antarctica/Troll", "Antarctica/Troll"), ("Antarctica/Vostok", "Antarctica/Vostok"), ("Arctic/Longyearbyen", "Arctic/Longyearbyen"), ("Asia/Aden", "Asia/Aden"), ("Asia/Almaty", "Asia/Almaty"), ("Asia/Amman", "Asia/Amman"), ("Asia/Anadyr", "Asia/Anadyr"), ("Asia/Aqtau", "Asia/Aqtau"), ("Asia/Aqtobe", "Asia/Aqtobe"), ("Asia/Ashgabat", "Asia/Ashgabat"), ("Asia/Atyrau", "Asia/Atyrau"), ("Asia/Baghdad", "Asia/Baghdad"), ("Asia/Bahrain", "Asia/Bahrain"), ("Asia/Baku", "Asia/Baku"), ("Asia/Bangkok", "Asia/Bangkok"), ("Asia/Barnaul", "Asia/Barnaul"), ("Asia/Beirut", "Asia/Beirut"), ("Asia/Bishkek", "Asia/Bishkek"), ("Asia/Brunei", "Asia/Brunei"), ("Asia/Chita", "Asia/Chita"), ("Asia/Choibalsan", "Asia/Choibalsan"), ("Asia/Colombo", "Asia/Colombo"), ("Asia/Damascus", "Asia/Damascus"), ("Asia/Dhaka", "Asia/Dhaka"), ("Asia/Dili", "Asia/Dili"), ("Asia/Dubai", "Asia/Dubai"), ("Asia/Dushanbe", "Asia/Dushanbe"), ("Asia/Famagusta", "Asia/Famagusta"), ("Asia/Gaza", "Asia/Gaza"), ("Asia/Hebron", "Asia/Hebron"), ("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"), ("Asia/Hong_Kong", "Asia/Hong_Kong"), ("Asia/Hovd", "Asia/Hovd"), ("Asia/Irkutsk", "Asia/Irkutsk"), ("Asia/Jakarta", "Asia/Jakarta"), ("Asia/Jayapura", "Asia/Jayapura"), ("Asia/Jerusalem", "Asia/Jerusalem"), ("Asia/Kabul", "Asia/Kabul"), ("Asia/Kamchatka", "Asia/Kamchatka"), ("Asia/Karachi", "Asia/Karachi"), ("Asia/Kathmandu", "Asia/Kathmandu"), ("Asia/Khandyga", "Asia/Khandyga"), ("Asia/Kolkata", "Asia/Kolkata"), ("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"), ("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"), ("Asia/Kuching", "Asia/Kuching"), ("Asia/Kuwait", "Asia/Kuwait"), ("Asia/Macau", "Asia/Macau"), ("Asia/Magadan", "Asia/Magadan"), ("Asia/Makassar", "Asia/Makassar"), ("Asia/Manila", "Asia/Manila"), ("Asia/Muscat", "Asia/Muscat"), ("Asia/Nicosia", "Asia/Nicosia"), ("Asia/Novokuznetsk", "Asia/Novokuznetsk"), ("Asia/Novosibirsk", "Asia/Novosibirsk"), ("Asia/Omsk", "Asia/Omsk"), ("Asia/Oral", "Asia/Oral"), ("Asia/Phnom_Penh", "Asia/Phnom_Penh"), ("Asia/Pontianak", "Asia/Pontianak"), ("Asia/Pyongyang", "Asia/Pyongyang"), ("Asia/Qatar", "Asia/Qatar"), ("Asia/Qyzylorda", "Asia/Qyzylorda"), ("Asia/Riyadh", "Asia/Riyadh"), ("Asia/Sakhalin", "Asia/Sakhalin"), ("Asia/Samarkand", "Asia/Samarkand"), ("Asia/Seoul", "Asia/Seoul"), ("Asia/Shanghai", "Asia/Shanghai"), ("Asia/Singapore", "Asia/Singapore"), ("Asia/Srednekolymsk", "Asia/Srednekolymsk"), ("Asia/Taipei", "Asia/Taipei"), ("Asia/Tashkent", "Asia/Tashkent"), ("Asia/Tbilisi", "Asia/Tbilisi"), ("Asia/Tehran", "Asia/Tehran"), ("Asia/Thimphu", "Asia/Thimphu"), ("Asia/Tokyo", "Asia/Tokyo"), ("Asia/Tomsk", "Asia/Tomsk"), ("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"), ("Asia/Urumqi", "Asia/Urumqi"), ("Asia/Ust-Nera", "Asia/Ust-Nera"), ("Asia/Vientiane", "Asia/Vientiane"), ("Asia/Vladivostok", "Asia/Vladivostok"), ("Asia/Yakutsk", "Asia/Yakutsk"), ("Asia/Yangon", "Asia/Yangon"), ("Asia/Yekaterinburg", "Asia/Yekaterinburg"), ("Asia/Yerevan", "Asia/Yerevan"), ("Atlantic/Azores", "Atlantic/Azores"), ("Atlantic/Bermuda", "Atlantic/Bermuda"), ("Atlantic/Canary", "Atlantic/Canary"), ("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"), ("Atlantic/Faroe", "Atlantic/Faroe"), ("Atlantic/Madeira", "Atlantic/Madeira"), ("Atlantic/Reykjavik", "Atlantic/Reykjavik"), ("Atlantic/South_Georgia", "Atlantic/South_Georgia"), ("Atlantic/St_Helena", "Atlantic/St_Helena"), ("Atlantic/Stanley", "Atlantic/Stanley"), ("Australia/Adelaide", "Australia/Adelaide"), ("Australia/Brisbane", "Australia/Brisbane"), ("Australia/Broken_Hill", "Australia/Broken_Hill"), ("Australia/Currie", "Australia/Currie"), ("Australia/Darwin", "Australia/Darwin"), ("Australia/Eucla", "Australia/Eucla"), ("Australia/Hobart", "Australia/Hobart"), ("Australia/Lindeman", "Australia/Lindeman"), ("Australia/Lord_Howe", "Australia/Lord_Howe"), ("Australia/Melbourne", "Australia/Melbourne"), ("Australia/Perth", "Australia/Perth"), ("Australia/Sydney", "Australia/Sydney"), ("Canada/Atlantic", "Canada/Atlantic"), ("Canada/Central", "Canada/Central"), ("Canada/Eastern", "Canada/Eastern"), ("Canada/Mountain", "Canada/Mountain"), ("Canada/Newfoundland", "Canada/Newfoundland"), ("Canada/Pacific", "Canada/Pacific"), ("Europe/Amsterdam", "Europe/Amsterdam"), ("Europe/Andorra", "Europe/Andorra"), ("Europe/Astrakhan", "Europe/Astrakhan"), ("Europe/Athens", "Europe/Athens"), ("Europe/Belgrade", "Europe/Belgrade"), ("Europe/Berlin", "Europe/Berlin"), ("Europe/Bratislava", "Europe/Bratislava"), ("Europe/Brussels", "Europe/Brussels"), ("Europe/Bucharest", "Europe/Bucharest"), ("Europe/Budapest", "Europe/Budapest"), ("Europe/Busingen", "Europe/Busingen"), ("Europe/Chisinau", "Europe/Chisinau"), ("Europe/Copenhagen", "Europe/Copenhagen"), ("Europe/Dublin", "Europe/Dublin"), ("Europe/Gibraltar", "Europe/Gibraltar"), ("Europe/Guernsey", "Europe/Guernsey"), ("Europe/Helsinki", "Europe/Helsinki"), ("Europe/Isle_of_Man", "Europe/Isle_of_Man"), ("Europe/Istanbul", "Europe/Istanbul"), ("Europe/Jersey", "Europe/Jersey"), ("Europe/Kaliningrad", "Europe/Kaliningrad"), ("Europe/Kiev", "Europe/Kiev"), ("Europe/Kirov", "Europe/Kirov"), ("Europe/Lisbon", "Europe/Lisbon"), ("Europe/Ljubljana", "Europe/Ljubljana"), ("Europe/London", "Europe/London"), ("Europe/Luxembourg", "Europe/Luxembourg"), ("Europe/Madrid", "Europe/Madrid"), ("Europe/Malta", "Europe/Malta"), ("Europe/Mariehamn", "Europe/Mariehamn"), ("Europe/Minsk", "Europe/Minsk"), ("Europe/Monaco", "Europe/Monaco"), ("Europe/Moscow", "Europe/Moscow"), ("Europe/Oslo", "Europe/Oslo"), ("Europe/Paris", "Europe/Paris"), ("Europe/Podgorica", "Europe/Podgorica"), ("Europe/Prague", "Europe/Prague"), ("Europe/Riga", "Europe/Riga"), ("Europe/Rome", "Europe/Rome"), ("Europe/Samara", "Europe/Samara"), ("Europe/San_Marino", "Europe/San_Marino"), ("Europe/Sarajevo", "Europe/Sarajevo"), ("Europe/Saratov", "Europe/Saratov"), ("Europe/Simferopol", "Europe/Simferopol"), ("Europe/Skopje", "Europe/Skopje"), ("Europe/Sofia", "Europe/Sofia"), ("Europe/Stockholm", "Europe/Stockholm"), ("Europe/Tallinn", "Europe/Tallinn"), ("Europe/Tirane", "Europe/Tirane"), ("Europe/Ulyanovsk", "Europe/Ulyanovsk"), ("Europe/Uzhgorod", "Europe/Uzhgorod"), ("Europe/Vaduz", "Europe/Vaduz"), ("Europe/Vatican", "Europe/Vatican"), ("Europe/Vienna", "Europe/Vienna"), ("Europe/Vilnius", "Europe/Vilnius"), ("Europe/Volgograd", "Europe/Volgograd"), ("Europe/Warsaw", "Europe/Warsaw"), ("Europe/Zagreb", "Europe/Zagreb"), ("Europe/Zaporozhye", "Europe/Zaporozhye"), ("Europe/Zurich", "Europe/Zurich"), ("GMT", "GMT"), ("Indian/Antananarivo", "Indian/Antananarivo"), ("Indian/Chagos", "Indian/Chagos"), ("Indian/Christmas", "Indian/Christmas"), ("Indian/Cocos", "Indian/Cocos"), ("Indian/Comoro", "Indian/Comoro"), ("Indian/Kerguelen", "Indian/Kerguelen"), ("Indian/Mahe", "Indian/Mahe"), ("Indian/Maldives", "Indian/Maldives"), ("Indian/Mauritius", "Indian/Mauritius"), ("Indian/Mayotte", "Indian/Mayotte"), ("Indian/Reunion", "Indian/Reunion"), ("Pacific/Apia", "Pacific/Apia"), ("Pacific/Auckland", "Pacific/Auckland"), ("Pacific/Bougainville", "Pacific/Bougainville"), ("Pacific/Chatham", "Pacific/Chatham"), ("Pacific/Chuuk", "Pacific/Chuuk"), ("Pacific/Easter", "Pacific/Easter"), ("Pacific/Efate", "Pacific/Efate"), ("Pacific/Enderbury", "Pacific/Enderbury"), ("Pacific/Fakaofo", "Pacific/Fakaofo"), ("Pacific/Fiji", "Pacific/Fiji"), ("Pacific/Funafuti", "Pacific/Funafuti"), ("Pacific/Galapagos", "Pacific/Galapagos"), ("Pacific/Gambier", "Pacific/Gambier"), ("Pacific/Guadalcanal", "Pacific/Guadalcanal"), ("Pacific/Guam", "Pacific/Guam"), ("Pacific/Honolulu", "Pacific/Honolulu"), ("Pacific/Kiritimati", "Pacific/Kiritimati"), ("Pacific/Kosrae", "Pacific/Kosrae"), ("Pacific/Kwajalein", "Pacific/Kwajalein"), ("Pacific/Majuro", "Pacific/Majuro"), ("Pacific/Marquesas", "Pacific/Marquesas"), ("Pacific/Midway", "Pacific/Midway"), ("Pacific/Nauru", "Pacific/Nauru"), ("Pacific/Niue", "Pacific/Niue"), ("Pacific/Norfolk", "Pacific/Norfolk"), ("Pacific/Noumea", "Pacific/Noumea"), ("Pacific/Pago_Pago", "Pacific/Pago_Pago"), ("Pacific/Palau", "Pacific/Palau"), ("Pacific/Pitcairn", "Pacific/Pitcairn"), ("Pacific/Pohnpei", "Pacific/Pohnpei"), ("Pacific/Port_Moresby", "Pacific/Port_Moresby"), ("Pacific/Rarotonga", "Pacific/Rarotonga"), ("Pacific/Saipan", "Pacific/Saipan"), ("Pacific/Tahiti", "Pacific/Tahiti"), ("Pacific/Tarawa", "Pacific/Tarawa"), ("Pacific/Tongatapu", "Pacific/Tongatapu"), ("Pacific/Wake", "Pacific/Wake"), ("Pacific/Wallis", "Pacific/Wallis"), ("US/Alaska", "US/Alaska"), ("US/Arizona", "US/Arizona"), ("US/Central", "US/Central"), ("US/Eastern", "US/Eastern"), ("US/Hawaii", "US/Hawaii"), ("US/Mountain", "US/Mountain"), ("US/Pacific", "US/Pacific"), ("UTC", "UTC"), ], default="UTC", max_length=80, null=True, ), ) ] ================================================ FILE: brutaldon/migrations/0012_auto_20180826_1853.py ================================================ # Generated by Django 2.1 on 2018-08-26 22:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0011_auto_20180825_1017")] operations = [ migrations.AlterField( model_name="account", name="username", field=models.EmailField(max_length=254, unique=True), ) ] ================================================ FILE: brutaldon/migrations/0013_auto_20180826_1935.py ================================================ # Generated by Django 2.1 on 2018-08-26 23:35 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [("brutaldon", "0012_auto_20180826_1853")] operations = [ migrations.AlterField( model_name="preference", name="theme", field=models.ForeignKey( default=1, on_delete=django.db.models.deletion.CASCADE, to="brutaldon.Theme", ), ) ] ================================================ FILE: brutaldon/migrations/0014_account_note_seen.py ================================================ # Generated by Django 2.1.1 on 2018-09-08 11:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0013_auto_20180826_1935")] operations = [ migrations.AddField( model_name="account", name="note_seen", field=models.IntegerField(null=True) ) ] ================================================ FILE: brutaldon/migrations/0015_auto_20181001_1812.py ================================================ # Generated by Django 2.1.1 on 2018-10-01 22:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0014_account_note_seen")] operations = [ migrations.AddField( model_name="preference", name="click_to_load", field=models.BooleanField(default=False), ), migrations.AddField( model_name="preference", name="no_javascript", field=models.BooleanField(default=False), ), migrations.AddField( model_name="preference", name="notifications", field=models.BooleanField(default=True), ), ] ================================================ FILE: brutaldon/migrations/0016_auto_20181009_1805.py ================================================ # Generated by Django 2.1.2 on 2018-10-09 22:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0015_auto_20181001_1812")] operations = [ migrations.AddField( model_name="preference", name="lightbox", field=models.BooleanField( default=False, help_text="Use a JavaScript lightbox to display media." ), ), migrations.AlterField( model_name="preference", name="click_to_load", field=models.BooleanField( default=False, help_text="Click to load more toots in the same page, rather than using pagination.", ), ), migrations.AlterField( model_name="preference", name="no_javascript", field=models.BooleanField( default=False, help_text="Disable all JavaScript. Overrides all other JavaScript options.", ), ), migrations.AlterField( model_name="preference", name="notifications", field=models.BooleanField( default=True, help_text="Display live notifications in header." ), ), ] ================================================ FILE: brutaldon/migrations/0017_preference_poll_frequency.py ================================================ # Generated by Django 2.1.2 on 2018-10-18 19:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0016_auto_20181009_1805")] operations = [ migrations.AddField( model_name="preference", name="poll_frequency", field=models.IntegerField( default=300, help_text="Number of seconds to wait between checking notifications. Default: 300", ), ) ] ================================================ FILE: brutaldon/migrations/0018_preference_filter_notifications.py ================================================ # Generated by Django 2.1.5 on 2019-01-14 13:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0017_preference_poll_frequency")] operations = [ migrations.AddField( model_name="preference", name="filter_notifications", field=models.BooleanField( default=False, help_text="Exclude boosts and favs from your notifications.", ), ) ] ================================================ FILE: brutaldon/migrations/0019_auto_20190124_0813.py ================================================ # Generated by Django 2.1.5 on 2019-01-24 13:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0018_preference_filter_notifications")] operations = [ migrations.AlterField( model_name="preference", name="timezone", field=models.CharField( blank=True, choices=[ ("Africa/Abidjan", "Africa/Abidjan"), ("Africa/Accra", "Africa/Accra"), ("Africa/Addis_Ababa", "Africa/Addis_Ababa"), ("Africa/Algiers", "Africa/Algiers"), ("Africa/Asmara", "Africa/Asmara"), ("Africa/Bamako", "Africa/Bamako"), ("Africa/Bangui", "Africa/Bangui"), ("Africa/Banjul", "Africa/Banjul"), ("Africa/Bissau", "Africa/Bissau"), ("Africa/Blantyre", "Africa/Blantyre"), ("Africa/Brazzaville", "Africa/Brazzaville"), ("Africa/Bujumbura", "Africa/Bujumbura"), ("Africa/Cairo", "Africa/Cairo"), ("Africa/Casablanca", "Africa/Casablanca"), ("Africa/Ceuta", "Africa/Ceuta"), ("Africa/Conakry", "Africa/Conakry"), ("Africa/Dakar", "Africa/Dakar"), ("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"), ("Africa/Djibouti", "Africa/Djibouti"), ("Africa/Douala", "Africa/Douala"), ("Africa/El_Aaiun", "Africa/El_Aaiun"), ("Africa/Freetown", "Africa/Freetown"), ("Africa/Gaborone", "Africa/Gaborone"), ("Africa/Harare", "Africa/Harare"), ("Africa/Johannesburg", "Africa/Johannesburg"), ("Africa/Juba", "Africa/Juba"), ("Africa/Kampala", "Africa/Kampala"), ("Africa/Khartoum", "Africa/Khartoum"), ("Africa/Kigali", "Africa/Kigali"), ("Africa/Kinshasa", "Africa/Kinshasa"), ("Africa/Lagos", "Africa/Lagos"), ("Africa/Libreville", "Africa/Libreville"), ("Africa/Lome", "Africa/Lome"), ("Africa/Luanda", "Africa/Luanda"), ("Africa/Lubumbashi", "Africa/Lubumbashi"), ("Africa/Lusaka", "Africa/Lusaka"), ("Africa/Malabo", "Africa/Malabo"), ("Africa/Maputo", "Africa/Maputo"), ("Africa/Maseru", "Africa/Maseru"), ("Africa/Mbabane", "Africa/Mbabane"), ("Africa/Mogadishu", "Africa/Mogadishu"), ("Africa/Monrovia", "Africa/Monrovia"), ("Africa/Nairobi", "Africa/Nairobi"), ("Africa/Ndjamena", "Africa/Ndjamena"), ("Africa/Niamey", "Africa/Niamey"), ("Africa/Nouakchott", "Africa/Nouakchott"), ("Africa/Ouagadougou", "Africa/Ouagadougou"), ("Africa/Porto-Novo", "Africa/Porto-Novo"), ("Africa/Sao_Tome", "Africa/Sao_Tome"), ("Africa/Tripoli", "Africa/Tripoli"), ("Africa/Tunis", "Africa/Tunis"), ("Africa/Windhoek", "Africa/Windhoek"), ("America/Adak", "America/Adak"), ("America/Anchorage", "America/Anchorage"), ("America/Anguilla", "America/Anguilla"), ("America/Antigua", "America/Antigua"), ("America/Araguaina", "America/Araguaina"), ( "America/Argentina/Buenos_Aires", "America/Argentina/Buenos_Aires", ), ("America/Argentina/Catamarca", "America/Argentina/Catamarca"), ("America/Argentina/Cordoba", "America/Argentina/Cordoba"), ("America/Argentina/Jujuy", "America/Argentina/Jujuy"), ("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"), ("America/Argentina/Mendoza", "America/Argentina/Mendoza"), ( "America/Argentina/Rio_Gallegos", "America/Argentina/Rio_Gallegos", ), ("America/Argentina/Salta", "America/Argentina/Salta"), ("America/Argentina/San_Juan", "America/Argentina/San_Juan"), ("America/Argentina/San_Luis", "America/Argentina/San_Luis"), ("America/Argentina/Tucuman", "America/Argentina/Tucuman"), ("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"), ("America/Aruba", "America/Aruba"), ("America/Asuncion", "America/Asuncion"), ("America/Atikokan", "America/Atikokan"), ("America/Bahia", "America/Bahia"), ("America/Bahia_Banderas", "America/Bahia_Banderas"), ("America/Barbados", "America/Barbados"), ("America/Belem", "America/Belem"), ("America/Belize", "America/Belize"), ("America/Blanc-Sablon", "America/Blanc-Sablon"), ("America/Boa_Vista", "America/Boa_Vista"), ("America/Bogota", "America/Bogota"), ("America/Boise", "America/Boise"), ("America/Cambridge_Bay", "America/Cambridge_Bay"), ("America/Campo_Grande", "America/Campo_Grande"), ("America/Cancun", "America/Cancun"), ("America/Caracas", "America/Caracas"), ("America/Cayenne", "America/Cayenne"), ("America/Cayman", "America/Cayman"), ("America/Chicago", "America/Chicago"), ("America/Chihuahua", "America/Chihuahua"), ("America/Costa_Rica", "America/Costa_Rica"), ("America/Creston", "America/Creston"), ("America/Cuiaba", "America/Cuiaba"), ("America/Curacao", "America/Curacao"), ("America/Danmarkshavn", "America/Danmarkshavn"), ("America/Dawson", "America/Dawson"), ("America/Dawson_Creek", "America/Dawson_Creek"), ("America/Denver", "America/Denver"), ("America/Detroit", "America/Detroit"), ("America/Dominica", "America/Dominica"), ("America/Edmonton", "America/Edmonton"), ("America/Eirunepe", "America/Eirunepe"), ("America/El_Salvador", "America/El_Salvador"), ("America/Fort_Nelson", "America/Fort_Nelson"), ("America/Fortaleza", "America/Fortaleza"), ("America/Glace_Bay", "America/Glace_Bay"), ("America/Godthab", "America/Godthab"), ("America/Goose_Bay", "America/Goose_Bay"), ("America/Grand_Turk", "America/Grand_Turk"), ("America/Grenada", "America/Grenada"), ("America/Guadeloupe", "America/Guadeloupe"), ("America/Guatemala", "America/Guatemala"), ("America/Guayaquil", "America/Guayaquil"), ("America/Guyana", "America/Guyana"), ("America/Halifax", "America/Halifax"), ("America/Havana", "America/Havana"), ("America/Hermosillo", "America/Hermosillo"), ("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"), ("America/Indiana/Knox", "America/Indiana/Knox"), ("America/Indiana/Marengo", "America/Indiana/Marengo"), ("America/Indiana/Petersburg", "America/Indiana/Petersburg"), ("America/Indiana/Tell_City", "America/Indiana/Tell_City"), ("America/Indiana/Vevay", "America/Indiana/Vevay"), ("America/Indiana/Vincennes", "America/Indiana/Vincennes"), ("America/Indiana/Winamac", "America/Indiana/Winamac"), ("America/Inuvik", "America/Inuvik"), ("America/Iqaluit", "America/Iqaluit"), ("America/Jamaica", "America/Jamaica"), ("America/Juneau", "America/Juneau"), ("America/Kentucky/Louisville", "America/Kentucky/Louisville"), ("America/Kentucky/Monticello", "America/Kentucky/Monticello"), ("America/Kralendijk", "America/Kralendijk"), ("America/La_Paz", "America/La_Paz"), ("America/Lima", "America/Lima"), ("America/Los_Angeles", "America/Los_Angeles"), ("America/Lower_Princes", "America/Lower_Princes"), ("America/Maceio", "America/Maceio"), ("America/Managua", "America/Managua"), ("America/Manaus", "America/Manaus"), ("America/Marigot", "America/Marigot"), ("America/Martinique", "America/Martinique"), ("America/Matamoros", "America/Matamoros"), ("America/Mazatlan", "America/Mazatlan"), ("America/Menominee", "America/Menominee"), ("America/Merida", "America/Merida"), ("America/Metlakatla", "America/Metlakatla"), ("America/Mexico_City", "America/Mexico_City"), ("America/Miquelon", "America/Miquelon"), ("America/Moncton", "America/Moncton"), ("America/Monterrey", "America/Monterrey"), ("America/Montevideo", "America/Montevideo"), ("America/Montserrat", "America/Montserrat"), ("America/Nassau", "America/Nassau"), ("America/New_York", "America/New_York"), ("America/Nipigon", "America/Nipigon"), ("America/Nome", "America/Nome"), ("America/Noronha", "America/Noronha"), ("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"), ("America/North_Dakota/Center", "America/North_Dakota/Center"), ( "America/North_Dakota/New_Salem", "America/North_Dakota/New_Salem", ), ("America/Ojinaga", "America/Ojinaga"), ("America/Panama", "America/Panama"), ("America/Pangnirtung", "America/Pangnirtung"), ("America/Paramaribo", "America/Paramaribo"), ("America/Phoenix", "America/Phoenix"), ("America/Port-au-Prince", "America/Port-au-Prince"), ("America/Port_of_Spain", "America/Port_of_Spain"), ("America/Porto_Velho", "America/Porto_Velho"), ("America/Puerto_Rico", "America/Puerto_Rico"), ("America/Punta_Arenas", "America/Punta_Arenas"), ("America/Rainy_River", "America/Rainy_River"), ("America/Rankin_Inlet", "America/Rankin_Inlet"), ("America/Recife", "America/Recife"), ("America/Regina", "America/Regina"), ("America/Resolute", "America/Resolute"), ("America/Rio_Branco", "America/Rio_Branco"), ("America/Santarem", "America/Santarem"), ("America/Santiago", "America/Santiago"), ("America/Santo_Domingo", "America/Santo_Domingo"), ("America/Sao_Paulo", "America/Sao_Paulo"), ("America/Scoresbysund", "America/Scoresbysund"), ("America/Sitka", "America/Sitka"), ("America/St_Barthelemy", "America/St_Barthelemy"), ("America/St_Johns", "America/St_Johns"), ("America/St_Kitts", "America/St_Kitts"), ("America/St_Lucia", "America/St_Lucia"), ("America/St_Thomas", "America/St_Thomas"), ("America/St_Vincent", "America/St_Vincent"), ("America/Swift_Current", "America/Swift_Current"), ("America/Tegucigalpa", "America/Tegucigalpa"), ("America/Thule", "America/Thule"), ("America/Thunder_Bay", "America/Thunder_Bay"), ("America/Tijuana", "America/Tijuana"), ("America/Toronto", "America/Toronto"), ("America/Tortola", "America/Tortola"), ("America/Vancouver", "America/Vancouver"), ("America/Whitehorse", "America/Whitehorse"), ("America/Winnipeg", "America/Winnipeg"), ("America/Yakutat", "America/Yakutat"), ("America/Yellowknife", "America/Yellowknife"), ("Antarctica/Casey", "Antarctica/Casey"), ("Antarctica/Davis", "Antarctica/Davis"), ("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"), ("Antarctica/Macquarie", "Antarctica/Macquarie"), ("Antarctica/Mawson", "Antarctica/Mawson"), ("Antarctica/McMurdo", "Antarctica/McMurdo"), ("Antarctica/Palmer", "Antarctica/Palmer"), ("Antarctica/Rothera", "Antarctica/Rothera"), ("Antarctica/Syowa", "Antarctica/Syowa"), ("Antarctica/Troll", "Antarctica/Troll"), ("Antarctica/Vostok", "Antarctica/Vostok"), ("Arctic/Longyearbyen", "Arctic/Longyearbyen"), ("Asia/Aden", "Asia/Aden"), ("Asia/Almaty", "Asia/Almaty"), ("Asia/Amman", "Asia/Amman"), ("Asia/Anadyr", "Asia/Anadyr"), ("Asia/Aqtau", "Asia/Aqtau"), ("Asia/Aqtobe", "Asia/Aqtobe"), ("Asia/Ashgabat", "Asia/Ashgabat"), ("Asia/Atyrau", "Asia/Atyrau"), ("Asia/Baghdad", "Asia/Baghdad"), ("Asia/Bahrain", "Asia/Bahrain"), ("Asia/Baku", "Asia/Baku"), ("Asia/Bangkok", "Asia/Bangkok"), ("Asia/Barnaul", "Asia/Barnaul"), ("Asia/Beirut", "Asia/Beirut"), ("Asia/Bishkek", "Asia/Bishkek"), ("Asia/Brunei", "Asia/Brunei"), ("Asia/Chita", "Asia/Chita"), ("Asia/Choibalsan", "Asia/Choibalsan"), ("Asia/Colombo", "Asia/Colombo"), ("Asia/Damascus", "Asia/Damascus"), ("Asia/Dhaka", "Asia/Dhaka"), ("Asia/Dili", "Asia/Dili"), ("Asia/Dubai", "Asia/Dubai"), ("Asia/Dushanbe", "Asia/Dushanbe"), ("Asia/Famagusta", "Asia/Famagusta"), ("Asia/Gaza", "Asia/Gaza"), ("Asia/Hebron", "Asia/Hebron"), ("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"), ("Asia/Hong_Kong", "Asia/Hong_Kong"), ("Asia/Hovd", "Asia/Hovd"), ("Asia/Irkutsk", "Asia/Irkutsk"), ("Asia/Jakarta", "Asia/Jakarta"), ("Asia/Jayapura", "Asia/Jayapura"), ("Asia/Jerusalem", "Asia/Jerusalem"), ("Asia/Kabul", "Asia/Kabul"), ("Asia/Kamchatka", "Asia/Kamchatka"), ("Asia/Karachi", "Asia/Karachi"), ("Asia/Kathmandu", "Asia/Kathmandu"), ("Asia/Khandyga", "Asia/Khandyga"), ("Asia/Kolkata", "Asia/Kolkata"), ("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"), ("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"), ("Asia/Kuching", "Asia/Kuching"), ("Asia/Kuwait", "Asia/Kuwait"), ("Asia/Macau", "Asia/Macau"), ("Asia/Magadan", "Asia/Magadan"), ("Asia/Makassar", "Asia/Makassar"), ("Asia/Manila", "Asia/Manila"), ("Asia/Muscat", "Asia/Muscat"), ("Asia/Nicosia", "Asia/Nicosia"), ("Asia/Novokuznetsk", "Asia/Novokuznetsk"), ("Asia/Novosibirsk", "Asia/Novosibirsk"), ("Asia/Omsk", "Asia/Omsk"), ("Asia/Oral", "Asia/Oral"), ("Asia/Phnom_Penh", "Asia/Phnom_Penh"), ("Asia/Pontianak", "Asia/Pontianak"), ("Asia/Pyongyang", "Asia/Pyongyang"), ("Asia/Qatar", "Asia/Qatar"), ("Asia/Qostanay", "Asia/Qostanay"), ("Asia/Qyzylorda", "Asia/Qyzylorda"), ("Asia/Riyadh", "Asia/Riyadh"), ("Asia/Sakhalin", "Asia/Sakhalin"), ("Asia/Samarkand", "Asia/Samarkand"), ("Asia/Seoul", "Asia/Seoul"), ("Asia/Shanghai", "Asia/Shanghai"), ("Asia/Singapore", "Asia/Singapore"), ("Asia/Srednekolymsk", "Asia/Srednekolymsk"), ("Asia/Taipei", "Asia/Taipei"), ("Asia/Tashkent", "Asia/Tashkent"), ("Asia/Tbilisi", "Asia/Tbilisi"), ("Asia/Tehran", "Asia/Tehran"), ("Asia/Thimphu", "Asia/Thimphu"), ("Asia/Tokyo", "Asia/Tokyo"), ("Asia/Tomsk", "Asia/Tomsk"), ("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"), ("Asia/Urumqi", "Asia/Urumqi"), ("Asia/Ust-Nera", "Asia/Ust-Nera"), ("Asia/Vientiane", "Asia/Vientiane"), ("Asia/Vladivostok", "Asia/Vladivostok"), ("Asia/Yakutsk", "Asia/Yakutsk"), ("Asia/Yangon", "Asia/Yangon"), ("Asia/Yekaterinburg", "Asia/Yekaterinburg"), ("Asia/Yerevan", "Asia/Yerevan"), ("Atlantic/Azores", "Atlantic/Azores"), ("Atlantic/Bermuda", "Atlantic/Bermuda"), ("Atlantic/Canary", "Atlantic/Canary"), ("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"), ("Atlantic/Faroe", "Atlantic/Faroe"), ("Atlantic/Madeira", "Atlantic/Madeira"), ("Atlantic/Reykjavik", "Atlantic/Reykjavik"), ("Atlantic/South_Georgia", "Atlantic/South_Georgia"), ("Atlantic/St_Helena", "Atlantic/St_Helena"), ("Atlantic/Stanley", "Atlantic/Stanley"), ("Australia/Adelaide", "Australia/Adelaide"), ("Australia/Brisbane", "Australia/Brisbane"), ("Australia/Broken_Hill", "Australia/Broken_Hill"), ("Australia/Currie", "Australia/Currie"), ("Australia/Darwin", "Australia/Darwin"), ("Australia/Eucla", "Australia/Eucla"), ("Australia/Hobart", "Australia/Hobart"), ("Australia/Lindeman", "Australia/Lindeman"), ("Australia/Lord_Howe", "Australia/Lord_Howe"), ("Australia/Melbourne", "Australia/Melbourne"), ("Australia/Perth", "Australia/Perth"), ("Australia/Sydney", "Australia/Sydney"), ("Canada/Atlantic", "Canada/Atlantic"), ("Canada/Central", "Canada/Central"), ("Canada/Eastern", "Canada/Eastern"), ("Canada/Mountain", "Canada/Mountain"), ("Canada/Newfoundland", "Canada/Newfoundland"), ("Canada/Pacific", "Canada/Pacific"), ("Europe/Amsterdam", "Europe/Amsterdam"), ("Europe/Andorra", "Europe/Andorra"), ("Europe/Astrakhan", "Europe/Astrakhan"), ("Europe/Athens", "Europe/Athens"), ("Europe/Belgrade", "Europe/Belgrade"), ("Europe/Berlin", "Europe/Berlin"), ("Europe/Bratislava", "Europe/Bratislava"), ("Europe/Brussels", "Europe/Brussels"), ("Europe/Bucharest", "Europe/Bucharest"), ("Europe/Budapest", "Europe/Budapest"), ("Europe/Busingen", "Europe/Busingen"), ("Europe/Chisinau", "Europe/Chisinau"), ("Europe/Copenhagen", "Europe/Copenhagen"), ("Europe/Dublin", "Europe/Dublin"), ("Europe/Gibraltar", "Europe/Gibraltar"), ("Europe/Guernsey", "Europe/Guernsey"), ("Europe/Helsinki", "Europe/Helsinki"), ("Europe/Isle_of_Man", "Europe/Isle_of_Man"), ("Europe/Istanbul", "Europe/Istanbul"), ("Europe/Jersey", "Europe/Jersey"), ("Europe/Kaliningrad", "Europe/Kaliningrad"), ("Europe/Kiev", "Europe/Kiev"), ("Europe/Kirov", "Europe/Kirov"), ("Europe/Lisbon", "Europe/Lisbon"), ("Europe/Ljubljana", "Europe/Ljubljana"), ("Europe/London", "Europe/London"), ("Europe/Luxembourg", "Europe/Luxembourg"), ("Europe/Madrid", "Europe/Madrid"), ("Europe/Malta", "Europe/Malta"), ("Europe/Mariehamn", "Europe/Mariehamn"), ("Europe/Minsk", "Europe/Minsk"), ("Europe/Monaco", "Europe/Monaco"), ("Europe/Moscow", "Europe/Moscow"), ("Europe/Oslo", "Europe/Oslo"), ("Europe/Paris", "Europe/Paris"), ("Europe/Podgorica", "Europe/Podgorica"), ("Europe/Prague", "Europe/Prague"), ("Europe/Riga", "Europe/Riga"), ("Europe/Rome", "Europe/Rome"), ("Europe/Samara", "Europe/Samara"), ("Europe/San_Marino", "Europe/San_Marino"), ("Europe/Sarajevo", "Europe/Sarajevo"), ("Europe/Saratov", "Europe/Saratov"), ("Europe/Simferopol", "Europe/Simferopol"), ("Europe/Skopje", "Europe/Skopje"), ("Europe/Sofia", "Europe/Sofia"), ("Europe/Stockholm", "Europe/Stockholm"), ("Europe/Tallinn", "Europe/Tallinn"), ("Europe/Tirane", "Europe/Tirane"), ("Europe/Ulyanovsk", "Europe/Ulyanovsk"), ("Europe/Uzhgorod", "Europe/Uzhgorod"), ("Europe/Vaduz", "Europe/Vaduz"), ("Europe/Vatican", "Europe/Vatican"), ("Europe/Vienna", "Europe/Vienna"), ("Europe/Vilnius", "Europe/Vilnius"), ("Europe/Volgograd", "Europe/Volgograd"), ("Europe/Warsaw", "Europe/Warsaw"), ("Europe/Zagreb", "Europe/Zagreb"), ("Europe/Zaporozhye", "Europe/Zaporozhye"), ("Europe/Zurich", "Europe/Zurich"), ("GMT", "GMT"), ("Indian/Antananarivo", "Indian/Antananarivo"), ("Indian/Chagos", "Indian/Chagos"), ("Indian/Christmas", "Indian/Christmas"), ("Indian/Cocos", "Indian/Cocos"), ("Indian/Comoro", "Indian/Comoro"), ("Indian/Kerguelen", "Indian/Kerguelen"), ("Indian/Mahe", "Indian/Mahe"), ("Indian/Maldives", "Indian/Maldives"), ("Indian/Mauritius", "Indian/Mauritius"), ("Indian/Mayotte", "Indian/Mayotte"), ("Indian/Reunion", "Indian/Reunion"), ("Pacific/Apia", "Pacific/Apia"), ("Pacific/Auckland", "Pacific/Auckland"), ("Pacific/Bougainville", "Pacific/Bougainville"), ("Pacific/Chatham", "Pacific/Chatham"), ("Pacific/Chuuk", "Pacific/Chuuk"), ("Pacific/Easter", "Pacific/Easter"), ("Pacific/Efate", "Pacific/Efate"), ("Pacific/Enderbury", "Pacific/Enderbury"), ("Pacific/Fakaofo", "Pacific/Fakaofo"), ("Pacific/Fiji", "Pacific/Fiji"), ("Pacific/Funafuti", "Pacific/Funafuti"), ("Pacific/Galapagos", "Pacific/Galapagos"), ("Pacific/Gambier", "Pacific/Gambier"), ("Pacific/Guadalcanal", "Pacific/Guadalcanal"), ("Pacific/Guam", "Pacific/Guam"), ("Pacific/Honolulu", "Pacific/Honolulu"), ("Pacific/Kiritimati", "Pacific/Kiritimati"), ("Pacific/Kosrae", "Pacific/Kosrae"), ("Pacific/Kwajalein", "Pacific/Kwajalein"), ("Pacific/Majuro", "Pacific/Majuro"), ("Pacific/Marquesas", "Pacific/Marquesas"), ("Pacific/Midway", "Pacific/Midway"), ("Pacific/Nauru", "Pacific/Nauru"), ("Pacific/Niue", "Pacific/Niue"), ("Pacific/Norfolk", "Pacific/Norfolk"), ("Pacific/Noumea", "Pacific/Noumea"), ("Pacific/Pago_Pago", "Pacific/Pago_Pago"), ("Pacific/Palau", "Pacific/Palau"), ("Pacific/Pitcairn", "Pacific/Pitcairn"), ("Pacific/Pohnpei", "Pacific/Pohnpei"), ("Pacific/Port_Moresby", "Pacific/Port_Moresby"), ("Pacific/Rarotonga", "Pacific/Rarotonga"), ("Pacific/Saipan", "Pacific/Saipan"), ("Pacific/Tahiti", "Pacific/Tahiti"), ("Pacific/Tarawa", "Pacific/Tarawa"), ("Pacific/Tongatapu", "Pacific/Tongatapu"), ("Pacific/Wake", "Pacific/Wake"), ("Pacific/Wallis", "Pacific/Wallis"), ("US/Alaska", "US/Alaska"), ("US/Arizona", "US/Arizona"), ("US/Central", "US/Central"), ("US/Eastern", "US/Eastern"), ("US/Hawaii", "US/Hawaii"), ("US/Mountain", "US/Mountain"), ("US/Pacific", "US/Pacific"), ("UTC", "UTC"), ], default="UTC", max_length=80, null=True, ), ) ] ================================================ FILE: brutaldon/migrations/0020_auto_20190127_2159.py ================================================ # Generated by Django 2.1.5 on 2019-01-28 02:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0019_auto_20190124_0813")] operations = [ migrations.AlterField( model_name="account", name="note_seen", field=models.CharField(blank=True, max_length=128, null=True), ) ] ================================================ FILE: brutaldon/migrations/0021_client_version.py ================================================ # Generated by Django 2.1.5 on 2019-04-29 18:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0020_auto_20190127_2159")] operations = [ migrations.AddField( model_name="client", name="version", field=models.CharField(default="1.0", max_length=8), ) ] ================================================ FILE: brutaldon/migrations/0022_auto_20190506_0938.py ================================================ # Generated by Django 2.2.1 on 2019-05-06 13:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0021_client_version")] operations = [ migrations.AlterField( model_name="client", name="version", field=models.CharField(default="1.0", max_length=80), ) ] ================================================ FILE: brutaldon/migrations/0023_preference_bundle_notifications.py ================================================ # Generated by Django 2.2.7 on 2019-11-04 23:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("brutaldon", "0022_auto_20190506_0938")] operations = [ migrations.AddField( model_name="preference", name="bundle_notifications", field=models.BooleanField( default=False, help_text="Collapse together boosts or likes of the same toot in the notifications page.", ), ) ] ================================================ FILE: brutaldon/migrations/0024_auto_20200601_0945.py ================================================ # Generated by Django 3.0.6 on 2020-06-01 13:45 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("brutaldon", "0023_preference_bundle_notifications"), ] operations = [ migrations.AlterField( model_name="preference", name="timezone", field=models.CharField( blank=True, choices=[ ("Africa/Abidjan", "Africa/Abidjan"), ("Africa/Accra", "Africa/Accra"), ("Africa/Addis_Ababa", "Africa/Addis_Ababa"), ("Africa/Algiers", "Africa/Algiers"), ("Africa/Asmara", "Africa/Asmara"), ("Africa/Bamako", "Africa/Bamako"), ("Africa/Bangui", "Africa/Bangui"), ("Africa/Banjul", "Africa/Banjul"), ("Africa/Bissau", "Africa/Bissau"), ("Africa/Blantyre", "Africa/Blantyre"), ("Africa/Brazzaville", "Africa/Brazzaville"), ("Africa/Bujumbura", "Africa/Bujumbura"), ("Africa/Cairo", "Africa/Cairo"), ("Africa/Casablanca", "Africa/Casablanca"), ("Africa/Ceuta", "Africa/Ceuta"), ("Africa/Conakry", "Africa/Conakry"), ("Africa/Dakar", "Africa/Dakar"), ("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"), ("Africa/Djibouti", "Africa/Djibouti"), ("Africa/Douala", "Africa/Douala"), ("Africa/El_Aaiun", "Africa/El_Aaiun"), ("Africa/Freetown", "Africa/Freetown"), ("Africa/Gaborone", "Africa/Gaborone"), ("Africa/Harare", "Africa/Harare"), ("Africa/Johannesburg", "Africa/Johannesburg"), ("Africa/Juba", "Africa/Juba"), ("Africa/Kampala", "Africa/Kampala"), ("Africa/Khartoum", "Africa/Khartoum"), ("Africa/Kigali", "Africa/Kigali"), ("Africa/Kinshasa", "Africa/Kinshasa"), ("Africa/Lagos", "Africa/Lagos"), ("Africa/Libreville", "Africa/Libreville"), ("Africa/Lome", "Africa/Lome"), ("Africa/Luanda", "Africa/Luanda"), ("Africa/Lubumbashi", "Africa/Lubumbashi"), ("Africa/Lusaka", "Africa/Lusaka"), ("Africa/Malabo", "Africa/Malabo"), ("Africa/Maputo", "Africa/Maputo"), ("Africa/Maseru", "Africa/Maseru"), ("Africa/Mbabane", "Africa/Mbabane"), ("Africa/Mogadishu", "Africa/Mogadishu"), ("Africa/Monrovia", "Africa/Monrovia"), ("Africa/Nairobi", "Africa/Nairobi"), ("Africa/Ndjamena", "Africa/Ndjamena"), ("Africa/Niamey", "Africa/Niamey"), ("Africa/Nouakchott", "Africa/Nouakchott"), ("Africa/Ouagadougou", "Africa/Ouagadougou"), ("Africa/Porto-Novo", "Africa/Porto-Novo"), ("Africa/Sao_Tome", "Africa/Sao_Tome"), ("Africa/Tripoli", "Africa/Tripoli"), ("Africa/Tunis", "Africa/Tunis"), ("Africa/Windhoek", "Africa/Windhoek"), ("America/Adak", "America/Adak"), ("America/Anchorage", "America/Anchorage"), ("America/Anguilla", "America/Anguilla"), ("America/Antigua", "America/Antigua"), ("America/Araguaina", "America/Araguaina"), ( "America/Argentina/Buenos_Aires", "America/Argentina/Buenos_Aires", ), ("America/Argentina/Catamarca", "America/Argentina/Catamarca"), ("America/Argentina/Cordoba", "America/Argentina/Cordoba"), ("America/Argentina/Jujuy", "America/Argentina/Jujuy"), ("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"), ("America/Argentina/Mendoza", "America/Argentina/Mendoza"), ( "America/Argentina/Rio_Gallegos", "America/Argentina/Rio_Gallegos", ), ("America/Argentina/Salta", "America/Argentina/Salta"), ("America/Argentina/San_Juan", "America/Argentina/San_Juan"), ("America/Argentina/San_Luis", "America/Argentina/San_Luis"), ("America/Argentina/Tucuman", "America/Argentina/Tucuman"), ("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"), ("America/Aruba", "America/Aruba"), ("America/Asuncion", "America/Asuncion"), ("America/Atikokan", "America/Atikokan"), ("America/Bahia", "America/Bahia"), ("America/Bahia_Banderas", "America/Bahia_Banderas"), ("America/Barbados", "America/Barbados"), ("America/Belem", "America/Belem"), ("America/Belize", "America/Belize"), ("America/Blanc-Sablon", "America/Blanc-Sablon"), ("America/Boa_Vista", "America/Boa_Vista"), ("America/Bogota", "America/Bogota"), ("America/Boise", "America/Boise"), ("America/Cambridge_Bay", "America/Cambridge_Bay"), ("America/Campo_Grande", "America/Campo_Grande"), ("America/Cancun", "America/Cancun"), ("America/Caracas", "America/Caracas"), ("America/Cayenne", "America/Cayenne"), ("America/Cayman", "America/Cayman"), ("America/Chicago", "America/Chicago"), ("America/Chihuahua", "America/Chihuahua"), ("America/Costa_Rica", "America/Costa_Rica"), ("America/Creston", "America/Creston"), ("America/Cuiaba", "America/Cuiaba"), ("America/Curacao", "America/Curacao"), ("America/Danmarkshavn", "America/Danmarkshavn"), ("America/Dawson", "America/Dawson"), ("America/Dawson_Creek", "America/Dawson_Creek"), ("America/Denver", "America/Denver"), ("America/Detroit", "America/Detroit"), ("America/Dominica", "America/Dominica"), ("America/Edmonton", "America/Edmonton"), ("America/Eirunepe", "America/Eirunepe"), ("America/El_Salvador", "America/El_Salvador"), ("America/Fort_Nelson", "America/Fort_Nelson"), ("America/Fortaleza", "America/Fortaleza"), ("America/Glace_Bay", "America/Glace_Bay"), ("America/Goose_Bay", "America/Goose_Bay"), ("America/Grand_Turk", "America/Grand_Turk"), ("America/Grenada", "America/Grenada"), ("America/Guadeloupe", "America/Guadeloupe"), ("America/Guatemala", "America/Guatemala"), ("America/Guayaquil", "America/Guayaquil"), ("America/Guyana", "America/Guyana"), ("America/Halifax", "America/Halifax"), ("America/Havana", "America/Havana"), ("America/Hermosillo", "America/Hermosillo"), ("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"), ("America/Indiana/Knox", "America/Indiana/Knox"), ("America/Indiana/Marengo", "America/Indiana/Marengo"), ("America/Indiana/Petersburg", "America/Indiana/Petersburg"), ("America/Indiana/Tell_City", "America/Indiana/Tell_City"), ("America/Indiana/Vevay", "America/Indiana/Vevay"), ("America/Indiana/Vincennes", "America/Indiana/Vincennes"), ("America/Indiana/Winamac", "America/Indiana/Winamac"), ("America/Inuvik", "America/Inuvik"), ("America/Iqaluit", "America/Iqaluit"), ("America/Jamaica", "America/Jamaica"), ("America/Juneau", "America/Juneau"), ("America/Kentucky/Louisville", "America/Kentucky/Louisville"), ("America/Kentucky/Monticello", "America/Kentucky/Monticello"), ("America/Kralendijk", "America/Kralendijk"), ("America/La_Paz", "America/La_Paz"), ("America/Lima", "America/Lima"), ("America/Los_Angeles", "America/Los_Angeles"), ("America/Lower_Princes", "America/Lower_Princes"), ("America/Maceio", "America/Maceio"), ("America/Managua", "America/Managua"), ("America/Manaus", "America/Manaus"), ("America/Marigot", "America/Marigot"), ("America/Martinique", "America/Martinique"), ("America/Matamoros", "America/Matamoros"), ("America/Mazatlan", "America/Mazatlan"), ("America/Menominee", "America/Menominee"), ("America/Merida", "America/Merida"), ("America/Metlakatla", "America/Metlakatla"), ("America/Mexico_City", "America/Mexico_City"), ("America/Miquelon", "America/Miquelon"), ("America/Moncton", "America/Moncton"), ("America/Monterrey", "America/Monterrey"), ("America/Montevideo", "America/Montevideo"), ("America/Montserrat", "America/Montserrat"), ("America/Nassau", "America/Nassau"), ("America/New_York", "America/New_York"), ("America/Nipigon", "America/Nipigon"), ("America/Nome", "America/Nome"), ("America/Noronha", "America/Noronha"), ("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"), ("America/North_Dakota/Center", "America/North_Dakota/Center"), ( "America/North_Dakota/New_Salem", "America/North_Dakota/New_Salem", ), ("America/Nuuk", "America/Nuuk"), ("America/Ojinaga", "America/Ojinaga"), ("America/Panama", "America/Panama"), ("America/Pangnirtung", "America/Pangnirtung"), ("America/Paramaribo", "America/Paramaribo"), ("America/Phoenix", "America/Phoenix"), ("America/Port-au-Prince", "America/Port-au-Prince"), ("America/Port_of_Spain", "America/Port_of_Spain"), ("America/Porto_Velho", "America/Porto_Velho"), ("America/Puerto_Rico", "America/Puerto_Rico"), ("America/Punta_Arenas", "America/Punta_Arenas"), ("America/Rainy_River", "America/Rainy_River"), ("America/Rankin_Inlet", "America/Rankin_Inlet"), ("America/Recife", "America/Recife"), ("America/Regina", "America/Regina"), ("America/Resolute", "America/Resolute"), ("America/Rio_Branco", "America/Rio_Branco"), ("America/Santarem", "America/Santarem"), ("America/Santiago", "America/Santiago"), ("America/Santo_Domingo", "America/Santo_Domingo"), ("America/Sao_Paulo", "America/Sao_Paulo"), ("America/Scoresbysund", "America/Scoresbysund"), ("America/Sitka", "America/Sitka"), ("America/St_Barthelemy", "America/St_Barthelemy"), ("America/St_Johns", "America/St_Johns"), ("America/St_Kitts", "America/St_Kitts"), ("America/St_Lucia", "America/St_Lucia"), ("America/St_Thomas", "America/St_Thomas"), ("America/St_Vincent", "America/St_Vincent"), ("America/Swift_Current", "America/Swift_Current"), ("America/Tegucigalpa", "America/Tegucigalpa"), ("America/Thule", "America/Thule"), ("America/Thunder_Bay", "America/Thunder_Bay"), ("America/Tijuana", "America/Tijuana"), ("America/Toronto", "America/Toronto"), ("America/Tortola", "America/Tortola"), ("America/Vancouver", "America/Vancouver"), ("America/Whitehorse", "America/Whitehorse"), ("America/Winnipeg", "America/Winnipeg"), ("America/Yakutat", "America/Yakutat"), ("America/Yellowknife", "America/Yellowknife"), ("Antarctica/Casey", "Antarctica/Casey"), ("Antarctica/Davis", "Antarctica/Davis"), ("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"), ("Antarctica/Macquarie", "Antarctica/Macquarie"), ("Antarctica/Mawson", "Antarctica/Mawson"), ("Antarctica/McMurdo", "Antarctica/McMurdo"), ("Antarctica/Palmer", "Antarctica/Palmer"), ("Antarctica/Rothera", "Antarctica/Rothera"), ("Antarctica/Syowa", "Antarctica/Syowa"), ("Antarctica/Troll", "Antarctica/Troll"), ("Antarctica/Vostok", "Antarctica/Vostok"), ("Arctic/Longyearbyen", "Arctic/Longyearbyen"), ("Asia/Aden", "Asia/Aden"), ("Asia/Almaty", "Asia/Almaty"), ("Asia/Amman", "Asia/Amman"), ("Asia/Anadyr", "Asia/Anadyr"), ("Asia/Aqtau", "Asia/Aqtau"), ("Asia/Aqtobe", "Asia/Aqtobe"), ("Asia/Ashgabat", "Asia/Ashgabat"), ("Asia/Atyrau", "Asia/Atyrau"), ("Asia/Baghdad", "Asia/Baghdad"), ("Asia/Bahrain", "Asia/Bahrain"), ("Asia/Baku", "Asia/Baku"), ("Asia/Bangkok", "Asia/Bangkok"), ("Asia/Barnaul", "Asia/Barnaul"), ("Asia/Beirut", "Asia/Beirut"), ("Asia/Bishkek", "Asia/Bishkek"), ("Asia/Brunei", "Asia/Brunei"), ("Asia/Chita", "Asia/Chita"), ("Asia/Choibalsan", "Asia/Choibalsan"), ("Asia/Colombo", "Asia/Colombo"), ("Asia/Damascus", "Asia/Damascus"), ("Asia/Dhaka", "Asia/Dhaka"), ("Asia/Dili", "Asia/Dili"), ("Asia/Dubai", "Asia/Dubai"), ("Asia/Dushanbe", "Asia/Dushanbe"), ("Asia/Famagusta", "Asia/Famagusta"), ("Asia/Gaza", "Asia/Gaza"), ("Asia/Hebron", "Asia/Hebron"), ("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"), ("Asia/Hong_Kong", "Asia/Hong_Kong"), ("Asia/Hovd", "Asia/Hovd"), ("Asia/Irkutsk", "Asia/Irkutsk"), ("Asia/Jakarta", "Asia/Jakarta"), ("Asia/Jayapura", "Asia/Jayapura"), ("Asia/Jerusalem", "Asia/Jerusalem"), ("Asia/Kabul", "Asia/Kabul"), ("Asia/Kamchatka", "Asia/Kamchatka"), ("Asia/Karachi", "Asia/Karachi"), ("Asia/Kathmandu", "Asia/Kathmandu"), ("Asia/Khandyga", "Asia/Khandyga"), ("Asia/Kolkata", "Asia/Kolkata"), ("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"), ("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"), ("Asia/Kuching", "Asia/Kuching"), ("Asia/Kuwait", "Asia/Kuwait"), ("Asia/Macau", "Asia/Macau"), ("Asia/Magadan", "Asia/Magadan"), ("Asia/Makassar", "Asia/Makassar"), ("Asia/Manila", "Asia/Manila"), ("Asia/Muscat", "Asia/Muscat"), ("Asia/Nicosia", "Asia/Nicosia"), ("Asia/Novokuznetsk", "Asia/Novokuznetsk"), ("Asia/Novosibirsk", "Asia/Novosibirsk"), ("Asia/Omsk", "Asia/Omsk"), ("Asia/Oral", "Asia/Oral"), ("Asia/Phnom_Penh", "Asia/Phnom_Penh"), ("Asia/Pontianak", "Asia/Pontianak"), ("Asia/Pyongyang", "Asia/Pyongyang"), ("Asia/Qatar", "Asia/Qatar"), ("Asia/Qostanay", "Asia/Qostanay"), ("Asia/Qyzylorda", "Asia/Qyzylorda"), ("Asia/Riyadh", "Asia/Riyadh"), ("Asia/Sakhalin", "Asia/Sakhalin"), ("Asia/Samarkand", "Asia/Samarkand"), ("Asia/Seoul", "Asia/Seoul"), ("Asia/Shanghai", "Asia/Shanghai"), ("Asia/Singapore", "Asia/Singapore"), ("Asia/Srednekolymsk", "Asia/Srednekolymsk"), ("Asia/Taipei", "Asia/Taipei"), ("Asia/Tashkent", "Asia/Tashkent"), ("Asia/Tbilisi", "Asia/Tbilisi"), ("Asia/Tehran", "Asia/Tehran"), ("Asia/Thimphu", "Asia/Thimphu"), ("Asia/Tokyo", "Asia/Tokyo"), ("Asia/Tomsk", "Asia/Tomsk"), ("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"), ("Asia/Urumqi", "Asia/Urumqi"), ("Asia/Ust-Nera", "Asia/Ust-Nera"), ("Asia/Vientiane", "Asia/Vientiane"), ("Asia/Vladivostok", "Asia/Vladivostok"), ("Asia/Yakutsk", "Asia/Yakutsk"), ("Asia/Yangon", "Asia/Yangon"), ("Asia/Yekaterinburg", "Asia/Yekaterinburg"), ("Asia/Yerevan", "Asia/Yerevan"), ("Atlantic/Azores", "Atlantic/Azores"), ("Atlantic/Bermuda", "Atlantic/Bermuda"), ("Atlantic/Canary", "Atlantic/Canary"), ("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"), ("Atlantic/Faroe", "Atlantic/Faroe"), ("Atlantic/Madeira", "Atlantic/Madeira"), ("Atlantic/Reykjavik", "Atlantic/Reykjavik"), ("Atlantic/South_Georgia", "Atlantic/South_Georgia"), ("Atlantic/St_Helena", "Atlantic/St_Helena"), ("Atlantic/Stanley", "Atlantic/Stanley"), ("Australia/Adelaide", "Australia/Adelaide"), ("Australia/Brisbane", "Australia/Brisbane"), ("Australia/Broken_Hill", "Australia/Broken_Hill"), ("Australia/Currie", "Australia/Currie"), ("Australia/Darwin", "Australia/Darwin"), ("Australia/Eucla", "Australia/Eucla"), ("Australia/Hobart", "Australia/Hobart"), ("Australia/Lindeman", "Australia/Lindeman"), ("Australia/Lord_Howe", "Australia/Lord_Howe"), ("Australia/Melbourne", "Australia/Melbourne"), ("Australia/Perth", "Australia/Perth"), ("Australia/Sydney", "Australia/Sydney"), ("Canada/Atlantic", "Canada/Atlantic"), ("Canada/Central", "Canada/Central"), ("Canada/Eastern", "Canada/Eastern"), ("Canada/Mountain", "Canada/Mountain"), ("Canada/Newfoundland", "Canada/Newfoundland"), ("Canada/Pacific", "Canada/Pacific"), ("Europe/Amsterdam", "Europe/Amsterdam"), ("Europe/Andorra", "Europe/Andorra"), ("Europe/Astrakhan", "Europe/Astrakhan"), ("Europe/Athens", "Europe/Athens"), ("Europe/Belgrade", "Europe/Belgrade"), ("Europe/Berlin", "Europe/Berlin"), ("Europe/Bratislava", "Europe/Bratislava"), ("Europe/Brussels", "Europe/Brussels"), ("Europe/Bucharest", "Europe/Bucharest"), ("Europe/Budapest", "Europe/Budapest"), ("Europe/Busingen", "Europe/Busingen"), ("Europe/Chisinau", "Europe/Chisinau"), ("Europe/Copenhagen", "Europe/Copenhagen"), ("Europe/Dublin", "Europe/Dublin"), ("Europe/Gibraltar", "Europe/Gibraltar"), ("Europe/Guernsey", "Europe/Guernsey"), ("Europe/Helsinki", "Europe/Helsinki"), ("Europe/Isle_of_Man", "Europe/Isle_of_Man"), ("Europe/Istanbul", "Europe/Istanbul"), ("Europe/Jersey", "Europe/Jersey"), ("Europe/Kaliningrad", "Europe/Kaliningrad"), ("Europe/Kiev", "Europe/Kiev"), ("Europe/Kirov", "Europe/Kirov"), ("Europe/Lisbon", "Europe/Lisbon"), ("Europe/Ljubljana", "Europe/Ljubljana"), ("Europe/London", "Europe/London"), ("Europe/Luxembourg", "Europe/Luxembourg"), ("Europe/Madrid", "Europe/Madrid"), ("Europe/Malta", "Europe/Malta"), ("Europe/Mariehamn", "Europe/Mariehamn"), ("Europe/Minsk", "Europe/Minsk"), ("Europe/Monaco", "Europe/Monaco"), ("Europe/Moscow", "Europe/Moscow"), ("Europe/Oslo", "Europe/Oslo"), ("Europe/Paris", "Europe/Paris"), ("Europe/Podgorica", "Europe/Podgorica"), ("Europe/Prague", "Europe/Prague"), ("Europe/Riga", "Europe/Riga"), ("Europe/Rome", "Europe/Rome"), ("Europe/Samara", "Europe/Samara"), ("Europe/San_Marino", "Europe/San_Marino"), ("Europe/Sarajevo", "Europe/Sarajevo"), ("Europe/Saratov", "Europe/Saratov"), ("Europe/Simferopol", "Europe/Simferopol"), ("Europe/Skopje", "Europe/Skopje"), ("Europe/Sofia", "Europe/Sofia"), ("Europe/Stockholm", "Europe/Stockholm"), ("Europe/Tallinn", "Europe/Tallinn"), ("Europe/Tirane", "Europe/Tirane"), ("Europe/Ulyanovsk", "Europe/Ulyanovsk"), ("Europe/Uzhgorod", "Europe/Uzhgorod"), ("Europe/Vaduz", "Europe/Vaduz"), ("Europe/Vatican", "Europe/Vatican"), ("Europe/Vienna", "Europe/Vienna"), ("Europe/Vilnius", "Europe/Vilnius"), ("Europe/Volgograd", "Europe/Volgograd"), ("Europe/Warsaw", "Europe/Warsaw"), ("Europe/Zagreb", "Europe/Zagreb"), ("Europe/Zaporozhye", "Europe/Zaporozhye"), ("Europe/Zurich", "Europe/Zurich"), ("GMT", "GMT"), ("Indian/Antananarivo", "Indian/Antananarivo"), ("Indian/Chagos", "Indian/Chagos"), ("Indian/Christmas", "Indian/Christmas"), ("Indian/Cocos", "Indian/Cocos"), ("Indian/Comoro", "Indian/Comoro"), ("Indian/Kerguelen", "Indian/Kerguelen"), ("Indian/Mahe", "Indian/Mahe"), ("Indian/Maldives", "Indian/Maldives"), ("Indian/Mauritius", "Indian/Mauritius"), ("Indian/Mayotte", "Indian/Mayotte"), ("Indian/Reunion", "Indian/Reunion"), ("Pacific/Apia", "Pacific/Apia"), ("Pacific/Auckland", "Pacific/Auckland"), ("Pacific/Bougainville", "Pacific/Bougainville"), ("Pacific/Chatham", "Pacific/Chatham"), ("Pacific/Chuuk", "Pacific/Chuuk"), ("Pacific/Easter", "Pacific/Easter"), ("Pacific/Efate", "Pacific/Efate"), ("Pacific/Enderbury", "Pacific/Enderbury"), ("Pacific/Fakaofo", "Pacific/Fakaofo"), ("Pacific/Fiji", "Pacific/Fiji"), ("Pacific/Funafuti", "Pacific/Funafuti"), ("Pacific/Galapagos", "Pacific/Galapagos"), ("Pacific/Gambier", "Pacific/Gambier"), ("Pacific/Guadalcanal", "Pacific/Guadalcanal"), ("Pacific/Guam", "Pacific/Guam"), ("Pacific/Honolulu", "Pacific/Honolulu"), ("Pacific/Kiritimati", "Pacific/Kiritimati"), ("Pacific/Kosrae", "Pacific/Kosrae"), ("Pacific/Kwajalein", "Pacific/Kwajalein"), ("Pacific/Majuro", "Pacific/Majuro"), ("Pacific/Marquesas", "Pacific/Marquesas"), ("Pacific/Midway", "Pacific/Midway"), ("Pacific/Nauru", "Pacific/Nauru"), ("Pacific/Niue", "Pacific/Niue"), ("Pacific/Norfolk", "Pacific/Norfolk"), ("Pacific/Noumea", "Pacific/Noumea"), ("Pacific/Pago_Pago", "Pacific/Pago_Pago"), ("Pacific/Palau", "Pacific/Palau"), ("Pacific/Pitcairn", "Pacific/Pitcairn"), ("Pacific/Pohnpei", "Pacific/Pohnpei"), ("Pacific/Port_Moresby", "Pacific/Port_Moresby"), ("Pacific/Rarotonga", "Pacific/Rarotonga"), ("Pacific/Saipan", "Pacific/Saipan"), ("Pacific/Tahiti", "Pacific/Tahiti"), ("Pacific/Tarawa", "Pacific/Tarawa"), ("Pacific/Tongatapu", "Pacific/Tongatapu"), ("Pacific/Wake", "Pacific/Wake"), ("Pacific/Wallis", "Pacific/Wallis"), ("US/Alaska", "US/Alaska"), ("US/Arizona", "US/Arizona"), ("US/Central", "US/Central"), ("US/Eastern", "US/Eastern"), ("US/Hawaii", "US/Hawaii"), ("US/Mountain", "US/Mountain"), ("US/Pacific", "US/Pacific"), ("UTC", "UTC"), ], default="UTC", max_length=80, null=True, ), ), ] ================================================ FILE: brutaldon/migrations/0025_preference_preview_sensitive.py ================================================ # Generated by Django 3.0.6 on 2020-06-01 14:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("brutaldon", "0024_auto_20200601_0945"), ] operations = [ migrations.AddField( model_name="preference", name="preview_sensitive", field=models.BooleanField( default=False, help_text='Show preview for media marked as "sensitive"' ), ), ] ================================================ FILE: brutaldon/migrations/__init__.py ================================================ ================================================ FILE: brutaldon/models.py ================================================ from django.db import models from django.conf import settings from django.utils.translation import gettext as _ from pytz import common_timezones timezones = [(tz, tz) for tz in common_timezones] class Client(models.Model): name = models.CharField(default="brutaldon", max_length=80) api_base_id = models.URLField(default="https://mastodon.social") version = models.CharField(default="1.0", max_length=80) client_id = models.CharField(null=True, blank=True, max_length=2048) client_secret = models.CharField(null=True, blank=True, max_length=2048) def __str__(self): return self.name + ": " + self.api_base_id class Theme(models.Model): name = models.CharField(max_length=80, unique=True) prefix = models.CharField(max_length=40, null=True, default="default") main_css = models.CharField( max_length=1024, blank=True, null=True, default="css/fullbrutalism.css" ) tweaks_css = models.CharField(max_length=1024, blank=True, null=True) is_brutalist = models.BooleanField(default=False) def __str__(self): return self.name from django.db.models.fields.related_descriptors import ForeignKeyDeferredAttribute def set_fields(klass): fields = [] for n in dir(klass): assert n != "_fields" v = getattr(klass, n) if not hasattr(v, "field"): continue if not isinstance(v.field, models.Field): continue if isinstance(v, ForeignKeyDeferredAttribute): continue fields.append(n) setattr(klass, "_fields", fields) return klass @set_fields class Preference(models.Model): theme = models.ForeignKey(Theme, models.CASCADE, null=False, default=1) filter_replies = models.BooleanField(default=False) filter_boosts = models.BooleanField(default=False) timezone = models.CharField( max_length=80, blank=True, null=True, choices=timezones, default="UTC" ) preview_sensitive = models.BooleanField( default=False, help_text=_('Show preview for media marked as "sensitive"') ) no_javascript = models.BooleanField( default=False, help_text=_( """Disable all JavaScript. Overrides all other JavaScript options.""" ), ) notifications = models.BooleanField( default=True, help_text=_("""Display live notifications in header.""") ) click_to_load = models.BooleanField( default=False, help_text=_( """Click to load more toots in the same page, rather than using pagination.""" ), ) lightbox = models.BooleanField( default=False, help_text=_("""Use a JavaScript lightbox to display media.""") ) poll_frequency = models.IntegerField( default=300, help_text=_( """Number of seconds to wait between checking notifications. Default: 300""" ), ) filter_notifications = models.BooleanField( default=False, help_text=_("""Exclude boosts and favs from your notifications."""), ) bundle_notifications = models.BooleanField( default=False, help_text=_( """Collapse together boosts or likes of the same toot in the notifications page.""" ), ) class Account(models.Model): username = models.EmailField(unique=True) email = models.EmailField(null=True, blank=True) django_user = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE, null=True) access_token = models.CharField(null=True, blank=True, max_length=2048) client = models.ForeignKey(Client, models.SET_NULL, null=True) preferences = models.ForeignKey(Preference, models.SET_NULL, null=True) note_seen = models.CharField(null=True, blank=True, max_length=128) ================================================ FILE: brutaldon/settings.py ================================================ """ Django settings for brutaldon project. Generated by 'django-admin startproject' using Django 2.0.1. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = "6lq9!52j^)=m89))umaphx9ac%)b$k^gs%x1rkk^v^$u9zjz$@" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", "widget_tweaks", "sanitizer", "django.contrib.humanize", "brutaldon", ] MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "brutaldon.middleware.timezone.TimezoneMiddleware", ] ROOT_URLCONF = "brutaldon.urls" TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [], "APP_DIRS": True, "OPTIONS": { "context_processors": [ "django.template.context_processors.debug", "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", "brutaldon.context_processors.bookmarklet_url", ] }, } ] WSGI_APPLICATION = "brutaldon.wsgi.application" # Database # https://docs.djangoproject.com/en/2.0/ref/settings/#databases DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"), } } # Password validation # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" }, {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, ] LOGGING = { "version": 1, "disable_existing_loggers": False, "filters": { "require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}, "require_debug_true": {"()": "django.utils.log.RequireDebugTrue"}, }, "formatters": { "django.server": { "()": "django.utils.log.ServerFormatter", "format": "[%(server_time)s] %(message)s", } }, "handlers": { "console": { "level": "INFO", "filters": ["require_debug_true"], "class": "logging.StreamHandler", }, "console_debug_false": { "level": "ERROR", "filters": ["require_debug_false"], "class": "logging.StreamHandler", }, "django.server": { "level": "INFO", "class": "logging.StreamHandler", "formatter": "django.server", }, "mail_admins": { "level": "ERROR", "filters": ["require_debug_false"], "class": "django.utils.log.AdminEmailHandler", }, }, "loggers": { "django": { "handlers": ["console", "console_debug_false", "mail_admins"], "level": "INFO", }, "django.server": { "handlers": ["django.server"], "level": "INFO", "propagate": False, }, }, } # Internationalization # https://docs.djangoproject.com/en/2.0/topics/i18n/ LANGUAGE_CODE = "en-us" TIME_ZONE = "America/New_York" USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = "/static/" STATIC_ROOT = os.path.join(BASE_DIR, "static") # Sanitizer settings SANITIZER_ALLOWED_TAGS = [ "a", "p", "img", "br", "i", "strong", "em", "pre", "code", "ul", "li", "ol", "blockquote", "del", "span", "u", ] SANITIZER_ALLOWED_ATTRIBUTES = ["href", "src", "title", "alt", "class", "lang"] # File upload settings. # Important: media will not work if you change this. FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"] # Session serialization # Important: whatever you choose has to be able to serialize DateTime, so not JSON. SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" # URL to redirect users to when not logged in ANONYMOUS_HOME_URL = "about" # URL to redirect galaxy brain users to RICKROLL_URL = "https://invidio.us/watch?v=dQw4w9WgXcQ" # Function to check if trying to add an account should trigger a special response def CHECK_INSTANCE_URL(url, redirect): if "gab.com" in url: return redirect(RICKROLL_URL) elif "shitposter.club" in url: return redirect(RICKROLL_URL) # Version number displayed on about page BRUTALDON_VERSION = "2.15.0" ================================================ FILE: brutaldon/static/css/brutaldon-dark.css ================================================ body.has-navbar-fixed-top { padding-top: 48px; } body > section > div.container { max-width: 100%; } .reblog-icon { position: relative; top: -24px; left: 40px; } img.fav-avatar { display: inline; } .media-content { padding: 1.25ex; } .is-max-128 img, .is-max-192 img, .is-max-256 img { bottom: 0; left: 0; position: absolute; right:0; top: 0; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .is-max-192 { max-height: 192px; max-width: 192px; } figure.media-left p.image a img { border-radius: 5px; } img.avatar { border-radius: 5px; } .active-context { background-color: #444; } h2.subtitle { margin-top: 2rem; margin-bottom: 1rem; } article.media.user-info .content img { max-height: 1.5rem; max-width: 1.5rem; } span.account-locked { margin-top: 48px; margin-left: -16px; } .errorlist { color: #FF0000; } .emoji-box { padding: .75rem; background-color: #444; border: 1px solid #ccc; border-radius: 5px; } img.emoji { display: inline; max-height: 1.5em; max-width: 1.5em; vertical-align: text-bottom; } emoji-link { font-size: 2em; } .content figure.attachment-image { text-align:left; margin-left: 0; margin-right: 0; } @media screen and (max-width: 768px) { .media { display: block; } } .level.attachments { overflow: auto; } .file-cta { -webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 0; -webkit-border-top-right-radius: 0; -moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 0; -moz-border-radius-topright: 0; border-top-left-radius: 5px; border-bottom-left-radius: 5px; border-bottom-right-radius: 0; border-top-right-radius: 0; height: 38px; } #page-load-indicator { width: 100%; opacity: 0.8; position: fixed; top: 0; left: 0; z-index: 666; transition: all 500ms; height: 2px; overflow: hidden; background-color: #ddd; display: none; } #page-load-indicator:before{ display: block; position: absolute; content: ""; left: -200px; width: 200px; height: 4px; background-color: #888; animation: page-loading 1.5s linear infinite; } @keyframes page-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;} } #status_count { margin-left: 90%; margin-top: 1rem; background-color: #888; color: #FFF; float: right; padding: 0.5ex; border-radius: 5px; min-height: 1.5rem; min-width: 1.5rem; font-size: 0.8em; text-align: right; } #before-main { width: 100%; height: 2em; background-color: #888; color: #444; margin-top: 12px; padding: 0; } #before-main span { margin-left: 50%; } input#id_poll_frequency { max-width: 10em; } .card { margin-top: 1em; margin: 0, auto; max-width: 90%; } #username_autocomplete { height: 0; } .media-content .content a:not(.mention) { text-decoration-line: underline; text-decoration-style: dotted; } .media-content a.level-item { text-decoration: none; } a.navbar-item span:nth-child(2):before { content: " "; } div.poll { margin-bottom: 1ex; margin-top: 1em; max-width: 90%; } /* Fix some rules that don't need to be there */ .content figure:not(:last-child) { margin-bottom: 0; } .content figure:not(:first-child) { margin-top: 0; } .input, .textarea { color: inherit; background-color: inherit; } input[type="text"] { color: inherit; background-color: inherit; } ================================================ FILE: brutaldon/static/css/brutaldon-material.css ================================================ body > section > div.container { max-width: 100%; } .reblog-icon { position: relative; top: -24px; left: 40px; } img.fav-avatar { display: inline; } .media-content { padding: 1.25ex; } .is-max-128 img, .is-max-192 img, .is-max-256 img { bottom: 0; left: 0; position: absolute; right:0; top: 0; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .is-max-192 { max-height: 192px; max-width: 192px; } figure.media-left p.image a img { border-radius: 5px; } img.avatar { border-radius: 5px; } .active-context { background-color: #FFF8DC; } h2.subtitle { margin-top: 2rem; margin-bottom: 1rem; } article.media.user-info .content img { max-height: 1.5rem; max-width: 1.5rem; } span.account-locked { margin-top: 48px; margin-left: -16px; } .errorlist { color: #FF0000; } .emoji-box { padding: .75rem; background-color: #FCFCFC; border: 1px solid #CCC; border-radius: 5px; } img.emoji { display: inline; max-height: 1.5em; max-width: 1.5em; vertical-align: text-bottom; } emoji-link { font-size: 2em; } .content figure.attachment-image { text-align:left; margin-left: 0; margin-right: 0; } @media screen and (max-width: 768px) { .media { display: block; } } #page-load-indicator { width: 100%; opacity: 0.8; position: fixed; top: 0; left: 0; z-index: 666; transition: all 500ms; height: 2px; overflow: hidden; background-color: #ddd; display: none; } #page-load-indicator:before{ display: block; position: absolute; content: ""; left: -200px; width: 200px; height: 4px; background-color: #888; animation: page-loading 1.5s linear infinite; } @keyframes page-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;} } #status_count { margin-left: 90%; margin-top: 1rem; background-color: #888; color: #FFF; float: right; padding: 0.5ex; border-radius: 5px; min-height: 1.5rem; min-width: 1.5rem; font-size: 0.8em; text-align: right; } #before-main { width: 100%; height: 2em; background-color: #DEDEDE; color: white; margin-top: 0; padding: 0; } #before-main span { margin-left: 50%; } input#id_poll_frequency { max-width: 10em; } body.has-navbar-fixed-top, html.has-navbar-fixed-top { padding-top: 5rem; } .card { margin-top: 1em; margin: 0, auto; max-width: 90%; } #username_autocomplete { height: 0; } .media-content .content a:not(.mention) { text-decoration-line: underline; text-decoration-style: dotted; } .media-content a.level-item { text-decoration: none; } a.navbar-item span:nth-child(2):before { content: " "; } div.poll { margin-bottom: 1ex; margin-top: 1em; max-width: 90%; } /* Fix some rules that don't need to be there */ .content figure:not(:last-child) { margin-bottom: 0; } .content figure:not(:first-child) { margin-top: 0; } ================================================ FILE: brutaldon/static/css/brutaldon.css ================================================ body > section > div.container { max-width: 100%; } .reblog-icon { position: relative; top: -24px; left: 40px; } img.fav-avatar { display: inline; } .media-content { padding: 1.25ex; } .is-max-128 img, .is-max-192 img, .is-max-256 img { bottom: 0; left: 0; position: absolute; right:0; top: 0; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .is-max-192 { max-height: 192px; max-width: 192px; } figure.media-left p.image a img { border-radius: 5px; } img.avatar { border-radius: 5px; } .active-context { background-color: #FFF8DC; } h2.subtitle { margin-top: 2rem; margin-bottom: 1rem; } article.media.user-info .content img { max-height: 1.5rem; max-width: 1.5rem; } span.account-locked { margin-top: 48px; margin-left: -16px; } .errorlist { color: #FF0000; } .emoji-box { padding: .75rem; background-color: #FCFCFC; border: 1px solid #CCC; border-radius: 5px; } img.emoji { display: inline; max-height: 1.5em; max-width: 1.5em; vertical-align: text-bottom; } emoji-link { font-size: 2em; } .content figure.attachment-image { text-align:left; margin-left: 0; margin-right: 0; } @media screen and (max-width: 768px) { .media { display: block; } } #page-load-indicator { width: 100%; opacity: 0.8; position: fixed; top: 0; left: 0; z-index: 666; transition: all 500ms; height: 2px; overflow: hidden; background-color: #ddd; display: none; } #page-load-indicator:before{ display: block; position: absolute; content: ""; left: -200px; width: 200px; height: 4px; background-color: #888; animation: page-loading 1.5s linear infinite; } @keyframes page-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;} } #status_count { margin-left: 90%; margin-top: 1rem; background-color: #888; color: #FFF; float: right; padding: 0.5ex; border-radius: 5px; min-height: 1.5rem; min-width: 1.5rem; font-size: 0.8em; text-align: right; } #before-main { width: 100%; height: 2em; background-color: #DEDEDE; color: white; margin-top: 0; padding: 0; } #before-main span { margin-left: 50%; } input#id_poll_frequency { max-width: 10em; } body.has-navbar-fixed-top, html.has-navbar-fixed-top { padding-top: 5rem; } .card { margin-top: 1em; margin: 0, auto; max-width: 90%; } #username_autocomplete { height: 0; } .media-content .content a:not(.mention) { text-decoration-line: underline; text-decoration-style: dotted; } .media-content a.level-item { text-decoration: none; } a.navbar-item span:nth-child(2):before { content: " "; } div.poll { margin-bottom: 1ex; margin-top: 1em; max-width: 90%; } /* Fix some rules that don't need to be there */ .content figure:not(:last-child) { margin-bottom: 0; } .content figure:not(:first-child) { margin-top: 0; } ================================================ FILE: brutaldon/static/css/brutstrap-tweaks.css ================================================ /* Tweaks to make brutstrap work with brutaldon's existing html */ /* Re-implemented brutstrap features for brutaldon's html structure */ nav { display: flex; } nav .navbar-menu, nav .navbar-brand { display: flex; margin: 0.2em; padding: 0; padding-bottom: 0.1em; } nav .navbar-item { display: inline; text-align: center; padding: 0 0.5em; } article /* As brutstrap's section */ { border-bottom: 0.1em solid #444; margin-top: 0.25em; margin-bottom: 1em; } article + hr /* Now redundant */ { display: none; } /* Bulma styles re-implemented for compatibility */ img.is-32x32 { float: left; max-width: 512px; max-height: auto; margin: 4px; } .level { clear: both; } .title { font-size: 3ex; font-weight: bold; margin-top: 1ex; margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; margin-top: 0.25ex; margin-bottom: 0.25ex; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 img, .is-max-256 img { display: block; clear: both; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } img.emoji { display: inline; max-height: 1.5rem; max-width: 1.5rem; vertical-align: text-bottom; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { z-index: 60; background-color: #CCC; color: #000; padding: 1em; border: 0.2em solid #444; max-height: 90vh; overflow: auto; } .modal.is-active { display: flex; } .card { padding: 1em; margin-top: 1em; border: 0.2em solid black; } .card-header { padding-bottom: 1em; border-bottom: 0.2em solid black; } .card-image { padding: 1em; margin 0, auto; } .button { border: 0.2em solid #444; display: inline; padding: 0.4em; } /* Fscking levels */ .level { align-items: center; justify-content: space-between; display:flex; flex-wrap: wrap; } .level.is-mobile { display: flex; } .level.is-mobile .level-left, .level.is-mobile .level-right { display: flex; } .level.is-mobile .level-item { margin-right: 0.75rem; } .level code { border-radius: 4px; } .level img { display: inline-block; vertical-align: top; } .level-item { align-items: center; display: flex; flex-basis: auto; flex-grow: 0; flex-shrink: 0; justify-content: center; } .level-item .title, .level-item .subtitle { margin-bottom: 0; } .level-left, .level-right { flex-basis: auto; flex-grow: 0; flex-shrink: 0; } .level-left { align-items: center; justify-content: flex-start; } .level-right { align-items: center; justify-content: flex-end; } .media { align-items: flex-start; display: flex; text-align: left; } #username_autocomplete div.tooltip::after { content: attr(data-tooltip); font-size: 0.6em; margin-left: 1em; margin-right: 1em; border: 1pt solid #444; background-color: #FFF; padding: 0.2em; } /* Remaining brutaldon-specific tweaks */ body { /* brutstrap's default font-size is fine for full-text web pages, but too big for this purpose. */ font-size: 1em; } input, textarea { font-family: sans-serif; } textarea { width: 100%; } input#id_spoiler_text { width: 100%; } .media-content { margin-bottom: 1em; } .reblog-icon { position: relative; top: -24px; left: 40px; } img.fav-avatar { display: inline; } #status_count { margin-left: 90%; margin-top: 1rem; background-color: #888; color: #FFF; float: right; padding: 0.5ex; border-radius: 5px; min-height: 1.5rem; min-width: 1.5rem; font-size: 0.8em; text-align: right; } #username_autocomplete { height: 0; } .attachments figure { border: 0.2ex solid #444; max-width: 256px; padding: 1em; } figure.level-item > video { max-height: 256px; max-width: 256px; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0.25em; border: 1px solid #444; } td.empty-cell, th.empty-cell { border: none; } @media screen and (max-width: 768px) { .box { max-width: 90%; } .media { display: block; } .media-left { float: left; } .media-content .content p { clear: inline-end; } } @media screen and (min-width: 1024px) { .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } ================================================ FILE: brutaldon/static/css/brutstrap.css ================================================ /* Components */ body { position: relative; background-color: #eee; color: #444; font-family: serif; margin: 0 auto; padding-bottom: 6rem; min-height: 100%; font-size: 1.4em; } header { font-family: sans-serif; text-align: center; width: 100%; overflow: hidden; border-bottom: 0.5rem dashed #444; } main { width: 75vw; max-width: 40em; margin: 0 auto; line-height: 1.6; margin-bottom: 8rem; } footer { padding: 1em 0; position: absolute; right: 0; bottom: 0; left: 0; border-top: 0.25em dashed #444; } nav ul { list-style-type: none; margin: 0.2em; padding: 0; padding-bottom: 0.1em; } nav ul li { display: inline; text-align: center; padding: 0 0.5em; } ::selection { background-color: #777; color: #eee; } h1 { font-family: sans-serif; margin: 0.1em; } section { border-bottom: 0.1em solid #444; margin-bottom: 1em; } h3 { font-family: sans-serif; margin: 0.5em; font-size: 1.4em; } .admonition { margin: 0 auto; width: 55vw; max-width: 30em; margin-top: 1em; padding: 1em; border: 0.2em solid #444; } .admonition > .h2 { margin: 1em 0 0.5em 0; } .admonition p { margin: 0.3em; } .blockQuote { padding: 0.5rem; border-left: 0.1em solid #444; } .codeBlock { padding: 0.5em; border: 0.1em solid #444; white-space: pre-wrap; overflow-x: scroll; text-overflow: clip; } ul li { margin-bottom: 0.5em;} ul li p { margin-top: 0; } a { text-decoration: none; color: inherit; display: inline-block; position: relative; border-bottom: 0.1rem dotted; line-height: 1.2; transition: border 0.3s; } a:visited { color: #777; } a:hover { outline-style: none; border-bottom: 0.1rem solid; } a:focus { outline-style: none; border-bottom: 0.1rem solid; background: #777; } .-advertisement { width: 40vw; max-width: 30rem; margin: auto; } .-colophon { margin: 0 auto; width: 50vw; max-width: 40rem; } .-motd { text-align: center; width: 100%; overflow: hidden; } .-copyright { margin: 0 auto; width: 50vw; max-width: 40rem; padding-bottom: 0.2rem; } .-disclaimer { font-size: 1rem; } .-invertColor { background-color: #444; color: #eee; } .-invertColor ::selection { background-color: #eee; color: #444; } .-invertColor a:before { background: #eee; } .-invertColor a:focus { outline: 0.1em solid #eee; background: inherit; } .-invertColor a:visited { color: #bbb; } .-invertColor .admonition { border-color: #eee;} .-monospace { font-family: monospace; } .-colorLinks a { color: #3ac; } .-colorLinks a:hover { color: #5ce; } .-colorLinks a:visited { color: #b8c; } .-colorLinks a:visited:hover { color: #dae; } .-tooSmall { font-size: 1rem; } .-small { font-size: 1.4rem; } .-medium { font-size: 2rem; } .-large { font-size: 4rem; } .-fullColumn { margin: 0 auto; width: 75vw; max-width: 40em; } .-twoThirdColumn { margin: 0 auto; width: 55vw; max-width: 30em; } .-halfColumn { margin: 0 auto; width: 40vw; max-width: 22em; } ================================================ FILE: brutaldon/static/css/fullbrutalism.css ================================================ /* HTML5 Reset :: style.css ---------------------------------------------------------- We have learned much from/been inspired by/taken code where offered from: Eric Meyer :: http://meyerweb.com HTML5 Doctor :: http://html5doctor.com and the HTML5 Boilerplate :: http://html5boilerplate.com -------------------------------------------------------------------------------*/ /* Let's default this puppy out -------------------------------------------------------------------------------*/ html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary { margin: 0; padding: 0; border: 0; font-size: 100%; font-weight: normal; vertical-align: baseline; background: transparent; } main, article, aside, figure, footer, header, nav, section, details, summary {display: block;} /* Handle box-sizing while better addressing child elements: http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */ html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } /* consider resetting the default cursor: https://gist.github.com/murtaugh/5247154 */ /* Responsive images and other embedded objects */ /* if you don't have full control over `img` tags (if you have to overcome attributes), consider adding height: auto */ img, object, embed {max-width: 100%;} /* Note: keeping IMG here will cause problems if you're using foreground images as sprites. In fact, it *will* cause problems with Google Maps' controls at small size. If this is the case for you, try uncommenting the following: #map img, img.is-32x32 { max-width: none; } */ /* force a vertical scrollbar to prevent a jumpy page */ html {overflow-y: scroll;} /* we use a lot of ULs that aren't bulleted. you'll have to restore the bullets within content, which is fine because they're probably customized anyway */ ul {list-style: none;} blockquote, q {quotes: none;} blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none;} a {margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; background: transparent;} del {text-decoration: line-through;} abbr[title], dfn[title] {border-bottom: 1px dotted #000; cursor: help;} /* tables still need cellspacing="0" in the markup */ table {border-collapse: separate; border-spacing: 0;} th {font-weight: bold; vertical-align: bottom;} td {font-weight: normal; vertical-align: top;} hr {display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0;} input, select {vertical-align: middle;} pre { white-space: pre; /* CSS2 */ white-space: pre-wrap; /* CSS 2.1 */ white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ word-wrap: break-word; /* IE */ } input[type="radio"] {vertical-align: text-bottom;} input[type="checkbox"] {vertical-align: bottom;} .ie7 input[type="checkbox"] {vertical-align: baseline;} .ie6 input {vertical-align: text-bottom;} select, input, textarea {font: 99% sans-serif;} table {font-size: inherit; font: 100%;} small {font-size: 85%;} strong {font-weight: bold;} td, td img, img.is-32x32 {vertical-align: top;} /* Make sure sup and sub don't mess with your line-heights http://gist.github.com/413930 */ sub, sup {font-size: 75%; line-height: 0; position: relative;} sup {top: -0.5em;} sub {bottom: -0.25em;} /* standardize any monospaced elements */ pre, code, kbd, samp {font-family: monospace, sans-serif;} /* hand cursor on clickable elements */ .clickable, label, input[type=button], input[type=submit], input[type=file], button {cursor: pointer;} /* Webkit browsers add a 2px margin outside the chrome of form elements */ button, input, select, textarea {margin: 0;} /* make buttons play nice in IE */ button, input[type=button] {width: auto; overflow: visible;} /* scale images in IE7 more attractively */ .ie7 img, img.is-32x32 {-ms-interpolation-mode: bicubic;} /* prevent BG image flicker upon hover (commented out as usage is rare, and the filter syntax messes with some pre-processors) .ie6 html {filter: expression(document.execCommand("BackgroundImageCache", false, true));} */ /* let's clear some floats */ .clearfix:after { content: " "; display: block; clear: both; } /* Okay, now add some extra brutalism */ body { font-family: Terminus, Inconsolata, Consolas, "Droid Sans Mono", "DejaVu Sans Mono", "Monaco", monospace; background-color: #CCC; color: #000; margin: 1em; } .container { margin: 0 auto; max-width: 80em; } a { color: blue; text-decoration: underline; } a:active { color: red; text-decoration: underline; } a:visited { color: purple; text-decoration: underline; } img.is-32x32 { float: left; max-width: 512px; max-height: auto; margin: 4px; } .level { clear: both; } .title { font-size: 3ex; font-weight: bold; margin-top: 1ex; margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; margin-top: 0.25ex; margin-bottom: 0.25ex; } .toot { clear: both; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 img, .is-max-256 img { display: block; clear: both; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { padding: 1em; margin: 4px; border: 8px ridge #CCC; overflow: auto; } .media.active-context { background-color: #DDD; } summary::before { content: " 🠞 "; } details[open] summary::before { content: " 🠟 "; } .field { margin-top: 1em; } label { font-weight: bold; } .control, .select { margin-top: 0.5ex; margin-bottom: 0.5ex; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } .media-content { margin-top: 1ex; } .media-content > div > p { margin-bottom: 1ex; } .textarea { max-width: 100%; } .errorlist { color: #FF0000; } img.emoji { display: inline; max-height: 1.5rem; max-width: 1.5rem; vertical-align: text-bottom; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { z-index: 60; background-color: #CCC; color: #000; padding: 1ex; border: 8px ridge #CCC; max-height: 90vh; overflow: auto; } .modal.is-active { display: flex; } .card { padding: 1em; margin-top: 1em; border: 1px solid black; } .card-header { padding-bottom: 1em; border-bottom: 1px solid black; } .card-image { padding: 1em; margin 0, auto; } ================================================ FILE: brutaldon/static/css/magnific-popup.css ================================================ /* Magnific Popup CSS */ .mfp-bg { top: 0; left: 0; width: 100%; height: 100%; z-index: 1042; overflow: hidden; position: fixed; background: #0b0b0b; opacity: 0.8; } .mfp-wrap { top: 0; left: 0; width: 100%; height: 100%; z-index: 1043; position: fixed; outline: none !important; -webkit-backface-visibility: hidden; } .mfp-container { text-align: center; position: absolute; width: 100%; height: 100%; left: 0; top: 0; padding: 0 8px; box-sizing: border-box; } .mfp-container:before { content: ''; display: inline-block; height: 100%; vertical-align: middle; } .mfp-align-top .mfp-container:before { display: none; } .mfp-content { position: relative; display: inline-block; vertical-align: middle; margin: 0 auto; text-align: left; z-index: 1045; } .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content { width: 100%; cursor: auto; } .mfp-ajax-cur { cursor: progress; } .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close { cursor: -moz-zoom-out; cursor: -webkit-zoom-out; cursor: zoom-out; } .mfp-zoom { cursor: pointer; cursor: -webkit-zoom-in; cursor: -moz-zoom-in; cursor: zoom-in; } .mfp-auto-cursor .mfp-content { cursor: auto; } .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter { -webkit-user-select: none; -moz-user-select: none; user-select: none; } .mfp-loading.mfp-figure { display: none; } .mfp-hide { display: none !important; } .mfp-preloader { color: #CCC; position: absolute; top: 50%; width: auto; text-align: center; margin-top: -0.8em; left: 8px; right: 8px; z-index: 1044; } .mfp-preloader a { color: #CCC; } .mfp-preloader a:hover { color: #FFF; } .mfp-s-ready .mfp-preloader { display: none; } .mfp-s-error .mfp-content { display: none; } button.mfp-close, button.mfp-arrow { overflow: visible; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; display: block; outline: none; padding: 0; z-index: 1046; box-shadow: none; touch-action: manipulation; } button::-moz-focus-inner { padding: 0; border: 0; } .mfp-close { width: 44px; height: 44px; line-height: 44px; position: absolute; right: 0; top: 0; text-decoration: none; text-align: center; opacity: 0.65; padding: 0 0 18px 10px; color: #FFF; font-style: normal; font-size: 28px; font-family: Arial, Baskerville, monospace; } .mfp-close:hover, .mfp-close:focus { opacity: 1; } .mfp-close:active { top: 1px; } .mfp-close-btn-in .mfp-close { color: #333; } .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close { color: #FFF; right: -6px; text-align: right; padding-right: 6px; width: 100%; } .mfp-counter { position: absolute; top: 0; right: 0; color: #CCC; font-size: 12px; line-height: 18px; white-space: nowrap; } .mfp-arrow { position: absolute; opacity: 0.65; margin: 0; top: 50%; margin-top: -55px; padding: 0; width: 90px; height: 110px; -webkit-tap-highlight-color: transparent; } .mfp-arrow:active { margin-top: -54px; } .mfp-arrow:hover, .mfp-arrow:focus { opacity: 1; } .mfp-arrow:before, .mfp-arrow:after { content: ''; display: block; width: 0; height: 0; position: absolute; left: 0; top: 0; margin-top: 35px; margin-left: 35px; border: medium inset transparent; } .mfp-arrow:after { border-top-width: 13px; border-bottom-width: 13px; top: 8px; } .mfp-arrow:before { border-top-width: 21px; border-bottom-width: 21px; opacity: 0.7; } .mfp-arrow-left { left: 0; } .mfp-arrow-left:after { border-right: 17px solid #FFF; margin-left: 31px; } .mfp-arrow-left:before { margin-left: 25px; border-right: 27px solid #3F3F3F; } .mfp-arrow-right { right: 0; } .mfp-arrow-right:after { border-left: 17px solid #FFF; margin-left: 39px; } .mfp-arrow-right:before { border-left: 27px solid #3F3F3F; } .mfp-iframe-holder { padding-top: 40px; padding-bottom: 40px; } .mfp-iframe-holder .mfp-content { line-height: 0; width: 100%; max-width: 900px; } .mfp-iframe-holder .mfp-close { top: -40px; } .mfp-iframe-scaler { width: 100%; height: 0; overflow: hidden; padding-top: 56.25%; } .mfp-iframe-scaler iframe { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); background: #000; } /* Main image in popup */ img.mfp-img { width: auto; max-width: 100%; height: auto; display: block; line-height: 0; box-sizing: border-box; padding: 40px 0 40px; margin: 0 auto; } /* The shadow behind the image */ .mfp-figure { line-height: 0; } .mfp-figure:after { content: ''; position: absolute; left: 0; top: 40px; bottom: 40px; display: block; right: 0; width: auto; height: auto; z-index: -1; box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); background: #444; } .mfp-figure small { color: #BDBDBD; display: block; font-size: 12px; line-height: 14px; } .mfp-figure figure { margin: 0; } .mfp-bottom-bar { margin-top: -36px; position: absolute; top: 100%; left: 0; width: 100%; cursor: auto; } .mfp-title { text-align: left; line-height: 18px; color: #F3F3F3; word-wrap: break-word; padding-right: 36px; } .mfp-image-holder .mfp-content { max-width: 100%; } .mfp-gallery .mfp-image-holder .mfp-figure { cursor: pointer; } @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) { /** * Remove all paddings around the image on small screen */ .mfp-img-mobile .mfp-image-holder { padding-left: 0; padding-right: 0; } .mfp-img-mobile img.mfp-img { padding: 0; } .mfp-img-mobile .mfp-figure:after { top: 0; bottom: 0; } .mfp-img-mobile .mfp-figure small { display: inline; margin-left: 5px; } .mfp-img-mobile .mfp-bottom-bar { background: rgba(0, 0, 0, 0.6); bottom: 0; margin: 0; top: auto; padding: 3px 5px; position: fixed; box-sizing: border-box; } .mfp-img-mobile .mfp-bottom-bar:empty { padding: 0; } .mfp-img-mobile .mfp-counter { right: 5px; top: 3px; } .mfp-img-mobile .mfp-close { top: 0; right: 0; width: 35px; height: 35px; line-height: 35px; background: rgba(0, 0, 0, 0.6); position: fixed; text-align: center; padding: 0; } } @media all and (max-width: 900px) { .mfp-arrow { -webkit-transform: scale(0.75); transform: scale(0.75); } .mfp-arrow-left { -webkit-transform-origin: 0; transform-origin: 0; } .mfp-arrow-right { -webkit-transform-origin: 100%; transform-origin: 100%; } .mfp-container { padding-left: 6px; padding-right: 6px; } } ================================================ FILE: brutaldon/static/css/minimal-dark.css ================================================ body, input, textarea, select { font-family: sans-serif; background-color: #111111; color: #CCCCCC; margin: 1ex; font-size: 11pt; } input[text], textarea { margin: 0 auto; position: relative; width: 100%; max-width: 100em; } a { color: cornflowerblue; text-decoration: underline; } a:active { color: lightcoral; text-decoration: underline; } a:visited { color: orchid; text-decoration: underline; } img.is-32x32 { float: left; max-width: 32px; max-height: auto; margin: 4px; } .container { margin: 0 auto; position: relative; } @media screen and (min-width: 1024px) { .container { max-width: 960px; width: 960px; } .container.is-fluid { margin-left: 64px; margin-right: 64px; max-width: none; width: auto; } .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } @media screen and (max-width: 1279px) { .container.is-widescreen { max-width: 1152px; width: auto; } } @media screen and (max-width: 1471px) { .container.is-fullhd { max-width: 1344px; width: auto; } } @media screen and (min-width: 1280px) { .container { max-width: 1152px; width: 1152px; } } @media screen and (min-width: 1472px) { .container { max-width: 1344px; width: 1344px; } } main > div.container { max-width: 100ex; } .level { clear: both; } .title { font-size: 3ex; font-weight: bold; margin-top: 1ex; margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; margin-top: 0.25ex; margin-bottom: 0.25ex; } .toot { clear: both; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { padding: 1ex; margin: 4px; overflow: auto; } .media.active-context { background-color: #2C2C2C; } .field { margin-top: 1em; } label { font-weight: bold; } .control, .select { margin-top: 0.5ex; margin-bottom: 0.5ex; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } .media-content { margin-top: 1ex; } .media-content > div > p { margin-bottom: 1ex; } .textarea { max-width: 100%; } .errorlist { color: #FF0000; } img.emoji { display: inline; max-height: 1.5rem; max-width: 1.5rem; vertical-align: text-bottom; } hr.is-hidden { display: none; } .box { border-radius: 3px; border: 1px solid #000; padding: 1em; margin-bottom: 1em; background-color: #1C1C1C; color: #CCCCCC; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { height: 90vh; overflow: auto; z-index: 60; } .modal.is-active { display: flex; } .navbar-item span { padding-right: 1ex; } .card { padding: 1em; margin-top: 1em; border: 0.2em solid white; } .card-header { padding-bottom: 1em; border-bottom: 0.2em solid white; } .card-image { padding: 1em; margin 0, auto; } .button { border: 0.2em solid #CCC; display: inline; padding: 0.4em; } ================================================ FILE: brutaldon/static/css/minimal-large.css ================================================ body, input, textarea, select { font-family: sans-serif; background-color: #FAFAFA; color: #000; margin: 1em; font-size: larger; } input[text], textarea { margin: 0 auto; position: relative; width: 100%; max-width: 120em; } a { color: blue; text-decoration: underline; } a:active { color: red; text-decoration: underline; } a:visited { color: purple; text-decoration: underline; } img.is-32x32 { float: left; max-width: 512px; max-height: auto; margin: 4px; } .container { margin: 0 auto; position: relative; } @media screen and (min-width: 1024px) { .container { max-width: 960px; width: 960px; } .container.is-fluid { margin-left: 64px; margin-right: 64px; max-width: none; width: auto; } .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } @media screen and (max-width: 1279px) { .container.is-widescreen { max-width: 1152px; width: auto; } } @media screen and (max-width: 1471px) { .container.is-fullhd { max-width: 1344px; width: auto; } } @media screen and (min-width: 1280px) { .container { max-width: 1152px; width: 1152px; } } @media screen and (min-width: 1472px) { .container { max-width: 1344px; width: 1344px; } } body > section > div.container { max-width: 100ex; } .level { clear: both; } .title { font-size: 3ex; font-weight: bold; margin-top: 1ex; margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; margin-top: 0.25ex; margin-bottom: 0.25ex; } .toot { clear: both; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { padding: 1ex; margin: 4px; overflow: auto; } .media.active-context { background-color: #DDD; } .field { margin-top: 1em; } label { font-weight: bold; } .control, .select { margin-top: 0.5ex; margin-bottom: 0.5ex; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } .media-content { margin-top: 1ex; } .media-content > div > p { margin-bottom: 1ex; } .textarea { max-width: 100%; } .errorlist { color: #FF0000; } img.emoji { display: inline; max-height: 1.5rem; max-width: 1.5rem; vertical-align: text-bottom; } hr.is-hidden { display: none; } .box { border-radius: 5px; border: 1px solid #000; padding: 1.5em; margin-bottom: 1.5em; background-color: white; color: black; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { height: 90vh; overflow: auto; z-index: 60; } .modal.is-active { display: flex; } ================================================ FILE: brutaldon/static/css/minimal-small.css ================================================ body, input, textarea, select { font-family: sans-serif; background-color: #FAFAFA; color: #000; margin: 1ex; font-size: 11pt; } input[text], textarea { margin: 0 auto; position: relative; width: 100%; max-width: 100em; } a { color: blue; text-decoration: underline; } a:active { color: red; text-decoration: underline; } a:visited { color: purple; text-decoration: underline; } img.is-32x32 { float: left; max-width: 32px; max-height: auto; margin: 4px; } .container { margin: 0 auto; position: relative; } @media screen and (min-width: 1024px) { .container { max-width: 960px; width: 960px; } .container.is-fluid { margin-left: 64px; margin-right: 64px; max-width: none; width: auto; } .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } @media screen and (max-width: 1279px) { .container.is-widescreen { max-width: 1152px; width: auto; } } @media screen and (max-width: 1471px) { .container.is-fullhd { max-width: 1344px; width: auto; } } @media screen and (min-width: 1280px) { .container { max-width: 1152px; width: 1152px; } } @media screen and (min-width: 1472px) { .container { max-width: 1344px; width: 1344px; } } main > div.container { max-width: 100ex; } .level { clear: both; } .title { font-size: 3ex; font-weight: bold; margin-top: 1ex; margin-bottom: 1ex; } .subtitle { font-size: 1.5ex; font-weight: bold; margin-top: 0.25ex; margin-bottom: 0.25ex; } .toot { clear: both; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { padding: 1ex; margin: 4px; overflow: auto; } .media.active-context { background-color: #DDD; } .field { margin-top: 1em; } label { font-weight: bold; } .control, .select { margin-top: 0.5ex; margin-bottom: 0.5ex; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } .media-content { margin-top: 1ex; } .media-content > div > p { margin-bottom: 1ex; } .textarea { max-width: 100%; } .errorlist { color: #FF0000; } img.emoji { display: inline; max-height: 1.5rem; max-width: 1.5rem; vertical-align: text-bottom; } hr.is-hidden { display: none; } .box { border-radius: 3px; border: 1px solid #000; padding: 1em; margin-bottom: 1em; background-color: white; color: black; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { height: 90vh; overflow: auto; z-index: 60; } .modal.is-active { display: flex; } .navbar-item span { padding-right: 1ex; } .card { padding: 1em; margin-top: 1em; border: 0.2em solid black; } .card-header { padding-bottom: 1em; border-bottom: 0.2em solid black; } .card-image { padding: 1em; margin 0, auto; } .button { border: 0.2em solid #444; display: inline; padding: 0.4em; } ================================================ FILE: brutaldon/static/css/vt240don-amber.css ================================================ html, a, div, div.notification, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary, h1.title, h2.subtitle { font-family: "DEC Terminal Modern", Terminus, Inconsolata, Consolas, "Droid Sans Mono", "DejaVu Sans Mono", "Monaco", monospace; color: #ff7700; background-color: #000000; font-size: 1.2rem; } tr, td, ul, ol { border-color: #ff7700; outline: 1px solid #ff7700; padding-top: 5px; padding-bottom: 5px; margin-top: 5px; margin-bottom: 10px; } a, a.button, a.button.is-primary, input.button.is-primary, input, .input, .textarea, .footer, .label, select, textarea { color: #ff8800; border-color: #ff8800; background-color: #000000; font-weight: bolder; text-decoration-line: none; } a:hover, a.button:hover, a.button.is-primary:hover, input.button.is-primary:hover { color: #000000; background-color: #ff8800; } .media-content a:not(.mention):not(.tag) { text-decoration-line: underline; text-decoration-style: solid; text-decoration:color: #ff7700; } .control input[type=text], .control textarea { width: 100%; max-width: 80em; border: 1px solid #ff7700; margin-bottom: 1ex; } .control input, .control select { border: 1px solid #ff7700; background-color: #000000; margin-bottom: 1ex; } img { filter: grayscale(100%); -webkit-filter: grayscale(100%); } div.card-header-title, div.card-header-icon { color: #ff7700; } .container { margin: 0 auto; max-width: 80ex; } .box { padding: 1em; border-color: #ff7700; outline: 1px solid #ff7700; background-color: #000; margin-bottom: 1em; } hr.is-hidden { display: none; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { background-color: black; border-radius: 5px; /*-webkit-box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);*/ color: #4a4a00; padding: 1.25rem; margin-bottom: 0.75rem; margin-top: 0.75rem; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } figure.media-left p.image a img { border-radius: 5px; } .active-context { background-color: #000000; border-color: #ffcc00; outline: 1px solid #ffcc00; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } img.fav-avatar { display: inline; } .level { display: block; margin-bottom: 1ex; margin-top: 1ex; } img.emoji { display: inline; max-height: 1.5em; max-width: 1.5em; vertical-align: text-bottom; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { z-index: 60; max-height: 90vh; overflow: auto; } .modal.is-active { display: flex; } .navbar-item { margin-right: 2em; } @media screen and (max-width: 768px) { .media { display: block; } } @media screen and (min-width: 1024px) { .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } ================================================ FILE: brutaldon/static/css/vt240don-green.css ================================================ html, body, a, div, div.notification, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary, h1.title, h2.subtitle { font-family: "DEC Terminal Modern", Terminus, Inconsolata, Consolas, "Droid Sans Mono", "DejaVu Sans Mono", "Monaco", monospace; color: #00ff77; background-color: #000; font-size: 1.2rem; } tr, td, ul, ol { border-color: #00ff77; outline: 1px solid #00ff77; padding-top: 5px; padding-bottom: 5px; margin-top: 5px; margin-bottom: 10px; background-color: #000000; } a, a.button, a.button.is-primary, input.button.is-primary, input, .input, .textarea, .footer, .label, select, textarea { color: #00ff88; border-color: #00ff88; background-color: #000000; font-weight: bolder; text-decoration-line: none; font-size: 1.2rem; } a:hover, a.button:hover, a.button.is-primary:hover, input.button.is-primary:hover { color: #000000; background-color: #00ff88; } .media-content a:not(.mention):not(.tag) { text-decoration-line: underline; text-decoration-style: solid; text-decoration:color: #00ff77; } .control input[type=text], .control textarea { width: 100%; max-width: 80ex; border: 1px solid #00ff77; background-color: #000000; margin-bottom: 1ex; } .control input, .control select { border: 1px solid #00ff77; background-color: #000000; margin-bottom: 1ex; } img { filter: grayscale(100%); -webkit-filter: grayscale(100%); } div.card-header-title, div.card-header-icon { color: #00ff77; } .container { margin: 0 auto; max-width: 80ex; color: #00ff88; background-color: #000000; } .box { padding: 1em; border-color: #00ff77; outline: 1px solid #00ff77; background-color: #000; margin-bottom: 1em; } hr.is-hidden { display: none; } .image.is-32x32, .is-32x32 img, img.is-32x32 { width: 32px; height: 32px; } .image.is-48x48, .is-48x48 img, img.is-48x48 { width: 48px; height: 48px; } .image.is-64x64, .is-64x64 img, img.is-64x64 { width: 64px; height: 64px; } .image.is-96x96, .is-96x96 img, img.is-96x96 { width: 96px; height: 96px; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } .media { background-color: black; border-radius: 5px; /*-webkit-box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1); box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);*/ color: #4a4a00; padding: 1.25rem; margin-bottom: 0.75rem; margin-top: 0.75rem; } .is-max-128 { max-height: 128px; max-width: 128px; } .is-max-256 { max-height: 256px; max-width: 256px; } figure.media-left p.image a img { border-radius: 5px; } .active-context { background-color: #000000; border-color: #00ff88; outline: 1px solid #00ff88; } .account-avatar { display: inline-block; } .reblog-icon { margin-top: 32px; display: inline-block; } img.fav-avatar { display: inline; } .level { display: block; margin-bottom: 1ex; margin-top: 1ex; } img.emoji { display: inline; max-height: 1.5em; max-width: 1.5em; vertical-align: text-bottom; } .modal { -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: none; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; position: fixed; z-index: 40; } .modal-background { position: absolute; background-color: rgba(10,10,10,.86); } .modal, .modal-background { bottom: 0; left: 0; right: 0; top: 0; } .modal-content { z-index: 60; max-height: 90vh; overflow: auto; } .modal.is-active { display: flex; } .navbar-item { margin-right: 2em; } @media screen and (max-width: 768px) { .media { display: block; } } @media screen and (min-width: 1024px) { .navbar, .navbar-menu, .navbar-start, .navbar-end { align-items: stretch; display: flex; } .navbar-start { justify-content: flex-start; margin-right: auto; } .navbar-end { justify-content: flex-end; margin-left: auto; } } ================================================ FILE: brutaldon/static/js/brutaldon-enhancements.js ================================================ String.prototype.trunc = function(n){ return this.substr(0,n-1)+(this.length>n?'…':''); }; function setTitle(user, page) { document.title = `Brutaldon (${user}) – ${page}`; } function afterPage(user, page) { setTitle(user,page); var menu = document.querySelector('#navMenu'); menu.classList.remove('is-active'); var burger = document.querySelector('.navbar-burger'); burger.classList.remove('is-active'); $('#page-load-indicator').hide(); } function menuPrepare() { // Remove is-active from navbar menu var menu = document.querySelector('#navMenu'); menu.classList.remove('is-active'); // Pin the navbar to the top document.querySelector('body').classList.toggle("has-navbar-fixed-top"); document.querySelector('nav.navbar').classList.toggle("is-fixed-top"); // Add the burger var brand = document.querySelector('.navbar-brand'); var burger = document.createElement('a'); burger.classList.toggle('navbar-burger'); burger.setAttribute("aria-label", "menu"); burger.setAttribute("aria-expanded", "false"); burger.setAttribute("data-target", "navMenu"); for (var index = 0; index < 3; index++) { var span = document.createElement('span'); span.setAttribute('aria-hidden', "true"); burger.appendChild(span); } brand.appendChild(burger); // Get all "navbar-burger" elements var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); // Check if there are any navbar burgers if ($navbarBurgers.length > 0) { // Add a click event on each of them $navbarBurgers.forEach(function ($el) { $el.addEventListener('click', function () { // Get the target from the "data-target" attribute var target = $el.dataset.target; var $target = document.getElementById(target); // Toggle the class on both the "navbar-burger" and the "navbar-menu" $el.classList.toggle('is-active'); $target.classList.toggle('is-active'); }); }); } } function expandCWButtonPrepare() { var theButton = document.querySelector('#expandCWs'); if (!theButton) { theButton = document.createElement('button'); theButton.id = "expandCWs"; theButton.textContent = "Expand CWs"; theButton.classList.toggle('button'); var title = document.querySelector('#title'); if (title) { title.insertAdjacentElement('afterend', theButton); var details = document.querySelectorAll('details'); var openState = false; if (details != null) { theButton.addEventListener('click', function() { openState = details.item(0).hasAttribute('open'); details.forEach(function ($el) { if (openState) { $el.removeAttribute('open'); } else { $el.setAttribute('open', ''); } }); openState = !openState; if (openState) { theButton.textContent = 'Collapse CWs'; } else { theButton.textContent = "Expand CWs"; }; theButton.classList.toggle('is-active'); }); } } } } function fileButtonUpdaters() { var file1 = document.getElementById("id_media_file_1"); file1.onchange = function(){ if (file1.files.length > 0) { document.getElementById('media_filename_1').innerHTML = file1.files[0].name.trunc(5); } }; var file2 = document.getElementById("id_media_file_2"); file2.onchange = function(){ if (file2.files.length > 0) { document.getElementById('media_filename_2').innerHTML = file2.files[0].name.trunc(5); } }; var file3 = document.getElementById("id_media_file_3"); file3.onchange = function(){ if (file3.files.length > 0) { document.getElementById('media_filename_3').innerHTML = file3.files[0].name.trunc(5); } }; var file4 = document.getElementById("id_media_file_4"); file4.onchange = function(){ if (file4.files.length > 0) { document.getElementById('media_filename_4').innerHTML = file4.files[0].name.trunc(5); } }; } function characterCountSetup() { if ($("#id_status").length) { $("#status_count").text(characterCount()); $("#id_status").keyup(function(){ $("#status_count").text(characterCount()); }); $("#id_spoiler_text").keyup(function(){ $("#status_count").text(characterCount()); }); } } function characterCount() { return $("#id_status").val().length + $("#id_spoiler_text").val().length; } ================================================ FILE: brutaldon/static/js/intercooler.js ================================================ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (root['Intercooler'] = factory(a0)); }); } else if (typeof module === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { root['Intercooler'] = factory(root["jQuery"]); } }(this, function ($) { //////////////////////////////////// /** * Intercooler.js - there is no need to be upset. */ var Intercooler = Intercooler || (function() { 'use strict'; // inside function for better merging // work around zepto build issue TODO - fix me if((typeof Zepto !== "undefined") && ($ == null)) { window["$"] = Zepto } //-------------------------------------------------- // Vars //-------------------------------------------------- var USE_DATA = $('meta[name="intercoolerjs:use-data-prefix"]').attr("content") == "true"; var USE_ACTUAL_HTTP_METHOD = $('meta[name="intercoolerjs:use-actual-http-method"]').attr("content") == "true"; var _MACROS = $.map(['ic-get-from', 'ic-post-to', 'ic-put-to', 'ic-patch-to', 'ic-delete-from', 'ic-style-src', 'ic-attr-src', 'ic-prepend-from', 'ic-append-from', 'ic-action'], function(elt){ return fixICAttributeName(elt) }); var _scrollHandler = null; var _UUID = 1; var _readyHandlers = []; var _isDependentFunction = function(src, dest) { if (!src || !dest) { return false; } // For two urls to be considered dependant, either one must contain all // of the path arguments the other has, like so: // - chomp off everything after ? or #. This is a design decision, so this // function will fail to determine dependencies for sites that store // their model IDs in query/hash params. If your usecase is not covered // by this you need to implement this function yourself by overriding // Intercooler.setIsDependentFunction(function(src, dest) { return bool; }); // - split by / to get the individual path elements, clear out empty values, // then simply compare them var asrc = src.split(/[\?#]/, 1)[0].split("/").filter(function(e) { return e != ""; }); var adest = dest.split(/[\?#]/, 1)[0].split("/").filter(function(e) { return e != ""; }); // ignore purely local tags (local transport) if (asrc == "" || adest == "") { return false; } return adest.slice(0, asrc.length).join("/") == asrc.join("/") || asrc.slice(0, adest.length).join("/") == adest.join("/"); }; //============================================================ // Base Swap Definitions //============================================================ function remove(elt) { elt.remove(); } function showIndicator(elt) { if (elt.closest('.ic-use-transition').length > 0) { elt.data('ic-use-transition', true); elt.removeClass('ic-use-transition'); } else { elt.show(); } } function hideIndicator(elt) { if (elt.data('ic-use-transition') || elt.data('ic-indicator-cleared')) { elt.data('ic-use-transition', null); elt.addClass('ic-use-transition'); elt.data('ic-indicator-cleared', true); } else { elt.hide(); } } function fixICAttributeName(s) { if (USE_DATA) { return 'data-' + s; } else { return s; } } function getICAttribute(element, attributeName) { return element.attr(fixICAttributeName(attributeName)); } function setICAttribute(element, attributeName, attributeValue) { element.attr(fixICAttributeName(attributeName), attributeValue); } function prepend(parent, responseContent) { try { parent.prepend(responseContent); } catch (e) { log(parent, formatError(e), "ERROR"); } if (getICAttribute(parent, 'ic-limit-children')) { var limit = parseInt(getICAttribute(parent, 'ic-limit-children')); if (parent.children().length > limit) { parent.children().slice(limit, parent.children().length).remove(); } } } function append(parent, responseContent) { try { parent.append(responseContent); } catch (e) { log(parent, formatError(e), "ERROR"); } if (getICAttribute(parent, 'ic-limit-children')) { var limit = parseInt(getICAttribute(parent, 'ic-limit-children')); if (parent.children().length > limit) { parent.children().slice(0, parent.children().length - limit).remove(); } } } //============================================================ // Utility Methods //============================================================ function triggerEvent(elt, event, args){ if($.zepto) { event = event.split(".").reverse().join(":"); } elt.trigger(event, args); } function log(elt, msg, level) { if (elt == null) { elt = $('body'); } triggerEvent(elt, "log.ic", [msg, level, elt]); if (level == "ERROR") { if (window.console) { window.console.log("Intercooler Error : " + msg); } var errorUrl = closestAttrValue($('body'), 'ic-post-errors-to'); if (errorUrl) { $.post(errorUrl, {'error': msg}); } } } function uuid() { return _UUID++; } function icSelectorFor(elt) { return getICAttributeSelector("ic-id='" + getIntercoolerId(elt) + "'"); } function parseInterval(str) { log(null, "POLL: Parsing interval string " + str, 'DEBUG'); if (str == "null" || str == "false" || str == "") { return null; } else if (str.lastIndexOf("ms") == str.length - 2) { return parseFloat(str.substr(0, str.length - 2)); } else if (str.lastIndexOf("s") == str.length - 1) { return parseFloat(str.substr(0, str.length - 1)) * 1000; } else { return 1000; } } function getICAttributeSelector(attribute) { return "[" + fixICAttributeName(attribute) + "]"; } function initScrollHandler() { if (_scrollHandler == null) { _scrollHandler = function() { $(getICAttributeSelector("ic-trigger-on='scrolled-into-view'")).each(function() { var _this = $(this); if (isScrolledIntoView(getTriggeredElement(_this)) && _this.data('ic-scrolled-into-view-loaded') != true) { _this.data('ic-scrolled-into-view-loaded', true); fireICRequest(_this); } }); }; $(window).scroll(_scrollHandler); } } function currentUrl() { return window.location.pathname + window.location.search + window.location.hash; } // taken from turbolinks.js function createDocument(html) { var doc = null; if (/<(html|body)/i.test(html)) { doc = document.documentElement.cloneNode(); doc.innerHTML = html; } else { doc = document.documentElement.cloneNode(true); doc.querySelector('body').innerHTML = html; } return $(doc); } //============================================================ // Request/Parameter/Include Processing //============================================================ function getTarget(elt) { return getTargetImpl(elt, 'ic-target') } function getTargetImpl(elt, attibuteName) { var closest = $(elt).closest(getICAttributeSelector(attibuteName)); var targetValue = getICAttribute(closest, attibuteName); if (targetValue == 'this') { return closest; } else if (targetValue && targetValue.indexOf('this.') != 0) { if (targetValue.indexOf('closest ') == 0) { return elt.closest(targetValue.substr(8)); } else if (targetValue.indexOf('find ') == 0) { return elt.find(targetValue.substr(5)); } else { return $(targetValue); } } else { return elt; } } function processHeaders(elt, xhr) { elt = $(elt); triggerEvent(elt, "beforeHeaders.ic", [elt, xhr]); log(elt, "response headers: " + xhr.getAllResponseHeaders(), "DEBUG"); var target = null; // set page title by header if (xhr.getResponseHeader("X-IC-Title")) { document.title = xhr.getResponseHeader("X-IC-Title"); } if (xhr.getResponseHeader("X-IC-Title-Encoded")) { var decodedTitle = decodeURIComponent((xhr.getResponseHeader("X-IC-Title-Encoded")).replace(/\+/g, '%20')); document.title = decodedTitle; } if (xhr.getResponseHeader("X-IC-Refresh")) { var pathsToRefresh = xhr.getResponseHeader("X-IC-Refresh").split(","); log(elt, "X-IC-Refresh: refreshing " + pathsToRefresh, "DEBUG"); $.each(pathsToRefresh, function(i, str) { refreshDependencies(str.replace(/ /g, ""), elt); }); } if (xhr.getResponseHeader("X-IC-Script")) { log(elt, "X-IC-Script: evaling " + xhr.getResponseHeader("X-IC-Script"), "DEBUG"); globalEval(xhr.getResponseHeader("X-IC-Script"), [["elt", elt]]); } if (xhr.getResponseHeader("X-IC-Redirect")) { log(elt, "X-IC-Redirect: redirecting to " + xhr.getResponseHeader("X-IC-Redirect"), "DEBUG"); window.location = xhr.getResponseHeader("X-IC-Redirect"); } if (xhr.getResponseHeader("X-IC-CancelPolling") == "true") { cancelPolling(elt.closest(getICAttributeSelector('ic-poll'))); } if (xhr.getResponseHeader("X-IC-ResumePolling") == "true") { var pollingElt = elt.closest(getICAttributeSelector('ic-poll')); setICAttribute(pollingElt, 'ic-pause-polling', null); startPolling(pollingElt); } if (xhr.getResponseHeader("X-IC-SetPollInterval")) { var pollingElt = elt.closest(getICAttributeSelector('ic-poll')); cancelPolling(pollingElt); setICAttribute(pollingElt, 'ic-poll', xhr.getResponseHeader("X-IC-SetPollInterval")); startPolling(pollingElt); } if (xhr.getResponseHeader("X-IC-Open")) { log(elt, "X-IC-Open: opening " + xhr.getResponseHeader("X-IC-Open"), "DEBUG"); window.open(xhr.getResponseHeader("X-IC-Open")); } var triggerValue = xhr.getResponseHeader("X-IC-Trigger"); if (triggerValue) { log(elt, "X-IC-Trigger: found trigger " + triggerValue, "DEBUG"); target = getTarget(elt); // Deprecated API if (xhr.getResponseHeader("X-IC-Trigger-Data")) { var triggerArgs = $.parseJSON(xhr.getResponseHeader("X-IC-Trigger-Data")); triggerEvent(target, triggerValue, triggerArgs); } else { if (triggerValue.indexOf("{") >= 0) { $.each($.parseJSON(triggerValue), function(event, args) { triggerEvent(target, event, args); }); } else { triggerEvent(target, triggerValue, []); } } } var localVars = xhr.getResponseHeader("X-IC-Set-Local-Vars"); if (localVars) { $.each($.parseJSON(localVars), function(key, val) { localStorage.setItem(key, val); }); } if (xhr.getResponseHeader("X-IC-Remove")) { if (elt) { var removeVal = xhr.getResponseHeader("X-IC-Remove"); removeVal += ''; // normalize as string for zapto var removeValAsInterval = parseInterval(removeVal); log(elt, "X-IC-Remove header found.", "DEBUG"); target = getTarget(elt); if(removeVal == "true" || removeValAsInterval == null) { remove(target); } else { target.addClass('ic-removing'); setTimeout(function () { remove(target); }, removeValAsInterval); } } } triggerEvent(elt, "afterHeaders.ic", [elt, xhr]); return true; } function beforeRequest(elt) { elt.addClass('disabled'); elt.addClass('ic-request-in-flight'); elt.data('ic-request-in-flight', true); } function requestCleanup(indicator, globalIndicator, elt) { if (indicator.length > 0) { hideIndicator(indicator); } if (globalIndicator.length > 0) { hideIndicator(globalIndicator); } elt.removeClass('disabled'); elt.removeClass('ic-request-in-flight'); elt.data('ic-request-in-flight', false); if (elt.data('ic-next-request')) { elt.data('ic-next-request')["req"](); elt.data('ic-next-request', null); } } function replaceOrAddMethod(data, actualMethod) { if ($.type(data) === "string") { var regex = /(&|^)_method=[^&]*/; var content = "&_method=" + actualMethod; if (regex.test(data)) { return data.replace(regex, content) } else { return data + content; } } else { data.append("_method", actualMethod); return data; } } /* Is the provided text a valid JavaScript identifier path? We should also probably check if an identifier is a JavaScript keyword here. */ function isIdentifier(txt) { return /^[$A-Z_][0-9A-Z_$]*$/i.test(txt); } /* Evaluate a script snippet provided by the user. script: A string. If this is an identifier, it is assumed to be a callable, retrieved from the global namespace, and called. If it is a compound statement, it is evaluated using eval. args: A list of [name, value] tuples. These will be injected into the namespace of evaluated scripts, and be passed as arguments to safe evaluations. */ // It would be nice to use the spread operator here globalEval(script, ...args) - but it breaks // uglify and isn't supported in some older browsers. function globalEval(script, args) { var names = []; var values = []; if (args) { for (var i = 0; i < args.length; i++) { names.push(args[i][0]); values.push(args[i][1]); } } if (isIdentifier(script)) { return window[script].apply(this, values); } else { var outerfunc = window["eval"].call( window, '(function (' + names.join(", ") + ') {' + script + '})' ); return outerfunc.apply(this, values); } } function closestAttrValue(elt, attr) { var closestElt = $(elt).closest(getICAttributeSelector(attr)); if (closestElt.length > 0) { return getICAttribute(closestElt, attr); } else { return null; } } function formatError(e) { var msg = e.toString() + "\n"; try { msg += e.stack; } catch (e) { // ignore } return msg; } function getLocalURL(baseURL, paramsToPush, data) { if (paramsToPush) { baseURL = baseURL + "?"; var vars = {}; data.replace(/([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); $(paramsToPush.split(",")).each(function(index) { var param = $.trim(this); var value = vars[param] || ""; baseURL += (index == 0) ? "" : "&"; baseURL += param + "=" + value; }); } return baseURL; } function handleRemoteRequest(elt, type, url, data, success) { beforeRequest(elt); data = replaceOrAddMethod(data, type); // Global spinner support var globalIndicator = findGlobalIndicator(elt); if (globalIndicator && globalIndicator.length > 0) { showIndicator(globalIndicator); } // Spinner support var indicator = findIndicator(elt); if (indicator.length > 0) { showIndicator(indicator); } var requestId = uuid(); var requestStart = new Date(); var actualRequestType; if(USE_ACTUAL_HTTP_METHOD) { actualRequestType = type; } else { actualRequestType = type == 'GET' ? 'GET' : 'POST'; } var ajaxSetup = { type: actualRequestType, url: url, data: data, dataType: 'text', headers: { "Accept": "text/html-partial, */*; q=0.9", "X-IC-Request": true, "X-HTTP-Method-Override": type }, beforeSend: function(xhr, settings) { triggerEvent(elt, "beforeSend.ic", [elt, data, settings, xhr, requestId]); log(elt, "before AJAX request " + requestId + ": " + type + " to " + url, "DEBUG"); var onBeforeSend = closestAttrValue(elt, 'ic-on-beforeSend'); if (onBeforeSend) { globalEval(onBeforeSend, [["elt", elt], ["data", data], ["settings", settings], ["xhr", xhr]]); } maybeInvokeLocalAction(elt, "-beforeSend"); }, success: function(responseData, textStatus, xhr) { triggerEvent(elt, "success.ic", [elt, responseData, textStatus, xhr, requestId]); log(elt, "AJAX request " + requestId + " was successful.", "DEBUG"); var onSuccess = closestAttrValue(elt, 'ic-on-success'); if (onSuccess) { if (globalEval(onSuccess, [["elt", elt], ["data", responseData], ["textStatus", textStatus], ["xhr", xhr]]) == false) { return; } } var beforeHeaders = new Date(); var oldTitle = document.title; try { if (processHeaders(elt, xhr)) { log(elt, "Processed headers for request " + requestId + " in " + (new Date() - beforeHeaders) + "ms", "DEBUG"); var beforeSuccess = new Date(); if (xhr.getResponseHeader("X-IC-PushURL") || closestAttrValue(elt, 'ic-push-url') == "true") { try { requestCleanup(indicator, globalIndicator, elt); // clean up before snap-shotting HTML var baseURL = closestAttrValue(elt, 'ic-src'); var paramsToPush = closestAttrValue(elt, 'ic-push-params'); var newUrl = xhr.getResponseHeader("X-IC-PushURL") || getLocalURL(baseURL, paramsToPush, data); if(_history) { _history.snapshotForHistory(newUrl, oldTitle); } else { throw "History support not enabled"; } } catch (e) { log(elt, "Error during history snapshot for " + requestId + ": " + formatError(e), "ERROR"); } } success(responseData, textStatus, elt, xhr); log(elt, "Process content for request " + requestId + " in " + (new Date() - beforeSuccess) + "ms", "DEBUG"); } triggerEvent(elt, "after.success.ic", [elt, responseData, textStatus, xhr, requestId]); maybeInvokeLocalAction(elt, "-success"); } catch (e) { log(elt, "Error processing successful request " + requestId + " : " + formatError(e), "ERROR"); } }, error: function(xhr, status, str) { triggerEvent(elt, "error.ic", [elt, status, str, xhr]); var onError = closestAttrValue(elt, 'ic-on-error'); if (onError) { globalEval(onError, [["elt", elt], ["status", status], ["str", str], ["xhr", xhr]]); } processHeaders(elt, xhr); maybeInvokeLocalAction(elt, "-error"); log(elt, "AJAX request " + requestId + " to " + url + " experienced an error: " + str, "ERROR"); }, complete: function(xhr, status) { log(elt, "AJAX request " + requestId + " completed in " + (new Date() - requestStart) + "ms", "DEBUG"); requestCleanup(indicator, globalIndicator, elt); try { if ($.contains(document, elt[0])) { triggerEvent(elt, "complete.ic", [elt, data, status, xhr, requestId]); } else { triggerEvent($('body'), "complete.ic", [elt, data, status, xhr, requestId]); } } catch (e) { log(elt, "Error during complete.ic event for " + requestId + " : " + formatError(e), "ERROR"); } var onComplete = closestAttrValue(elt, 'ic-on-complete'); if (onComplete) { globalEval(onComplete, [["elt", elt], ["xhr", xhr], ["status", status]]); } maybeInvokeLocalAction(elt, "-complete"); } }; if ($.type(data) != "string") { ajaxSetup.dataType = null; ajaxSetup.processData = false; ajaxSetup.contentType = false; } triggerEvent($(document), "beforeAjaxSend.ic", [ajaxSetup, elt]); if(ajaxSetup.cancel) { requestCleanup(indicator, globalIndicator, elt); } else { $.ajax(ajaxSetup) } } function findGlobalIndicator(elt) { var indicator = $([]); elt = $(elt); var attr = closestAttrValue(elt, 'ic-global-indicator'); if (attr && attr !== "false") { indicator = $(attr).first(); } return indicator; } function findIndicator(elt) { var indicator = $([]); elt = $(elt); if (getICAttribute(elt, 'ic-indicator')) { indicator = $(getICAttribute(elt, 'ic-indicator')).first(); } else { indicator = elt.find(".ic-indicator").first(); if (indicator.length == 0) { var parent = closestAttrValue(elt, 'ic-indicator'); if (parent) { indicator = $(parent).first(); } else { if (elt.next().is('.ic-indicator')) { indicator = elt.next(); } } } } return indicator; } function processIncludes(data, str) { if ($.trim(str).indexOf("{") == 0) { var obj = $.parseJSON(str); $.each(obj, function(name, value) { data = appendData(data, name, value); }); } else { $(str).each(function() { var obj = $(this).serializeArray(); $.each(obj, function(i, input) { data = appendData(data, input.name, input.value); }); }); } return data; } function processLocalVars(data, str) { $(str.split(",")).each(function() { var key = $.trim(this); var item = localStorage.getItem(key); if(item) { data = appendData(data, key, item); } }); return data; } function appendData(data, key, value) { if ($.type(data) === "string") { if($.type(value) !== "string") { value = JSON.stringify(value); } return data + "&" + key + "=" + encodeURIComponent(value); } else { data.append(key, value); return data; } } function getParametersForElement(verb, elt, triggerOrigin) { var target = getTarget(elt); var data = null; if (elt.is('form') && elt.attr('enctype') == 'multipart/form-data') { data = new FormData(elt[0]); data = appendData(data, 'ic-request', true); } else { data = "ic-request=true"; // if the element is in a form, include the entire form var closestForm = elt.closest('form'); if (elt.is('form') || (verb != "GET" && closestForm.length > 0)) { data += "&" + closestForm.serialize(); // include data from a focused button (to capture clicked button value) var buttonData = elt.data('ic-last-clicked-button'); if(buttonData) { data = appendData(data, buttonData.name, buttonData.value); } } else { // otherwise include the element data += "&" + elt.serialize(); } } var promptText = closestAttrValue(elt, 'ic-prompt'); if (promptText) { var promptVal = prompt(promptText); if (promptVal) { var promptParamName = closestAttrValue(elt, 'ic-prompt-name') || 'ic-prompt-value'; data = appendData(data, promptParamName, promptVal); } else { return null; } } if (elt.attr('id')) { data = appendData(data, 'ic-element-id', elt.attr('id')); } if (elt.attr('name')) { data = appendData(data, 'ic-element-name', elt.attr('name')); } if (getICAttribute(target, 'ic-id')) { data = appendData(data, 'ic-id', getICAttribute(target, 'ic-id')); } if (target.attr('id')) { data = appendData(data, 'ic-target-id', target.attr('id')); } if (triggerOrigin && triggerOrigin.attr('id')) { data = appendData(data, 'ic-trigger-id', triggerOrigin.attr('id')); } if (triggerOrigin && triggerOrigin.attr('name')) { data = appendData(data, 'ic-trigger-name', triggerOrigin.attr('name')); } var includeAttr = closestAttrValue(elt, 'ic-include'); if (includeAttr) { data = processIncludes(data, includeAttr); } var localVars = closestAttrValue(elt, 'ic-local-vars'); if (localVars) { data = processLocalVars(data, localVars); } $(getICAttributeSelector('ic-global-include')).each(function() { data = processIncludes(data, getICAttribute($(this), 'ic-global-include')); }); data = appendData(data, 'ic-current-url', currentUrl()); var selectFromResp = closestAttrValue(elt, 'ic-select-from-response'); if(selectFromResp) { data = appendData(data, 'ic-select-from-response', selectFromResp); } log(elt, "request parameters " + data, "DEBUG"); return data; } function maybeSetIntercoolerInfo(elt) { var target = getTarget(elt); getIntercoolerId(target); if (elt.data('elementAdded.ic') != true) { elt.data('elementAdded.ic', true); triggerEvent(elt, "elementAdded.ic"); } } function getIntercoolerId(elt) { if (!getICAttribute(elt, 'ic-id')) { setICAttribute(elt, 'ic-id', uuid()); } return getICAttribute(elt, 'ic-id'); } //============================================================ // Tree Processing //============================================================ function processNodes(elt) { elt = $(elt); if (elt.length > 1) { elt.each(function() { processNodes(this); }); } else { processMacros(elt); processEnhancement(elt); processSources(elt); processPolling(elt); processEventSources(elt); processTriggerOn(elt); processRemoveAfter(elt); processAddClasses(elt); processRemoveClasses(elt); } } function fireReadyStuff(elt) { triggerEvent(elt, 'nodesProcessed.ic'); $.each(_readyHandlers, function(i, handler) { try { handler(elt); } catch (e) { log(elt, formatError(e), "ERROR"); } }); } function autoFocus(elt) { elt.find('[autofocus]').last().focus(); } function processMacros(elt) { $.each(_MACROS, function(i, macro) { if (elt.closest('.ic-ignore').length == 0) { if (elt.is('[' + macro + ']')) { processMacro(macro, elt); } elt.find('[' + macro + ']').each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { processMacro(macro, _this); } }); } }); } function processSources(elt) { if (elt.closest('.ic-ignore').length == 0) { if (elt.is(getICAttributeSelector("ic-src"))) { maybeSetIntercoolerInfo(elt); } elt.find(getICAttributeSelector("ic-src")).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { maybeSetIntercoolerInfo(_this); } }); } } function processPolling(elt) { if (elt.closest('.ic-ignore').length == 0) { if (elt.is(getICAttributeSelector("ic-poll"))) { maybeSetIntercoolerInfo(elt); startPolling(elt); } elt.find(getICAttributeSelector("ic-poll")).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { maybeSetIntercoolerInfo(_this); startPolling(_this); } }); } } function processTriggerOn(elt) { if (elt.closest('.ic-ignore').length == 0) { handleTriggerOn(elt); elt.find(getICAttributeSelector('ic-trigger-on')).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { handleTriggerOn(_this); } }); } } function processRemoveAfter(elt) { if (elt.closest('.ic-ignore').length == 0) { handleRemoveAfter(elt); elt.find(getICAttributeSelector('ic-remove-after')).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { handleRemoveAfter(_this); } }); } } function processAddClasses(elt) { if (elt.closest('.ic-ignore').length == 0) { handleAddClasses(elt); elt.find(getICAttributeSelector('ic-add-class')).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { handleAddClasses(_this); } }); } } function processRemoveClasses(elt) { if (elt.closest('.ic-ignore').length == 0) { handleRemoveClasses(elt); elt.find(getICAttributeSelector('ic-remove-class')).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { handleRemoveClasses(_this); } }); } } function processEnhancement(elt) { if (elt.closest('.ic-ignore').length == 0) { if(closestAttrValue(elt, 'ic-enhance') === 'true') { enhanceDomTree(elt); } else { elt.find(getICAttributeSelector('ic-enhance')).each(function(){ enhanceDomTree($(this)); }); } } } function processEventSources(elt) { if (elt.closest('.ic-ignore').length == 0) { handleEventSource(elt); elt.find(getICAttributeSelector('ic-sse-src')).each(function() { var _this = $(this); if (_this.closest('.ic-ignore').length == 0) { handleEventSource(_this); } }); } } //============================================================ // Polling support //============================================================ function startPolling(elt) { if (elt.data('ic-poll-interval-id') == null && getICAttribute(elt, 'ic-pause-polling') != 'true') { var interval = parseInterval(getICAttribute(elt, 'ic-poll')); if (interval != null) { var selector = icSelectorFor(elt); var repeats = parseInt(getICAttribute(elt, 'ic-poll-repeats')) || -1; var currentIteration = 0; log(elt, "POLL: Starting poll for element " + selector, "DEBUG"); var timerId = setInterval(function() { var target = $(selector); triggerEvent(elt, "onPoll.ic", target); if ((target.length == 0) || (currentIteration == repeats) || elt.data('ic-poll-interval-id') != timerId) { log(elt, "POLL: Clearing poll for element " + selector, "DEBUG"); clearTimeout(timerId); } else { fireICRequest(target); } currentIteration++; }, interval); elt.data('ic-poll-interval-id', timerId); } } } function cancelPolling(elt) { if (elt.data('ic-poll-interval-id') != null) { clearTimeout(elt.data('ic-poll-interval-id')); elt.data('ic-poll-interval-id', null); } } //============================================================---- // Dependency support //============================================================---- function refreshDependencies(dest, src) { log(src, "refreshing dependencies for path " + dest, "DEBUG"); $(getICAttributeSelector('ic-src')).each(function() { var fired = false; var _this = $(this); if (verbFor(_this) == "GET" && getICAttribute(_this, 'ic-deps') != 'ignore' ) { if (isDependent(dest, getICAttribute(_this, 'ic-src'))) { if (src == null || $(src)[0] != _this[0]) { fireICRequest(_this); fired = true; } } else if (isICDepsDependent(dest, getICAttribute(_this, 'ic-deps')) || getICAttribute(_this, 'ic-deps') == "*") { if (src == null || $(src)[0] != _this[0]) { fireICRequest(_this); fired = true; } } } if (fired) { log(_this, "depends on path " + dest + ", refreshing...", "DEBUG") } }); } function isICDepsDependent(src, dest) { if(dest) { var paths = dest.split(","); for (var i = 0; i < paths.length; i++) { var str = paths[i].trim(); if(isDependent(src, str)) { return true; } } } return false; } function isDependent(src, dest) { return !!_isDependentFunction(src, dest); } //============================================================---- // Trigger-On support //============================================================---- function verbFor(elt) { elt = $(elt); if (getICAttribute(elt, 'ic-verb')) { return getICAttribute(elt, 'ic-verb').toUpperCase(); } return "GET"; } function eventFor(attr, elt) { if (attr == "default") { elt = $(elt); if (elt.is('button')) { return 'click'; } else if (elt.is('form')) { return 'submit'; } else if (elt.is('input, textarea, select, button')) { return 'change'; } else { return 'click'; } } else { return attr; } } function preventDefault(elt, evt) { return elt.is('form') || (elt.is('input[type="submit"], button') && elt.closest('form').length == 1) || (elt.is('a') && elt.is('[href]') && elt.attr('href').indexOf('#') != 0); } function handleRemoveAfter(elt) { elt = $(elt); if (getICAttribute(elt, 'ic-remove-after')) { var interval = parseInterval(getICAttribute(elt, 'ic-remove-after')); setTimeout(function() { remove(elt); }, interval); } } function parseAndApplyClass(classInfo, elt, operation) { var cssClass = ""; var delay = 50; if (classInfo.indexOf(":") > 0) { var split = classInfo.split(':'); cssClass = split[0]; delay = parseInterval(split[1]); } else { cssClass = classInfo; } setTimeout(function() { elt[operation](cssClass) }, delay); } function handleAddClasses(elt) { elt = $(elt); if (getICAttribute(elt, 'ic-add-class')) { var values = getICAttribute(elt, 'ic-add-class').split(","); var arrayLength = values.length; for (var i = 0; i < arrayLength; i++) { parseAndApplyClass($.trim(values[i]), elt, 'addClass'); } } } function handleRemoveClasses(elt) { elt = $(elt); if (getICAttribute(elt, 'ic-remove-class')) { var values = getICAttribute(elt, 'ic-remove-class').split(","); var arrayLength = values.length; for (var i = 0; i < arrayLength; i++) { parseAndApplyClass($.trim(values[i]), elt, 'removeClass'); } } } function handleEventSource(elt) { elt = $(elt); if (getICAttribute(elt, 'ic-sse-src')) { var evtSrcUrl = getICAttribute(elt, 'ic-sse-src'); var evtSrcWithCredentials = getICAttribute(elt, 'ic-sse-with-credentials') === 'true'; var eventSource = initEventSource(elt, evtSrcUrl, evtSrcWithCredentials); elt.data('ic-event-sse-source', eventSource); elt.data('ic-event-sse-map', {}); } } function initEventSource(elt, evtSrcUrl, evtSrcWithCredentials) { var eventSource = Intercooler._internal.initEventSource(evtSrcUrl, evtSrcWithCredentials); eventSource.onmessage = function(e) { processICResponse(e.data, elt, false); }; return eventSource; } function registerSSE(sourceElement, event) { var source = sourceElement.data('ic-event-sse-source'); var eventMap = sourceElement.data('ic-event-sse-map'); if(source.addEventListener && eventMap[event] != true) { source.addEventListener(event, function(){ sourceElement.find(getICAttributeSelector('ic-trigger-on')).each(function(){ var _that = $(this); if(_that.attr('ic-trigger-on') == "sse:" + event) { fireICRequest(_that); } }); }) } } function getTriggeredElement(elt) { var triggerFrom = getICAttribute(elt, 'ic-trigger-from'); if(triggerFrom) { if (triggerFrom == "document") { return $(document); } else if (triggerFrom == "window") { return $(window); } else { return $(triggerFrom); } } else { return elt; } } function handleTriggerOn(elt) { var triggerOnValue = getICAttribute(elt, 'ic-trigger-on'); if (triggerOnValue) { // record button or submit input click info if(elt.is('form')) { elt.on('click focus', 'input, button, select, textarea', function(e){ if($(this).is('input[type="submit"], button') && $(this).is("[name]")) { elt.data('ic-last-clicked-button', {name:$(this).attr("name"), value:$(this).val()}) } else { elt.data('ic-last-clicked-button', null) } }); } var triggerOnArray = triggerOnValue.split(","); for (var i = 0; i < triggerOnArray.length; i++) { var triggerOn = $.trim(triggerOnArray[i]); var splitTriggerOn = triggerOn.split(" "); var eventString = eventFor(splitTriggerOn[0], $(elt)); var eventModifier = splitTriggerOn[1]; if (triggerOn == 'load') { fireICRequest(elt); } else if (triggerOn == 'scrolled-into-view') { initScrollHandler(); setTimeout(function() { triggerEvent($(window), 'scroll'); }, 100); // Trigger a scroll in case element is already viewable } else { if(eventString.indexOf("sse:") == 0) { //Server-sent event, find closest event source and register for it var sourceElt = elt.closest(getICAttributeSelector('ic-sse-src')); if(sourceElt.length > 0) { registerSSE(sourceElt, splitTriggerOn[0].substr(4)) } } else { $(getTriggeredElement(elt)).on(eventString, function(e) { var onBeforeTrigger = closestAttrValue(elt, 'ic-on-beforeTrigger'); if (onBeforeTrigger) { if (globalEval(onBeforeTrigger, [["elt", elt], ["evt", e], ["elt", elt]]) == false) { log(elt, "ic-trigger cancelled by ic-on-beforeTrigger", "DEBUG"); return false; } } if (eventModifier == 'changed') { var currentVal = elt.val(); var previousVal = elt.data('ic-previous-val'); elt.data('ic-previous-val', currentVal); if (currentVal != previousVal) { fireICRequest(elt); } } else if (eventModifier == 'once') { var alreadyTriggered = elt.data('ic-already-triggered'); elt.data('ic-already-triggered', true); if (alreadyTriggered !== true) { fireICRequest(elt); } } else { fireICRequest(elt); } if (preventDefault(elt, e)) { e.preventDefault(); return false; } return true; }); if(eventString && (eventString.indexOf("timeout:") == 0)) { var timeout = parseInterval(eventString.split(":")[1]); setTimeout(function () { $(getTriggeredElement(elt)).trigger(eventString); }, timeout); } } } } } } //============================================================---- // Macro support //============================================================---- function macroIs(macro, constant) { return macro == fixICAttributeName(constant); } function processMacro(macro, elt) { // action attributes if (macroIs(macro, 'ic-post-to')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-post-to')); setIfAbsent(elt, 'ic-verb', 'POST'); setIfAbsent(elt, 'ic-trigger-on', 'default'); setIfAbsent(elt, 'ic-deps', 'ignore'); } if (macroIs(macro, 'ic-put-to')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-put-to')); setIfAbsent(elt, 'ic-verb', 'PUT'); setIfAbsent(elt, 'ic-trigger-on', 'default'); setIfAbsent(elt, 'ic-deps', 'ignore'); } if (macroIs(macro, 'ic-patch-to')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-patch-to')); setIfAbsent(elt, 'ic-verb', 'PATCH'); setIfAbsent(elt, 'ic-trigger-on', 'default'); setIfAbsent(elt, 'ic-deps', 'ignore'); } if (macroIs(macro, 'ic-get-from')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-get-from')); setIfAbsent(elt, 'ic-trigger-on', 'default'); setIfAbsent(elt, 'ic-deps', 'ignore'); } if (macroIs(macro, 'ic-delete-from')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-delete-from')); setIfAbsent(elt, 'ic-verb', 'DELETE'); setIfAbsent(elt, 'ic-trigger-on', 'default'); setIfAbsent(elt, 'ic-deps', 'ignore'); } if (macroIs(macro, 'ic-action')) { setIfAbsent(elt, 'ic-trigger-on', 'default'); } // non-action attributes var value = null; var url = null; if (macroIs(macro, 'ic-style-src')) { value = getICAttribute(elt, 'ic-style-src').split(":"); var styleAttribute = value[0]; url = value[1]; setIfAbsent(elt, 'ic-src', url); setIfAbsent(elt, 'ic-target', 'this.style.' + styleAttribute); } if (macroIs(macro, 'ic-attr-src')) { value = getICAttribute(elt, 'ic-attr-src').split(":"); var attribute = value[0]; url = value[1]; setIfAbsent(elt, 'ic-src', url); setIfAbsent(elt, 'ic-target', 'this.' + attribute); } if (macroIs(macro, 'ic-prepend-from')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-prepend-from')); setIfAbsent(elt, 'ic-swap-style', 'prepend'); } if (macroIs(macro, 'ic-append-from')) { setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-append-from')); setIfAbsent(elt, 'ic-swap-style', 'append'); } } function isLocalLink(anchor) { return location.hostname === anchor[0].hostname && anchor.attr('href') && !anchor.attr('href').startsWith("#") } function enhanceAnchor(anchor) { if (closestAttrValue(anchor, 'ic-enhance') === "true") { if (isLocalLink(anchor)) { setIfAbsent(anchor, 'ic-src', anchor.attr('href')); setIfAbsent(anchor, 'ic-trigger-on', 'default'); setIfAbsent(anchor, 'ic-deps', 'ignore'); setIfAbsent(anchor, 'ic-push-url', 'true'); } } } function determineFormVerb(form) { return form.find('input[name="_method"]').val() || form.attr('method') || form[0].method; } function enhanceForm(form) { if (closestAttrValue(form, 'ic-enhance') === "true") { setIfAbsent(form, 'ic-src', form.attr('action')); setIfAbsent(form, 'ic-trigger-on', 'default'); setIfAbsent(form, 'ic-deps', 'ignore'); setIfAbsent(form, 'ic-verb', determineFormVerb(form)); } } function enhanceDomTree(elt) { if(elt.is('a')) { enhanceAnchor(elt); } elt.find('a').each(function(){ enhanceAnchor($(this)); }); if(elt.is('form')){ enhanceForm(elt); } elt.find('form').each(function(){ enhanceForm($(this)); }); } function setIfAbsent(elt, attr, value) { if (getICAttribute(elt, attr) == null) { setICAttribute(elt, attr, value); } } //============================================================---- // Utilities //============================================================---- function isScrolledIntoView(elem) { elem = $(elem); if (elem.height() == 0 && elem.width() == 0) { return false; } var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = elem.offset().top; var elemBottom = elemTop + elem.height(); return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) && (elemBottom <= docViewBottom) && (elemTop >= docViewTop)); } function maybeScrollToTarget(elt, target) { if (closestAttrValue(elt, 'ic-scroll-to-target') != "false" && (closestAttrValue(elt, 'ic-scroll-to-target') == 'true' || closestAttrValue(target, 'ic-scroll-to-target') == 'true')) { var offset = -50; // -50 px default offset padding if (closestAttrValue(elt, 'ic-scroll-offset')) { offset = parseInt(closestAttrValue(elt, 'ic-scroll-offset')); } else if (closestAttrValue(target, 'ic-scroll-offset')) { offset = parseInt(closestAttrValue(target, 'ic-scroll-offset')); } var currentPosition = target.offset().top; var portalTop = $(window).scrollTop(); var portalEnd = portalTop + window.innerHeight; //if the current top of this element is not visible, scroll it to the top position if (currentPosition < portalTop || currentPosition > portalEnd) { offset += currentPosition; $('html,body').animate({scrollTop: offset}, 400); } } } function getTransitionDuration(elt, target) { var transitionDuration = closestAttrValue(elt, 'ic-transition-duration'); if (transitionDuration) { return parseInterval(transitionDuration); } transitionDuration = closestAttrValue(target, 'ic-transition-duration'); if (transitionDuration) { return parseInterval(transitionDuration); } target = $(target); var duration = 0; var durationStr = target.css('transition-duration'); if (durationStr) { duration += parseInterval(durationStr); } var delayStr = target.css('transition-delay'); if (delayStr) { duration += parseInterval(delayStr); } return duration; } function closeSSESource(elt) { var src = elt.data('ic-event-sse-source'); try { if(src) { src.close(); } } catch (e) { log(elt, "Error closing ServerSentEvent source" + e, "ERROR"); } } function beforeSwapCleanup(target) { target.find(getICAttributeSelector('ic-sse-src')).each(function() { closeSSESource($(this)); }); triggerEvent(target, 'beforeSwap.ic'); } function processICResponse(responseContent, elt, forHistory, url) { if (responseContent && responseContent != "" && responseContent != " ") { log(elt, "response content: \n" + responseContent, "DEBUG"); var target = getTarget(elt); var transformer = closestAttrValue(elt, 'ic-transform-response'); if(transformer) { responseContent = globalEval(transformer, [["content", responseContent], ["url", url], ["elt", elt]]); } var contentToSwap = maybeFilter(responseContent, closestAttrValue(elt, 'ic-select-from-response')); if (closestAttrValue(elt, 'ic-fix-ids') == "true") { fixIDs(contentToSwap); } var doSwap = function() { if (closestAttrValue(elt, 'ic-replace-target') == "true") { try { beforeSwapCleanup(target); closeSSESource(target); target.replaceWith(contentToSwap); target = contentToSwap; } catch (e) { log(elt, formatError(e), "ERROR"); } processNodes(contentToSwap); fireReadyStuff(target); autoFocus(target); } else { if (getICAttribute(elt, 'ic-swap-style') == "prepend") { prepend(target, contentToSwap); processNodes(contentToSwap); fireReadyStuff(target); autoFocus(target); } else if (getICAttribute(elt, 'ic-swap-style') == "append") { append(target, contentToSwap); processNodes(contentToSwap); fireReadyStuff(target); autoFocus(target); } else { try { beforeSwapCleanup(target); target.empty().append(contentToSwap); } catch (e) { log(elt, formatError(e), "ERROR"); } target.children().each(function() { processNodes(this); }); fireReadyStuff(target); autoFocus(target); } if (forHistory != true) { maybeScrollToTarget(elt, target); } var switchClass = elt.closest(getICAttributeSelector('ic-switch-class')); var classToSwitch = switchClass.attr(fixICAttributeName('ic-switch-class')); if(classToSwitch) { switchClass.children().removeClass(classToSwitch); switchClass.children().each(function(){ if($.contains($(this)[0], $(elt)[0]) || $(this)[0] == $(elt)[0]) { $(this).addClass(classToSwitch); $(this).addClass(classToSwitch); } }) } } }; if (target.length == 0) { //TODO cgross - refactor getTarget to return printable string here log(elt, "Invalid target for element: " + getICAttribute(elt.closest(getICAttributeSelector('ic-target')), 'ic-target'), "ERROR"); return; } var delay = getTransitionDuration(elt, target); target.addClass('ic-transitioning'); setTimeout(function() { try { doSwap(); } catch (e) { log(elt, "Error during content swap : " + formatError(e), "ERROR"); } setTimeout(function() { try { target.removeClass('ic-transitioning'); if(_history) { _history.updateHistory(); } triggerEvent(target, "complete_transition.ic", [target]); } catch (e) { log(elt, "Error during transition complete : " + formatError(e), "ERROR"); } }, 20); }, delay); } else { log(elt, "Empty response, nothing to do here.", "DEBUG"); } } function maybeFilter(newContent, filter) { var asQuery; if ($.zepto) { var newDoc = createDocument(newContent); asQuery = $(newDoc).find('body').contents(); } else { asQuery = $($.parseHTML(newContent, null, true)); } if (filter) { return walkTree(asQuery, filter).contents(); } else { return asQuery; } } function walkTree(elt, filter) { return elt.filter(filter).add(elt.find(filter)); } function fixIDs(contentToSwap) { var fixedIDs = {}; walkTree(contentToSwap, "[id]").each(function() { var originalID = $(this).attr("id"); var fixedID; do { fixedID = "ic-fixed-id-" + uuid(); } while ($("#" + fixedID).length > 0); fixedIDs[originalID] = fixedID; $(this).attr("id", fixedID); }); walkTree(contentToSwap, "label[for]").each(function () { var originalID = $(this).attr("for"); $(this).attr("for", fixedIDs[originalID] || originalID); }); walkTree(contentToSwap, "*").each(function () { $.each(this.attributes, function () { if (this.value.indexOf("#") !== -1) { this.value = this.value.replace(/#([-_A-Za-z0-9]+)/g, function(match, originalID) { return "#" + (fixedIDs[originalID] || originalID); }); } }) }); } function getStyleTarget(elt) { var val = closestAttrValue(elt, 'ic-target'); if (val && val.indexOf("this.style.") == 0) { return val.substr(11) } else { return null; } } function getAttrTarget(elt) { var val = closestAttrValue(elt, 'ic-target'); if (val && val.indexOf("this.") == 0) { return val.substr(5) } else { return null; } } function fireICRequest(elt, alternateHandler) { elt = $(elt); var triggerOrigin = elt; if (!elt.is(getICAttributeSelector('ic-src')) && getICAttribute(elt, 'ic-action') == undefined) { elt = elt.closest(getICAttributeSelector('ic-src')); } var confirmText = closestAttrValue(elt, 'ic-confirm'); if (confirmText) { if (!confirm(confirmText)) { return; } } if("true" == closestAttrValue(elt, 'ic-disable-when-doc-hidden')) { if(document['hidden']) { return; } } if("true" == closestAttrValue(elt, 'ic-disable-when-doc-inactive')) { if(!document.hasFocus()) { return; } } if (elt.length > 0) { var icEventId = uuid(); elt.data('ic-event-id', icEventId); var invokeRequest = function() { // if an existing request is in flight for this element, push this request as the next to be executed if (elt.data('ic-request-in-flight') == true) { elt.data('ic-next-request', {"req" : invokeRequest}); return; } if (elt.data('ic-event-id') == icEventId) { var styleTarget = getStyleTarget(elt); var attrTarget = styleTarget ? null : getAttrTarget(elt); var verb = verbFor(elt); var url = getICAttribute(elt, 'ic-src'); if (url) { var success = alternateHandler || function(data) { if (styleTarget) { elt.css(styleTarget, data); } else if (attrTarget) { elt.attr(attrTarget, data); } else { processICResponse(data, elt, false, url); if (verb != 'GET') { refreshDependencies(getICAttribute(elt, 'ic-src'), elt); } } }; var data = getParametersForElement(verb, elt, triggerOrigin); if(data) { handleRemoteRequest(elt, verb, url, data, success); } } maybeInvokeLocalAction(elt, ""); } }; var triggerDelay = closestAttrValue(elt, 'ic-trigger-delay'); if (triggerDelay) { setTimeout(invokeRequest, parseInterval(triggerDelay)); } else { invokeRequest(); } } } function maybeInvokeLocalAction(elt, modifier) { var actions = getICAttribute(elt, 'ic' + modifier + '-action'); if (actions) { invokeLocalAction(elt, actions, modifier); } } function invokeLocalAction(elt, actions, modifier) { var actionTargetVal = closestAttrValue(elt, 'ic' + modifier + '-action-target'); if(actionTargetVal === null && modifier !== "") { actionTargetVal = closestAttrValue(elt, 'ic-action-target'); } var target = null; if(actionTargetVal) { target = getTargetImpl(elt, 'ic-action-target'); } else { target = getTarget(elt); } var actionArr = actions.split(";"); var actionsArr = []; var delay = 0; $.each(actionArr, function(i, actionStr) { var actionDef = $.trim(actionStr); var action = actionDef; var actionArgs = []; if (actionDef.indexOf(":") > 0) { action = actionDef.substr(0, actionDef.indexOf(":")); actionArgs = computeArgs(actionDef.substr(actionDef.indexOf(":") + 1, actionDef.length)); } if (action == "") { // ignore blanks } else if (action == "delay") { if (delay == null) { delay = 0; } delay += parseInterval(actionArgs[0] + ""); // custom interval increase } else { if (delay == null) { delay = 420; // 420ms default interval increase (400ms jQuery default + 20ms slop) } actionsArr.push([delay, makeApplyAction(target, action, actionArgs)]); delay = null; } }); delay = 0; $.each(actionsArr, function(i, action) { delay += action[0]; setTimeout(action[1], delay); }); } function computeArgs(args) { try { return eval("[" + args + "]") } catch (e) { return [$.trim(args)]; } } function makeApplyAction(target, action, args) { return function() { var func = target[action] || window[action]; if (func) { func.apply(target, args); } else { log(target, "Action " + action + " was not found", "ERROR"); } }; } //============================================================ // History Support //============================================================ function newIntercoolerHistory(storage, history, slotLimit, historyVersion) { /* Constants */ var HISTORY_SUPPORT_SLOT = 'ic-history-support'; var HISTORY_SLOT_PREFIX = "ic-hist-elt-"; /* Instance Vars */ var historySupportData = JSON.parse(storage.getItem(HISTORY_SUPPORT_SLOT)); var _snapshot = null; // Reset history if the history config has changed if (historyConfigHasChanged(historySupportData)) { log(getTargetForHistory($('body')), "Intercooler History configuration changed, clearing history", "INFO"); clearHistory(); } if (historySupportData == null) { historySupportData = { slotLimit: slotLimit, historyVersion: historyVersion, lruList: [] }; } /* Instance Methods */ function historyConfigHasChanged(historySupportData) { return historySupportData == null || historySupportData.slotLimit != slotLimit || historySupportData.historyVersion != historyVersion || historySupportData.lruList == null } function clearHistory() { var keys = []; for (var i = 0; i < storage.length; i++) { if (storage.key(i).indexOf(HISTORY_SLOT_PREFIX) == 0) { keys.push(storage.key(i)); } } for (var j = 0; j < keys.length; j++) { storage.removeItem(keys[j]); } storage.removeItem(HISTORY_SUPPORT_SLOT); historySupportData = { slotLimit: slotLimit, historyVersion: historyVersion, lruList: [] }; } function updateLRUList(url) { var lruList = historySupportData.lruList; var currentIndex = lruList.indexOf(url); var t = getTargetForHistory($('body')); // found in current list, shift it to the end if (currentIndex >= 0) { log(t, "URL found in LRU list, moving to end", "INFO"); lruList.splice(currentIndex, 1); lruList.push(url); } else { // not found, add and shift if necessary log(t, "URL not found in LRU list, adding", "INFO"); lruList.push(url); if (lruList.length > historySupportData.slotLimit) { var urlToDelete = lruList.shift(); log(t, "History overflow, removing local history for " + urlToDelete, "INFO"); storage.removeItem(HISTORY_SLOT_PREFIX + urlToDelete); } } // save history metadata storage.setItem(HISTORY_SUPPORT_SLOT, JSON.stringify(historySupportData)); return lruList; } function saveHistoryData(restorationData) { var content = JSON.stringify(restorationData); try { storage.setItem(restorationData.id, content); } catch (e) { //quota error, nuke local cache try { clearHistory(); storage.setItem(restorationData.id, content); } catch (e) { log(getTargetForHistory($('body')), "Unable to save intercooler history with entire history cleared, is something else eating " + "local storage? History Limit:" + slotLimit, "ERROR"); } } } function makeHistoryEntry(html, yOffset, url, title) { var restorationData = { "url": url, "id": HISTORY_SLOT_PREFIX + url, "content": html, "yOffset": yOffset, "timestamp": new Date().getTime(), "title": title }; updateLRUList(url); // save to the history slot saveHistoryData(restorationData); return restorationData; } function addPopStateHandler(windowToAdd) { if (windowToAdd.onpopstate == null || windowToAdd.onpopstate['ic-on-pop-state-handler'] != true) { var currentOnPopState = windowToAdd.onpopstate; windowToAdd.onpopstate = function(event) { triggerEvent(getTargetForHistory($('body')), 'handle.onpopstate.ic'); if (!handleHistoryNavigation(event)) { if (currentOnPopState) { currentOnPopState(event); } } triggerEvent(getTargetForHistory($('body')), 'pageLoad.ic'); }; windowToAdd.onpopstate['ic-on-pop-state-handler'] = true; } } function updateHistory() { if (_snapshot) { pushUrl(_snapshot.newUrl, currentUrl(), _snapshot.oldHtml, _snapshot.yOffset, _snapshot.oldTitle); _snapshot = null; } } function pushUrl(newUrl, originalUrl, originalHtml, yOffset, originalTitle) { var historyEntry = makeHistoryEntry(originalHtml, yOffset, originalUrl, originalTitle); history.replaceState({"ic-id": historyEntry.id}, "", ""); var t = getTargetForHistory($('body')); var restorationData = makeHistoryEntry(t.html(), window.pageYOffset, newUrl, document.title); history.pushState({'ic-id': restorationData.id}, "", newUrl); triggerEvent(t, "pushUrl.ic", [t, restorationData]); } function handleHistoryNavigation(event) { var data = event.state; if (data && data['ic-id']) { var historyData = JSON.parse(storage.getItem(data['ic-id'])); if (historyData) { processICResponse(historyData["content"], getTargetForHistory($('body')), true); if (historyData["yOffset"]) { setTimeout(function () { window.scrollTo(0, historyData["yOffset"]); }, 100); } if (historyData["title"]) { document.title = historyData["title"]; } return true; } else { $.get(currentUrl(), {'ic-restore-history': true}, function(data, status) { var newDoc = createDocument(data); var replacementHtml = getTargetForHistory(newDoc).html(); processICResponse(replacementHtml, getTargetForHistory($('body')), true); }); } } return false; } function getTargetForHistory(elt) { var explicitHistoryTarget = elt.find(getICAttributeSelector('ic-history-elt')); if (explicitHistoryTarget.length > 0) { return explicitHistoryTarget; } else { return elt; } } function snapshotForHistory(newUrl, oldTitle) { var t = getTargetForHistory($('body')); triggerEvent(t, "beforeHistorySnapshot.ic", [t]); _snapshot = { newUrl: newUrl, oldHtml: t.html(), yOffset: window.pageYOffset, oldTitle: oldTitle }; } function dumpLocalStorage() { var str = ""; var keys = []; for (var x in storage) { keys.push(x); } keys.sort(); var total = 0; for (var i in keys) { var size = (storage[keys[i]].length * 2); total += size; str += keys[i] + "=" + (size / 1024 / 1024).toFixed(2) + " MB\n"; } return str + "\nTOTAL LOCAL STORAGE: " + (total / 1024 / 1024).toFixed(2) + " MB"; } function supportData() { return historySupportData; } /* API */ return { clearHistory: clearHistory, updateHistory: updateHistory, addPopStateHandler: addPopStateHandler, snapshotForHistory: snapshotForHistory, _internal: { addPopStateHandler: addPopStateHandler, supportData: supportData, dumpLocalStorage: dumpLocalStorage, updateLRUList: updateLRUList } }; } function getSlotLimit() { return 20; } function refresh(val) { if (typeof val == 'string' || val instanceof String) { refreshDependencies(val); } else { fireICRequest(val); } return Intercooler; } var _history = null; try { _history = newIntercoolerHistory(localStorage, window.history, getSlotLimit(), .1); } catch(e) { log($('body'), "Could not initialize history", "WARN"); } //============================================================ // Local references transport //============================================================ if($.ajaxTransport) { $.ajaxTransport("text", function(options, origOptions) { if (origOptions.url[0] == "#") { var ltAttr = fixICAttributeName("ic-local-"); var src = $(origOptions.url); var rsphdr = []; var status = 200; var statusText = "OK"; src.each(function(i, el) { $.each(el.attributes, function(j, attr) { if (attr.name.substr(0, ltAttr.length) == ltAttr) { var lhName = attr.name.substring(ltAttr.length); if (lhName == "status") { var statusLine = attr.value.match(/(\d+)\s?(.*)/); if (statusLine != null) { status = statusLine[1]; statusText = statusLine[2]; } else { status = "500"; statusText = "Attribute Error"; } } else { rsphdr.push(lhName + ": " + attr.value); } } }); }); var rsp = src.length > 0 ? src.html() : ""; return { send: function(reqhdr, completeCallback) { completeCallback(status, statusText, {html: rsp}, rsphdr.join("\n")); }, abort: function() { } }; } else { return null; } } ); } //============================================================ // Bootstrap //============================================================ function init() { var elt = $('body'); processNodes(elt); fireReadyStuff(elt); if(_history) { _history.addPopStateHandler(window); } if($.zepto) { $('body').data('zeptoDataTest', {}); if(typeof($('body').data('zeptoDataTest')) == "string") { log(null, "!!!! Please include the data module with Zepto! Intercooler requires full data support to function !!!!", "ERROR") } } } $(function() { init(); }); /* =================================================== * API * =================================================== */ return { refresh: refresh, history: _history, triggerRequest: fireICRequest, processNodes: processNodes, closestAttrValue: closestAttrValue, verbFor: verbFor, isDependent: isDependent, getTarget: getTarget, processHeaders: processHeaders, startPolling: startPolling, cancelPolling: cancelPolling, setIsDependentFunction: function(func) { _isDependentFunction = func; }, ready: function(readyHandler) { _readyHandlers.push(readyHandler); }, _internal: { init: init, replaceOrAddMethod: replaceOrAddMethod, initEventSource: function(url, withCredentials) { return new EventSource(url, {withCredentials: withCredentials}); }, globalEval: globalEval, getLocalURL: getLocalURL } }; })(); return Intercooler; })); ================================================ FILE: brutaldon/static/js/jquery.magnific-popup.js ================================================ /*! Magnific Popup - v1.1.0 - 2016-02-20 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2016 Dmitry Semenov; */ ;(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS factory(require('jquery')); } else { // Browser globals factory(window.jQuery || window.Zepto); } }(function($) { /*>>core*/ /** * * Magnific Popup Core JS file * */ /** * Private static constants */ var CLOSE_EVENT = 'Close', BEFORE_CLOSE_EVENT = 'BeforeClose', AFTER_CLOSE_EVENT = 'AfterClose', BEFORE_APPEND_EVENT = 'BeforeAppend', MARKUP_PARSE_EVENT = 'MarkupParse', OPEN_EVENT = 'Open', CHANGE_EVENT = 'Change', NS = 'mfp', EVENT_NS = '.' + NS, READY_CLASS = 'mfp-ready', REMOVING_CLASS = 'mfp-removing', PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; /** * Private vars */ /*jshint -W079 */ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' MagnificPopup = function(){}, _isJQ = !!(window.jQuery), _prevStatus, _window = $(window), _document, _prevContentType, _wrapClasses, _currPopupType; /** * Private functions */ var _mfpOn = function(name, f) { mfp.ev.on(NS + name + EVENT_NS, f); }, _getEl = function(className, appendTo, html, raw) { var el = document.createElement('div'); el.className = 'mfp-'+className; if(html) { el.innerHTML = html; } if(!raw) { el = $(el); if(appendTo) { el.appendTo(appendTo); } } else if(appendTo) { appendTo.appendChild(el); } return el; }, _mfpTrigger = function(e, data) { mfp.ev.triggerHandler(NS + e, data); if(mfp.st.callbacks) { // converts "mfpEventName" to "eventName" callback and triggers it if it's present e = e.charAt(0).toLowerCase() + e.slice(1); if(mfp.st.callbacks[e]) { mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); } } }, _getCloseBtn = function(type) { if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); _currPopupType = type; } return mfp.currTemplate.closeBtn; }, // Initialize Magnific Popup only when called at least once _checkInstance = function() { if(!$.magnificPopup.instance) { /*jshint -W020 */ mfp = new MagnificPopup(); mfp.init(); $.magnificPopup.instance = mfp; } }, // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr supportsTransitions = function() { var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist v = ['ms','O','Moz','Webkit']; // 'v' for vendor if( s['transition'] !== undefined ) { return true; } while( v.length ) { if( v.pop() + 'Transition' in s ) { return true; } } return false; }; /** * Public functions */ MagnificPopup.prototype = { constructor: MagnificPopup, /** * Initializes Magnific Popup plugin. * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed */ init: function() { var appVersion = navigator.appVersion; mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; mfp.isAndroid = (/android/gi).test(appVersion); mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); mfp.supportsTransition = supportsTransitions(); // We disable fixed positioned lightbox on devices that don't handle it nicely. // If you know a better way of detecting this - let me know. mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); _document = $(document); mfp.popupsCache = {}; }, /** * Opens popup * @param data [description] */ open: function(data) { var i; if(data.isObj === false) { // convert jQuery collection to array to avoid conflicts later mfp.items = data.items.toArray(); mfp.index = 0; var items = data.items, item; for(i = 0; i < items.length; i++) { item = items[i]; if(item.parsed) { item = item.el[0]; } if(item === data.el[0]) { mfp.index = i; break; } } } else { mfp.items = $.isArray(data.items) ? data.items : [data.items]; mfp.index = data.index || 0; } // if popup is already opened - we just update the content if(mfp.isOpen) { mfp.updateItemHTML(); return; } mfp.types = []; _wrapClasses = ''; if(data.mainEl && data.mainEl.length) { mfp.ev = data.mainEl.eq(0); } else { mfp.ev = _document; } if(data.key) { if(!mfp.popupsCache[data.key]) { mfp.popupsCache[data.key] = {}; } mfp.currTemplate = mfp.popupsCache[data.key]; } else { mfp.currTemplate = {}; } mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; if(mfp.st.modal) { mfp.st.closeOnContentClick = false; mfp.st.closeOnBgClick = false; mfp.st.showCloseBtn = false; mfp.st.enableEscapeKey = false; } // Building markup // main containers are created only once if(!mfp.bgOverlay) { // Dark overlay mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { mfp.close(); }); mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { if(mfp._checkIfClose(e.target)) { mfp.close(); } }); mfp.container = _getEl('container', mfp.wrap); } mfp.contentContainer = _getEl('content'); if(mfp.st.preloader) { mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); } // Initializing modules var modules = $.magnificPopup.modules; for(i = 0; i < modules.length; i++) { var n = modules[i]; n = n.charAt(0).toUpperCase() + n.slice(1); mfp['init'+n].call(mfp); } _mfpTrigger('BeforeOpen'); if(mfp.st.showCloseBtn) { // Close button if(!mfp.st.closeBtnInside) { mfp.wrap.append( _getCloseBtn() ); } else { _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { values.close_replaceWith = _getCloseBtn(item.type); }); _wrapClasses += ' mfp-close-btn-in'; } } if(mfp.st.alignTop) { _wrapClasses += ' mfp-align-top'; } if(mfp.fixedContentPos) { mfp.wrap.css({ overflow: mfp.st.overflowY, overflowX: 'hidden', overflowY: mfp.st.overflowY }); } else { mfp.wrap.css({ top: _window.scrollTop(), position: 'absolute' }); } if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { mfp.bgOverlay.css({ height: _document.height(), position: 'absolute' }); } if(mfp.st.enableEscapeKey) { // Close on ESC key _document.on('keyup' + EVENT_NS, function(e) { if(e.keyCode === 27) { mfp.close(); } }); } _window.on('resize' + EVENT_NS, function() { mfp.updateSize(); }); if(!mfp.st.closeOnContentClick) { _wrapClasses += ' mfp-auto-cursor'; } if(_wrapClasses) mfp.wrap.addClass(_wrapClasses); // this triggers recalculation of layout, so we get it once to not to trigger twice var windowHeight = mfp.wH = _window.height(); var windowStyles = {}; if( mfp.fixedContentPos ) { if(mfp._hasScrollBar(windowHeight)){ var s = mfp._getScrollbarSize(); if(s) { windowStyles.marginRight = s; } } } if(mfp.fixedContentPos) { if(!mfp.isIE7) { windowStyles.overflow = 'hidden'; } else { // ie7 double-scroll bug $('body, html').css('overflow', 'hidden'); } } var classesToadd = mfp.st.mainClass; if(mfp.isIE7) { classesToadd += ' mfp-ie7'; } if(classesToadd) { mfp._addClassToMFP( classesToadd ); } // add content mfp.updateItemHTML(); _mfpTrigger('BuildControls'); // remove scrollbar, add margin e.t.c $('html').css(windowStyles); // add everything to DOM mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); // Save last focused element mfp._lastFocusedEl = document.activeElement; // Wait for next cycle to allow CSS transition setTimeout(function() { if(mfp.content) { mfp._addClassToMFP(READY_CLASS); mfp._setFocus(); } else { // if content is not defined (not loaded e.t.c) we add class only for BG mfp.bgOverlay.addClass(READY_CLASS); } // Trap the focus in popup _document.on('focusin' + EVENT_NS, mfp._onFocusIn); }, 16); mfp.isOpen = true; mfp.updateSize(windowHeight); _mfpTrigger(OPEN_EVENT); return data; }, /** * Closes the popup */ close: function() { if(!mfp.isOpen) return; _mfpTrigger(BEFORE_CLOSE_EVENT); mfp.isOpen = false; // for CSS3 animation if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { mfp._addClassToMFP(REMOVING_CLASS); setTimeout(function() { mfp._close(); }, mfp.st.removalDelay); } else { mfp._close(); } }, /** * Helper for close() function */ _close: function() { _mfpTrigger(CLOSE_EVENT); var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; mfp.bgOverlay.detach(); mfp.wrap.detach(); mfp.container.empty(); if(mfp.st.mainClass) { classesToRemove += mfp.st.mainClass + ' '; } mfp._removeClassFromMFP(classesToRemove); if(mfp.fixedContentPos) { var windowStyles = {marginRight: ''}; if(mfp.isIE7) { $('body, html').css('overflow', ''); } else { windowStyles.overflow = ''; } $('html').css(windowStyles); } _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); mfp.ev.off(EVENT_NS); // clean up DOM elements that aren't removed mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); mfp.bgOverlay.attr('class', 'mfp-bg'); mfp.container.attr('class', 'mfp-container'); // remove close button from target element if(mfp.st.showCloseBtn && (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { if(mfp.currTemplate.closeBtn) mfp.currTemplate.closeBtn.detach(); } if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { $(mfp._lastFocusedEl).focus(); // put tab focus back } mfp.currItem = null; mfp.content = null; mfp.currTemplate = null; mfp.prevHeight = 0; _mfpTrigger(AFTER_CLOSE_EVENT); }, updateSize: function(winHeight) { if(mfp.isIOS) { // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; var height = window.innerHeight * zoomLevel; mfp.wrap.css('height', height); mfp.wH = height; } else { mfp.wH = winHeight || _window.height(); } // Fixes #84: popup incorrectly positioned with position:relative on body if(!mfp.fixedContentPos) { mfp.wrap.css('height', mfp.wH); } _mfpTrigger('Resize'); }, /** * Set content of popup based on current index */ updateItemHTML: function() { var item = mfp.items[mfp.index]; // Detach and perform modifications mfp.contentContainer.detach(); if(mfp.content) mfp.content.detach(); if(!item.parsed) { item = mfp.parseEl( mfp.index ); } var type = item.type; _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); // BeforeChange event works like so: // _mfpOn('BeforeChange', function(e, prevType, newType) { }); mfp.currItem = item; if(!mfp.currTemplate[type]) { var markup = mfp.st[type] ? mfp.st[type].markup : false; // allows to modify markup _mfpTrigger('FirstMarkupParse', markup); if(markup) { mfp.currTemplate[type] = $(markup); } else { // if there is no markup found we just define that template is parsed mfp.currTemplate[type] = true; } } if(_prevContentType && _prevContentType !== item.type) { mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); } var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); mfp.appendContent(newContent, type); item.preloaded = true; _mfpTrigger(CHANGE_EVENT, item); _prevContentType = item.type; // Append container back after its content changed mfp.container.prepend(mfp.contentContainer); _mfpTrigger('AfterChange'); }, /** * Set HTML content of popup */ appendContent: function(newContent, type) { mfp.content = newContent; if(newContent) { if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && mfp.currTemplate[type] === true) { // if there is no markup, we just append close button element inside if(!mfp.content.find('.mfp-close').length) { mfp.content.append(_getCloseBtn()); } } else { mfp.content = newContent; } } else { mfp.content = ''; } _mfpTrigger(BEFORE_APPEND_EVENT); mfp.container.addClass('mfp-'+type+'-holder'); mfp.contentContainer.append(mfp.content); }, /** * Creates Magnific Popup data object based on given data * @param {int} index Index of item to parse */ parseEl: function(index) { var item = mfp.items[index], type; if(item.tagName) { item = { el: $(item) }; } else { type = item.type; item = { data: item, src: item.src }; } if(item.el) { var types = mfp.types; // check for 'mfp-TYPE' class for(var i = 0; i < types.length; i++) { if( item.el.hasClass('mfp-'+types[i]) ) { type = types[i]; break; } } item.src = item.el.attr('data-mfp-src'); if(!item.src) { item.src = item.el.attr('href'); } } item.type = type || mfp.st.type || 'inline'; item.index = index; item.parsed = true; mfp.items[index] = item; _mfpTrigger('ElementParse', item); return mfp.items[index]; }, /** * Initializes single popup or a group of popups */ addGroup: function(el, options) { var eHandler = function(e) { e.mfpEl = this; mfp._openClick(e, el, options); }; if(!options) { options = {}; } var eName = 'click.magnificPopup'; options.mainEl = el; if(options.items) { options.isObj = true; el.off(eName).on(eName, eHandler); } else { options.isObj = false; if(options.delegate) { el.off(eName).on(eName, options.delegate , eHandler); } else { options.items = el; el.off(eName).on(eName, eHandler); } } }, _openClick: function(e, el, options) { var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { return; } var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; if(disableOn) { if($.isFunction(disableOn)) { if( !disableOn.call(mfp) ) { return true; } } else { // else it's number if( _window.width() < disableOn ) { return true; } } } if(e.type) { e.preventDefault(); // This will prevent popup from closing if element is inside and popup is already opened if(mfp.isOpen) { e.stopPropagation(); } } options.el = $(e.mfpEl); if(options.delegate) { options.items = el.find(options.delegate); } mfp.open(options); }, /** * Updates text on preloader */ updateStatus: function(status, text) { if(mfp.preloader) { if(_prevStatus !== status) { mfp.container.removeClass('mfp-s-'+_prevStatus); } if(!text && status === 'loading') { text = mfp.st.tLoading; } var data = { status: status, text: text }; // allows to modify status _mfpTrigger('UpdateStatus', data); status = data.status; text = data.text; mfp.preloader.html(text); mfp.preloader.find('a').on('click', function(e) { e.stopImmediatePropagation(); }); mfp.container.addClass('mfp-s-'+status); _prevStatus = status; } }, /* "Private" helpers that aren't private at all */ // Check to close popup or not // "target" is an element that was clicked _checkIfClose: function(target) { if($(target).hasClass(PREVENT_CLOSE_CLASS)) { return; } var closeOnContent = mfp.st.closeOnContentClick; var closeOnBg = mfp.st.closeOnBgClick; if(closeOnContent && closeOnBg) { return true; } else { // We close the popup if click is on close button or on preloader. Or if there is no content. if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { return true; } // if click is outside the content if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { if(closeOnBg) { // last check, if the clicked element is in DOM, (in case it's removed onclick) if( $.contains(document, target) ) { return true; } } } else if(closeOnContent) { return true; } } return false; }, _addClassToMFP: function(cName) { mfp.bgOverlay.addClass(cName); mfp.wrap.addClass(cName); }, _removeClassFromMFP: function(cName) { this.bgOverlay.removeClass(cName); mfp.wrap.removeClass(cName); }, _hasScrollBar: function(winHeight) { return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); }, _setFocus: function() { (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); }, _onFocusIn: function(e) { if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { mfp._setFocus(); return false; } }, _parseMarkup: function(template, values, item) { var arr; if(item.data) { values = $.extend(item.data, values); } _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); $.each(values, function(key, value) { if(value === undefined || value === false) { return true; } arr = key.split('_'); if(arr.length > 1) { var el = template.find(EVENT_NS + '-'+arr[0]); if(el.length > 0) { var attr = arr[1]; if(attr === 'replaceWith') { if(el[0] !== value[0]) { el.replaceWith(value); } } else if(attr === 'img') { if(el.is('img')) { el.attr('src', value); } else { el.replaceWith( $('').attr('src', value).attr('class', el.attr('class')) ); } } else { el.attr(arr[1], value); } } } else { template.find(EVENT_NS + '-'+key).html(value); } }); }, _getScrollbarSize: function() { // thx David if(mfp.scrollbarSize === undefined) { var scrollDiv = document.createElement("div"); scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; document.body.appendChild(scrollDiv); mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); } return mfp.scrollbarSize; } }; /* MagnificPopup core prototype end */ /** * Public static functions */ $.magnificPopup = { instance: null, proto: MagnificPopup.prototype, modules: [], open: function(options, index) { _checkInstance(); if(!options) { options = {}; } else { options = $.extend(true, {}, options); } options.isObj = true; options.index = index || 0; return this.instance.open(options); }, close: function() { return $.magnificPopup.instance && $.magnificPopup.instance.close(); }, registerModule: function(name, module) { if(module.options) { $.magnificPopup.defaults[name] = module.options; } $.extend(this.proto, module.proto); this.modules.push(name); }, defaults: { // Info about options is in docs: // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options disableOn: 0, key: null, midClick: false, mainClass: '', preloader: true, focus: '', // CSS selector of input to focus after popup is opened closeOnContentClick: false, closeOnBgClick: true, closeBtnInside: true, showCloseBtn: true, enableEscapeKey: true, modal: false, alignTop: false, removalDelay: 0, prependTo: null, fixedContentPos: 'auto', fixedBgPos: 'auto', overflowY: 'auto', closeMarkup: '', tClose: 'Close (Esc)', tLoading: 'Loading...', autoFocusLast: true } }; $.fn.magnificPopup = function(options) { _checkInstance(); var jqEl = $(this); // We call some API method of first param is a string if (typeof options === "string" ) { if(options === 'open') { var items, itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, index = parseInt(arguments[1], 10) || 0; if(itemOpts.items) { items = itemOpts.items[index]; } else { items = jqEl; if(itemOpts.delegate) { items = items.find(itemOpts.delegate); } items = items.eq( index ); } mfp._openClick({mfpEl:items}, jqEl, itemOpts); } else { if(mfp.isOpen) mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); } } else { // clone options obj options = $.extend(true, {}, options); /* * As Zepto doesn't support .data() method for objects * and it works only in normal browsers * we assign "options" object directly to the DOM element. FTW! */ if(_isJQ) { jqEl.data('magnificPopup', options); } else { jqEl[0].magnificPopup = options; } mfp.addGroup(jqEl, options); } return jqEl; }; /*>>core*/ /*>>inline*/ var INLINE_NS = 'inline', _hiddenClass, _inlinePlaceholder, _lastInlineElement, _putInlineElementsBack = function() { if(_lastInlineElement) { _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); _lastInlineElement = null; } }; $.magnificPopup.registerModule(INLINE_NS, { options: { hiddenClass: 'hide', // will be appended with `mfp-` prefix markup: '', tNotFound: 'Content not found' }, proto: { initInline: function() { mfp.types.push(INLINE_NS); _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { _putInlineElementsBack(); }); }, getInline: function(item, template) { _putInlineElementsBack(); if(item.src) { var inlineSt = mfp.st.inline, el = $(item.src); if(el.length) { // If target element has parent - we replace it with placeholder and put it back after popup is closed var parent = el[0].parentNode; if(parent && parent.tagName) { if(!_inlinePlaceholder) { _hiddenClass = inlineSt.hiddenClass; _inlinePlaceholder = _getEl(_hiddenClass); _hiddenClass = 'mfp-'+_hiddenClass; } // replace target inline element with placeholder _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); } mfp.updateStatus('ready'); } else { mfp.updateStatus('error', inlineSt.tNotFound); el = $('
'); } item.inlineElement = el; return el; } mfp.updateStatus('ready'); mfp._parseMarkup(template, {}, item); return template; } } }); /*>>inline*/ /*>>ajax*/ var AJAX_NS = 'ajax', _ajaxCur, _removeAjaxCursor = function() { if(_ajaxCur) { $(document.body).removeClass(_ajaxCur); } }, _destroyAjaxRequest = function() { _removeAjaxCursor(); if(mfp.req) { mfp.req.abort(); } }; $.magnificPopup.registerModule(AJAX_NS, { options: { settings: null, cursor: 'mfp-ajax-cur', tError: 'The content could not be loaded.' }, proto: { initAjax: function() { mfp.types.push(AJAX_NS); _ajaxCur = mfp.st.ajax.cursor; _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); }, getAjax: function(item) { if(_ajaxCur) { $(document.body).addClass(_ajaxCur); } mfp.updateStatus('loading'); var opts = $.extend({ url: item.src, success: function(data, textStatus, jqXHR) { var temp = { data:data, xhr:jqXHR }; _mfpTrigger('ParseAjax', temp); mfp.appendContent( $(temp.data), AJAX_NS ); item.finished = true; _removeAjaxCursor(); mfp._setFocus(); setTimeout(function() { mfp.wrap.addClass(READY_CLASS); }, 16); mfp.updateStatus('ready'); _mfpTrigger('AjaxContentAdded'); }, error: function() { _removeAjaxCursor(); item.finished = item.loadError = true; mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); } }, mfp.st.ajax.settings); mfp.req = $.ajax(opts); return ''; } } }); /*>>ajax*/ /*>>image*/ var _imgInterval, _getTitle = function(item) { if(item.data && item.data.title !== undefined) return item.data.title; var src = mfp.st.image.titleSrc; if(src) { if($.isFunction(src)) { return src.call(mfp, item); } else if(item.el) { return item.el.attr(src) || ''; } } return ''; }; $.magnificPopup.registerModule('image', { options: { markup: '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
'+ '
', cursor: 'mfp-zoom-out-cur', titleSrc: 'title', verticalFit: true, tError: 'The image could not be loaded.' }, proto: { initImage: function() { var imgSt = mfp.st.image, ns = '.image'; mfp.types.push('image'); _mfpOn(OPEN_EVENT+ns, function() { if(mfp.currItem.type === 'image' && imgSt.cursor) { $(document.body).addClass(imgSt.cursor); } }); _mfpOn(CLOSE_EVENT+ns, function() { if(imgSt.cursor) { $(document.body).removeClass(imgSt.cursor); } _window.off('resize' + EVENT_NS); }); _mfpOn('Resize'+ns, mfp.resizeImage); if(mfp.isLowIE) { _mfpOn('AfterChange', mfp.resizeImage); } }, resizeImage: function() { var item = mfp.currItem; if(!item || !item.img) return; if(mfp.st.image.verticalFit) { var decr = 0; // fix box-sizing in ie7/8 if(mfp.isLowIE) { decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); } item.img.css('max-height', mfp.wH-decr); } }, _onImageHasSize: function(item) { if(item.img) { item.hasSize = true; if(_imgInterval) { clearInterval(_imgInterval); } item.isCheckingImgSize = false; _mfpTrigger('ImageHasSize', item); if(item.imgHidden) { if(mfp.content) mfp.content.removeClass('mfp-loading'); item.imgHidden = false; } } }, /** * Function that loops until the image has size to display elements that rely on it asap */ findImageSize: function(item) { var counter = 0, img = item.img[0], mfpSetInterval = function(delay) { if(_imgInterval) { clearInterval(_imgInterval); } // decelerating interval that checks for size of an image _imgInterval = setInterval(function() { if(img.naturalWidth > 0) { mfp._onImageHasSize(item); return; } if(counter > 200) { clearInterval(_imgInterval); } counter++; if(counter === 3) { mfpSetInterval(10); } else if(counter === 40) { mfpSetInterval(50); } else if(counter === 100) { mfpSetInterval(500); } }, delay); }; mfpSetInterval(1); }, getImage: function(item, template) { var guard = 0, // image load complete handler onLoadComplete = function() { if(item) { if (item.img[0].complete) { item.img.off('.mfploader'); if(item === mfp.currItem){ mfp._onImageHasSize(item); mfp.updateStatus('ready'); } item.hasSize = true; item.loaded = true; _mfpTrigger('ImageLoadComplete'); } else { // if image complete check fails 200 times (20 sec), we assume that there was an error. guard++; if(guard < 200) { setTimeout(onLoadComplete,100); } else { onLoadError(); } } } }, // image error handler onLoadError = function() { if(item) { item.img.off('.mfploader'); if(item === mfp.currItem){ mfp._onImageHasSize(item); mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); } item.hasSize = true; item.loaded = true; item.loadError = true; } }, imgSt = mfp.st.image; var el = template.find('.mfp-img'); if(el.length) { var img = document.createElement('img'); img.className = 'mfp-img'; if(item.el && item.el.find('img').length) { img.alt = item.el.find('img').attr('alt'); } item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); img.src = item.src; // without clone() "error" event is not firing when IMG is replaced by new IMG // TODO: find a way to avoid such cloning if(el.is('img')) { item.img = item.img.clone(); } img = item.img[0]; if(img.naturalWidth > 0) { item.hasSize = true; } else if(!img.width) { item.hasSize = false; } } mfp._parseMarkup(template, { title: _getTitle(item), img_replaceWith: item.img }, item); mfp.resizeImage(); if(item.hasSize) { if(_imgInterval) clearInterval(_imgInterval); if(item.loadError) { template.addClass('mfp-loading'); mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); } else { template.removeClass('mfp-loading'); mfp.updateStatus('ready'); } return template; } mfp.updateStatus('loading'); item.loading = true; if(!item.hasSize) { item.imgHidden = true; template.addClass('mfp-loading'); mfp.findImageSize(item); } return template; } } }); /*>>image*/ /*>>zoom*/ var hasMozTransform, getHasMozTransform = function() { if(hasMozTransform === undefined) { hasMozTransform = document.createElement('p').style.MozTransform !== undefined; } return hasMozTransform; }; $.magnificPopup.registerModule('zoom', { options: { enabled: false, easing: 'ease-in-out', duration: 300, opener: function(element) { return element.is('img') ? element : element.find('img'); } }, proto: { initZoom: function() { var zoomSt = mfp.st.zoom, ns = '.zoom', image; if(!zoomSt.enabled || !mfp.supportsTransition) { return; } var duration = zoomSt.duration, getElToAnimate = function(image) { var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, cssObj = { position: 'fixed', zIndex: 9999, left: 0, top: 0, '-webkit-backface-visibility': 'hidden' }, t = 'transition'; cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; newImg.css(cssObj); return newImg; }, showMainContent = function() { mfp.content.css('visibility', 'visible'); }, openTimeout, animatedImg; _mfpOn('BuildControls'+ns, function() { if(mfp._allowZoom()) { clearTimeout(openTimeout); mfp.content.css('visibility', 'hidden'); // Basically, all code below does is clones existing image, puts in on top of the current one and animated it image = mfp._getItemToZoom(); if(!image) { showMainContent(); return; } animatedImg = getElToAnimate(image); animatedImg.css( mfp._getOffset() ); mfp.wrap.append(animatedImg); openTimeout = setTimeout(function() { animatedImg.css( mfp._getOffset( true ) ); openTimeout = setTimeout(function() { showMainContent(); setTimeout(function() { animatedImg.remove(); image = animatedImg = null; _mfpTrigger('ZoomAnimationEnded'); }, 16); // avoid blink when switching images }, duration); // this timeout equals animation duration }, 16); // by adding this timeout we avoid short glitch at the beginning of animation // Lots of timeouts... } }); _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { if(mfp._allowZoom()) { clearTimeout(openTimeout); mfp.st.removalDelay = duration; if(!image) { image = mfp._getItemToZoom(); if(!image) { return; } animatedImg = getElToAnimate(image); } animatedImg.css( mfp._getOffset(true) ); mfp.wrap.append(animatedImg); mfp.content.css('visibility', 'hidden'); setTimeout(function() { animatedImg.css( mfp._getOffset() ); }, 16); } }); _mfpOn(CLOSE_EVENT+ns, function() { if(mfp._allowZoom()) { showMainContent(); if(animatedImg) { animatedImg.remove(); } image = null; } }); }, _allowZoom: function() { return mfp.currItem.type === 'image'; }, _getItemToZoom: function() { if(mfp.currItem.hasSize) { return mfp.currItem.img; } else { return false; } }, // Get element postion relative to viewport _getOffset: function(isLarge) { var el; if(isLarge) { el = mfp.currItem.img; } else { el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); } var offset = el.offset(); var paddingTop = parseInt(el.css('padding-top'),10); var paddingBottom = parseInt(el.css('padding-bottom'),10); offset.top -= ( $(window).scrollTop() - paddingTop ); /* Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. */ var obj = { width: el.width(), // fix Zepto height+padding issue height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop }; // I hate to do this, but there is no another option if( getHasMozTransform() ) { obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; } else { obj.left = offset.left; obj.top = offset.top; } return obj; } } }); /*>>zoom*/ /*>>iframe*/ var IFRAME_NS = 'iframe', _emptyPage = '//about:blank', _fixIframeBugs = function(isShowing) { if(mfp.currTemplate[IFRAME_NS]) { var el = mfp.currTemplate[IFRAME_NS].find('iframe'); if(el.length) { // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug if(!isShowing) { el[0].src = _emptyPage; } // IE8 black screen bug fix if(mfp.isIE8) { el.css('display', isShowing ? 'block' : 'none'); } } } }; $.magnificPopup.registerModule(IFRAME_NS, { options: { markup: '
'+ '
'+ ''+ '
', srcAction: 'iframe_src', // we don't care and support only one default type of URL by default patterns: { youtube: { index: 'youtube.com', id: 'v=', src: '//www.youtube.com/embed/%id%?autoplay=1' }, vimeo: { index: 'vimeo.com/', id: '/', src: '//player.vimeo.com/video/%id%?autoplay=1' }, gmaps: { index: '//maps.google.', src: '%id%&output=embed' } } }, proto: { initIframe: function() { mfp.types.push(IFRAME_NS); _mfpOn('BeforeChange', function(e, prevType, newType) { if(prevType !== newType) { if(prevType === IFRAME_NS) { _fixIframeBugs(); // iframe if removed } else if(newType === IFRAME_NS) { _fixIframeBugs(true); // iframe is showing } }// else { // iframe source is switched, don't do anything //} }); _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { _fixIframeBugs(); }); }, getIframe: function(item, template) { var embedSrc = item.src; var iframeSt = mfp.st.iframe; $.each(iframeSt.patterns, function() { if(embedSrc.indexOf( this.index ) > -1) { if(this.id) { if(typeof this.id === 'string') { embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); } else { embedSrc = this.id.call( this, embedSrc ); } } embedSrc = this.src.replace('%id%', embedSrc ); return false; // break; } }); var dataObj = {}; if(iframeSt.srcAction) { dataObj[iframeSt.srcAction] = embedSrc; } mfp._parseMarkup(template, dataObj, item); mfp.updateStatus('ready'); return template; } } }); /*>>iframe*/ /*>>gallery*/ /** * Get looped index depending on number of slides */ var _getLoopedId = function(index) { var numSlides = mfp.items.length; if(index > numSlides - 1) { return index - numSlides; } else if(index < 0) { return numSlides + index; } return index; }, _replaceCurrTotal = function(text, curr, total) { return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); }; $.magnificPopup.registerModule('gallery', { options: { enabled: false, arrowMarkup: '', preload: [0,2], navigateByImgClick: true, arrows: true, tPrev: 'Previous (Left arrow key)', tNext: 'Next (Right arrow key)', tCounter: '%curr% of %total%' }, proto: { initGallery: function() { var gSt = mfp.st.gallery, ns = '.mfp-gallery'; mfp.direction = true; // true - next, false - prev if(!gSt || !gSt.enabled ) return false; _wrapClasses += ' mfp-gallery'; _mfpOn(OPEN_EVENT+ns, function() { if(gSt.navigateByImgClick) { mfp.wrap.on('click'+ns, '.mfp-img', function() { if(mfp.items.length > 1) { mfp.next(); return false; } }); } _document.on('keydown'+ns, function(e) { if (e.keyCode === 37) { mfp.prev(); } else if (e.keyCode === 39) { mfp.next(); } }); }); _mfpOn('UpdateStatus'+ns, function(e, data) { if(data.text) { data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); } }); _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { var l = mfp.items.length; values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; }); _mfpOn('BuildControls' + ns, function() { if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { var markup = gSt.arrowMarkup, arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); arrowLeft.click(function() { mfp.prev(); }); arrowRight.click(function() { mfp.next(); }); mfp.container.append(arrowLeft.add(arrowRight)); } }); _mfpOn(CHANGE_EVENT+ns, function() { if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); mfp._preloadTimeout = setTimeout(function() { mfp.preloadNearbyImages(); mfp._preloadTimeout = null; }, 16); }); _mfpOn(CLOSE_EVENT+ns, function() { _document.off(ns); mfp.wrap.off('click'+ns); mfp.arrowRight = mfp.arrowLeft = null; }); }, next: function() { mfp.direction = true; mfp.index = _getLoopedId(mfp.index + 1); mfp.updateItemHTML(); }, prev: function() { mfp.direction = false; mfp.index = _getLoopedId(mfp.index - 1); mfp.updateItemHTML(); }, goTo: function(newIndex) { mfp.direction = (newIndex >= mfp.index); mfp.index = newIndex; mfp.updateItemHTML(); }, preloadNearbyImages: function() { var p = mfp.st.gallery.preload, preloadBefore = Math.min(p[0], mfp.items.length), preloadAfter = Math.min(p[1], mfp.items.length), i; for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { mfp._preloadItem(mfp.index+i); } for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { mfp._preloadItem(mfp.index-i); } }, _preloadItem: function(index) { index = _getLoopedId(index); if(mfp.items[index].preloaded) { return; } var item = mfp.items[index]; if(!item.parsed) { item = mfp.parseEl( index ); } _mfpTrigger('LazyLoad', item); if(item.type === 'image') { item.img = $('').on('load.mfploader', function() { item.hasSize = true; }).on('error.mfploader', function() { item.hasSize = true; item.loadError = true; _mfpTrigger('LazyLoadError', item); }).attr('src', item.src); } item.preloaded = true; } } }); /*>>gallery*/ /*>>retina*/ var RETINA_NS = 'retina'; $.magnificPopup.registerModule(RETINA_NS, { options: { replaceSrc: function(item) { return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); }, ratio: 1 // Function or number. Set to 1 to disable. }, proto: { initRetina: function() { if(window.devicePixelRatio > 1) { var st = mfp.st.retina, ratio = st.ratio; ratio = !isNaN(ratio) ? ratio : ratio(); if(ratio > 1) { _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { item.img.css({ 'max-width': item.img[0].naturalWidth / ratio, 'width': '100%' }); }); _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { item.src = st.replaceSrc(item, ratio); }); } } } } }); /*>>retina*/ _checkInstance(); })); ================================================ FILE: brutaldon/static/manifest.webmanifest ================================================ {"dir" : "ltr", "lang" : "en", "name" : "brutaldon", "scope" : "/", "display" : "minimal-ui", "start_url" : "/", "short_name" : "brutaldon", "theme_color" : "#CCCCCC", "description" : "", "orientation" : "any", "background_color" : "#CCCCCC", "icons" : [ { "src": "https://brutaldon.online/static/images/brutaldon.png", "sizes": "320x320" }, { "src": "https://brutaldon.online/static/images/brutaldon-48.png", "sizes": "48x48" }, { "src": "https://brutaldon.online/static/images/brutaldon-72.png", "sizes": "72x72" }, { "src": "https://brutaldon.online/static/images/brutaldon-76.png", "sizes": "76x76" }, { "src": "https://brutaldon.online/static/images/brutaldon-96.png", "sizes": "96x96" }, { "src": "https://brutaldon.online/static/images/brutaldon-120.png", "sizes": "120x120" }, { "src": "https://brutaldon.online/static/images/brutaldon-144.png", "sizes": "144x144" }, { "src": "https://brutaldon.online/static/images/brutaldon-152.png", "sizes": "152x152" }, { "src": "https://brutaldon.online/static/images/brutaldon-192.png", "sizes": "192x192" }, { "src": "https://brutaldon.online/static/images/brutaldon-180.png", "sizes": "180x180" }, { "src": "https://brutaldon.online/static/images/brutaldon-512.png", "sizes": "512x512" } ]} ================================================ FILE: brutaldon/static/offline.html ================================================ brutaldon
 

Brutaldon

a brutalist web interface for Mastodon

Either you are offline currently, or brutaldon is down. Please try again later.

================================================ FILE: brutaldon/templates/about.html ================================================ {% extends "base.html" %} {% load static %} {% block content %}

Brutaldon

a brutalist web interface for Mastodon

Brutaldon is a client for Mastodon. You can use it to log in to any Mastodon instance from any browser, including text browsers such as lynx.

You do not need a separate brutaldon account to use it. Brutaldon will authenticate you to your instance.

Log in

{% if request.session.instance %} {% if request.session.username or request.session.access_token %}

Or continue to your home timeline.

{% endif %} {% endif %}
This is version {{ version }} of brutaldon.
{% endblock %} ================================================ FILE: brutaldon/templates/accounts/account_partial.html ================================================

{{ account.user.acct }}

{{ account.user.display_name }} ({{ account.user.username }})
{% csrf_token %}
================================================ FILE: brutaldon/templates/accounts/list.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Signed-in accounts

{% if not accounts %}

No accounts.

{% endif %} {% for account in accounts %} {% include "accounts/account_partial.html" %} {% endfor %}

Or log in to another account to add it to the list.

Or log out of all accounts.

{% endblock %} ================================================ FILE: brutaldon/templates/base.html ================================================ {% load static %} {% load taglinks %} {% block title %} {% if own_acct %} brutaldon ('{{ own_acct.username }}') {% else %} brutaldon {% endif %} {% endblock %} {% if not preferences %} {% else %} {% if not preferences.theme.is_brutalist %} {% endif %} {% if not preferences.no_javascript %} {% block page_scripts %} {% endblock %} {% endif %} {% endif %} {% if own_acct %} {% else %} {% endif %}
{% block navbar %} {% endblock %}
{% block content %}

Title

Brutaldon is totally a thing.

{% endblock %}
{% if not preferences.no_javascript %} {% block page_scripts_inline %} {% endblock %} {% endif %} ================================================ FILE: brutaldon/templates/comma.html ================================================ {% if not forloop.first %} {% if forloop.last %}, and {% else %}, {% endif %} {% endif %} ================================================ FILE: brutaldon/templates/error.html ================================================ {% extends "base.html" %} ================================================ FILE: brutaldon/templates/filters/create.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Create Filter

{% csrf_token %}
{{ form.non_field_errors }}
{% render_field form.phrase class+="input" %}
{% render_field form.expires_in class+="select" %}
{% endblock %} ================================================ FILE: brutaldon/templates/filters/delete.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Delete that filter?

Phrase: {{ filter.phrase }}

Context: {{ filter.context|join:", " }}

Whole word? {{ filter.whole_word }}

{% csrf_token %}
{% endblock %} ================================================ FILE: brutaldon/templates/filters/edit.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Edit Filter

{% csrf_token %}
{{ form.non_field_errors }}
{% render_field form.phrase class+="input" %}
{% render_field form.expires_in class+="select" %}
{% endblock %} ================================================ FILE: brutaldon/templates/filters/list.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Filters

{% for filter in filters %} {% endfor %}
Phrase Filter contexts
{{ filter.phrase }} {% for context in filter.context %} {{ context }} {% endfor %} Edit filter Delete filter

Create filter

{% endblock %} ================================================ FILE: brutaldon/templates/intercooler/block.html ================================================ {% if not relationship.blocking %} {% else %} {% endif %} ================================================ FILE: brutaldon/templates/intercooler/boost.html ================================================ {% if toot.visibility != 'private' and toot.visibility != 'direct' %} {% if toot.reblogged %} Boosted {% else %} Boost {% endif %} {% endif %} ================================================ FILE: brutaldon/templates/intercooler/fav.html ================================================ {% if toot.favourited %} Favorited {% else %} Favorite {% endif %} ================================================ FILE: brutaldon/templates/intercooler/follow.html ================================================ {% if relationship.requested %} {% elif not relationship.following %} {% else %} {% endif %} ================================================ FILE: brutaldon/templates/intercooler/mute.html ================================================ {% if not relationship.muting %} {% else %} {% endif %} ================================================ FILE: brutaldon/templates/intercooler/notes.html ================================================ {% if not preferences.theme.is_brutalist %} Notifications {% else %} Notifications ({{ notifications }}) {% endif %} ================================================ FILE: brutaldon/templates/intercooler/post.html ================================================ ================================================ FILE: brutaldon/templates/intercooler/search.html ================================================ ================================================ FILE: brutaldon/templates/intercooler/users.html ================================================
================================================ FILE: brutaldon/templates/main/block.html ================================================ {% extends "base.html" %} {% load taglinks %} {% load sanitizer %} {% block title %}Brutaldon ({{ own_acct.username }}) - confirm (un)block {% endblock %} {% block content %} {% if relationship.blocking %}

Unblock this user?

{% else %}

Block this user?

{% endif %}
{% csrf_token %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/boost.html ================================================ {% extends "base.html" %} {% block title %} Brutaldon ({{ own_acct.username }}) - confirm boost {% endblock %} {% block content %} {% if toot.reblogged %}

Unboost that toot?

{% else %}

Boost that toot?

{% endif %} {% include "main/toot_partial.html" with toot=toot %}
{% csrf_token %}
{% if toot.reblogged %} {% else %} {% endif %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/delete.html ================================================ {% extends "base.html" %} {% block title %} Brutaldon - confirm delete {% endblock %} {% block content %}

Delete that toot?

{% include "main/toot_partial.html" with toot=toot %}
{% csrf_token %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/emoji.html ================================================ {% extends "base.html" %} {% block title %}Brutaldon ({{ own_acct.username }}) - Custom emoji reference {% endblock %} {% block content %}

Custom emoji reference

Copy shortcodes from the list below to use your instance's custom emoji.


{% for emojo in emojos %}

:{{ emojo.shortcode }}:

{% endfor %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/fav.html ================================================ {% extends "base.html" %} {% block title %} Brutaldon ({{ own_acct.username }}) - confirm favorite {% endblock %} {% block content %} {% if toot.favourited %}

Unfav that toot?

{% else %}

Fav that toot?

{% endif %} {% include "main/toot_partial.html" with toot=toot %}
{% csrf_token %}
{% if toot.favorited %} {% else %} {% endif %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/follow.html ================================================ {% extends "base.html" %} {% load taglinks %} {% load sanitizer %} {% block title %}Brutaldon ({{ own_acct.username }}) - confirm (un)follow {% endblock %} {% block content %} {% if relationship.requested %}

Cancel follow request?

{% elif relationship.following %}

Unfollow this user?

{% else %}

Follow this user?

{% endif %}
{% csrf_token %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/home_timeline.html ================================================ {% extends "main/timeline.html" %} ================================================ FILE: brutaldon/templates/main/local_timeline.html ================================================ {% extends "main/timeline.html" %} {% block pagination %} {% endblock %} ================================================ FILE: brutaldon/templates/main/mute.html ================================================ {% extends "base.html" %} {% load taglinks %} {% load sanitizer %} {% block title %}Brutaldon - confirm (un)mute {% endblock %} {% block content %} {% if relationship.muting %}

Unmute this user?

{% else %}

Mute this user?

{% endif %}
{% csrf_token %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/notifications.html ================================================ {% extends "base.html" %} {% load humanetime %} {% load taglinks %} {% load sanitizer %} {% block title %} Brutaldon ({{ own_acct.username }}) - Notifications timelime {% endblock %} {% comment %} mastodon.notifications()[0] # Returns the following dictionary: { 'id': # id of the notification 'type': # "mention", "reblog", "favourite" or "follow" 'created_at': # The time the notification was created 'account': # User dict of the user from whom the notification originates 'status': # In case of "mention", the mentioning status # In case of reblog / favourite, the reblogged / favourited status } {% endcomment %} {% block content %}

Your notifications timeline

{% for group in groups %} {% if bundle_notifications and group.0.type in bundleable %} {% if group.0.type == 'favourite' %}

{% for account in group.accounts %} {% include "comma.html" %}{{ account.display_name | fix_emojos:account.emojis |strip_html |safe }} ({{ account.acct }}) {% endfor %} favorited your toot.

{% include "main/toot_partial.html" with toot=group.0.status %} {% elif group.0.type == 'reblog' %}

{% for account in group.accounts %} {% include "comma.html" %}{{ account.display_name | fix_emojos:account.emojis |strip_html |safe }} ({{ account.acct }}) {% endfor %} boosted your toot.

{% include "main/toot_partial.html" with toot=group.0.status reblog=True reblog_by=group.0.account.acct reblog_icon=group.0.account.avatar_static %} {% endif %} {% else %} {% for note in group %} {% if note.type == 'mention' %}

{{ note.account.display_name | fix_emojos:note.account.emojis |strip_html |safe }} ({{ note.account.acct }}) mentioned you.


{% include "main/toot_partial.html" with toot=note.status reblog=False %} {% elif note.type == 'reblog' %}

{{ note.account.display_name | fix_emojos:note.account.emojis |strip_html |safe }} ({{ note.account.acct }}) boosted your toot. ( {{ note.created_at |humane_time }} )

{% include "main/toot_partial.html" with toot=note.status reblog=True reblog_by=note.account.acct reblog_icon=note.account.avatar_static %} {% elif note.type == 'favourite' %}

{{ note.account.display_name | fix_emojos:note.account.emojis |strip_html |safe }} ({{ note.account.acct }}) favorited your toot. ( {{ note.created_at |humane_time }} )

{% include "main/toot_partial.html" with toot=note.status %} {% elif note.type == 'follow' %} {% elif note.type == 'poll' %}

A poll you created or voted in has ended.

{% include "main/toot_partial.html" with toot=note.status %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endblock %} ================================================ FILE: brutaldon/templates/main/post.html ================================================ {% extends "base.html" %} {% load static %} {% block title %} Brutaldon ({{ own_acct.username }}) - toot {% endblock %} {% block content %}

Toot!

{% include "main/post_partial.html" %}
{% endblock %} {% block page_scripts_inline %} {% endblock %} ================================================ FILE: brutaldon/templates/main/post_minimal_partial.html ================================================ {% load widget_tweaks %}
{% csrf_token %}
{{ form.non_field_errors }}
{% render_field form.spoiler_text class+="input mousetrap" placeholder="Optional" %}
{% if not preferences.theme.no_javascript %} {% endif %}
================================================ FILE: brutaldon/templates/main/post_partial.html ================================================ {% load widget_tweaks %} {% if reply %}
{% elif redraft %} {% else %} {% endif %} {% csrf_token %}
{{ form.non_field_errors }}
{% render_field form.spoiler_text class+="input mousetrap" placeholder="Optional" %}
{% render_field form.visibility class+="select"%}
{% render_field form.media_text_1 class+="input mousetrap" placeholder="Describe attachment" %}
{% render_field form.media_text_2 class+="input mousetrap" placeholder="Describe attachment" %}
{% render_field form.media_text_3 class+="input mousetrap" placeholder="Describe attachment" %}
{% render_field form.media_text_4 class+="input mousetrap" placeholder="Describe attachment" %}
{% if not preferences.no_javascript %} {% endif %}
================================================ FILE: brutaldon/templates/main/public_timeline.html ================================================ {% extends "main/timeline.html" %} {% block pagination %} {% endblock %} ================================================ FILE: brutaldon/templates/main/redraft.html ================================================ {% extends "base.html" %} {% load humanize %} {% load static %} {% block title %} Brutaldon ({{ own_acct.username }}) - reply {% endblock %} {% block page_scripts %} {% endblock %} {% block content %}

Redraft

{% include "main/toot_partial.html" with toot=toot active=True %}

Submitting this form will post this replacement toot, and delete the original toot. The replacement toot will not have any favs, boosts, or replies that the original toot had. Currently, media attachments must be re-uploaded. Sorry, working on it.

{% include "main/post_partial.html" %}
{% endblock %} {% block page_scripts_inline %} {% endblock %} ================================================ FILE: brutaldon/templates/main/reply.html ================================================ {% extends "base.html" %} {% load humanize %} {% load static %} {% block title %} Brutaldon ({{ own_acct.username }}) - reply {% endblock %} {% block page_scripts %} {% endblock %} {% block content %}

Thread

{% for ancestor in context.ancestors %} {% include "main/toot_partial.html" with toot=ancestor %} {% endfor %} {% include "main/toot_partial.html" with toot=toot active=True %}
{% include "main/post_partial.html" %}
{% endblock %} {% block page_scripts_inline %} {% endblock %} ================================================ FILE: brutaldon/templates/main/search.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block title %}brutaldon ({{ own_acct.username }}) – search {% endblock %} {% block content %}

Search

You can search for tags, users, or for specific toots by URL. You may also be able to full-text search for toots you have previously interacted with.
{% endblock %} ================================================ FILE: brutaldon/templates/main/search_results.html ================================================ {% extends "base.html" %} {% load humanize %} {% load taglinks %} {% load sanitizer %} {% block title %} Brutaldon ({{ own_acct.username }}) - search results {% endblock %} {% comment %} mastodon.search("") # Returns the following dictionary { 'accounts': # List of account dicts resulting from the query 'hashtags': # List of hashtag dicts resulting from the query 'statuses': # List of toot dicts resulting from the query } {% endcomment %} {% block content %}

Search results

Users

{% for user in results.accounts %} {% endfor %}

Tags

Toots

{% for toot in results.statuses %} {% include "main/toot_partial.html" with toot=toot reblog=False %} {% endfor %}
{% endblock %} ================================================ FILE: brutaldon/templates/main/thread.html ================================================ {% extends "base.html" %} {% load humanize %} {% block title %} Brutaldon ({{ own_acct.username }}) - thread {% endblock %} {% comment %} mastodon.status_context() # Returns the following dictionary: { 'ancestors': # A list of toot dicts 'descendants': # A list of toot dicts } {% endcomment %} {% block content %}

Thread

{% include "main/toot_partial.html" with toot=root %} {% for descendant in descendants %} {% if descendant == toot %} {% include "main/toot_partial.html" with toot=toot active=True %} {% else %} {% include "main/toot_partial.html" with toot=descendant %} {% endif %} {% endfor %} {% if not preferences.no_javascript %} {% endif %} {% endblock %} ================================================ FILE: brutaldon/templates/main/timeline.html ================================================ {% extends "base.html" %} {% load humanize %} {% load static %} {% load cache %} {% block title %} Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timelime {% endblock %} {% block page_scripts %} {% if not fullbrutalism %} {% endif %} {% endblock %} {% block content %} {% if form %}

Post

{% include "main/post_minimal_partial.html" %}
{% endif %}

Your {{ timeline_name }} timeline

{% for toot in toots %} {% cache 600 toot_partial toot.id %} {% if toot.reblog %} {% include "main/toot_partial.html" with toot=toot.reblog reblog=True reblog_by=toot.account.acct reblog_icon=toot.account.avatar_static %} {% else %} {% include "main/toot_partial.html" with toot=toot reblog=False %} {% endif %} {% endcache %} {% endfor %} {% block pagination %}
{% if next %}

Older

{% endif %} {% if prev %}

Newer

{% endif %}
{% endblock %}
{% endblock %} {% block page_scripts_inline %} {% endblock %} ================================================ FILE: brutaldon/templates/main/toot_partial.html ================================================ {% load humanetime %} {% load humanize %} {% load sanitizer %} {% load taglinks %} {% load static %} {% if toot %} {% if active %}
{% else %}
{% endif %}
{% if reblog %}

{% endif %}

{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}} @{{ toot.account.acct }} {{ toot.created_at |humane_time }} {% if reblog %}
Boosted by @{{ reblog_by }} {% endif %}

{% if toot.spoiler_text %}
{{ toot.spoiler_text }}
{{ toot.content | relink_toot | fix_emojos:toot.emojis | strip_html | safe }}
{% else %}
{{ toot.content | relink_toot | fix_emojos:toot.emojis | strip_html | safe }}
{% endif %} {% if toot.poll %}
{% if toot.poll.voted or toot.poll.expired %} {% include "polls/completed_partial.html" with toot=toot %} {% else %} {% include "polls/new_partial.html" with toot=toot %} {% endif %}
{% endif %} {% if toot.card %}
{% if toot.card.image %} {% endif %}

{{ toot.card.title }}

{{ toot.card.description |truncatechars_html:500}}

{% endif %} {% if toot.media_attachments %}
{% for media in toot.media_attachments %} {% if media.type == "image" %}
{% else %}
{% endif %} {% endfor %}
{% endif %}
{% if not confirm_page %} {% endif %}
{% endif %} ================================================ FILE: brutaldon/templates/main/user.html ================================================ {% extends "base.html" %} {% load humanize %} {% load sanitizer %} {% load taglinks %} {% block title %} Brutaldon ({{ own_acct.username }}) - {{ user.acct }} timelime {% endblock %} {% block content %}
{% if not preferences.theme.is_brutalist %}
{% else %}
{% endif %}
Avatar {% if user.locked %} {% endif %}
{{ user.note | relink_toot | strip_html | safe }}
{% if user.acct != own_acct.acct %}
{% if relationship.requested %} {% elif not relationship.following %} {% else %} {% endif %}
{% if not relationship.muting %} {% else %} {% endif %} {% if not relationship.blocking %} {% else %} {% endif %}
{% endif %}

{% for toot in toots %} {% if toot.reblog %} {% include "main/toot_partial.html" with toot=toot.reblog reblog=True reblog_by=toot.account.acct reblog_icon=toot.account.avatar_static %} {% else %} {% include "main/toot_partial.html" with toot=toot reblog=False %} {% endif %} {% endfor %} {% endblock %} ================================================ FILE: brutaldon/templates/polls/completed_partial.html ================================================ {% load sanitizer %} {% load taglinks %} {% load static %}
{% for option in toot.poll.options %}
{{ option.title }} ({{ option.votes_count}} vote{{ option.votes_count|pluralize }})
{% endfor %}
================================================ FILE: brutaldon/templates/polls/new_partial.html ================================================ {% load sanitizer %} {% load taglinks %} {% load static %}
{% csrf_token %} {% for option in toot.poll.options %}
{% if toot.poll.multiple %} {% else %} {% endif %}
{% endfor %}
================================================ FILE: brutaldon/templates/privacy.html ================================================ {% extends "base.html" %} {% load static %} {% block content %}

Privacy statement

A shameful attempt at ass-covering

Summary

Brutaldon tries to collect as little information about you as possible. The information that it collects in order to log you in to your instance and to implement client features is stored as transiently as possible.

Information that is stored until a database wipe

If you use the old login form (instance, email, password), which is only recommended if you running your own copy of brutaldon behind a firewall, the email you use to sign in will be stored along with an access token and the name of the instance you connected to. Your password will never be stored. We will never share your email with anyone for any reason, unless legally forced to do so. We will never send you email except in the case of an unforseen emergency requiring us to.

If you use the normal login form, your email will not be stored, only your instance name and access token.

Both methods of login will store your username and instance name. All of your brutaldon settings (theme, timezone, etc) are stored and associated with your username.

You can always revoke an access token through the web interface of your instance.

Information that is stored only during your session

Data stored in your session is deleted when you log out, or periodically by the server.

Data stored in the session includes:

  • A reference to your information in the database.
  • All of your public Mastodon profile information. This is needed for some client functionality.
{% endblock %} ================================================ FILE: brutaldon/templates/requests/list.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Follow requests

{% if not requests %}

No follow requests.

{% endif %} {% for request in requests %} {% include "requests/request_partial.html" %} {% endfor %}
{% endblock %} ================================================ FILE: brutaldon/templates/requests/request_partial.html ================================================

{{ request.acct }}

{{ request.display_name }} ({{ request.acct }})
{% csrf_token %}
================================================ FILE: brutaldon/templates/setup/login-oauth.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Log in to your instance

{% csrf_token %}
{% render_field form.instance class+="input" %}
Not able to log in with this form? Maybe your brutaldon instance isn't visible on the internet to your Mastodon instance? If so, you can use the old login form.
{% endblock %} ================================================ FILE: brutaldon/templates/setup/login.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Log in to your instance

{% csrf_token %}
{% render_field form.instance class+="input" %}
{% render_field form.email class+="input" %}
{% render_field form.password class+="input" type="password" %}
{% if form.errors %}

{{ form.non_field_errors | escape }}

{% endif %}

This information is only used to log you in to your instance for the first time. Brutaldon never stores your username and password; it only uses it to acquire a token which you can disable from the settings page of your Mastodon instance. However, you do need to absolutely trust the person running this copy of brutaldon! If that's not the case, use the OAuth login form.

{% endblock %} ================================================ FILE: brutaldon/templates/setup/settings.html ================================================ {% extends "base.html" %} {% load widget_tweaks %} {% block content %}

Settings

{% csrf_token %}

General Options

{% render_field form.theme class+="select" %}
{% render_field form.timezone class+="select" %}

Content Options

{{ form.preview_sensitive.help_text }}

Timeline Options

{{ form.filter_notifications.help_text }}

{{ form.bundle_notifications.help_text }}

JavaScript Options

{{ form.no_javascript.help_text }}

{{ form.notifications.help_text }}

{{ form.click_to_load.help_text }}

{{ form.lightbox.help_text }}

{% render_field form.poll_frequency class+="input" %}

{{ form.poll_frequency.help_text }}

Bookmarklet

Share via brutaldon

Filters and More

List filters

Follow requests

{% endblock %} ================================================ FILE: brutaldon/templatetags/__init__.py ================================================ ================================================ FILE: brutaldon/templatetags/humanetime.py ================================================ from datetime import datetime, timedelta from django.utils.timezone import get_default_timezone, get_current_timezone, localtime from django.utils.timezone import now as django_now from django.utils.translation import gettext as _ from django import template register = template.Library() @register.filter(is_safe=True) def humane_time(arg): """Returns a time string that is humane but not relative (unlike Django's humanetime) For times less than 6 hours ago: display date and time to the minute. For times less than 12 hours ago: display date and time to the hour. For times more than 12 hours ago display date and "time of day". For times more than 2 days ago display date. For times more than 6 months ago, display month and year. For times more than 10 years ago, display year. Prefer words to numbers, unless it is too long. The goal is a date/time that is always accurate no matter how long it's been sitting there waiting for you to look at it, but is only precise to a degree you are liable to care about. It is not safe to use on future times. FIXME: work out how best to make these strings translatable """ now = django_now() arg = localtime(arg) diff = now - arg if arg.tzinfo == now.tzinfo: utc = " (UTC)" else: utc = "" if diff < timedelta(hours=6): return arg.strftime("%a, %b %d, %Y at %I:%M %p") + utc elif diff < timedelta(hours=12): return arg.strftime("%a, %b %d, %Y around %I %p") + utc elif diff < timedelta(hours=36): return arg.strftime("%a, %b %d, %Y in the ") + time_of_day(arg.hour) + utc elif diff < timedelta(days=6 * 28): return arg.strftime("%b %d, %Y") elif diff < timedelta(days=10 * 365): return arg.strftime("%b, %Y") else: return arg.strftime("%Y") def time_of_day(hour): """Return a description of what time of day an hour is. This is very english-centric and probably not translatable. """ if hour < 3: return _("wee hours") elif hour < 6: return _("early morning") elif hour < 12: return _("morning") elif hour < 18: return _("afternoon") elif hour < 22: return _("evening") else: return _("night") ================================================ FILE: brutaldon/templatetags/taglinks.py ================================================ from django import template from bs4 import BeautifulSoup from urllib import parse from django.urls import reverse from django.utils.translation import gettext as _ from pdb import set_trace register = template.Library() @register.filter def pdb(element): set_trace() return element @register.filter def relink_tags(value): """Treat the text as html, and replace tag links with app-internal tag links Currently, this only works for tags in toots coming from Mastodon servers, not necessarily GNU Social, Pleroma, or other fediverse servers, because it relies on the markup that Mastodon puts on tags. FIXME: handle arbitrary tag links """ value = value.replace("'", "'") soup = BeautifulSoup(value, "html.parser") for link in soup.find_all("a", class_="hashtag"): try: link["href"] = reverse("tag", args=[link.span.string]) except: continue return soup.decode(formatter="html") @register.filter def relink_mentions(value): """Treat the text as html, and replace mention links with app-internal links Currently, this only works for mentions in toots coming from Mastodon servers, not necessarily GNU Social, Pleroma, or other fediverse servers, because it relies on the markup that Mastodon puts on mentions. FIXME: handle arbitrary mention links """ value = value.replace("'", "'") soup = BeautifulSoup(value, "html.parser") for link in soup.find_all("a", class_="mention"): parsed = parse.urlparse(link["href"]) try: instance = parsed[1] user = parsed[2][2:] link["href"] = reverse("user", args=[user + "@" + instance]) except: continue return soup.decode(formatter="html") @register.filter def relink_toot(value): return relink_tags(relink_mentions(value)) @register.filter def localuser(value): """Convert a remote user link to local""" try: parsed = parse.urlparse(value) instance = parsed[1] if parsed[2].startswith("/@"): user = parsed[2][2:] else: user = parsed[2].split("/")[-1] local = reverse("user", args=[user + "@" + instance]) except: local = value return local @register.filter def fix_emojos(value, emojos): """Replace instances of recognized custom emoji :shortcodes: in value with image link tags """ for emojo in emojos: try: value = value.replace( ":%(shortcode)s:" % emojo, ':%(shortcode)s:' % emojo, ) except: continue return value ================================================ FILE: brutaldon/urls.py ================================================ """brutaldon URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from brutaldon import views urlpatterns = [ path("admin/", admin.site.urls), path("about", views.about, name="about"), path("privacy", views.privacy, name="privacy"), path("home/next/", views.home, name="home_next"), path("home/prev/", views.home, name="home_prev"), path("home", views.home, name="home"), path("login", views.login, name="login"), path("oldlogin", views.old_login, name="oldlogin"), path("logout", views.logout, name="logout"), path("oauth_callback", views.oauth_callback, name="oauth_callback"), path("error", views.error, name="error"), path("local", views.local, name="local"), path("local/next/", views.local, name="local_next"), path("local/prev/", views.local, name="local_prev"), path("fed", views.fed, name="fed"), path("fed/next/", views.fed, name="fed_next"), path("fed/prev/", views.fed, name="fed_prev"), path("note", views.note, name="note"), path("note/next", views.note, name="note_next"), path("note/prev/", views.note, name="note_prev"), path("notes_count", views.notes_count, name="notes_count"), path("user_search", views.user_search, name="user_search"), path("settings", views.settings, name="settings"), path("thread/", views.thread, name="thread"), path("tags/", views.tag, name="tag"), path("user/", views.home, name="user_bad"), path("user/", views.user, name="user"), # next/prev are integers, but pleroma uses 128 bit integers # ...encoded in Base62. # aka a "flake_id" # from baseconv import base62, but we don't need to decode it # just pass it along back to pleroma but it is NOT an path("user//next/", views.user, name="user_next"), path("user//prev/", views.user, name="user_prev"), path("toot/", views.toot, name="toot"), path("toot", views.toot, name="toot"), path("reply/", views.reply, name="reply"), path("redraft/", views.redraft, name="redraft"), path("fav/", views.fav, name="fav"), path("boost/", views.boost, name="boost"), path("delete/", views.delete, name="delete"), path("follow/", views.follow, name="follow"), path("block/", views.block, name="block"), path("mute/", views.mute, name="mute"), path("search", views.search, name="search"), path("search_results", views.search_results, name="search_results"), path("emoji", views.emoji_reference, name="emoji"), path("filters/list", views.list_filters, name="list_filters"), path("filters/create", views.create_filter, name="create_filter"), path("filters/delete/", views.delete_filter, name="delete_filter"), path("filters/edit/", views.edit_filter, name="edit_filter"), path("requests/", views.follow_requests, name="follow_requests"), path("requests/", views.follow_requests, name="follow_requests"), path("accounts/", views.accounts, name="accounts"), path("accounts/", views.accounts, name="accounts"), path("vote/", views.vote, name="vote"), path("share/", views.share, name="share"), path("", views.home, name=""), ] ================================================ FILE: brutaldon/views.py ================================================ from django.http import HttpResponse, Http404, HttpResponseRedirect from django.db import IntegrityError from django.conf import settings as django_settings from django.shortcuts import render, redirect from django.urls import reverse from django.views.decorators.cache import never_cache, cache_page from django.core.files.uploadhandler import TemporaryFileUploadHandler from django.utils.translation import gettext as _ from brutaldon.forms import ( LoginForm, OAuthLoginForm, PreferencesForm, PostForm, FilterForm, ) from brutaldon.models import Client, Account, Preference, Theme from mastodon import ( Mastodon, MastodonIllegalArgumentError, AttribAccessDict, MastodonError, MastodonAPIError, MastodonNotFoundError, ) from urllib import parse from pdb import set_trace from itertools import groupby from inscriptis import get_text from time import sleep from requests import Session import re class NotLoggedInException(Exception): pass class LabeledList(list): """A subclass of list that can accept additional attributes""" def __new__(self, *args, **kwargs): return super(LabeledList, self).__new__(self, args, kwargs) def __init(self, *args, **kwargs): if len(args) == 1 and hasattr(args[0], "__iter__"): list.__init__(self, args[0]) else: list.__init__(self, args) self.__dict__.update(kwargs) def __call(self, **kwargs): self.__dict__.update(kwargs) return self global sessons_cache sessions_cache = {} VISIBILITIES = ["direct", "private", "unlisted", "public"] ### ### Utility functions ### def get_session(domain): if domain in sessions_cache: return sessions_cache[domain] else: s = Session() sessions_cache[domain] = s return s def get_usercontext(request, feature_set="mainline"): if is_logged_in(request): try: client = Client.objects.get(api_base_id=request.session["active_instance"]) user = Account.objects.get(username=request.session["active_username"]) except ( Client.DoesNotExist, Client.MultipleObjectsReturned, Account.DoesNotExist, Account.MultipleObjectsReturned, ): raise NotLoggedInException() mastodon = Mastodon( client_id=client.client_id, client_secret=client.client_secret, access_token=user.access_token, api_base_url=client.api_base_id, session=get_session(client.api_base_id), ratelimit_method="throw", feature_set=feature_set, ) return user, mastodon else: return None, None def is_logged_in(request): return request.session.has_key("active_user") def _notes_count(account, mastodon): if not mastodon: return "" notes = mastodon.notifications(limit=40) if account.preferences.filter_notifications: notes = [ note for note in notes if note.type == "mention" or note.type == "follow" ] for index, item in enumerate(notes): if account.note_seen is None: account.note_seen = "0" account.save() if str(item.id) <= str(account.note_seen): break else: index = "40+" return str(index) def br_login_required(function=None, home_url=None, redirect_field_name=None): """Check that the user is logged in to a Mastodon instance. This decorator ensures that the view functions it is called on can be accessed only by logged in users. When an instanceless user accesses such a protected view, they are redirected to the address specified in the field named in `next_field` or, lacking such a value, the URL in `home_url`, or the `ANONYMOUS_HOME_URL` setting. """ if home_url is None: home_url = django_settings.ANONYMOUS_HOME_URL def _dec(view_func): def _view(request, *args, **kwargs): def not_logged_in(): url = None if redirect_field_name and redirect_field_name in request.REQUEST: url = request.REQUEST[redirect_field_name] if not url: url = home_url if not url: url = "/" return HttpResponseRedirect(url) if not is_logged_in(request): return not_logged_in() else: try: return view_func(request, *args, **kwargs) except MastodonAPIError: # mastodon must have expired our session return not_logged_in() _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ _view.__doc__ = view_func.__doc__ return _view if function is None: return _dec else: return _dec(function) def user_search(request): check = request.POST.get("status", "").split() if len(check): check = check[-1] if len(check) > 1 and check.startswith("@"): check = check[1:] return user_search_inner(request, check) else: check = " " else: check = " " return HttpResponse(check) def user_search_inner(request, query): account, mastodon = get_usercontext(request) results = mastodon.search(query) return render( request, "intercooler/users.html", { "users": "\n".join([user.acct for user in results.accounts]), "preferences": account.preferences, }, ) def min_visibility(visibility1, visibility2): return VISIBILITIES[ min(VISIBILITIES.index(visibility1), VISIBILITIES.index(visibility2)) ] def timeline( request, timeline="home", timeline_name="Home", max_id=None, min_id=None, filter_context="home", ): account, mastodon = get_usercontext(request) data = mastodon.timeline(timeline, limit=40, max_id=max_id, min_id=min_id) form = PostForm( initial={"visibility": request.session["active_user"].source.privacy} ) try: prev = data[0]._pagination_prev if len(mastodon.timeline(min_id=prev["min_id"])) == 0: prev = None else: prev["min_id"] = data[0].id except (IndexError, AttributeError, KeyError): prev = None try: next = data[-1]._pagination_next next["max_id"] = data[-1].id except (IndexError, AttributeError, KeyError): next = None notifications = _notes_count(account, mastodon) filters = get_filters(mastodon, filter_context) # This filtering has to be done *after* getting next/prev links if account.preferences.filter_replies: data = [x for x in data if not x.in_reply_to_id] if account.preferences.filter_boosts: data = [x for x in data if not x.reblog] # Apply filters data = [x for x in data if not toot_matches_filters(x, filters)] return render( request, "main/%s_timeline.html" % timeline, { "toots": data, "form": form, "timeline": timeline, "timeline_name": timeline_name, "own_acct": request.session["active_user"], "preferences": account.preferences, "notifications": notifications, "prev": prev, "next": next, }, ) def get_filters(mastodon, context=None): try: if context: return [ff for ff in mastodon.filters() if context in ff.context] else: return mastodon.filters() except: return [] def toot_matches_filters(toot, filters=[]): if not filters: return False def maybe_rewrite_filter(filter): if filter.whole_word: return f"\\b{filter.phrase}\\b" else: return filter.phrase phrases = [maybe_rewrite_filter(x) for x in filters] pattern = "|".join(phrases) try: if toot.get("type") in ["reblog", "favourite"]: return re.search( pattern, toot.status.spoiler_text + toot.status.content, re.I ) return re.search(pattern, toot.spoiler_text + toot.content, re.I) except: return False def switch_accounts(request, new_account): """Try to switch accounts to the specified account, if it is already in the user's session. Sets up new session variables. Returns boolean success code.""" accounts_dict = request.session.get("accounts_dict") if not accounts_dict or not new_account in accounts_dict.keys(): return False try: account = Account.objects.get(id=accounts_dict[new_account]["account_id"]) if account.username != new_account: return False except Account.DoesNotExist: return False request.session["active_username"] = account.username request.session["active_instance"] = account.client.api_base_id account, mastodon = get_usercontext(request) request.session["active_user"] = mastodon.account_verify_credentials() accounts_dict[new_account]["user"] = request.session["active_user"] request.session["accounts_dict"] = accounts_dict return True def forget_account(request, account_name): """Forget that you were logged into an account. If it's the last one, log out entirely. Sets up session variables. Returns a redirect to the correct view. """ accounts_dict = request.session.get("accounts_dict") if not accounts_dict or not account_name in accounts_dict.keys(): return redirect("accounts") del accounts_dict[account_name] if len(accounts_dict) == 0: request.session.flush() return redirect("about") elif account_name == request.session["active_username"]: key = [*accounts_dict][0] if switch_accounts(request, key): return redirect("accounts") else: request.session.flush() return redirect("about") else: request.session["accounts_dict"] = accounts_dict return redirect("accounts") ### ### View functions ### def notes_count(request): account, mastodon = get_usercontext(request) count = _notes_count(account, mastodon) return render( request, "intercooler/notes.html", {"notifications": count, "preferences": account.preferences}, ) @br_login_required def home(request, next=None, prev=None): return timeline( request, "home", "Home", max_id=next, min_id=prev, filter_context="home" ) @br_login_required def local(request, next=None, prev=None, filter_context="public"): return timeline(request, "local", "Local", max_id=next, min_id=prev) @br_login_required def fed(request, next=None, prev=None, filter_context="public"): return timeline(request, "public", "Federated", max_id=next, min_id=prev) @br_login_required def tag(request, tag): try: account, mastodon = get_usercontext(request) except NotLoggedInException: return redirect(login) data = mastodon.timeline_hashtag(tag) notifications = _notes_count(account, mastodon) return render( request, "main/timeline.html", { "toots": data, "timeline_name": "#" + tag, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, }, ) @never_cache def login(request): # User posts instance name in form. # POST page redirects user to instance, where they log in. # Instance redirects user to oauth_after_login view. # oauth_after_login view saves credential in session, then redirects to home. if request.method == "GET": form = OAuthLoginForm() return render(request, "setup/login-oauth.html", {"form": form}) elif request.method == "POST": form = OAuthLoginForm(request.POST) redirect_uris = request.build_absolute_uri(reverse("oauth_callback")) if form.is_valid(): api_base_url = form.cleaned_data["instance"] resp = django_settings.CHECK_INSTANCE_URL(api_base_url, redirect) if resp is not None: return resp tmp_base = parse.urlparse(api_base_url.lower()) if tmp_base.netloc == "": api_base_url = parse.urlunparse( ("https", tmp_base.path, "", "", "", "") ) request.session["active_instance_hostname"] = tmp_base.path else: api_base_url = api_base_url.lower() request.session["active_instance_hostname"] = tmp_base.netloc request.session["active_instance"] = api_base_url try: client = Client.objects.get(api_base_id=api_base_url) except (Client.DoesNotExist, Client.MultipleObjectsReturned): (client_id, client_secret) = Mastodon.create_app( "brutaldon", api_base_url=api_base_url, redirect_uris=redirect_uris, scopes=["read", "write", "follow"], ) client = Client( api_base_id=api_base_url, client_id=client_id, client_secret=client_secret, ) client.save() request.session["active_client_id"] = client.client_id request.session["active_client_secret"] = client.client_secret mastodon = Mastodon( client_id=client.client_id, client_secret=client.client_secret, api_base_url=api_base_url, ) client.version = mastodon.instance().get("version") client.save() return redirect( mastodon.auth_request_url( redirect_uris=redirect_uris, scopes=["read", "write", "follow"] ) ) else: return render(request, "setup/login.html", {"form": form}) else: return redirect(login) @never_cache def oauth_callback(request): code = request.GET.get("code", "") mastodon = Mastodon( client_id=request.session["active_client_id"], client_secret=request.session["active_client_secret"], api_base_url=request.session["active_instance"], ) redirect_uri = request.build_absolute_uri(reverse("oauth_callback")) access_token = mastodon.log_in( code=code, redirect_uri=redirect_uri, scopes=["read", "write", "follow"] ) request.session["access_token"] = access_token user = mastodon.account_verify_credentials() try: account = Account.objects.get( username=user.username + "@" + request.session["active_instance_hostname"] ) account.access_token = access_token if not account.preferences: preferences = Preference(theme=Theme.objects.get(id=1)) preferences.save() account.preferences = preferences else: request.session["timezone"] = account.preferences.timezone account.save() except (Account.DoesNotExist, Account.MultipleObjectsReturned): preferences = Preference(theme=Theme.objects.get(id=1)) preferences.save() account = Account( username=user.username + "@" + request.session["active_instance_hostname"], access_token=access_token, client=Client.objects.get(api_base_id=request.session["active_instance"]), preferences=preferences, ) account.save() request.session["active_user"] = user request.session["active_username"] = ( user.username + "@" + request.session["active_instance_hostname"] ) accounts_dict = request.session.get("accounts_dict") if not accounts_dict: accounts_dict = {} accounts_dict[account.username] = {"account_id": account.id, "user": user} request.session["accounts_dict"] = accounts_dict return redirect(home) @never_cache def old_login(request): if request.method == "GET": form = LoginForm() return render(request, "setup/login.html", {"form": form}) elif request.method == "POST": form = LoginForm(request.POST) if form.is_valid(): api_base_url = form.cleaned_data["instance"] if "gab.com" in api_base_url: return redirect(django_settings.GAB_RICKROLL_URL) tmp_base = parse.urlparse(api_base_url.lower()) if tmp_base.netloc == "": api_base_url = parse.urlunparse( ("https", tmp_base.path, "", "", "", "") ) request.session["active_instance_hostname"] = tmp_base.path else: api_base_url = api_base_url.lower() request.session["active_instance_hostname"] = tmp_base.netloc request.session["active_instance"] = api_base_url email = form.cleaned_data["email"] password = form.cleaned_data["password"] try: client = Client.objects.get(api_base_id=api_base_url) except (Client.DoesNotExist, Client.MultipleObjectsReturned): (client_id, client_secret) = Mastodon.create_app( "brutaldon", api_base_url=api_base_url, scopes=["read", "write", "follow"], ) client = Client( api_base_id=api_base_url, client_id=client_id, client_secret=client_secret, ) client.save() mastodon = Mastodon( client_id=client.client_id, client_secret=client.client_secret, api_base_url=api_base_url, ) client.version = mastodon.instance().get("version") client.save() try: account = Account.objects.get(email=email, client_id=client.id) except (Account.DoesNotExist, Account.MultipleObjectsReturned): preferences = Preference(theme=Theme.objects.get(id=1)) preferences.save() account = Account( email=email, access_token="", client=client, preferences=preferences ) try: access_token = mastodon.log_in( email, password, scopes=["read", "write", "follow"] ) account.access_token = access_token user = mastodon.account_verify_credentials() request.session["active_user"] = user request.session["active_username"] = ( user.username + "@" + request.session["active_instance_hostname"] ) account.username = request.session["active_username"] request.session["timezone"] = account.preferences.timezone accounts_dict = request.session.get("accounts_dict") if not accounts_dict: accounts_dict = {} accounts_dict[account.username] = { "account_id": account.id, "user": user, } request.session["accounts_dict"] = accounts_dict account.save() return redirect(home) except IntegrityError: account = Account.objects.get(username=account.username) accounts_dict[account.username] = { "account_id": account.id, "user": user, } request.session["accounts_dict"] = accounts_dict return redirect(home) except Exception as ex: form.add_error("", ex) return render(request, "setup/login.html", {"form": form}) else: return render(request, "setup/login.html", {"form": form}) @never_cache def logout(request): request.session.flush() return redirect(about) def error(request): return render(request, "error.html", {"error": _("Not logged in yet.")}) @br_login_required def note(request, next=None, prev=None): try: account, mastodon = get_usercontext(request) except NotLoggedInException: return redirect(about) try: last_seen = mastodon.notifications(limit=1)[0] except IndexError: pass else: account.note_seen = last_seen.id account.save() notes = mastodon.notifications(limit=40, max_id=next, min_id=prev) filters = get_filters(mastodon, context="notifications") if account.preferences.filter_notifications: notes = [ note for note in notes if note.type == "mention" or note.type == "follow" ] # Apply filters notes = [x for x in notes if not toot_matches_filters(x, filters)] try: prev = notes[0]._pagination_prev if len(mastodon.notifications(min_id=prev["min_id"])) == 0: prev = None except (IndexError, AttributeError, KeyError): prev = None try: next = notes[-1]._pagination_next except (IndexError, AttributeError, KeyError): next = None # Now group notes into lists based on type and status groups = [] if account.preferences.bundle_notifications: def bundle_key(note): try: return str(note.status.id) + note.type except: return str(note.id) + note.type def group_sort_key(group): return max([k.id for k in group]) sorted_notes = sorted(notes, key=bundle_key, reverse=True) for _, group in groupby(sorted_notes, bundle_key): group = LabeledList(group) group.accounts = [x.account for x in group] groups.append(group) groups.sort(key=group_sort_key, reverse=True) else: groups.append(notes) return render( request, "main/notifications.html", { "notes": notes, "groups": groups, "timeline": "Notifications", "timeline_name": "Notifications", "own_acct": request.session["active_user"], "preferences": account.preferences, "prev": prev, "next": next, "bundleable": ["favourite", "reblog"], "bundle_notifications": account.preferences.bundle_notifications, }, ) @br_login_required def thread(request, id): account, mastodon = get_usercontext(request) try: toot = mastodon.status(id) root = toot context = mastodon.status_context(id) if context.ancestors and len(context.ancestors) > 0: root = context.ancestors[0] context = mastodon.status_context(context.ancestors[0]) except MastodonNotFoundError: raise Http404(_("Thread not found; the message may have been deleted.")) notifications = _notes_count(account, mastodon) filters = get_filters(mastodon, context="thread") # Apply filters descendants = [ x for x in context.descendants if not toot_matches_filters(x, filters) ] return render( request, "main/thread.html", { "context": context, "toot": toot, "root": root, "descendants": descendants, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, }, ) def same_username(account, acct, username): if acct == username: return True try: user, host = username.split("@", 1) except ValueError: user, host = username, "" myhost = account.username.split("@", 1)[1] if acct == user and host == myhost: return True return False @br_login_required def user(request, username, prev=None, next=None): try: account, mastodon = get_usercontext(request) except NotLoggedInException: return redirect(about) user_dict = None # pleroma currently flops if the user's not already locally known # this is a BUG that they MUST FIX # but until then, we might have to fallback to a regular search, # if the account search fails to return results. for dict in mastodon.account_search(username): if not same_username(account, dict.acct, username): continue user_dict = dict break else: for dict in mastodon.search(username, result_type="accounts").accounts: if not same_username(account, dict.acct, username): continue user_dict = dict break else: raise Http404(_("The user %s could not be found.") % username) data = mastodon.account_statuses(user_dict.id, max_id=next, min_id=prev) relationship = mastodon.account_relationships(user_dict.id)[0] notifications = _notes_count(account, mastodon) try: prev = data[0]._pagination_prev if len(mastodon.account_statuses(user_dict.id, min_id=prev["min_id"])) == 0: prev = None except (IndexError, AttributeError, KeyError): prev = None try: next = data[-1]._pagination_next except (IndexError, AttributeError, KeyError): next = None return render( request, "main/user.html", { "toots": data, "user": user_dict, "relationship": relationship, "own_acct": request.session["active_user"], "preferences": account.preferences, "notifications": notifications, "prev": prev, "next": next, }, ) @never_cache @br_login_required def settings(request): try: account, mastodon = get_usercontext(request) account.client.version = mastodon.instance().get("version") account.client.save() except NotLoggedInException: return redirect(about) if request.method == "POST": form = PreferencesForm(request.POST) if form.is_valid(): for field in account.preferences._fields: if field in form.cleaned_data: setattr(account.preferences, field, form.cleaned_data[field]) request.session["timezone"] = account.preferences.timezone account.preferences.save() account.save() # Update this here because it's a handy place to do it. user_info = mastodon.account_verify_credentials() request.session["active_user"] = user_info accounts_dict = request.session["accounts_dict"] accounts_dict[account.username]["user"] = user_info request.session["accounts_dict"] = accounts_dict return redirect(home) else: return render( request, "setup/settings.html", {"form": form, "account": account} ) else: request.session["timezone"] = account.preferences.timezone form = PreferencesForm(instance=account.preferences) return render( request, "setup/settings.html", {"form": form, "account": account, "preferences": account.preferences}, ) def status_post(account, request, mastodon, **kw): while True: try: mastodon.status_post(**kw) except MastodonIllegalArgumentError as e: if not "is only available with feature set" in e.args[0]: raise feature_set = e.args[0].rsplit(" ", 1)[-1] account, mastodon = get_usercontext(request, feature_set=feature_set) continue except TypeError: # not sure why, but the old code retried status_post without a # content_type keyword, if there was a TypeError kw.pop("content_type") continue else: break return account, mastodon @never_cache @br_login_required def toot(request, mention=None): account, mastodon = get_usercontext(request) if request.method == "GET": if mention: if not mention.startswith("@"): mention = "@" + mention form = PostForm( initial={ "visibility": request.session["active_user"].source.privacy, "status": mention + " ", } ) else: form = PostForm( initial={"visibility": request.session["active_user"].source.privacy} ) if request.GET.get("ic-request"): return render( request, "intercooler/post.html", { "form": form, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return render( request, "main/post.html", { "form": form, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) elif request.method == "POST": form = PostForm(request.POST, request.FILES) if form.is_valid(): # create media objects media_objects = [] for index in range(1, 5): if "media_file_" + str(index) in request.FILES: media_objects.append( mastodon.media_post( request.FILES[ "media_file_" + str(index) ].temporary_file_path(), description=request.POST.get( "media_text_" + str(index), None ), ) ) if form.cleaned_data["visibility"] == "": form.cleaned_data["visibility"] = request.session[ "active_user" ].source.privacy try: status_post( account, request, mastodon, status=form.cleaned_data["status"], visibility=form.cleaned_data["visibility"], spoiler_text=form.cleaned_data["spoiler_text"], media_ids=media_objects, content_type="text/markdown", ) except MastodonAPIError as error: form.add_error( "", "%s (%s used)" % ( error.args[-1], len(form.cleaned_data["status"]) + len(form.cleaned_data["spoiler_text"]), ), ) return render( request, "main/post.html", { "form": form, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) return redirect(home) else: return render( request, "main/post.html", { "form": form, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return redirect(toot) @br_login_required def redraft(request, id): if request.method == "GET": account, mastodon = get_usercontext(request) toot = mastodon.status(id) toot_content = get_text(toot.content) # convert to plain text # fix up white space toot_content = re.sub("(^\n)|(\n$)", "", re.sub("\n\n", "\n", toot_content)) # Fix up references for mention in toot.mentions: menchie_re = re.compile(r"\s?@" + mention.username + r"\s", re.I) toot_content = menchie_re.sub( " @" + mention.acct + " ", toot_content, count=1 ) form = PostForm( { "status": toot_content.strip(), "visibility": toot.visibility, "spoiler_text": toot.spoiler_text, "media_text_1": safe_get_attachment(toot, 0).description, "media_text_2": safe_get_attachment(toot, 1).description, "media_text_3": safe_get_attachment(toot, 2).description, "media_text_4": safe_get_attachment(toot, 3).description, } ) return render( request, "main/redraft.html", { "toot": toot, "form": form, "redraft": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) elif request.method == "POST": form = PostForm(request.POST, request.FILES) account, mastodon = get_usercontext(request) toot = mastodon.status(id) if form.is_valid(): media_objects = [] for index in range(1, 5): if "media_file_" + str(index) in request.FILES: media_objects.append( mastodon.media_post( request.FILES[ "media_file_" + str(index) ].temporary_file_path(), description=request.POST.get( "media_text_" + str(index), None ), ) ) if form.cleaned_data["visibility"] == "": form.cleaned_data["visibility"] = request.session[ "active_user" ].source.privacy try: status_post( account, request, mastodon, status=form.cleaned_data["status"], visibility=form.cleaned_data["visibility"], spoiler_text=form.cleaned_data["spoiler_text"], media_ids=media_objects, in_reply_to_id=toot.in_reply_to_id, content_type="text/markdown", ) mastodon.status_delete(id) except MastodonAPIError as error: form.add_error( "", "%s (%s used)" % ( error.args[-1], len(form.cleaned_data["status"]) + len(form.cleaned_data["spoiler_text"]), ), ) return render( request, "main/redraft.html", { "toot": toot, "form": form, "redraft": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) return redirect(home) else: return render( request, "main/redraft.html", { "toot": toot, "form": form, "redraft": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return redirect(redraft, id) def safe_get_attachment(toot, index): """Get an attachment from a toot, without crashing if it isn't there.""" try: return toot.media_attachments[index] except IndexError: adict = AttribAccessDict() adict.id, adict.type, adict.description = "", "unknown", "" adict.url, adict.remote_url, adict.preview_url = "", "", "" adict.text_url = "" return adict @br_login_required def reply(request, id): if request.method == "GET": account, mastodon = get_usercontext(request) try: toot = mastodon.status(id) context = mastodon.status_context(id) except MastodonNotFoundError: raise Http404(_("Thread not found; the message may have been deleted.")) notifications = _notes_count(account, mastodon) if toot.account.acct != request.session["active_user"].acct: initial_text = "@" + toot.account.acct + " " else: initial_text = "" for mention in [ x for x in toot.mentions if x.acct != request.session["active_user"].acct and x.acct != toot.account.acct ]: initial_text += "@" + mention.acct + " " form = PostForm( initial={ "status": initial_text, "visibility": min_visibility( toot.visibility, request.session["active_user"].source.privacy ), "spoiler_text": toot.spoiler_text, } ) return render( request, "main/reply.html", { "context": context, "toot": toot, "form": form, "reply": True, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, }, ) elif request.method == "POST": form = PostForm(request.POST, request.FILES) account, mastodon = get_usercontext(request) toot = mastodon.status(id) context = mastodon.status_context(id) notifications = _notes_count(account, mastodon) if form.is_valid(): # create media objects media_objects = [] for index in range(1, 5): if "media_file_" + str(index) in request.FILES: media_objects.append( mastodon.media_post( request.FILES[ "media_file_" + str(index) ].temporary_file_path(), description=request.POST.get( "media_text_" + str(index), None ), ) ) try: status_post( account, request, mastodon, status=form.cleaned_data["status"], visibility=form.cleaned_data["visibility"], spoiler_text=form.cleaned_data["spoiler_text"], media_ids=media_objects, in_reply_to_id=id, content_type="text/markdown", ) except MastodonAPIError as error: form.add_error( "", "%s (%s used)" % ( error.args[-1], len(form.cleaned_data["status"]) + len(form.cleaned_data["spoiler_text"]), ), ) return render( request, "main/reply.html", { "context": context, "toot": toot, "form": form, "reply": True, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, }, ) return HttpResponseRedirect( reverse("thread", args=[id]) + "#toot-" + str(id) ) else: return render( request, "main/reply.html", { "context": context, "toot": toot, "form": form, "reply": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return HttpResponseRedirect(reverse("reply", args=[id]) + "#toot-" + str(id)) @br_login_required def share(request): account, mastodon = get_usercontext(request) if request.method == "GET": params = request.GET if request.method == "POST": params = request.POST title = params.get("title") url = params.get("url") if title: initial_text = f"{title}\n\n{url}" else: initial_text = f"{url}" form = PostForm( initial={ "status": initial_text, "visibility": request.session["active_user"].source.privacy, } ) return render( request, "main/post.html", { "form": form, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) @never_cache @br_login_required def fav(request, id): account, mastodon = get_usercontext(request) toot = mastodon.status(id) if request.method == "POST": if not request.POST.get("cancel", None): if toot.favourited: mastodon.status_unfavourite(id) else: mastodon.status_favourite(id) if request.POST.get("ic-request"): toot["favourited"] = not toot["favourited"] return render( request, "intercooler/fav.html", { "toot": toot, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return HttpResponseRedirect( reverse("thread", args=[id]) + "#toot-" + str(id) ) else: return render( request, "main/fav.html", { "toot": toot, "own_acct": request.session["active_user"], "confirm_page": True, "preferences": account.preferences, }, ) @never_cache @br_login_required def boost(request, id): account, mastodon = get_usercontext(request) toot = mastodon.status(id) if request.method == "POST": if not request.POST.get("cancel", None): if toot.reblogged: mastodon.status_unreblog(id) else: mastodon.status_reblog(id) if request.POST.get("ic-request"): toot["reblogged"] = not toot["reblogged"] return render( request, "intercooler/boost.html", { "toot": toot, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return HttpResponseRedirect( reverse("thread", args=[id]) + "#toot-" + str(id) ) else: return render( request, "main/boost.html", { "toot": toot, "own_acct": request.session["active_user"], "confirm_page": True, "preferences": account.preferences, }, ) @never_cache @br_login_required def delete(request, id): account, mastodon = get_usercontext(request) toot = mastodon.status(id) if request.method == "POST" or request.method == "DELETE": if toot.account.acct != request.session["active_user"].acct: return redirect("home") if not request.POST.get("cancel", None): mastodon.status_delete(id) if request.POST.get("ic-request"): return HttpResponse("") return redirect(home) else: return render( request, "main/delete.html", { "toot": toot, "own_acct": request.session["active_user"], "confirm_page": True, "preferences": account.preferences, }, ) @never_cache @br_login_required def follow(request, id): account, mastodon = get_usercontext(request) try: user_dict = mastodon.account(id) relationship = mastodon.account_relationships(user_dict.id)[0] except (IndexError, AttributeError, KeyError): raise Http404("The user could not be found.") if request.method == "POST": if not request.POST.get("cancel", None): if relationship.requested or relationship.following: mastodon.account_unfollow(id) else: mastodon.account_follow(id) if request.POST.get("ic-request"): sleep( 1 ) # This is annoying, but the next call will return Requested instead of Following in some cases relationship = mastodon.account_relationships(user_dict.id)[0] return render( request, "intercooler/follow.html", { "user": user_dict, "relationship": relationship, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) else: return redirect(user, user_dict.acct) else: return render( request, "main/follow.html", { "user": user_dict, "relationship": relationship, "confirm_page": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) @never_cache @br_login_required def block(request, id): account, mastodon = get_usercontext(request) try: user_dict = mastodon.account(id) relationship = mastodon.account_relationships(user_dict.id)[0] except (IndexError, AttributeError, KeyError): raise Http404("The user could not be found.") if request.method == "POST": if not request.POST.get("cancel", None): if relationship.blocking: mastodon.account_unblock(id) else: mastodon.account_block(id) if request.POST.get("ic-request"): relationship["blocking"] = not relationship["blocking"] return render( request, "intercooler/block.html", {"user": user_dict, "relationship": relationship}, ) else: return redirect(user, user_dict.acct) else: return render( request, "main/block.html", { "user": user_dict, "relationship": relationship, "confirm_page": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) @never_cache @br_login_required def mute(request, id): account, mastodon = get_usercontext(request) try: user_dict = mastodon.account(id) relationship = mastodon.account_relationships(user_dict.id)[0] except (IndexError, AttributeError, KeyError): raise Http404("The user could not be found.") if request.method == "POST": if not request.POST.get("cancel", None): if relationship.muting: mastodon.account_unmute(id) else: mastodon.account_mute(id) if request.POST.get("ic-request"): relationship["muting"] = not relationship["muting"] return render( request, "intercooler/mute.html", {"user": user_dict, "relationship": relationship}, ) else: return redirect(user, user_dict.acct) else: return render( request, "main/mute.html", { "user": user_dict, "relationship": relationship, "confirm_page": True, "own_acct": request.session["active_user"], "preferences": account.preferences, }, ) @br_login_required def search(request): account, mastodon = get_usercontext(request) if request.GET.get("ic-request"): return render( request, "intercooler/search.html", { "preferences": account.preferences, "own_acct": request.session["active_user"], }, ) else: return render( request, "main/search.html", { "preferences": account.preferences, "own_acct": request.session["active_user"], }, ) @br_login_required @cache_page(60 * 5) def search_results(request): if request.method == "GET": query = request.GET.get("q", "") elif request.method == "POST": query = request.POST.get("q", "") else: query = "" account, mastodon = get_usercontext(request) results = mastodon.search(query) notifications = _notes_count(account, mastodon) return render( request, "main/search_results.html", { "results": results, "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, }, ) @cache_page(60 * 30) def about(request): version = django_settings.BRUTALDON_VERSION account, mastodon = get_usercontext(request) if account: preferences = account.preferences else: preferences = None return render( request, "about.html", { "preferences": preferences, "version": version, "own_acct": request.session.get("active_user", None), }, ) @cache_page(60 * 30) def privacy(request): account, mastodon = get_usercontext(request) if account: preferences = account.preferences else: preferences = None return render( request, "privacy.html", { "preferences": preferences, "own_acct": request.session.get("active_user", None), }, ) @cache_page(60 * 30) @br_login_required def emoji_reference(request): account, mastodon = get_usercontext(request) emojos = mastodon.custom_emojis() notifications = _notes_count(account, mastodon) return render( request, "main/emoji.html", { "preferences": account.preferences, "emojos": sorted(emojos, key=lambda x: x["shortcode"]), "notifications": notifications, "own_acct": request.session["active_user"], }, ) @br_login_required def list_filters(request): account, mastodon = get_usercontext(request) filters = mastodon.filters() return render( request, "filters/list.html", {"account": account, "preferences": account.preferences, "filters": filters}, ) @br_login_required def create_filter(request): account, mastodon = get_usercontext(request) if request.method == "POST": form = FilterForm(request.POST) if form.is_valid(): contexts = [] if form.cleaned_data["context_home"]: contexts.append("home") if form.cleaned_data["context_public"]: contexts.append("public") if form.cleaned_data["context_notes"]: contexts.append("notifications") if form.cleaned_data["context_thread"]: contexts.append("thread") expires = form.cleaned_data["expires_in"] if expires == "": expires = None mastodon.filter_create( form.cleaned_data["phrase"], contexts, whole_word=form.cleaned_data["whole_word"], expires_in=expires, ) return redirect(list_filters) else: return render( request, "filters/create.html", {"form": form, "account": account, "preferences": account.preferences}, ) else: form = FilterForm() return render( request, "filters/create.html", {"form": form, "account": account, "preferences": account.preferences}, ) @br_login_required def delete_filter(request, id): account, mastodon = get_usercontext(request) filter = mastodon.filter(id) if request.method == "POST" or request.method == "DELETE": if not request.POST.get("cancel", None): mastodon.filter_delete(filter.id) if request.POST.get("ic-request"): return HttpResponse("") return redirect(list_filters) else: return render( request, "filters/delete.html", { "filter": filter, "own_acct": request.session["active_user"], "confirm_page": True, "preferences": account.preferences, }, ) @br_login_required def edit_filter(request, id): account, mastodon = get_usercontext(request) filter = mastodon.filter(id) contexts = [] if request.method == "POST": form = FilterForm(request.POST) if form.is_valid(): if form.cleaned_data["context_home"]: contexts.append("home") if form.cleaned_data["context_public"]: contexts.append("public") if form.cleaned_data["context_notes"]: contexts.append("notifications") if form.cleaned_data["context_thread"]: contexts.append("thread") expires = form.cleaned_data["expires_in"] if expires == "": expires = None mastodon.filter_update( id, form.cleaned_data["phrase"], contexts, whole_word=form.cleaned_data["whole_word"], expires_in=expires, ) return redirect(list_filters) else: return render( request, "filters/edit.html", { "form": form, "account": account, "filter": filter, "preferences": account.preferences, }, ) else: contexts = [] form = FilterForm( { "phrase": filter.phrase, "context_home": "home" in filter.context, "context_public": "public" in filter.context, "context_notes": "notifications" in filter.context, "context_thread": "thread" in filter.context, "whole_word": filter.whole_word, } ) return render( request, "filters/edit.html", { "form": form, "account": account, "filter": filter, "preferences": account.preferences, }, ) @br_login_required def follow_requests(request, id=None): account, mastodon = get_usercontext(request) if request.method == "GET": reqs = mastodon.follow_requests() return render( request, "requests/list.html", {"account": account, "preferences": account.preferences, "requests": reqs}, ) elif id is None: return redirect(follow_requests) else: if request.POST.get("accept", None): mastodon.follow_request_authorize(id) elif request.POST.get("reject", None): mastodon.follow_request_reject(id) return redirect(follow_requests) @br_login_required def accounts(request, id=None): active_account, mastodon = get_usercontext(request) if request.method == "GET": accounts = [x for x in request.session.get("accounts_dict").values()] return render( request, "accounts/list.html", { "active_account": active_account, "own_acct": request.session["active_user"], "accounts": accounts, "preferences": active_account.preferences, }, ) if request.method == "POST": if request.POST.get("activate"): to_account = Account.objects.get(id=id).username if switch_accounts(request, to_account): return redirect(home) else: return redirect("accounts") elif request.POST.get("forget"): account = Account.objects.get(id=id).username return forget_account(request, account) else: accounts = [x for x in request.session.get("accounts_dict").values()] return render( request, "accounts/list.html", { "active_account": active_account, "own_acct": request.session["active_user"], "accounts": accounts, "preferences": active_account.preferences, }, ) @br_login_required def vote(request, id): if request.method == "GET": return redirect("thread", id) if request.method == "POST": account, mastodon = get_usercontext(request) toot = mastodon.status(id) poll = toot.poll if not poll: return redirect("thread", id) # radio buttons if "poll-single" in request.POST.keys(): mastodon.poll_vote(poll.id, request.POST["poll-single"]) # checkboxes else: values = [x for x in request.POST.getlist("poll-multiple")] if values: mastodon.poll_vote(poll.id, values) if request.POST.get("ic-request"): return render( request, "main/toot_partial.html", {"toot": mastodon.status(id)} ) else: return redirect("thread", id) ================================================ FILE: brutaldon/wsgi.py ================================================ """ WSGI config for brutaldon project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "brutaldon.settings") application = get_wsgi_application() ================================================ FILE: manage.py ================================================ #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "brutaldon.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) ================================================ FILE: package.json ================================================ { "dependencies": { "bulma": "^0.7.5", "bulma-extensions": "^2.2.2", "bulmaswatch": "^0.6.2", "fork-awesome": "^1.1.0", "intercooler": "^1.2.1", "jquery": "^3.4.1", "loading-attribute-polyfill": "^1.2.0", "magnific-popup": "^1.1.0", "mousetrap": "^1.6.2" } }