From: Radek Czajka Date: Wed, 19 May 2010 13:45:02 +0000 (+0200) Subject: Merge branch 'production' X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/e0de41ae1e67c230ad1e67f34f6f4f76e53d7234?hp=9531d8a55106384d86cda24825b5f9a9d769d33d Merge branch 'production' --- diff --git a/.gitignore b/.gitignore index f11a79bab..d78f78f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,21 @@ localsettings.py dev.sqlite +dev.db # Python garbage *.pyc .coverage +pip-log.txt # Mac OS X garbage .DS_Store # Windows garbage thumbs.db + +# Eclipse +.project +.settings +.pydevproject +.tmp_* + diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..2def0e883 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + 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 +. \ No newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..7bd984478 --- /dev/null +++ b/NOTICE @@ -0,0 +1,19 @@ + + FNP Wolnelektury + + Copyright © 2010 Fundacja Nowoczesna Polska + + For full list of contributors see AUTHORS file. + + 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 . \ No newline at end of file diff --git a/README b/README deleted file mode 100644 index fa3064e1c..000000000 --- a/README +++ /dev/null @@ -1,93 +0,0 @@ -Dependencies -============ - - * [Django 1.0](http://djangoproject.com/) (application framework) - * [lxml 2.0.0](http://codespeak.net/lxml/) (for importing books) - * [librarian 1.1](http://redmine.nowoczesnapolska.org.pl/projects/show/librarian) (for importing books) - * Python libraries from lib directory - * Django applications from apps directory - - -How to deploy -============= - -Just execute this commands: - - cd wolnelektury.pl - source setpythonpath.sh - cd wolnelektury - ./manage.py syncdbc - ./manage.py importbooks ../books/01 ../books/02 ../books/03 - ../setmainpage.py - -[TODO] - - -Używany kod open-source -======================= - -django ------- - - Źródła: [djangoproject.com](http://www.djangoproject.com/) - - Autorzy: [wielu autorów](http://code.djangoproject.com/browser/django/trunk/AUTHORS) - - Licencja: [BSD License](http://code.djangoproject.com/browser/django/trunk/LICENSE) - - Typ: framework - -django-chunks -------------- - - Źródła: [Google Code](http://code.google.com/p/django-chunks/) - - Autorzy: Clint Ecker - - Licencja: [New BSD License](http://www.opensource.org/licenses/bsd-license.php) - - Typ: biblioteka (aplikacja django) - -django-pagination ------------------ - - Źródła: [Google Code](http://code.google.com/p/django-pagination/) - - Autorzy: James Tauber , leidel@gmail.com - - Licencja: [New BSD License](http://www.opensource.org/licenses/bsd-license.php) - - Typ: biblioteka (aplikacja django) - -django-compress ---------------- - - Źródła: [Google Code](http://code.google.com/p/django-compress/) - - Autorzy: Andreas Pelme - - Licencja: [MIT License](http://www.opensource.org/licenses/mit-license.php) - - Typ: biblioteka (aplikacja django) - -django-newtagging ------------------ - - Źródła: [BitBucket](http://www.bitbucket.org/zuber/django-newtagging/) - - Autorzy: Marek Stępniowski - - Licencja: [MIT License](http://www.opensource.org/licenses/mit-license.php) - - Typ: biblioteka (aplikacja django) - - Nota: Aplikacja wzorowana na [django-tagging](http://code.google.com/p/django-tagging/), która jest również wydana na licencji [MIT](http://www.opensource.org/licenses/mit-license.php) Około połowa kodu jest dzielona. - -south ------ -- Źródła: [aercode.org](http://south.aeracode.org/) -- Autorzy: Andrew Godwin , Andy McCurdy -- Licencja: [Apache License 2.0](http://www.opensource.org/licenses/apache2.0.php) -- Typ: biblioteka (aplikacja django) - -feedparser ----------- - - Źródła: [Google Code](http://code.google.com/p/feedparser/) - - Autorzy: Mark Pilgrim - - Licencja: [MIT License](http://www.opensource.org/licenses/mit-license.php) - - Typ: biblioteka - -markupstring ------------- - - Żródła: [ASPN Cookbook](http://code.activestate.com/recipes/389023/) - - Autorzy: Thomas Hinkle - - Licencja: [MIT License](http://code.activestate.com/help/terms/) - - Typ: biblioteka - - Nota: Zmienione przez Marka Stępniowskiego tak, żeby akceptowało ciągi znaków Unicode - -lxml ----- - - Żródła: [codespeak.net](http://codespeak.net/lxml/index.html#download) - - Autorzy: [wielu autorów](http://codespeak.net/lxml/credits.html) - - Licencja: [BSD License](http://codespeak.net/lxml/index.html#license) - - Typ: biblioteka - diff --git a/README.md b/README.md new file mode 100644 index 000000000..725dc7c2d --- /dev/null +++ b/README.md @@ -0,0 +1,151 @@ +License +------- + + ![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png) + + Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska + + For full list of contributors see AUTHORS section at the end. + + 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 . + +Dependencies +============ + + * All packages listed in requirements.txt + * Python libraries from lib directory + * Django applications from apps directory + +How to deploy (development version) +============= + +1. Checkout the source code from Github +2. Install libraries (we recommend using pip): + + pip install -r requirements.txt + +3. Setup your local configuration based on settings.py. You need to generate a new SECRET_KEY, database stuff and domain related stuff. +4. Populate database: + + ./wolnelektury/manage.py syncdb + ./wolnelektury/manage.py migrate + +5. Run the server + + ./wolnelektury/manage.py runserver + + +6. Import some books which are available on http://www.wolnelektury.pl or on bitbucket mirror: http://bitbucket.org/lqc/wlbooks/ + If you use Bitbucket, you also need Mercurial to fetch books (you can install it using: pip install mercurial). + After downloading books, log into administration, go to Books and choose 'Browse' to select book file, + then fire 'Import book' to upload it. Some books have invalid XML, so you can get an error + (just ignore it and look for other books). + +7. We provide localization of the software in following languages: Polish, Russian, German, English, Spanish, French and Lithuanian. + Translation strings are based on gettext and can be found under 'locale' dir. + There are also JavaScript files for jQuery countdown plugin (static/js/jquery.countdown-*.js). + +Full list of used open-source software +====================================== + +External +-------- + +django +-------- + - Source: [djangoproject.com](http://www.djangoproject.com/) + - Authors: [many authors](http://code.djangoproject.com/browser/django/trunk/AUTHORS) + - License: [BSD License](http://code.djangoproject.com/browser/django/trunk/LICENSE) + - Type: framework + +django-pagination +----------------- + - Source: [Google Code](http://code.google.com/p/django-pagination/) + - Authors: James Tauber , leidel@gmail.com + - License: [New BSD License](http://www.opensource.org/licenses/bsd-license.php) + - Type: library (django application) + +django-rosetta +----------------- + - Source: [Google Code](http://code.google.com/p/django-rosetta/) + - Authors: James Tauber , leidel@gmail.com + - License: [MIT License](http://www.opensource.org/licenses/mit-license.php) + - Type: library (django application) + + +Django South +------------ +- Source: [aercode.org](http://south.aeracode.org/) +- Authors: Andrew Godwin , Andy McCurdy +- License: [Apache License 2.0](http://www.opensource.org/licenses/apache2.0.php) +- Type: library (django application) + +lxml +--------- + - Source: [codespeak.net](http://codespeak.net/lxml/index.html#download) + - Authors: [many authors](http://codespeak.net/lxml/credits.html) + - License: [BSD License](http://codespeak.net/lxml/index.html#license) + - Type: library + +feedparser +---------- + - Source: [Google Code](http://code.google.com/p/feedparser/) + - Authors: Mark Pilgrim + - License: [MIT License](http://www.opensource.org/licenses/mit-license.php) + - Type: library + + +Internal (means we hacked on sources of those): +--------- + +django-compress +--------------- + - Source: [Google Code](http://code.google.com/p/django-compress/) + - Authors: Andreas Pelme + - License: [MIT License](http://www.opensource.org/licenses/mit-license.php) + - Type: library (Django application) + + django-chunks +------------- + - Source: [Google Code](http://code.google.com/p/django-chunks/) + - Authors: Clint Ecker + - License: [New BSD License](http://www.opensource.org/licenses/bsd-license.php) + - Type: library (Django application) + +django-newtagging +----------------- + - Source: [BitBucket](http://www.bitbucket.org/zuber/django-newtagging/) + - Authors: Marek Stępniowski + - License: [MIT License](http://www.opensource.org/licenses/mit-license.php) + - Type: library (Django aplication) + - Notes: Aplication based on [django-tagging](http://code.google.com/p/django-tagging/), also [MIT](http://www.opensource.org/licenses/mit-license.php) license. + +django-piston (0.2.3rc) +------------------------ + - http://bitbucket.org/jespern/django-piston/wiki/Home + +markupstring +------------ + - Source: [ASPN Cookbook](http://code.activestate.com/recipes/389023/) + - Authors: Thomas Hinkle + - License: [MIT License](http://code.activestate.com/help/terms/) + - Type: library + - Notes: Patched by Marek Stępniowski to accept Unicode strings + + +Authors +======= + + * Marek Stępniowski + * Łukasz Rekucki diff --git a/apps/api/handlers.py b/apps/api/handlers.py index 03115d894..799b60827 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.shortcuts import get_object_or_404 from django.contrib.auth.decorators import login_required, user_passes_test from piston.handler import BaseHandler diff --git a/apps/catalogue/admin.py b/apps/catalogue/admin.py index 9f1770d95..8a718ffd0 100644 --- a/apps/catalogue/admin.py +++ b/apps/catalogue/admin.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib import admin from newtagging.admin import TaggableModelAdmin -from catalogue.models import Tag, Book, Fragment +from catalogue.models import Tag, Book, Fragment, BookStub class TagAdmin(admin.ModelAdmin): @@ -32,6 +35,17 @@ class FragmentAdmin(TaggableModelAdmin): ordering = ('book', 'anchor',) +class BookStubAdmin(admin.ModelAdmin): + # tag_model = Tag + + list_display = ('title', 'author', 'slug','pd') + search_fields = ('title','author') + ordering = ('title',) + + prepopulated_fields = {'slug': ('title',)} + + +admin.site.register(BookStub, BookStubAdmin) admin.site.register(Tag, TagAdmin) admin.site.register(Book, BookAdmin) admin.site.register(Fragment, FragmentAdmin) diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index eedff6705..0478f9d1b 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import datetime from django.conf import settings @@ -10,6 +13,7 @@ from django.forms.util import smart_unicode from django.utils import simplejson as json from django.utils.html import escape from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ class JSONEncoder(json.JSONEncoder): @@ -39,7 +43,7 @@ class JSONFormField(forms.CharField): loads(value) return value except ValueError, e: - raise forms.ValidationError('Enter a valid JSON value. Error: %s' % e) + raise forms.ValidationError(_('Enter a valid JSON value. Error: %s') % e) class JSONField(models.TextField): @@ -80,7 +84,7 @@ class JQueryAutoCompleteWidget(forms.TextInput): if self.options: options += ', %s' % self.options - return u'$(\'#%s\').autocomplete(%s%s);' % (field_id, source, options) + return u'$(\'#%s\').autocomplete(%s%s).result(autocomplete_result_handler);' % (field_id, source, options) def render(self, name, value=None, attrs=None): final_attrs = self.build_attrs(attrs, name=name) diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index bf6b0df35..076282bf4 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -1,5 +1,9 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import forms +from django.utils.translation import ugettext_lazy as _ from slughifi import slughifi from catalogue.models import Tag, Book @@ -15,13 +19,13 @@ class BookImportForm(forms.Form): class SearchForm(forms.Form): - q = JQueryAutoCompleteField('/katalog/tags/', {'minChars': 2, 'selectFirst': True, 'cacheLength': 50}) + q = JQueryAutoCompleteField('/katalog/tags/', {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"}) tags = forms.CharField(widget=forms.HiddenInput, required=False) def __init__(self, *args, **kwargs): tags = kwargs.pop('tags', []) super(SearchForm, self).__init__(*args, **kwargs) - self.fields['q'].widget.attrs['title'] = u'tytuł, autor, motyw/temat, epoka, rodzaj, gatunek' + self.fields['q'].widget.attrs['title'] = _('title, author, theme/topic, epoch, kind, genre') self.fields['tags'].initial = '/'.join(tag.slug for tag in Tag.get_tag_list(tags)) @@ -37,7 +41,7 @@ class ObjectSetsForm(forms.Form): def __init__(self, obj, user, *args, **kwargs): super(ObjectSetsForm, self).__init__(*args, **kwargs) self.fields['set_ids'] = forms.MultipleChoiceField( - label=u'Półki', + label=_('Shelves'), required=False, choices=[(tag.id, "%s (%s)" % (tag.name, tag.book_count)) for tag in Tag.objects.filter(category='set', user=user)], initial=[tag.id for tag in obj.tags.filter(category='set', user=user)], @@ -50,7 +54,7 @@ class NewSetForm(forms.Form): def __init__(self, *args, **kwargs): super(NewSetForm, self).__init__(*args, **kwargs) - self.fields['name'].widget.attrs['title'] = u'nazwa nowej półki' + self.fields['name'].widget.attrs['title'] = _('Name of the new shelf') def save(self, user, commit=True): name = self.cleaned_data['name'] diff --git a/apps/catalogue/locale/de/LC_MESSAGES/django.po b/apps/catalogue/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/en/LC_MESSAGES/django.po b/apps/catalogue/locale/en/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/es/LC_MESSAGES/django.po b/apps/catalogue/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/fr/LC_MESSAGES/django.po b/apps/catalogue/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/lt/LC_MESSAGES/django.po b/apps/catalogue/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 000000000..fa865dc19 Binary files /dev/null and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.po b/apps/catalogue/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..dd45be0df --- /dev/null +++ b/apps/catalogue/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: 2010-05-19 14:20\n" +"Last-Translator: \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Translated-Using: django-rosetta 0.5.3\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "tytuł, autor, motyw/temat, epoka, rodzaj, gatunek" + +#: forms.py:44 +msgid "Shelves" +msgstr "Półki" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "nazwa nowej półki" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "autor" + +#: models.py:25 +msgid "epoch" +msgstr "epoka" + +#: models.py:26 +msgid "kind" +msgstr "rodzaj" + +#: models.py:27 +msgid "genre" +msgstr "gatunek" + +#: models.py:28 +msgid "theme" +msgstr "motyw" + +#: models.py:29 +msgid "set" +msgstr "półka" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "liczba książek" + +#: models.py:54 +msgid "year of death" +msgstr "rok śmierci" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "tag" + +#: models.py:81 +msgid "tags" +msgstr "tagi" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "tytuł" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "Plik XML" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "Plik HTML" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "Plik PDF" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "Plik ODT" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "Plik TXT" + +#: models.py:119 +msgid "MP3 file" +msgstr "Plik MP3" + +#: models.py:120 +msgid "OGG file" +msgstr "Plik OGG" + +#: models.py:141 +msgid "Read online" +msgstr "Czytaj online" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "trafia do domeny publicznej" + +#: models.py:366 +msgid "translator" +msgstr "tłumacz" + +#: models.py:367 +msgid "year of translator's death" +msgstr "rok śmierci tłumacza" + +#: models.py:385 +msgid "book stub" +msgstr "zapowiedź książki" + +#: models.py:386 +msgid "book stubs" +msgstr "zapowiedzi książek" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "

Aby zarządzać swoimi półkami, musisz się zalogować.

" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "

Półki zostały zapisane.

" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "Usunięto" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "Książki nie ma na półce" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "

Półka %s została utworzona

" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "

Półka %s została usunięta

" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/locale/ru/LC_MESSAGES/django.po b/apps/catalogue/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 000000000..5362b95bb --- /dev/null +++ b/apps/catalogue/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:57+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: fields.py:45 +#, python-format +msgid "Enter a valid JSON value. Error: %s" +msgstr "" + +#: forms.py:28 +msgid "title, author, theme/topic, epoch, kind, genre" +msgstr "" + +#: forms.py:44 +msgid "Shelves" +msgstr "" + +#: forms.py:57 +msgid "Name of the new shelf" +msgstr "" + +#: models.py:24 models.py:363 +msgid "author" +msgstr "" + +#: models.py:25 +msgid "epoch" +msgstr "" + +#: models.py:26 +msgid "kind" +msgstr "" + +#: models.py:27 +msgid "genre" +msgstr "" + +#: models.py:28 +msgid "theme" +msgstr "" + +#: models.py:29 +msgid "set" +msgstr "" + +#: models.py:30 models.py:322 +msgid "book" +msgstr "" + +#: models.py:44 migrations/0001_initial.py:47 +msgid "name" +msgstr "" + +#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 +#: migrations/0001_initial.py:48 +msgid "slug" +msgstr "" + +#: models.py:46 migrations/0001_initial.py:49 +msgid "sort key" +msgstr "" + +#: models.py:47 migrations/0001_initial.py:50 +msgid "category" +msgstr "" + +#: models.py:49 models.py:60 models.py:104 models.py:185 +#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +msgid "description" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "main page" +msgstr "" + +#: models.py:50 migrations/0001_initial.py:52 +msgid "Show tag on main page" +msgstr "" + +#: models.py:53 migrations/0001_initial.py:54 +msgid "book count" +msgstr "" + +#: models.py:54 +msgid "year of death" +msgstr "" + +#: models.py:80 migrations/0001_initial.py:61 +msgid "tag" +msgstr "" + +#: models.py:81 +msgid "tags" +msgstr "" + +#: models.py:102 models.py:362 migrations/0001_initial.py:18 +msgid "title" +msgstr "" + +#: models.py:105 migrations/0001_initial.py:21 +msgid "creation date" +msgstr "" + +#: models.py:106 migrations/0001_initial.py:22 +msgid "short HTML" +msgstr "" + +#: models.py:107 migrations/0001_initial.py:23 +msgid "parent number" +msgstr "" + +#: models.py:108 +msgid "extra information" +msgstr "" + +#: models.py:114 migrations/0001_initial.py:24 +msgid "XML file" +msgstr "" + +#: models.py:115 migrations/0001_initial.py:25 +msgid "HTML file" +msgstr "" + +#: models.py:116 migrations/0001_initial.py:26 +msgid "PDF file" +msgstr "" + +#: models.py:117 migrations/0001_initial.py:27 +msgid "ODT file" +msgstr "" + +#: models.py:118 migrations/0001_initial.py:28 +msgid "TXT file" +msgstr "" + +#: models.py:119 +msgid "MP3 file" +msgstr "" + +#: models.py:120 +msgid "OGG file" +msgstr "" + +#: models.py:141 +msgid "Read online" +msgstr "" + +#: models.py:221 +#, python-format +msgid "Book %s already exists" +msgstr "" + +#: models.py:264 +#, python-format +msgid "Book with slug = \"%s\" does not exist." +msgstr "" + +#: models.py:323 +msgid "books" +msgstr "" + +#: models.py:357 +msgid "fragment" +msgstr "" + +#: models.py:358 +msgid "fragments" +msgstr "" + +#: models.py:364 +msgid "goes to public domain" +msgstr "" + +#: models.py:366 +msgid "translator" +msgstr "" + +#: models.py:367 +msgid "year of translator's death" +msgstr "" + +#: models.py:385 +msgid "book stub" +msgstr "" + +#: models.py:386 +msgid "book stubs" +msgstr "" + +#: views.py:308 +msgid "

To maintain your shelves you need to be logged in.

" +msgstr "" + +#: views.py:326 +msgid "

Shelves were sucessfully saved.

" +msgstr "" + +#: views.py:350 +msgid "Book was successfully removed from the shelf" +msgstr "" + +#: views.py:352 +msgid "This book is not on the shelf" +msgstr "" + +#: views.py:448 +#, python-format +msgid "

Shelf %s was successfully created

" +msgstr "" + +#: views.py:463 +#, python-format +msgid "

Shelf %s was successfully removed

" +msgstr "" + +#: views.py:522 +#, python-format +msgid "Today is %(month)s, %(day)s." +msgstr "" + +#: views.py:523 +#, python-format +msgid "" +"An error occurred: %(exception)s\n" +"\n" +"%(tb)s" +msgstr "" + +#: views.py:524 +msgid "Book imported successfully" +msgstr "" + +#: views.py:526 +#, python-format +msgid "Error importing file: %r" +msgstr "" + +#: migrations/0001_initial.py:62 +msgid "content type" +msgstr "" + +#: migrations/0001_initial.py:63 +msgid "object id" +msgstr "" diff --git a/apps/catalogue/management/commands/importbooks.py b/apps/catalogue/management/commands/importbooks.py index 0aa808137..52aa69feb 100644 --- a/apps/catalogue/management/commands/importbooks.py +++ b/apps/catalogue/management/commands/importbooks.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import os import sys from optparse import make_option diff --git a/apps/catalogue/migrations/0006_add_author_death.py b/apps/catalogue/migrations/0006_add_author_death.py new file mode 100644 index 000000000..ef8491edd --- /dev/null +++ b/apps/catalogue/migrations/0006_add_author_death.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +from south.db import db +from django.db import models + + +class Migration: + def forwards(self): + db.add_column('catalogue_tag', 'death', models.IntegerField(blank=True, null=True)) + + def backwards(self): + db.delete_column('catalogue_tag', 'death') + + diff --git a/apps/catalogue/migrations/0007_add_bookstub.py b/apps/catalogue/migrations/0007_add_bookstub.py new file mode 100644 index 000000000..12de1492b --- /dev/null +++ b/apps/catalogue/migrations/0007_add_bookstub.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +from south.db import db +from django.db import models +from catalogue.models import * + +class Migration: + + def forwards(self, orm): + + # Adding model 'BookStub' + db.create_table('catalogue_bookstub', ( + ('id', orm['catalogue.BookStub:id']), + ('title', orm['catalogue.BookStub:title']), + ('author', orm['catalogue.BookStub:author']), + ('pd', orm['catalogue.BookStub:pd']), + ('slug', orm['catalogue.BookStub:slug']), + ('translator', orm['catalogue.BookStub:translator']), + ('translator_death', orm['catalogue.BookStub:translator_death']), + )) + db.send_create_signal('catalogue', ['BookStub']) + + + + def backwards(self, orm): + + # Deleting model 'BookStub' + db.delete_table('catalogue_bookstub') + + + + models = { + 'auth.group': { + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)"}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + '_short_html': ('django.db.models.fields.TextField', [], {}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'extra_info': ('JSONField', ["_('extra information')"], {}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), + 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) + }, + 'catalogue.bookstub': { + 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'catalogue.fragment': { + '_short_html': ('django.db.models.fields.TextField', [], {}), + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'short_text': ('django.db.models.fields.TextField', [], {}), + 'text': ('django.db.models.fields.TextField', [], {}) + }, + 'catalogue.tag': { + 'book_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) + }, + 'catalogue.tagrelation': { + 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'db_table': "'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + } + } + + complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0008_fix_shelf_book_count.py b/apps/catalogue/migrations/0008_fix_shelf_book_count.py new file mode 100644 index 000000000..b4ee91506 --- /dev/null +++ b/apps/catalogue/migrations/0008_fix_shelf_book_count.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from south.db import db +from django.db import models +from catalogue.models import Tag, Book + +class Migration: + + def forwards(self): + "Write your forwards migration here" + for tag in Tag.objects.filter(user__isnull=False): + books = Tag.intermediary_table_model.objects.get_intersection_by_model(Book, [tag]) + tag.book_count = len(books) + tag.save() + + def backwards(self, orm): + "Write your backwards migration here" + pass diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 2f4e7fe06..59011fd9b 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models from django.db.models import permalink, Q from django.utils.translation import ugettext_lazy as _ @@ -7,6 +10,7 @@ from django.core.files import File from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse +from datetime import datetime from newtagging.models import TagBase from newtagging import managers @@ -47,6 +51,7 @@ class Tag(TagBase): user = models.ForeignKey(User, blank=True, null=True) book_count = models.IntegerField(_('book count'), default=0, blank=False, null=False) + death = models.IntegerField(_(u'year of death'), blank=True, null=True) gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) @@ -55,6 +60,17 @@ class Tag(TagBase): has_description.short_description = _('description') has_description.boolean = True + def alive(self): + return self.death is None + + def in_pd(self): + """ tests whether an author is in public domain """ + return self.death is not None and self.goes_to_pd() <= datetime.now().year + + def goes_to_pd(self): + """ calculates the year of public domain entry for an author """ + return self.death + 71 if self.death is not None else None + @permalink def get_absolute_url(self): return ('catalogue.views.tagged_object_list', [self.slug]) @@ -108,7 +124,6 @@ class Book(models.Model): objects = models.Manager() tagged = managers.ModelTaggedItemManager(Tag) tags = managers.TagDescriptor(Tag) - @property def name(self): @@ -123,7 +138,7 @@ class Book(models.Model): formats = [] if self.html_file: - formats.append(u'Czytaj online' % reverse('book_text', kwargs={'slug': self.slug})) + formats.append(u'%s' % (reverse('book_text', kwargs={'slug': self.slug}), _('Read online'))) if self.pdf_file: formats.append(u'PDF' % self.pdf_file.url) if self.odt_file: @@ -203,7 +218,7 @@ class Book(models.Model): book_shelves = [] else: if not overwrite: - raise Book.AlreadyExists('Book %s already exists' % book_slug) + raise Book.AlreadyExists(_('Book %s already exists') % book_slug) # Save shelves for this book book_shelves = list(book.tags.filter(category='set')) @@ -246,7 +261,7 @@ class Book(models.Model): child_book.parent_number = n child_book.save() except Book.DoesNotExist, e: - raise Book.DoesNotExist(u'Book with slug = "%s" does not exist.' % slug) + raise Book.DoesNotExist(_('Book with slug = "%s" does not exist.') % slug) book_descendants = list(book.children.all()) while len(book_descendants) > 0: @@ -342,3 +357,30 @@ class Fragment(models.Model): verbose_name = _('fragment') verbose_name_plural = _('fragments') + +class BookStub(models.Model): + title = models.CharField(_('title'), max_length=120) + author = models.CharField(_('author'), max_length=120) + pd = models.IntegerField(_('goes to public domain'), null=True, blank=True) + slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True) + translator = models.TextField(_('translator'), blank=True) + translator_death = models.TextField(_('year of translator\'s death'), blank=True) + + def in_pd(self): + return self.pd is not None and self.pd <= datetime.now().year + + @property + def name(self): + return self.title + + @permalink + def get_absolute_url(self): + return ('catalogue.views.book_detail', [self.slug]) + + def __unicode__(self): + return self.title + + class Meta: + ordering = ('title',) + verbose_name = _('book stub') + verbose_name_plural = _('book stubs') \ No newline at end of file diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index d3f608ac9..41be051f2 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import feedparser import datetime diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py index 327e0fc72..25389f48b 100644 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf.urls.defaults import * @@ -14,6 +17,9 @@ urlpatterns = patterns('catalogue.views', url(r'^polki/nowa/$', 'new_set', name='new_set'), url(r'^tags/$', 'tags_starting_with', name='hint'), url(r'^szukaj/$', 'search', name='search'), + + # tools + url(r'^zegar', 'clock', name='clock'), # Public interface. Do not change this URLs. url(r'^lektura/(?P[a-zA-Z0-9-]+)\.html$', 'book_text', name='book_text'), diff --git a/apps/catalogue/utils.py b/apps/catalogue/utils.py index 72b097392..36bd9e700 100644 --- a/apps/catalogue/utils.py +++ b/apps/catalogue/utils.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import random import time from base64 import urlsafe_b64encode diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 92aa3e054..cf1461feb 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -1,10 +1,15 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import tempfile import zipfile import sys import pprint import traceback +import re +from django.conf import settings from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect, Http404 @@ -18,7 +23,9 @@ from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.utils import simplejson from django.utils.functional import Promise from django.utils.encoding import force_unicode +from django.utils.http import urlquote_plus from django.views.decorators import cache +from django.utils.translation import ugettext as _ from catalogue import models from catalogue import forms @@ -40,10 +47,10 @@ def main_page(request): if request.user.is_authenticated(): shelves = models.Tag.objects.filter(category='set', user=request.user) new_set_form = forms.NewSetForm() - extra_where = 'NOT catalogue_tag.category = "set"' + extra_where = "NOT catalogue_tag.category = 'set'" tags = models.Tag.objects.usage_for_model(models.Book, counts=True, extra={'where': [extra_where]}) fragment_tags = models.Tag.objects.usage_for_model(models.Fragment, counts=True, - extra={'where': ['catalogue_tag.category = "theme"'] + [extra_where]}) + extra={'where': ["catalogue_tag.category = 'theme'"] + [extra_where]}) categories = split_tags(tags) form = forms.SearchForm() @@ -82,10 +89,12 @@ def tagged_object_list(request, tags=''): theme_is_set = len([tag for tag in tags if tag.category == 'theme']) > 0 if theme_is_set: model = models.Fragment + only_author = len(tags) == 1 and tags[0].category == 'author' + pd_counter = only_author and tags[0].goes_to_pd() user_is_owner = (len(shelf) and request.user.is_authenticated() and request.user == shelf[0].user) - extra_where = 'catalogue_tag.category NOT IN ("set", "book")' + extra_where = "catalogue_tag.category NOT IN ('set', 'book')" related_tags = models.Tag.objects.related_for_model(tags, model, counts=True, extra={'where': [extra_where]}) categories = split_tags(related_tags) @@ -101,6 +110,8 @@ def tagged_object_list(request, tags=''): extra_context = { 'categories': categories, 'shelf_is_set': shelf_is_set, + 'only_author': only_author, + 'pd_counter': pd_counter, 'user_is_owner': user_is_owner, 'formats_form': forms.DownloadFormatsForm(), }, @@ -119,12 +130,16 @@ def book_fragments(request, book_slug, theme_slug): def book_detail(request, slug): - book = get_object_or_404(models.Book, slug=slug) + try: + book = models.Book.objects.get(slug=slug) + except models.Book.DoesNotExist: + return book_stub_detail(request, slug) + book_tag = get_object_or_404(models.Tag, slug = 'l-' + slug) tags = list(book.tags.filter(~Q(category='set'))) categories = split_tags(tags) book_children = book.children.all().order_by('parent_number') - extra_where = 'catalogue_tag.category = "theme"' + extra_where = "catalogue_tag.category = 'theme'" book_themes = models.Tag.objects.related_for_model(book_tag, models.Fragment, counts=True, extra={'where': [extra_where]}) extra_info = book.get_extra_info_value() @@ -133,6 +148,15 @@ def book_detail(request, slug): context_instance=RequestContext(request)) +def book_stub_detail(request, slug): + book = get_object_or_404(models.BookStub, slug=slug) + pd_counter = book.pd + form = forms.SearchForm() + + return render_to_response('catalogue/book_stub_detail.html', locals(), + context_instance=RequestContext(request)) + + def book_text(request, slug): book = get_object_or_404(models.Book, slug=slug) book_themes = {} @@ -149,40 +173,109 @@ def book_text(request, slug): # ========== # = Search = # ========== + +def _no_diacritics_regexp(query): + """ returns a regexp for searching for a query without diacritics + + should be locale-aware """ + names = {'a':u'ą', 'c':u'ć', 'e':u'ę', 'l': u'ł', 'n':u'ń', 'o':u'ó', 's':u'ś', 'z':u'ź|ż'} + def repl(m): + l = m.group() + return "(%s|%s)" % (l, names[l]) + return re.sub('[%s]'%(''.join(names.keys())), repl, query) + +def _word_starts_with(name, prefix): + """returns a Q object getting models having `name` contain a word + starting with `prefix` + """ + kwargs = {} + if settings.DATABASE_ENGINE in ('mysql', 'postgresql_psycopg2', 'postgresql'): + prefix = _no_diacritics_regexp(re.escape(prefix)) + # we could use a [[:<:]] (word start), + # but we want both `xy` and `(xy` to catch `(xyz)` + kwargs['%s__iregex' % name] = u"(^|[^[:alpha:]])%s" % prefix + else: + # don't know how to do a generic regex + # checking for simple icontain instead + kwargs['%s__icontains' % name] = prefix + return Q(**kwargs) + + +def _tags_exact_matches(prefix, user): + book_stubs = models.BookStub.objects.filter(title__iexact = prefix) + books = models.Book.objects.filter(title__iexact = prefix) + book_stubs = filter(lambda x: x not in books, book_stubs) + tags = models.Tag.objects.filter(name__iexact = prefix) + if user.is_authenticated(): + tags = tags.filter(~Q(category='book') & (~Q(category='set') | Q(user=user))) + else: + tags = tags.filter(~Q(category='book') & ~Q(category='set')) + + return list(books) + list(tags) + list(book_stubs) + + def _tags_starting_with(prefix, user): - books = models.Book.objects.filter(title__icontains=prefix) - tags = models.Tag.objects.filter(name__icontains=prefix) + book_stubs = models.BookStub.objects.filter(_word_starts_with('title', prefix)) + books = models.Book.objects.filter(_word_starts_with('title', prefix)) + book_stubs = filter(lambda x: x not in books, book_stubs) + tags = models.Tag.objects.filter(_word_starts_with('name', prefix)) if user.is_authenticated(): tags = tags.filter(~Q(category='book') & (~Q(category='set') | Q(user=user))) else: tags = tags.filter(~Q(category='book') & ~Q(category='set')) - return list(books) + list(tags) + return list(books) + list(tags) + list(book_stubs) + +def _get_result_link(match, tag_list): + if isinstance(match, models.Book) or isinstance(match, models.BookStub): + return match.get_absolute_url() + else: + return reverse('catalogue.views.tagged_object_list', + kwargs={'tags': '/'.join(tag.slug for tag in tag_list + [match])} + ) + +def _get_result_type(match): + if isinstance(match, models.Book) or isinstance(match, models.BookStub): + type = 'book' + else: + type = match.category + return dict(models.TAG_CATEGORIES)[type] + + + def search(request): tags = request.GET.get('tags', '') prefix = request.GET.get('q', '') - # Prefix must have at least 2 characters - if len(prefix) < 2: - return HttpResponse('') try: tag_list = models.Tag.get_tag_list(tags) except: tag_list = [] + + # Prefix must have at least 2 characters + if len(prefix) < 2: + return render_to_response('catalogue/search_too_short.html', {'tags':tag_list, 'prefix':prefix}, + context_instance=RequestContext(request)) - result = _tags_starting_with(prefix, request.user) - if len(result) > 0: - tag = result[0] - if isinstance(tag, models.Book): - return HttpResponseRedirect(tag.get_absolute_url()) - else: - tag_list.append(tag) - - return HttpResponseRedirect(reverse('catalogue.views.tagged_object_list', - kwargs={'tags': '/'.join(tag.slug for tag in tag_list)} - )) + result = _tags_exact_matches(prefix, request.user) + + if len(result) > 1: + # multiple exact matches + return render_to_response('catalogue/search_multiple_hits.html', + {'tags':tag_list, 'prefix':prefix, 'results':((x, _get_result_link(x, tag_list), _get_result_type(x)) for x in result)}, + context_instance=RequestContext(request)) + + if not result: + # no exact matches + result = _tags_starting_with(prefix, request.user) + + if result: + return HttpResponseRedirect(_get_result_link(result[0], tag_list)) + else: + return render_to_response('catalogue/search_no_hits.html', {'tags':tag_list, 'prefix':prefix}, + context_instance=RequestContext(request)) def tags_starting_with(request): @@ -212,7 +305,7 @@ def book_sets(request, slug): book_sets = book.tags.filter(category='set', user=request.user) if not request.user.is_authenticated(): - return HttpResponse('

Aby zarządzać swoimi półkami, musisz się zalogować.

') + return HttpResponse(_('

To maintain your shelves you need to be logged in.

')) if request.method == 'POST': form = forms.ObjectSetsForm(book, request.user, request.POST) @@ -230,7 +323,7 @@ def book_sets(request, slug): book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user))) if request.is_ajax(): - return HttpResponse('

Półki zostały zapisane.

') + return HttpResponse(_('

Shelves were sucessfully saved.

')) else: return HttpResponseRedirect('/') else: @@ -248,12 +341,15 @@ def remove_from_shelf(request, shelf, book): book = get_object_or_404(models.Book, slug=book) shelf = get_object_or_404(models.Tag, slug=shelf, category='set', user=request.user) - models.Tag.objects.remove_tag(book, shelf) - - shelf.book_count -= 1 - shelf.save() - - return HttpResponse('Usunieto') + if shelf in book.tags: + models.Tag.objects.remove_tag(book, shelf) + + shelf.book_count -= 1 + shelf.save() + + return HttpResponse(_('Book was successfully removed from the shelf')) + else: + return HttpResponse(_('This book is not on the shelf')) def collect_books(books): @@ -286,7 +382,7 @@ def download_shelf(request, slug): formats = ['pdf', 'odt', 'txt', 'mp3', 'ogg'] # Create a ZIP archive - temp = temp = tempfile.TemporaryFile() + temp = tempfile.TemporaryFile() archive = zipfile.ZipFile(temp, 'w') for book in collect_books(models.Book.tagged.with_all(shelf)): @@ -349,7 +445,7 @@ def new_set(request): new_set = new_set_form.save(request.user) if request.is_ajax(): - return HttpResponse(u'

Półka %s została utworzona

' % new_set) + return HttpResponse(_('

Shelf %s was successfully created

') % new_set) else: return HttpResponseRedirect('/') @@ -364,7 +460,7 @@ def delete_shelf(request, slug): user_set.delete() if request.is_ajax(): - return HttpResponse(u'

Półka %s została usunięta

' % user_set.name) + return HttpResponse(_('

Shelf %s was successfully removed

') % user_set.name) else: return HttpResponseRedirect('/') @@ -404,7 +500,7 @@ def register(request): @cache.never_cache def logout_then_redirect(request): auth.logout(request) - return HttpResponseRedirect(request.GET.get('next', '/')) + return HttpResponseRedirect(urlquote_plus(request.GET.get('next', '/'), safe='/?=')) @@ -423,7 +519,17 @@ def import_book(request): info = sys.exc_info() exception = pprint.pformat(info[1]) tb = '\n'.join(traceback.format_tb(info[2])) - return HttpResponse("An error occurred: %s\n\n%s" % (exception, tb), mimetype='text/plain') - return HttpResponse("Book imported successfully") + _('Today is %(month)s, %(day)s.') % {'month': m, 'day': d} + return HttpResponse(_("An error occurred: %(exception)s\n\n%(tb)s") % {'exception':exception, 'tb':tb}, mimetype='text/plain') + return HttpResponse(_("Book imported successfully")) else: - return HttpResponse("Error importing file: %r" % book_import_form.errors) \ No newline at end of file + return HttpResponse(_("Error importing file: %r") % book_import_form.errors) + + + +def clock(request): + """ Provides server time for jquery.countdown, + in a format suitable for Date.parse() + """ + from datetime import datetime + return HttpResponse(datetime.now().strftime('%Y/%m/%d %H:%M:%S')) \ No newline at end of file diff --git a/apps/chunks/locale/de/LC_MESSAGES/django.po b/apps/chunks/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..41fcd005e --- /dev/null +++ b/apps/chunks/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:58+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/en/LC_MESSAGES/django.po b/apps/chunks/locale/en/LC_MESSAGES/django.po new file mode 100644 index 000000000..41fcd005e --- /dev/null +++ b/apps/chunks/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:58+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/es/LC_MESSAGES/django.po b/apps/chunks/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..936f3dfb8 --- /dev/null +++ b/apps/chunks/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/fr/LC_MESSAGES/django.po b/apps/chunks/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..936f3dfb8 --- /dev/null +++ b/apps/chunks/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/lt/LC_MESSAGES/django.po b/apps/chunks/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 000000000..936f3dfb8 --- /dev/null +++ b/apps/chunks/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/pl/LC_MESSAGES/django.po b/apps/chunks/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..936f3dfb8 --- /dev/null +++ b/apps/chunks/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/chunks/locale/ru/LC_MESSAGES/django.po b/apps/chunks/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 000000000..936f3dfb8 --- /dev/null +++ b/apps/chunks/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 10:59+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:10 models.py:24 +msgid "key" +msgstr "" + +#: models.py:10 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:11 +msgid "description" +msgstr "" + +#: models.py:12 +msgid "content" +msgstr "" + +#: models.py:16 +msgid "chunk" +msgstr "" + +#: models.py:17 +msgid "chunks" +msgstr "" + +#: models.py:24 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:29 +msgid "attachment" +msgstr "" + +#: models.py:29 +msgid "attachments" +msgstr "" diff --git a/apps/lessons/admin.py b/apps/lessons/admin.py index 813621f91..1447453c2 100644 --- a/apps/lessons/admin.py +++ b/apps/lessons/admin.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib import admin from django.utils.translation import ugettext_lazy as _ diff --git a/apps/lessons/locale/de/LC_MESSAGES/django.po b/apps/lessons/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/en/LC_MESSAGES/django.po b/apps/lessons/locale/en/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/es/LC_MESSAGES/django.po b/apps/lessons/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/fr/LC_MESSAGES/django.po b/apps/lessons/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..cbbd035b4 --- /dev/null +++ b/apps/lessons/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:01+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/lt/LC_MESSAGES/django.po b/apps/lessons/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/pl/LC_MESSAGES/django.po b/apps/lessons/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/locale/ru/LC_MESSAGES/django.po b/apps/lessons/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 000000000..f7d920cf8 --- /dev/null +++ b/apps/lessons/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,49 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:00+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "slug" +msgstr "" + +#: models.py:14 +msgid "file" +msgstr "" + +#: models.py:15 +msgid "author" +msgstr "" + +#: models.py:16 +msgid "slideshare ID" +msgstr "" + +#: models.py:17 +msgid "description" +msgstr "" + +#: models.py:29 +msgid "document" +msgstr "" + +#: models.py:29 +msgid "documents" +msgstr "" diff --git a/apps/lessons/models.py b/apps/lessons/models.py index b0cd59337..dc113ed16 100644 --- a/apps/lessons/models.py +++ b/apps/lessons/models.py @@ -1,11 +1,14 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models from django.utils.translation import ugettext_lazy as _ from os import path class Document(models.Model): - """Dokument - materiał pomocniczy dla nauczycieli.""" + """Document - hand-out for teachers""" title = models.CharField(_('title'), max_length=120) slug = models.SlugField(_('slug')) file = models.FileField(_('file'), upload_to='lessons/document') diff --git a/apps/lessons/urls.py b/apps/lessons/urls.py index d43ac3ab1..69a47e3ea 100644 --- a/apps/lessons/urls.py +++ b/apps/lessons/urls.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf.urls.defaults import * from catalogue import forms from lessons import models diff --git a/apps/lessons/views.py b/apps/lessons/views.py index e22691985..69380d688 100644 --- a/apps/lessons/views.py +++ b/apps/lessons/views.py @@ -1,3 +1,7 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.views.generic.list_detail import object_detail from catalogue import forms from lessons import models diff --git a/apps/newtagging/locale/de/LC_MESSAGES/django.po b/apps/newtagging/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..7089f261f --- /dev/null +++ b/apps/newtagging/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:01+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/en/LC_MESSAGES/django.po b/apps/newtagging/locale/en/LC_MESSAGES/django.po new file mode 100644 index 000000000..ca7d41b80 --- /dev/null +++ b/apps/newtagging/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/es/LC_MESSAGES/django.po b/apps/newtagging/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..ca7d41b80 --- /dev/null +++ b/apps/newtagging/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/fr/LC_MESSAGES/django.po b/apps/newtagging/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..ca7d41b80 --- /dev/null +++ b/apps/newtagging/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/lt/LC_MESSAGES/django.po b/apps/newtagging/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 000000000..ca7d41b80 --- /dev/null +++ b/apps/newtagging/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/pl/LC_MESSAGES/django.po b/apps/newtagging/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..7089f261f --- /dev/null +++ b/apps/newtagging/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:01+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/locale/ru/LC_MESSAGES/django.po b/apps/newtagging/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 000000000..ca7d41b80 --- /dev/null +++ b/apps/newtagging/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-05-18 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:38 +msgid "tags" +msgstr "" + +#: models.py:491 +msgid "tag" +msgstr "" + +#: models.py:492 +msgid "content type" +msgstr "" + +#: models.py:493 +msgid "object id" +msgstr "" + +#: views.py:30 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: views.py:32 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: views.py:34 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: views.py:38 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "" diff --git a/apps/newtagging/managers.py b/apps/newtagging/managers.py index 1dbcb2999..7870092e0 100644 --- a/apps/newtagging/managers.py +++ b/apps/newtagging/managers.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Custom managers for Django models registered with the tagging application. diff --git a/apps/newtagging/models.py b/apps/newtagging/models.py index e121994c7..2055ec318 100644 --- a/apps/newtagging/models.py +++ b/apps/newtagging/models.py @@ -1,8 +1,12 @@ +# -*- coding: utf-8 -*- """ Models and managers for generic tagging. """ + # Python 2.3 compatibility -if not hasattr(__builtins__, 'set'): +try: + set +except NameError: from sets import Set as set from django.contrib.contenttypes import generic @@ -108,7 +112,7 @@ class TagManager(models.Manager): WHERE %(tagged_item)s.content_type_id = %(content_type_id)s %%s %(extra_where)s - GROUP BY %(tag)s.id, %(tag)s.name + GROUP BY %(tag_columns)s, %(tag)s.id, %(tag)s.name %%s ORDER BY %(tag)s.%(ordering)s ASC""" % { 'tag': qn(self.model._meta.db_table), diff --git a/apps/newtagging/views.py b/apps/newtagging/views.py index 150a08477..b88e9c42d 100644 --- a/apps/newtagging/views.py +++ b/apps/newtagging/views.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """ Tagging related views. """ diff --git a/apps/pagination/__init__.py b/apps/pagination/__init__.py deleted file mode 100644 index 8b1378917..000000000 --- a/apps/pagination/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/pagination/middleware.py b/apps/pagination/middleware.py deleted file mode 100644 index 0bab76712..000000000 --- a/apps/pagination/middleware.py +++ /dev/null @@ -1,10 +0,0 @@ -class PaginationMiddleware(object): - """ - Inserts a variable representing the current page onto the request object if - it exists in either **GET** or **POST** portions of the request. - """ - def process_request(self, request): - try: - request.page = int(request.REQUEST['page']) - except (KeyError, ValueError): - request.page = 1 \ No newline at end of file diff --git a/apps/pagination/models.py b/apps/pagination/models.py deleted file mode 100644 index 8b1378917..000000000 --- a/apps/pagination/models.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/pagination/templates/pagination/pagination.html b/apps/pagination/templates/pagination/pagination.html deleted file mode 100644 index 3799314e4..000000000 --- a/apps/pagination/templates/pagination/pagination.html +++ /dev/null @@ -1,25 +0,0 @@ -{% if is_paginated %} - -{% endif %} diff --git a/apps/pagination/templatetags/__init__.py b/apps/pagination/templatetags/__init__.py deleted file mode 100644 index 8b1378917..000000000 --- a/apps/pagination/templatetags/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/pagination/templatetags/pagination_tags.py b/apps/pagination/templatetags/pagination_tags.py deleted file mode 100644 index 4908421ea..000000000 --- a/apps/pagination/templatetags/pagination_tags.py +++ /dev/null @@ -1,202 +0,0 @@ -try: - set -except NameError: - from sets import Set as set -from django import template -from django.db.models.query import QuerySet -from django.core.paginator import Paginator, QuerySetPaginator, InvalidPage - -register = template.Library() - -DEFAULT_PAGINATION = 20 -DEFAULT_WINDOW = 4 -DEFAULT_ORPHANS = 0 - -def do_autopaginate(parser, token): - """ - Splits the arguments to the autopaginate tag and formats them correctly. - """ - split = token.split_contents() - if len(split) == 2: - return AutoPaginateNode(split[1]) - elif len(split) == 3: - try: - paginate_by = int(split[2]) - except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2]) - return AutoPaginateNode(split[1], paginate_by=paginate_by) - elif len(split) == 4: - try: - paginate_by = int(split[2]) - except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2]) - try: - orphans = int(split[3]) - except ValueError: - raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[3]) - return AutoPaginateNode(split[1], paginate_by=paginate_by, orphans=orphans) - else: - raise template.TemplateSyntaxError('%r tag takes one required argument and one optional argument' % split[0]) - -class AutoPaginateNode(template.Node): - """ - Emits the required objects to allow for Digg-style pagination. - - First, it looks in the current context for the variable specified. This - should be either a QuerySet or a list. - - 1. If it is a QuerySet, this ``AutoPaginateNode`` will emit a - ``QuerySetPaginator`` and the current page object into the context names - ``paginator`` and ``page_obj``, respectively. - - 2. If it is a list, this ``AutoPaginateNode`` will emit a simple - ``Paginator`` and the current page object into the context names - ``paginator`` and ``page_obj``, respectively. - - It will then replace the variable specified with only the objects for the - current page. - - .. note:: - - It is recommended to use *{% paginate %}* after using the autopaginate - tag. If you choose not to use *{% paginate %}*, make sure to display the - list of availabale pages, or else the application may seem to be buggy. - """ - def __init__(self, queryset_var, paginate_by=DEFAULT_PAGINATION, orphans=DEFAULT_ORPHANS): - self.queryset_var = template.Variable(queryset_var) - self.paginate_by = paginate_by - self.orphans = orphans - - def render(self, context): - key = self.queryset_var.var - value = self.queryset_var.resolve(context) - if issubclass(value.__class__, QuerySet): - model = value.model - paginator_class = QuerySetPaginator - else: - value = list(value) - try: - model = value[0].__class__ - except IndexError: - return u'' - paginator_class = Paginator - paginator = paginator_class(value, self.paginate_by, self.orphans) - try: - page_obj = paginator.page(context['request'].page) - except InvalidPage: - # context[key] = [] - # context['invalid_page'] = True - # return u'' - from django.http import Http404 - raise Http404 - context[key] = page_obj.object_list - context['paginator'] = paginator - context['page_obj'] = page_obj - return u'' - -def paginate(context, window=DEFAULT_WINDOW): - """ - Renders the ``pagination/pagination.html`` template, resulting in a - Digg-like display of the available pages, given the current page. If there - are too many pages to be displayed before and after the current page, then - elipses will be used to indicate the undisplayed gap between page numbers. - - Requires one argument, ``context``, which should be a dictionary-like data - structure and must contain the following keys: - - ``paginator`` - A ``Paginator`` or ``QuerySetPaginator`` object. - - ``page_obj`` - This should be the result of calling the page method on the - aforementioned ``Paginator`` or ``QuerySetPaginator`` object, given - the current page. - - This same ``context`` dictionary-like data structure may also include: - - ``getvars`` - A dictionary of all of the **GET** parameters in the current request. - This is useful to maintain certain types of state, even when requesting - a different page. - """ - try: - paginator = context['paginator'] - page_obj = context['page_obj'] - page_range = paginator.page_range - # First and last are simply the first *n* pages and the last *n* pages, - # where *n* is the current window size. - first = set(page_range[:window]) - last = set(page_range[-window:]) - # Now we look around our current page, making sure that we don't wrap - # around. - current_start = page_obj.number-1-window - if current_start < 0: - current_start = 0 - current_end = page_obj.number-1+window - if current_end < 0: - current_end = 0 - current = set(page_range[current_start:current_end]) - pages = [] - # If there's no overlap between the first set of pages and the current - # set of pages, then there's a possible need for elusion. - if len(first.intersection(current)) == 0: - first_list = sorted(list(first)) - second_list = sorted(list(current)) - pages.extend(first_list) - diff = second_list[0] - first_list[-1] - # If there is a gap of two, between the last page of the first - # set and the first page of the current set, then we're missing a - # page. - if diff == 2: - pages.append(second_list[0] - 1) - # If the difference is just one, then there's nothing to be done, - # as the pages need no elusion and are correct. - elif diff == 1: - pass - # Otherwise, there's a bigger gap which needs to be signaled for - # elusion, by pushing a None value to the page list. - else: - pages.append(None) - pages.extend(second_list) - else: - pages.extend(sorted(list(first.union(current)))) - # If there's no overlap between the current set of pages and the last - # set of pages, then there's a possible need for elusion. - if len(current.intersection(last)) == 0: - second_list = sorted(list(last)) - diff = second_list[0] - pages[-1] - # If there is a gap of two, between the last page of the current - # set and the first page of the last set, then we're missing a - # page. - if diff == 2: - pages.append(second_list[0] - 1) - # If the difference is just one, then there's nothing to be done, - # as the pages need no elusion and are correct. - elif diff == 1: - pass - # Otherwise, there's a bigger gap which needs to be signaled for - # elusion, by pushing a None value to the page list. - else: - pages.append(None) - pages.extend(second_list) - else: - pages.extend(sorted(list(last.difference(current)))) - to_return = { - 'pages': pages, - 'page_obj': page_obj, - 'paginator': paginator, - 'is_paginated': paginator.count > paginator.per_page, - } - if 'request' in context: - getvars = context['request'].GET.copy() - if 'page' in getvars: - del getvars['page'] - if len(getvars.keys()) > 0: - to_return['getvars'] = "&%s" % getvars.urlencode() - else: - to_return['getvars'] = '' - return to_return - except KeyError: - return {} -register.inclusion_tag('pagination/pagination.html', takes_context=True)(paginate) -register.tag('autopaginate', do_autopaginate) \ No newline at end of file diff --git a/apps/pagination/tests.py b/apps/pagination/tests.py deleted file mode 100644 index 837e55cfe..000000000 --- a/apps/pagination/tests.py +++ /dev/null @@ -1,52 +0,0 @@ -""" ->>> from django.core.paginator import Paginator ->>> from pagination.templatetags.pagination_tags import paginate ->>> from django.template import Template, Context - ->>> p = Paginator(range(15), 2) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2, 3, 4, 5, 6, 7, 8] - ->>> p = Paginator(range(17), 2) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2, 3, 4, 5, 6, 7, 8, 9] - ->>> p = Paginator(range(19), 2) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2, 3, 4, None, 7, 8, 9, 10] - ->>> p = Paginator(range(21), 2) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2, 3, 4, None, 8, 9, 10, 11] - -# Testing orphans ->>> p = Paginator(range(5), 2, 1) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2] - ->>> p = Paginator(range(21), 2, 1) ->>> paginate({'paginator': p, 'page_obj': p.page(1)})['pages'] -[1, 2, 3, 4, None, 7, 8, 9, 10] - ->>> t = Template("{% load pagination_tags %}{% autopaginate var 2 %}{% paginate %}") - -# WARNING: Please, please nobody read this portion of the code! ->>> class GetProxy(object): -... def __iter__(self): yield self.__dict__.__iter__ -... def copy(self): return self -... def urlencode(self): return u'' -... def keys(self): return [] ->>> class RequestProxy(object): -... page = 1 -... GET = GetProxy() ->>> -# ENDWARNING - ->>> t.render(Context({'var': range(21), 'request': RequestProxy()})) -u'\\n