├── .gitignore ├── AUTHORS ├── ChangeLog ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.rst ├── bin └── django-gitcms-load-content ├── docs ├── Makefile └── source │ ├── conf.py │ ├── index.rst │ └── readme.rst ├── example-website ├── .gitignore ├── README ├── __init__.py ├── content │ ├── blog │ │ └── firstpost.rst │ ├── files │ │ ├── Luis_Pedro_Coelho.vcf │ │ ├── arrows.png │ │ ├── mississippi-0-no-sl.png │ │ ├── mississippi-0.png │ │ ├── niagara-small.jpg │ │ └── painting-rice.jpeg │ ├── menus │ │ ├── menu.yaml │ │ └── top.yaml │ ├── pages │ │ ├── another │ │ ├── gitcms │ │ ├── index │ │ └── template │ ├── redirect │ │ └── one2two_three2four.yaml │ └── tagging │ │ └── tags ├── manage.py ├── media │ ├── .gitignore │ ├── images │ │ └── ramblingsoul3 │ │ │ ├── footer.png │ │ │ ├── headbanner.png │ │ │ ├── header-bg.png │ │ │ ├── highlightgreen.png │ │ │ ├── logo.png │ │ │ ├── menu-hvr.png │ │ │ ├── menu.png │ │ │ └── topheadbg.png │ ├── js │ │ └── jquery.js │ └── style │ │ ├── luispedro.css │ │ ├── ramblingsoul3.css │ │ └── rest.css ├── settings.py ├── templates │ └── base.html └── urls.py ├── gitcms ├── .gitignore ├── __init__.py ├── blog │ ├── __init__.py │ ├── admin.py │ ├── feeds.py │ ├── load.py │ ├── models.py │ ├── templates │ │ └── blog │ │ │ ├── disqus.html │ │ │ ├── list.html │ │ │ └── post.html │ ├── templatetags │ │ ├── __init__.py │ │ └── disqus.py │ ├── tests │ │ ├── data │ │ │ └── firstpost.rst │ │ └── test_load.py │ ├── urls.py │ └── views.py ├── books │ ├── __init__.py │ ├── load.py │ ├── models.py │ ├── templates │ │ └── books │ │ │ ├── book.html │ │ │ └── list.html │ ├── urls.py │ └── views.py ├── conferences │ ├── __init__.py │ ├── load.py │ ├── models.py │ ├── templates │ │ └── conferences │ │ │ ├── conference_detail.html │ │ │ └── list.html │ ├── tests │ │ ├── data │ │ │ └── conferences │ │ └── test_load.py │ ├── urls.py │ └── views.py ├── files │ ├── __init__.py │ ├── load.py │ └── urls.py ├── gitcms_version.py ├── menus │ ├── __init__.py │ ├── load.py │ ├── models.py │ ├── templates │ │ └── menus │ │ │ ├── menu.html │ │ │ └── tabs.html │ ├── templatetags │ │ ├── __init__.py │ │ └── menus_tags.py │ ├── tests │ │ ├── data │ │ │ └── menu.yaml │ │ └── test_load.py │ └── views.py ├── pages │ ├── __init__.py │ ├── admin.py │ ├── load.py │ ├── models.py │ ├── rest.py │ ├── sourcecode_directive.py │ ├── templates │ │ └── pages │ │ │ ├── article.html │ │ │ └── list.html │ ├── tests │ │ ├── data │ │ │ └── article │ │ └── test_load.py │ ├── urls.py │ └── views.py ├── parsedate │ ├── __init__.py │ ├── parsedate.py │ └── tests.py ├── publications │ ├── __init__.py │ ├── load.py │ ├── templates │ │ └── publications │ │ │ ├── history.html │ │ │ └── publications.html │ ├── urls.py │ └── views.py ├── redirect │ ├── __init__.py │ ├── load.py │ ├── middleware.py │ └── models.py └── tagging │ ├── __init__.py │ ├── admin.py │ ├── load.py │ ├── models.py │ └── tests │ └── data │ └── categories ├── media └── .gitignore ├── setup.py └── testsettings.py /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | dist/ 3 | django_gitcms.egg-info/ 4 | *.pyc 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Luis Pedro Coelho 2 | Remigijus Jarmalavičius 3 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | Version 0.4 2 | * Renamed apps to remove 'simple' prefix 3 | * URL independence (from Remigijus Jarmalavičius) 4 | * Improved blog feed (from Remigijus Jarmalavičius) 5 | * Remove `blog.post.year_month_slug` (from Remigijus Jarmalavičius) 6 | * Fix `status` handling in blog 7 | 8 | version 0.3.6 2011-01-24 by 9 | * Add RSS for blog app 10 | * Add disqus integration for blog app 11 | 12 | 2010-04-25 luispedro 13 | * Remove references to BASE_URL from package. 14 | 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | 663 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include example-website/*.py 2 | include example-website/README 3 | include README.rst LICENSE ChangeLog 4 | recursive-include example-website/content * 5 | recursive-include example-website/media * 6 | recursive-include example-website/templates * 7 | recursive-include gitcms *.html 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | make tests: 2 | DJANGO_SETTINGS_MODULE=testsettings django-admin.py test 3 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Git CMS 3 | ======= 4 | Git Based Content Management 5 | ---------------------------- 6 | 7 | **DEPRECATED**: This project is no longer maintained. There are a lot of good 8 | alternatives nowadays. Use those. 9 | 10 | 11 | This is a simple way to allow git to store information related to a website. 12 | 13 | USAGE 14 | ----- 15 | 16 | I assume that you know django. If not, check the django website. 17 | 18 | Edit the files in example-website. The format of the files should be pretty 19 | obvious. If not, check the corresponding load.py file (e.g., for 20 | example-website/pages/ check gitcms/pages/load.py). 21 | 22 | WHAT'S NEW 23 | ---------- 24 | 25 | **Version 0.3.6** 26 | - Add RSS for blog app 27 | - Add disqus integration for blog app 28 | 29 | BACKGROUND 30 | ---------- 31 | 32 | I came to this after having spent a semester maintaining a simple course 33 | website by using restructured text and sphinx to build a website. It was very 34 | easy to use a text editor and reST and after a bit of setting up, I had written 35 | a script so that, after each edit, I could publish by calling ``publish.sh``. I 36 | almost converted my website to this system, but I hesitated because of the 37 | limitations of only having text. 38 | 39 | This is similar to the couple of gitwiki projects that are around the web, but 40 | with the major difference that it can use *any time of content*. For example, I 41 | want to maintain a list of upcoming conferences as a text file and have it 42 | served on a webpage, as an online calendar, &c. 43 | 44 | -------------------------------------------------------------------------------- /bin/django-gitcms-load-content: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python manage.py shell<' where is one of" 19 | @echo " html to make standalone HTML files" 20 | @echo " dirhtml to make HTML files named index.html in directories" 21 | @echo " singlehtml to make a single large HTML file" 22 | @echo " pickle to make pickle files" 23 | @echo " json to make JSON files" 24 | @echo " htmlhelp to make HTML files and a HTML help project" 25 | @echo " qthelp to make HTML files and a qthelp project" 26 | @echo " devhelp to make HTML files and a Devhelp project" 27 | @echo " epub to make an epub" 28 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 29 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 30 | @echo " text to make text files" 31 | @echo " man to make manual pages" 32 | @echo " changes to make an overview of all changed/added/deprecated items" 33 | @echo " linkcheck to check all external links for integrity" 34 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 35 | 36 | clean: 37 | -rm -rf $(BUILDDIR)/* 38 | 39 | html: 40 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 41 | @echo 42 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 43 | 44 | dirhtml: 45 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 48 | 49 | singlehtml: 50 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 51 | @echo 52 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 53 | 54 | pickle: 55 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 56 | @echo 57 | @echo "Build finished; now you can process the pickle files." 58 | 59 | json: 60 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 61 | @echo 62 | @echo "Build finished; now you can process the JSON files." 63 | 64 | htmlhelp: 65 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 66 | @echo 67 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 68 | ".hhp project file in $(BUILDDIR)/htmlhelp." 69 | 70 | qthelp: 71 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 72 | @echo 73 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 74 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 75 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-gitcms.qhcp" 76 | @echo "To view the help file:" 77 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-gitcms.qhc" 78 | 79 | devhelp: 80 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 81 | @echo 82 | @echo "Build finished." 83 | @echo "To view the help file:" 84 | @echo "# mkdir -p $$HOME/.local/share/devhelp/django-gitcms" 85 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/django-gitcms" 86 | @echo "# devhelp" 87 | 88 | epub: 89 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 90 | @echo 91 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 92 | 93 | latex: 94 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 95 | @echo 96 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 97 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 98 | "(use \`make latexpdf' here to do that automatically)." 99 | 100 | latexpdf: 101 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 102 | @echo "Running LaTeX files through pdflatex..." 103 | make -C $(BUILDDIR)/latex all-pdf 104 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 105 | 106 | text: 107 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 108 | @echo 109 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 110 | 111 | man: 112 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 113 | @echo 114 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 115 | 116 | changes: 117 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 118 | @echo 119 | @echo "The overview file is in $(BUILDDIR)/changes." 120 | 121 | linkcheck: 122 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 123 | @echo 124 | @echo "Link check complete; look for any errors in the above output " \ 125 | "or in $(BUILDDIR)/linkcheck/output.txt." 126 | 127 | doctest: 128 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 129 | @echo "Testing of doctests in the sources finished, look at the " \ 130 | "results in $(BUILDDIR)/doctest/output.txt." 131 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # django-gitcms documentation build configuration file, created by 4 | # sphinx-quickstart on Sat Jan 22 12:32:35 2011. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | from gitcms import __version__ as gitcm_version 16 | 17 | # If extensions (or modules to document with autodoc) are in another directory, 18 | # add these directories to sys.path here. If the directory is relative to the 19 | # documentation root, use os.path.abspath to make it absolute, like shown here. 20 | #sys.path.insert(0, os.path.abspath('.')) 21 | 22 | # -- General configuration ----------------------------------------------------- 23 | 24 | # If your documentation needs a minimal Sphinx version, state it here. 25 | #needs_sphinx = '1.0' 26 | 27 | # Add any Sphinx extension module names here, as strings. They can be extensions 28 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 29 | extensions = [ 30 | 'sphinx.ext.autodoc', 31 | 'sphinx.ext.doctest', 32 | 'sphinx.ext.intersphinx', 33 | 'sphinx.ext.todo', 34 | 'sphinx.ext.coverage', 35 | 'sphinx.ext.ifconfig', 36 | 'sphinx.ext.viewcode' 37 | ] 38 | 39 | # Add any paths that contain templates here, relative to this directory. 40 | templates_path = ['_templates'] 41 | 42 | # The suffix of source filenames. 43 | source_suffix = '.rst' 44 | 45 | # The encoding of source files. 46 | #source_encoding = 'utf-8-sig' 47 | 48 | # The master toctree document. 49 | master_doc = 'index' 50 | 51 | # General information about the project. 52 | project = u'django-gitcms' 53 | copyright = u'2011, Luis Pedro Coelho' 54 | 55 | # The version info for the project you're documenting, acts as replacement for 56 | # |version| and |release|, also used in various other places throughout the 57 | # built documents. 58 | # 59 | # The short X.Y version. 60 | version = gitcm_version 61 | # The full version, including alpha/beta/rc tags. 62 | release = gitcm_version 63 | 64 | # The language for content autogenerated by Sphinx. Refer to documentation 65 | # for a list of supported languages. 66 | #language = None 67 | 68 | # There are two options for replacing |today|: either, you set today to some 69 | # non-false value, then it is used: 70 | #today = '' 71 | # Else, today_fmt is used as the format for a strftime call. 72 | #today_fmt = '%B %d, %Y' 73 | 74 | # List of patterns, relative to source directory, that match files and 75 | # directories to ignore when looking for source files. 76 | exclude_patterns = [] 77 | 78 | # The reST default role (used for this markup: `text`) to use for all documents. 79 | #default_role = None 80 | 81 | # If true, '()' will be appended to :func: etc. cross-reference text. 82 | #add_function_parentheses = True 83 | 84 | # If true, the current module name will be prepended to all description 85 | # unit titles (such as .. function::). 86 | #add_module_names = True 87 | 88 | # If true, sectionauthor and moduleauthor directives will be shown in the 89 | # output. They are ignored by default. 90 | #show_authors = False 91 | 92 | # The name of the Pygments (syntax highlighting) style to use. 93 | pygments_style = 'sphinx' 94 | 95 | # A list of ignored prefixes for module index sorting. 96 | #modindex_common_prefix = [] 97 | 98 | 99 | # -- Options for HTML output --------------------------------------------------- 100 | 101 | # The theme to use for HTML and HTML Help pages. See the documentation for 102 | # a list of builtin themes. 103 | html_theme = 'default' 104 | 105 | # Theme options are theme-specific and customize the look and feel of a theme 106 | # further. For a list of options available for each theme, see the 107 | # documentation. 108 | #html_theme_options = {} 109 | 110 | # Add any paths that contain custom themes here, relative to this directory. 111 | #html_theme_path = [] 112 | 113 | # The name for this set of Sphinx documents. If None, it defaults to 114 | # " v documentation". 115 | #html_title = None 116 | 117 | # A shorter title for the navigation bar. Default is the same as html_title. 118 | #html_short_title = None 119 | 120 | # The name of an image file (relative to this directory) to place at the top 121 | # of the sidebar. 122 | #html_logo = None 123 | 124 | # The name of an image file (within the static path) to use as favicon of the 125 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 126 | # pixels large. 127 | #html_favicon = None 128 | 129 | # Add any paths that contain custom static files (such as style sheets) here, 130 | # relative to this directory. They are copied after the builtin static files, 131 | # so a file named "default.css" will overwrite the builtin "default.css". 132 | html_static_path = ['_static'] 133 | 134 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 135 | # using the given strftime format. 136 | #html_last_updated_fmt = '%b %d, %Y' 137 | 138 | # If true, SmartyPants will be used to convert quotes and dashes to 139 | # typographically correct entities. 140 | #html_use_smartypants = True 141 | 142 | # Custom sidebar templates, maps document names to template names. 143 | #html_sidebars = {} 144 | 145 | # Additional templates that should be rendered to pages, maps page names to 146 | # template names. 147 | #html_additional_pages = {} 148 | 149 | # If false, no module index is generated. 150 | #html_domain_indices = True 151 | 152 | # If false, no index is generated. 153 | #html_use_index = True 154 | 155 | # If true, the index is split into individual pages for each letter. 156 | #html_split_index = False 157 | 158 | # If true, links to the reST sources are added to the pages. 159 | #html_show_sourcelink = True 160 | 161 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 162 | #html_show_sphinx = True 163 | 164 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 165 | #html_show_copyright = True 166 | 167 | # If true, an OpenSearch description file will be output, and all pages will 168 | # contain a tag referring to it. The value of this option must be the 169 | # base URL from which the finished HTML is served. 170 | #html_use_opensearch = '' 171 | 172 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 173 | #html_file_suffix = None 174 | 175 | # Output file base name for HTML help builder. 176 | htmlhelp_basename = 'django-gitcmsdoc' 177 | 178 | 179 | # -- Options for LaTeX output -------------------------------------------------- 180 | 181 | # The paper size ('letter' or 'a4'). 182 | #latex_paper_size = 'letter' 183 | 184 | # The font size ('10pt', '11pt' or '12pt'). 185 | #latex_font_size = '10pt' 186 | 187 | # Grouping the document tree into LaTeX files. List of tuples 188 | # (source start file, target name, title, author, documentclass [howto/manual]). 189 | latex_documents = [ 190 | ('index', 'django-gitcms.tex', u'django-gitcms Documentation', 191 | u'Luis Pedro Coelho', 'manual'), 192 | ] 193 | 194 | # The name of an image file (relative to this directory) to place at the top of 195 | # the title page. 196 | #latex_logo = None 197 | 198 | # For "manual" documents, if this is true, then toplevel headings are parts, 199 | # not chapters. 200 | #latex_use_parts = False 201 | 202 | # If true, show page references after internal links. 203 | #latex_show_pagerefs = False 204 | 205 | # If true, show URL addresses after external links. 206 | #latex_show_urls = False 207 | 208 | # Additional stuff for the LaTeX preamble. 209 | #latex_preamble = '' 210 | 211 | # Documents to append as an appendix to all manuals. 212 | #latex_appendices = [] 213 | 214 | # If false, no module index is generated. 215 | #latex_domain_indices = True 216 | 217 | 218 | # -- Options for manual page output -------------------------------------------- 219 | 220 | # One entry per manual page. List of tuples 221 | # (source start file, name, description, authors, manual section). 222 | man_pages = [ 223 | ('index', 'django-gitcms', u'django-gitcms Documentation', 224 | [u'Luis Pedro Coelho'], 1) 225 | ] 226 | 227 | 228 | # -- Options for Epub output --------------------------------------------------- 229 | 230 | # Bibliographic Dublin Core info. 231 | epub_title = u'django-gitcms' 232 | epub_author = u'Luis Pedro Coelho' 233 | epub_publisher = u'Luis Pedro Coelho' 234 | epub_copyright = u'2011, Luis Pedro Coelho' 235 | 236 | # The language of the text. It defaults to the language option 237 | # or en if the language is not set. 238 | #epub_language = '' 239 | 240 | # The scheme of the identifier. Typical schemes are ISBN or URL. 241 | #epub_scheme = '' 242 | 243 | # The unique identifier of the text. This can be a ISBN number 244 | # or the project homepage. 245 | #epub_identifier = '' 246 | 247 | # A unique identification for the text. 248 | #epub_uid = '' 249 | 250 | # HTML files that should be inserted before the pages created by sphinx. 251 | # The format is a list of tuples containing the path and title. 252 | #epub_pre_files = [] 253 | 254 | # HTML files shat should be inserted after the pages created by sphinx. 255 | # The format is a list of tuples containing the path and title. 256 | #epub_post_files = [] 257 | 258 | # A list of files that should not be packed into the epub file. 259 | #epub_exclude_files = [] 260 | 261 | # The depth of the table of contents in toc.ncx. 262 | #epub_tocdepth = 3 263 | 264 | # Allow duplicate toc entries. 265 | #epub_tocdup = True 266 | 267 | 268 | # Example configuration for intersphinx: refer to the Python standard library. 269 | intersphinx_mapping = {'http://docs.python.org/': None} 270 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. django-gitcms documentation master file, created by 2 | sphinx-quickstart on Sat Jan 22 12:32:35 2011. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to django-gitcms's documentation! 7 | ========================================= 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | readme 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | 23 | -------------------------------------------------------------------------------- /docs/source/readme.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Git CMS 3 | ======= 4 | Git Based Content Management 5 | ---------------------------- 6 | 7 | This is a simple way to allow git to store information related to a website. 8 | 9 | USAGE 10 | ----- 11 | 12 | I assume that you know django. If not, check the django website. 13 | 14 | Edit the files in example-website. The format of the files should be pretty 15 | obvious. If not, check the corresponding load.py file (e.g., for 16 | example-website/pages/ check gitcms/pages/load.py). 17 | 18 | BACKGROUND 19 | ---------- 20 | 21 | I came to this after having spent a semester maintaining a simple course 22 | website by using restructured text and sphinx to build a website. It was very 23 | easy to use a text editor and reST and after a bit of setting up, I had written 24 | a script so that, after each edit, I could publish by calling ``publish.sh``. I 25 | almost converted my website to this system, but I hesitated because of the 26 | limitations of only having text. 27 | 28 | This is similar to the couple of gitwiki projects that are around the web, but 29 | with the major difference that it can use *any time of content*. For example, I 30 | want to maintain a list of upcoming conferences as a text file and have it 31 | served on a webpage, as an online calendar, &c. 32 | 33 | -------------------------------------------------------------------------------- /example-website/.gitignore: -------------------------------------------------------------------------------- 1 | *pyc 2 | example.db 3 | -------------------------------------------------------------------------------- /example-website/README: -------------------------------------------------------------------------------- 1 | Example Website 2 | =============== 3 | 4 | Test it with:: 5 | 6 | python manage.py syncdb --noinput 7 | git-cms-load-content 8 | python manage.py runserver 9 | 10 | And then point your browser to http://127.0.0.1:8000/ 11 | -------------------------------------------------------------------------------- /example-website/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/__init__.py -------------------------------------------------------------------------------- /example-website/content/blog/firstpost.rst: -------------------------------------------------------------------------------- 1 | title: First Post 2 | slug: first-post 3 | timestamp: April 4 2010 9:01 4 | categories: 5 | status: published 6 | --- 7 | 8 | First Post 9 | ---------- 10 | 11 | Subtitle 12 | ........ 13 | 14 | This is the best thing ever! 15 | 16 | -------------------------------------------------------------------------------- /example-website/content/files/Luis_Pedro_Coelho.vcf: -------------------------------------------------------------------------------- 1 | BEGIN:VCARD 2 | ADR;TYPE=pref;TYPE=work:;;Lane Center for Computational Biology\nCarnegie M 3 | ellon University\n7405 Gates-Hillman Center\n5000 Forbes Ave;Pittbusrgh;Pen 4 | nsylvania;15213;United States of America 5 | BDAY:2081-04-22T00:00:00 6 | CLASS:PUBLIC 7 | EMAIL;TYPE=PREF:lpc@cmu.edu 8 | EMAIL:luis@luispedro.org 9 | FN:Luis Pedro Coelho 10 | N:Coelho;Luis;Pedro;; 11 | ORG:;Lane Center for Computational Biology 12 | PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJRgABAQIAJQAlAAD/2wBDAAgGBgcGBQ 13 | gHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zN 14 | DL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy 15 | MjIyMjIyMjIyMjIyMjL/wAARCACMAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAE 16 | CAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0 17 | KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc 18 | 3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW 19 | 19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQo 20 | L/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYn 21 | LRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g 22 | oOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk 23 | 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDzFSMdc10/hzxrqvh66V7edmiLZkic5VxnnI9 24 | ffr71ytzYXunTvDNDLDIn3o5FKkfUHpTEuRnDjafequQ0fS3hz4g6N4gVYzMtrecZhlYYY5x8p4 25 | z244PPSuqLcV8kxzFTuRiDjqDXd+F/iTqGklba+LXVnjABPzJ9D/Tp06datSFqj3K4nWKNnc4UV 26 | 8+fG6/Fz4ntLVHyIYAGX0Ykk/oVr1y18S6brkCtZ3Uch+80ROHUDGcjPvjPTnrXz/4/uJ9T8b6h 27 | KsbOI5TGSoyPl+UfotKWwR1ZU0e2HlCY5yWI+o47/XNdjZxnyByQOgFczYSQ21rAskyABBnJ6E8 28 | kfmTW3/aduYdttdxlwAAu4DJJ9+tSJ6s0drc4Y4rMvJWkfykUsQecDPFWrC5kmnKk+ZGgLNkAZx 29 | 2yPWrnhHTLjxPrF/bxyJb2toBumaMuWcnG37wx0bnn7tMkxmiefR7iLY29o3UAj1BxXFaaStyw9 30 | VOPrmvWL+xWyv7i3VmdYZGQM3UgHjNeT2waK/VWGCG2kemcipZpFHfCLzEVsnkCin2gMllA3qgo 31 | pmJ7FqdlZ6lbmC9toriPBwrrnBPceh9xXnPiD4ZQSq82jybGwT9nkOQfZW6j05z9RXozybqiJPr 32 | SOlnz7qfh7VdDkxdWskOTwTypPoCOCfxqmlzhtsilT7civoiaKOeJopo1kjYYZHUFW+oPWvJ/H1 33 | jomlXATT4XiveGkRWzGqnJ6HkHpwOMUCsc4l69jMjxyvHKpypRiCD9R0PWsu7vZJXd2fezHJz69 34 | 6k+zzyjco7ZyaqSWk68KpY+3SlcfLYrSTM5J3H61ErODlSRzkVbWxnJyY8VIbCXGRE2PalcLMu6 35 | Hr01m7RTKHhkG1sjkc8EGvY/hRbfYPC0l3Moae9naQvnO5RwP13fnXhyWcqsCYmAzzXpXw48RSW 36 | lymiXpbyp2AtmPRHPb6H+f1NVFktdToPEMKprNwVOfMO/8+a8d1WNrfxBdZGMTl8exOR+le5+LL 37 | BrPUIt4w8kYc/nj+leNeLITF4hlY/8tUVh9Mbf6UPcOp1mivnTUHoSKKoaTcMloyqeN5x+lFUZa 38 | nvB0q4HJA/Ck/sucj5cZ9+K7HyYx0UUGNMfdX8hUanQcJqNvJpmm3F7PtEcCF2APJAHQV4DLv1n 39 | xCrXDFjPL+8JPqf8K+j/AIkSfZ/AGquoXcURBx/edR/Wvm3TpNmpwP3Dg4pPYFudvJpdtDHtWNQ 40 | DjtWZc2ka52IB+Fbtw+QOwxWXMhGcmsEzv5VYx3t0x90flUHlqRgCr8w25qpzVoycUQ+RngCrf2 41 | XzNMdojtubc+dCy9QRzx+ApgBx71Ys3ZJGB7qf5VSMpI9D1jVf7f8ADmh6o3MksLCQ+jLtBH5lq 42 | 8m8cwsupWk/Zoin5HP/ALNXoXhstP8AC+z+X/Uag0WcdAUZz+pH6VxfxAgP2SynHASRk/FgD/7L 43 | WhzrcxraYrbx89VB/Sio7NPMtI29Mj8jiignlR9jFm/ufrSb3P8Ayz/WqA1FJE3KXxz2Pb8Kab+ 44 | MdfN/75NRzo1sc38VTIfh9qJ2EAGM/e/6aKP618+6HaNd6zBGM4GWPsBXrvxB1u51C6n0KCQrbG 45 | 2Dy5XnO7POe3T+dedeFbV4vt9z1aOLyxj1Jz/QUnK6Zr7Jxcb9TY1jVbbTsBm3SZ+6vUVzFx4tt 46 | i+0K2aqajaymYhIWY9WL8gfh3rDMUhD+YFjKn5QqYzSSVtByqTvY6hNSS4TIBpXuVRelU9AgaWT 47 | 94uVAyOKNbYwx4iTGc54o0vYr3uW4ja9bRSGNyVNX7a9hurW7aJvnjgdhj6VxW5muNr2yy5P3sG 48 | trTLQT7xGGRtjfI3fg8VRi5M9a8O3Edl8LbeyELm4nmEpZuAuZAuff5QPTrXI+PIS/h7eOkUyuf 49 | pgj/2aur07UYr3wdFJGAfs1sIyMdGRM/0B/GsLxjEZPC18AOQqt+Tg/wBKoy6nBaevnW2cfdYj+ 50 | v8AWiqtjOY4CPU5/QUUxH0mmr3McYTCkZ6kH608avdNyFXHtVcQDuKkKhRgVHJHsaXZx3jJ5Y5m 51 | 1KP5JZUVJGXrtBwT7dV/KqGgWD2Wl3AnIZ2nbnPUDgH8etdbqtsktusjqD5TbsevYj9awMLFaKi 52 | 8KBioaszrjLnjG/QxNWthMPkGOe1YMejRTTEyk8ds109ywWHtg1z815KlwEhGWzzSXkayjF6s1r 53 | Gyt7MgquBj1rK1G2SeTBxjJroIvKW1kLTq74HAPSslUSTzfnG7b8ufXNCCaXLY5/8As4QynYT+F 54 | b2jW8Ud3G7jDd896rQMsp3EYqwTjeVzwjYwec44xV2OblR0Pgi0dfCpWQApcSuw91I2/wBKNfjD 55 | +H9SXGf9Gkx9dpxU2nyPaafBCuYjGgyoOcHqf1zREv23Row//La3Gf8AgS//AF6voc8neR4kh+R 56 | fpRRCf3fXvRTEfTbXIGM55pjXBBBzxWCmouyc85qvrFzLFpNzcsVVEjOwjru/zg/nS2GtXZGJ4n 57 | 8ULqeo/wBk2s81tEhO+5RjjIzngDnoMcjnHSm6JfpPp7xCaaQxPgtMwZ8EZ5P1yPwrgo7ktfSkn 58 | 5pEYD65B459qv6NqIsNSxMxEU42tzgA9j/n1qXG6Om0YanYzsGhbPueTWEko+0MkaZc961riYC3 59 | cfxduKyYdOhuA7TOQ/baen1qFoU220kJdiS2/erHsduGx1P1qojyqpZ92D7026sWgkHlTle/Jpk 60 | NlI4O64YKTzg1asKcX3LttICSFODWnZhWkJcZC4I+uaw7WI28uwsWAPXua1YH2oQDzkk+9OKuzm 61 | nUaRuSXhDKN2MjnNaOlOJNLtyP4V2D/gJx/SuciZmAUbQdvrW/oQC6RGoxxJL0/wCujf0q5GUWe 62 | GxOyrj3oqS8h8m/uYf+ecrJ+RopXLse3xOIsHO7cg2k9a53xfqZWCGzkkIGC5XOOvA/z71t3bCx 63 | Mc0zNHH5gUFhjccHABzjPFed+NbhZNZkEMvmRKoCkHg//WzTVt2CbWxg3l6I5leIklWzn1//AFj 64 | PNO1KRZIoynRuf8P8+9ZsnzKMHtT/ALQGtkQj5lOPw7f59qfNe4dDqPDmvb4xY3T/ADIuI3J+8O 65 | w+tbySqDgk4JrzNuTlT9K2bHxA8SCO5JOOjj+tZtIpSadzqrmAO4+bGfSmAiNSp6+9ZQ1eOU7lf 66 | qeOae96PLaRsqijJZhilYpzvqg1bVlsbdhGQbmQYUD+EetW/DVys1lGZlLhGKk5Prn+tcazPd3L 67 | 3EgzuPf9BXongG/TR7W7AUSNMUOwPtbA3cgd6teRlJaam7Lp9rHbM6xkADIJY1oeH2VrO4VPuJO 68 | VX8VVv61orqMNxlfscz8c5jBHP41T0poXl1EwR+VGbkEJs2Y/dRg8fUGs4tvcHCx4vr+F8SaqPS 69 | 8m/wDQzRUviyIp4r1Mes7N+fP9aKsu53XiHW0nLyG4EkgQpHHgbI9wxxnqeev8u/ndzcGeSYk5I 70 | bue2MVb1KcSq5BOSP1rJVme7AQf6zAA9/x/KqbISGnvUPIcetaY0uVj8zKvXPfFK+mIIxhzv7Ht 71 | /nrUlGWTjp+VGc1YeDcu9fxHoahETnB2HrjNAGpa/LboGLAj+9/nitKKJb22lhlQuyqWU7uFPv3 72 | I/Cs5BIuBuDD3q7HI1rYvcKU3k7RuJBHuKQijDHubAGMcc+lJBftDqv3j5ZAj+U/w9iPx5qrNcl 73 | kMcfRuCfWmD78TPgkDABPvn8BzTRc5X0O/0PxC1rMsFy+YzgLzhWHbaT936Hjtla7PRVVLq8RCS 74 | rLHIM++4c8DB+XBHYjFeTNKk0ZRhjAz06A9P8P/ANVdn4F1jfezWFyzG4ZAFYk9FycDsOCTxj15 75 | JNNpdDJ3W5x3j391411FfeM/nGpop/xBTd41viM4Ii/9FrRSLM8/vbbPcVmo5hmikIJMTg49s5/ 76 | xrSg/495Ko3yhcMOCetMSOgYh2GOR2C9Pb8B/WhLeSYDy42bPbHJ6fl1/WtPSoozpELtGrMqKfm 77 | HXKjIPtUN/qdzDLtjKqGZt2B97DKRn+X0qLiV2c9eI9hP+9jYLJ8w4/P8Az7063IR92AyN3FLfX 78 | El4kfnndtyB/n8BVCHKuVViAeuDTtdWZV3FnQRQxSDKoT64qtqzeXBHbBSC5yc/3R/9fFUtPvZx 79 | d7d+Rz1FWNTdnvxk9Ixj8zWPLaaRvdODl1M4wHd8ozmq/mb5M/wjgD2FXZWKxrj++KoLw/HvW5g 80 | jX8wqkMp5K4Vvof8AJ/MVr6Lc/Ytbs7rd/q5AGI7oeD+hrHsFDSLGw3KwOQe9b+pWUNrbWjx7gZ 81 | FbcCePlPFCHU1KvxAT/isLo46pGf8AxwUU/wAffN4okY9TEn8qKDO5/9k= 82 | ROLE:Graduate Student 83 | TEL;TYPE=CELL:4123308306 84 | UID:4w8ZpKUyVu 85 | URL:http://luispedro.org 86 | VERSION:3.0 87 | X-KADDRESSBOOK-CRYPTOPROTOPREF:openpgp/mime 88 | X-KADDRESSBOOK-CRYPTOSIGNPREF:alwaysIfPossible 89 | X-KADDRESSBOOK-OPENPGPFP:6FB8B07A620CC7A7FB5B2AB4110D6C98E760BEF2 90 | X-KADDRESSBOOK-X-Profession:Graduate Student in Computational Biology 91 | END:VCARD 92 | 93 | -------------------------------------------------------------------------------- /example-website/content/files/arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/content/files/arrows.png -------------------------------------------------------------------------------- /example-website/content/files/mississippi-0-no-sl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/content/files/mississippi-0-no-sl.png -------------------------------------------------------------------------------- /example-website/content/files/mississippi-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/content/files/mississippi-0.png -------------------------------------------------------------------------------- /example-website/content/files/niagara-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/content/files/niagara-small.jpg -------------------------------------------------------------------------------- /example-website/content/files/painting-rice.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/content/files/painting-rice.jpeg -------------------------------------------------------------------------------- /example-website/content/menus/menu.yaml: -------------------------------------------------------------------------------- 1 | name: Main Menu 2 | children: 3 | - name: One 4 | url: / 5 | children: 6 | - name: Flat 7 | title: about gitcms 8 | url: /two 9 | - name: Nested 10 | title: another page 11 | url: /deeply/nested/url 12 | - name: External links 13 | url: http://luispedro.org/software/git-cms 14 | children: 15 | - name: Home Page 16 | title: Project Home Page 17 | url: http://luispedro.org/software/git-cms 18 | - name: Author's Webpage 19 | title: Luis Pedro Coelho's Webpage 20 | url: http://luispedro.org/ 21 | 22 | -------------------------------------------------------------------------------- /example-website/content/menus/top.yaml: -------------------------------------------------------------------------------- 1 | name: Top Menu 2 | children: 3 | - name: Home 4 | url: / 5 | - name: One 6 | url: /one 7 | - name: Two 8 | url: /two 9 | - name: Gitcms 10 | url: http://luispedro.org/software/git-cms 11 | 12 | 13 | -------------------------------------------------------------------------------- /example-website/content/pages/another: -------------------------------------------------------------------------------- 1 | title: Page in Subdirectory 2 | url: deeply/nested/url 3 | categories: somecategory 4 | .. 5 | 6 | Page in Subdirectory 7 | ==================== 8 | 9 | Pages can be placed in subdirectories by their *url* property. 10 | 11 | It does not matter where the original data comes from! 12 | 13 | But if you want, you can use subdirectories for your own organisation. 14 | -------------------------------------------------------------------------------- /example-website/content/pages/gitcms: -------------------------------------------------------------------------------- 1 | title: Git CMS 2 | url: two 3 | categories: software 4 | .. 5 | 6 | Git Content Management System 7 | ============================= 8 | 9 | How is this website run? 10 | ------------------------ 11 | 12 | This is a django website with a twist: *all content is stored in text files*. I manage those files with git. A little script loads those files into the database and then django serves them. 13 | 14 | In fact, all of the content and its history is actually `publicly available`_ (but you don't have to make your history available in order to use this system). You can all see this an example of how to use django-gitcm. 15 | 16 | .. _`publicly available`: http://github.com/luispedro/luispedro_org 17 | 18 | Where can I get the code for this? 19 | ---------------------------------- 20 | 21 | Github_, of course. The code is license Affero 3 (GPL for web applications). 22 | 23 | .. _Github: http://github.com/luispedro/django-gitcms 24 | 25 | I have also released it on `PyPI `_ if you prefer. 26 | 27 | 28 | Features 29 | -------- 30 | 31 | - Your website is using *django*. This means that it's easy to add any functionality you want. 32 | - Out of the box, it supports: 33 | - Restructured text articles (pages such as this one) 34 | - menus 35 | - raw files 36 | - a conference system 37 | 38 | but the main point is that the architechture is easily extensible. I'm selling you an idea more than software. 39 | 40 | Alternative Projects 41 | -------------------- 42 | 43 | - `yst `_: Uses `Yaml `_ as a language and a system of string templates. 44 | - `gitwiki`_: A Wiki with a git back-end. Several other similar projects exist. 45 | - `nesta `_: A ruby based CMS with text files as its backend. 46 | 47 | Why is this worse than gitwiki? 48 | -------------------------------- 49 | 50 | Because there is *no web front-end* to the history or even an edit button. It's git all the way. It's not friendly to non-technical users (it's very friendly for technical users—those of us who live on the command line and don't want to have to learn a new way of doing things). 51 | 52 | Why is this better than `gitwiki`_? 53 | ----------------------------------- 54 | 55 | .. _`gitwiki`: http://github.com/al3x/git-wiki 56 | 57 | Because you can store any type of data, not only hyper-text files. 58 | 59 | For example, in this website, the `conferences `_ is a django app whose data is a text file that looks like: 60 | 61 | :: 62 | 63 | name: International Symposium on Biomedical Imaging (ISBI) 64 | short_name: ISBI 65 | location: Rotterdam, The Netherlands 66 | start: April 14 2010 67 | end: April 17 2010 68 | submission_deadline: November 2 2009 69 | 70 | followed by many more examples. Actually, the menus on this website are also saved as a `yaml `_ file, while the `publications `_ app saves its information as a bibtex file (I use `exhibit `_ for the display, but pre-process the bibtex file everytime it changes). I can write any functionality I want with django and store the information as a text file (I only have to write a *load()* function in Python, which can do whatever I want). 71 | 72 | This is not really comparable to wiki-git-like projects. We just have different goals. 73 | 74 | Why is this better than yst? 75 | ---------------------------- 76 | 77 | Because it uses django so you can do any Python processing you want. Also, the website does not have to be static, so you gain a lot of flexibility there. 78 | 79 | Why is this better than nesta? 80 | ------------------------------ 81 | 82 | I don't know how nesta works because I don't know RoR. But I know Django on Python, so I wanted to use a system based on those technologies. 83 | 84 | -------------------------------------------------------------------------------- /example-website/content/pages/index: -------------------------------------------------------------------------------- 1 | title: Example Website 2 | url: 3 | categories: somecategory 4 | .. 5 | 6 | Where Goes Content 7 | ================== 8 | 9 | Just use restructured text. 10 | 11 | Including pictures: 12 | 13 | .. image:: /files/niagara-small.jpg 14 | :alt: Luis Pedro Coelho 15 | :class: float-right 16 | 17 | Or Lists 18 | ======== 19 | - Item one 20 | - Item two 21 | 22 | Here's a `link `_ 23 | 24 | -------------------------------------------------------------------------------- /example-website/content/pages/template: -------------------------------------------------------------------------------- 1 | title: <+title+> 2 | url: <+url+> 3 | categories: <+categories+> 4 | .. 5 | 6 | <+Page Title+> 7 | =============== 8 | 9 | <+content+> 10 | -------------------------------------------------------------------------------- /example-website/content/redirect/one2two_three2four.yaml: -------------------------------------------------------------------------------- 1 | source: one 2 | target: two 3 | --- 4 | source: three 5 | target: four 6 | -------------------------------------------------------------------------------- /example-website/content/tagging/tags: -------------------------------------------------------------------------------- 1 | - 2 | name: Somewhere 3 | slug: somecategory 4 | - 5 | name: Software 6 | slug: software 7 | - 8 | name: Work 9 | slug: work 10 | - 11 | name: Python 12 | slug: python 13 | -------------------------------------------------------------------------------- /example-website/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from django.core.management import execute_manager 3 | try: 4 | from . import settings # Assumed to be in the same directory. 5 | except ImportError: 6 | import sys 7 | sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) 8 | sys.exit(1) 9 | 10 | if __name__ == "__main__": 11 | execute_manager(settings) 12 | -------------------------------------------------------------------------------- /example-website/media/.gitignore: -------------------------------------------------------------------------------- 1 | bibtex 2 | files 3 | bibtex-json 4 | -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/footer.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/headbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/headbanner.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/header-bg.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/highlightgreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/highlightgreen.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/logo.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/menu-hvr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/menu-hvr.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/menu.png -------------------------------------------------------------------------------- /example-website/media/images/ramblingsoul3/topheadbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/example-website/media/images/ramblingsoul3/topheadbg.png -------------------------------------------------------------------------------- /example-website/media/js/jquery.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery JavaScript Library v1.3.2 3 | * http://jquery.com/ 4 | * 5 | * Copyright (c) 2009 John Resig 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://docs.jquery.com/License 8 | * 9 | * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) 10 | * Revision: 6246 11 | */ 12 | (function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); 13 | /* 14 | * Sizzle CSS Selector Engine - v0.9.3 15 | * Copyright 2009, The Dojo Foundation 16 | * Released under the MIT, BSD, and GPL Licenses. 17 | * More information: http://sizzlejs.com/ 18 | */ 19 | (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); -------------------------------------------------------------------------------- /example-website/media/style/luispedro.css: -------------------------------------------------------------------------------- 1 | #sidebar { 2 | float: left; 3 | padding: 2em; 4 | max-width: 25%; 5 | } 6 | 7 | #content { 8 | width: 70%; 9 | float: right; 10 | padding: 1em; 11 | border: 1px dashed navy; 12 | } 13 | #footer { 14 | clear: both; 15 | text-align: center; 16 | font-size: small; 17 | font-style: italic; 18 | padding-top: 1em; 19 | } 20 | 21 | H1 { 22 | color: #ccc; 23 | } 24 | -------------------------------------------------------------------------------- /example-website/media/style/ramblingsoul3.css: -------------------------------------------------------------------------------- 1 | /* Original http://ramblingsoul.com/ */ 2 | body { 3 | margin:0px; 4 | padding:0px; 5 | font-family:verdana, arial, helvetica, sans-serif; 6 | font-size: 12px; 7 | color:#333; 8 | background-color:white; 9 | background-repeat: repeat-x; 10 | } 11 | h1 { 12 | padding:0px; 13 | font-size:24px; 14 | line-height:28px; 15 | font-weight:normal; 16 | color:#996633; 17 | font-family: "Century Gothic", Arial; 18 | text-decoration: none; 19 | margin-top: 15px; 20 | margin-right: 0px; 21 | margin-bottom: 10px; 22 | margin-left: 0px; 23 | } 24 | #content h2 { 25 | font-family: "Century Gothic", Arial; 26 | font-size: 17px; 27 | text-align: center; 28 | display: block; 29 | font-weight: bold; 30 | color: #999900; 31 | padding-right: 15px; 32 | padding-left: 15px; 33 | background-color: #EAECCD; 34 | padding-top: 10px; 35 | padding-bottom: 10px; 36 | margin-top: 10px; 37 | border: 1px dashed #C0D490; 38 | } 39 | .footer { 40 | background-image: url(/media/images/ramblingsoul3/footer.png); 41 | background-repeat: repeat-x; 42 | background-color: #D9EDA8; 43 | padding-top: 20px; 44 | padding-right: 25px; 45 | padding-bottom: 10px; 46 | padding-left: 25px; 47 | } 48 | 49 | 50 | p { 51 | margin:0px 0px 16px 0px; 52 | padding:0px; 53 | font-family: verdana, arial, helvetica, sans-serif; 54 | font-size: 12px; 55 | line-height: 25px; 56 | color:black; 57 | } 58 | li { 59 | font-family: verdana, arial, helvetica, sans-serif; 60 | font-size: 12px; 61 | line-height: 25px; 62 | color: black; 63 | } 64 | #content>p { 65 | margin:0px; 66 | } 67 | #content>p+p { 68 | text-indent:30px; 69 | } 70 | 71 | a { 72 | color:#CC6600; 73 | text-decoration:none; 74 | font-weight:600; 75 | font-family:verdana, arial, helvetica, sans-serif; 76 | } 77 | 78 | a:visited { 79 | color:#07a; 80 | } 81 | #header #navigation li { 82 | display: inline; 83 | } 84 | #header #navigation a { 85 | background-image: url(/media/images/ramblingsoul3/menu.png); 86 | background-repeat: no-repeat; 87 | float: left; 88 | height: 32px; 89 | width: 102px; 90 | margin-right: 5px; 91 | padding-top: 10px; 92 | text-align: center; 93 | display: block; 94 | color: #6B633F; 95 | font-family: Georgia, "Times New Roman", Times, serif; 96 | font-size: 18px; 97 | font-weight: normal; 98 | text-decoration: none; 99 | } 100 | 101 | a:hover {} 102 | 103 | #header { 104 | height:42px; 105 | line-height:11px; 106 | voice-family: "\"}\""; 107 | voice-family:inherit; 108 | height:42px; 109 | background-image: url(/media/images/ramblingsoul3/topheadbg.png); 110 | background-repeat: repeat-x; 111 | padding-left: 200px; 112 | } 113 | #header2 .logo { 114 | background-image: url(/media/images/ramblingsoul3/logo.png); 115 | float: left; 116 | height: 40px; 117 | width: 188px; 118 | margin-left: 15px; 119 | padding-top: 75px; 120 | font-family: "Century Gothic", Arial, Verdana; 121 | font-size: 24px; 122 | text-align: center; 123 | color: #999933; 124 | } 125 | #header2 .banner { 126 | background-image: url(/media/images/ramblingsoul3/headbanner.png); 127 | float: right; 128 | height: 115px; 129 | background-repeat: no-repeat; 130 | width: 350px; 131 | background-position: right; 132 | } 133 | #header2 .banner span { 134 | margin-top: 75px; 135 | display: block; 136 | font-family: Georgia, "Times New Roman", Times, serif; 137 | font-size: 18px; 138 | font-weight: normal; 139 | color: #B3A87C; 140 | } 141 | 142 | 143 | body>#header {height:42px;} 144 | blockquote p { 145 | color: #CC6600; 146 | line-height: 18px; 147 | font-family: Georgia, "Times New Roman", Times, serif; 148 | } 149 | .spacer { 150 | clear: both; 151 | } 152 | 153 | #header2 { 154 | background-image: url(/media/images/ramblingsoul3/header-bg.png); 155 | background-repeat: repeat-x; 156 | height: 115px; 157 | } 158 | body>#header2 {height:115px;} 159 | 160 | #content { 161 | background-color: #FFFFFF; 162 | margin-top: 20px; 163 | margin-right: 20px; 164 | margin-bottom: 20px; 165 | margin-left: 275px; 166 | padding-right: 10px; 167 | padding-bottom: 10px; 168 | padding-left: 10px; 169 | min-height: 400px; 170 | } 171 | #header a { 172 | color: #993300; 173 | } 174 | 175 | 176 | #menu { 177 | position:absolute; 178 | top:82px; 179 | left:20px; 180 | width:210px; 181 | line-height:25px; 182 | voice-family: "\"}\""; 183 | voice-family:inherit; 184 | width:210px; 185 | margin-top: 86px; 186 | font-size: 12px; 187 | color: #339900; 188 | padding-top: 15px; 189 | padding-right: 10px; 190 | padding-left: 10px; 191 | } 192 | /* Again, "be nice to Opera 5". */ 193 | body>#menu {width:210px;} 194 | #tabs { 195 | font-size:93%; 196 | line-height:normal; 197 | text-align: center; 198 | margin-right: auto; 199 | margin-left: auto; 200 | width: 700px; 201 | } 202 | 203 | #header #tabs .font { 204 | display: block; 205 | float: left; 206 | color: #FFFFFF; 207 | text-decoration: none; 208 | font-weight: bold; 209 | } 210 | 211 | #tabs ul { 212 | margin:0; 213 | list-style:none; 214 | height: 42px; 215 | padding-right: 5px; 216 | padding-bottom: 0; 217 | padding-left: 10px; 218 | padding-top: 0px; 219 | text-align: center; 220 | } 221 | #header #tabs .font1 a { 222 | font-family: "Century Gothic", Arial; 223 | font-size: 12px; 224 | font-weight: bold; 225 | color: #FFFFFF; 226 | text-decoration: none; 227 | display: block; 228 | float: left; 229 | height: 30px; 230 | width: 53px; 231 | padding-top: 13px; 232 | } 233 | #header #tabs .font2 a:hover { 234 | color: #00CCFF; 235 | background-color: #006699; 236 | } 237 | #header #tabs .font2 a { 238 | font-family: "Century Gothic", Arial; 239 | font-size: 14px; 240 | font-weight: bold; 241 | color: #FFFFFF; 242 | text-decoration: none; 243 | display: block; 244 | float: left; 245 | height: 33px; 246 | width: 53px; 247 | padding-top: 10px; 248 | } 249 | #header #tabs .font3 a { 250 | font-family: "Century Gothic", Arial; 251 | font-size: 16px; 252 | font-weight: bold; 253 | color: #FFFFFF; 254 | text-decoration: none; 255 | display: block; 256 | height: 30px; 257 | width: 53px; 258 | padding-top: 10px; 259 | float: left; 260 | } 261 | 262 | .activemenu { 263 | background-image: url(/media/images/ramblingsoul3/dldoor.png); 264 | background-repeat: repeat-x; 265 | background-position: top; 266 | background-color: #F0EEE0; 267 | border-right-width: 1px; 268 | border-left-width: 1px; 269 | border-right-style: solid; 270 | border-left-style: solid; 271 | border-right-color: #FFFFFF; 272 | border-left-color: #FFFFFF; 273 | color: #4480C8; 274 | font-weight: bold; 275 | } 276 | #header #tabs .activemenu a { 277 | color: #A3B083; 278 | } 279 | 280 | 281 | #tabs li { 282 | display:block; 283 | margin-bottom: 0; 284 | float: left; 285 | padding-right: 5; 286 | padding-bottom: 0; 287 | padding-left: 5; 288 | height: 28px; 289 | padding-top: 10px; 290 | margin-right: 5px; 291 | margin-left: 5px; 292 | } 293 | 294 | #header #tabs li a { 295 | padding-right: 5px; 296 | padding-left: 5px; 297 | color: #FFFFFF; 298 | font-family: "Century Gothic", Arial; 299 | font-size: 13px; 300 | font-weight: bold; 301 | margin-right: 3px; 302 | margin-left: 3px; 303 | } 304 | #header #tabs a:hover { 305 | color: #006600; 306 | text-decoration: none; 307 | } 308 | #mainright { 309 | width:32%; 310 | float:left; 311 | padding-bottom:110px; 312 | margin-top: 70px; 313 | font-size: 14px; 314 | margin-left: 5px; 315 | background-image: url(/media/images/ramblingsoul3/mcbg.png); 316 | background-repeat: no-repeat; 317 | background-position: right bottom; 318 | } 319 | 320 | #maincenter { 321 | width:32%; 322 | float:left; 323 | padding-bottom:110px; 324 | margin-top: 70px; 325 | padding-right: 5px; 326 | padding-left: 2px; 327 | margin-left: 5px; 328 | border-right-width: 1px; 329 | border-right-style: dashed; 330 | border-right-color: #A6B7CA; 331 | background-image: url(/media/images/ramblingsoul3/webbg.png); 332 | background-repeat: no-repeat; 333 | background-position: right bottom; 334 | } 335 | 336 | #mainleft { 337 | width:32%; 338 | float:left; 339 | padding-bottom:110px; 340 | margin-top: 70px; 341 | padding-right: 5px; 342 | margin-left: 5px; 343 | border-right-width: 1px; 344 | border-right-style: dashed; 345 | border-right-color: #A6B7CA; 346 | background-image: url(/media/images/ramblingsoul3/swbg.png); 347 | background-repeat: no-repeat; 348 | background-position: right bottom; 349 | } 350 | 351 | #banner { 352 | } 353 | 354 | #banner h1 { 355 | margin:0px; 356 | padding:10px; 357 | } 358 | 359 | #menu h2 { 360 | font-family: Georgia, "Times New Roman", Times, serif; 361 | font-size: 18px; 362 | display: block; 363 | padding-left: 5px; 364 | background-color: #F6F6EE; 365 | color: #669933; 366 | font-weight: normal; 367 | } 368 | #menu .submenu { 369 | margin: 0px; 370 | padding: 0px; 371 | list-style-type: none; 372 | } 373 | 374 | li.submenu-item { 375 | display: block; 376 | margin-top: 0px; 377 | margin-right: 0px; 378 | margin-bottom: 0px; 379 | margin-left: 0px; 380 | border-bottom-width: 1px; 381 | border-bottom-style: dashed; 382 | border-bottom-color: #D8D3B9; 383 | } 384 | #menu .submenu a { 385 | font-weight: normal; 386 | color: #CC6633; 387 | } 388 | 389 | 390 | 391 | #header #tabs .font1 a:hover { 392 | color: #00CCFF; 393 | background-color: #006699; 394 | } 395 | #header #tabs .font3 a:hover { 396 | color: #00CCFF; 397 | background-color: #006699; 398 | } 399 | /* 400 | @font-face { 401 | font-family: Century Gothic; 402 | font-style: normal; 403 | font-weight: 700; 404 | src: url(CENTURY3.eot); 405 | } 406 | @font-face { 407 | font-family: Century Gothic; 408 | font-style: normal; 409 | font-weight: normal; 410 | src: url(CENTURY4.eot); 411 | } 412 | @font-face { 413 | font-family: Verdana; 414 | font-style: normal; 415 | font-weight: normal; 416 | src: url(VERDANA0.eot); 417 | } 418 | @font-face { 419 | font-family: Gunny Handwriting; 420 | font-style: normal; 421 | font-weight: normal; 422 | src: url(GUNNYHA1.eot); 423 | } 424 | */ 425 | #content blockquote { 426 | margin: 10px; 427 | color: #996633; 428 | text-decoration: none; 429 | font-size: 12px; 430 | padding-left: 15px; 431 | font-family: Verdana, Arial, Helvetica, sans-serif; 432 | line-height: 18px; 433 | background-color: #F1EFE2; 434 | padding-top: 5px; 435 | padding-bottom: 5px; 436 | text-align: justify; 437 | padding-right: 10px; 438 | border: 2px solid #ECE9D8; 439 | } 440 | #navigation { 441 | list-style-type: none; 442 | margin: 0px; 443 | padding: 0px; 444 | } 445 | #header #navigation a:hover { 446 | background-image: url(/media/images/ramblingsoul3/menu-hvr.png); 447 | background-repeat: no-repeat; 448 | float: left; 449 | height: 32px; 450 | width: 102px; 451 | margin-right: 5px; 452 | padding-top: 10px; 453 | text-align: center; 454 | display: block; 455 | color: #6B633F; 456 | font-family: Georgia, "Times New Roman", Times, serif; 457 | font-size: 18px; 458 | font-weight: normal; 459 | text-decoration: none; 460 | } 461 | #header #navigation .active a { 462 | 463 | background-image: url(/media/images/ramblingsoul3/menu-hvr.png); 464 | background-repeat: no-repeat; 465 | float: left; 466 | height: 32px; 467 | width: 82px; 468 | margin-right: 5px; 469 | padding-top: 10px; 470 | text-align: center; 471 | display: block; 472 | color: #6B633F; 473 | font-family: Georgia, "Times New Roman", Times, serif; 474 | font-size: 18px; 475 | font-weight: normal; 476 | text-decoration: none; 477 | } 478 | #menu .submenu a:visited,active { 479 | font-weight: normal; 480 | color: #CC6633; 481 | } 482 | #menu .submenu a:hover { 483 | font-weight: normal; 484 | color: #000000; 485 | background-color: #F6F6EE; 486 | } 487 | -------------------------------------------------------------------------------- /example-website/media/style/rest.css: -------------------------------------------------------------------------------- 1 | .float-right { 2 | float: right; 3 | } 4 | -------------------------------------------------------------------------------- /example-website/settings.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | _BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 4 | DEBUG = True 5 | TEMPLATE_DEBUG = DEBUG 6 | 7 | ADMINS = ( 8 | # ('Your Name', 'your_email@domain.com'), 9 | ) 10 | APPEND_SLASH = True 11 | 12 | MANAGERS = ADMINS 13 | 14 | DATABASES = { 15 | 'default' : { 16 | 'ENGINE': 'django.db.backends.sqlite3', 17 | 'NAME': _BASE_DIR + '/example.db', 18 | } 19 | } 20 | 21 | # Local time zone for this installation. Choices can be found here: 22 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 23 | # although not all choices may be available on all operating systems. 24 | # If running in a Windows environment this must be set to the same as your 25 | # system time zone. 26 | TIME_ZONE = 'America/Chicago' 27 | 28 | # Language code for this installation. All choices can be found here: 29 | # http://www.i18nguy.com/unicode/language-identifiers.html 30 | LANGUAGE_CODE = 'en-us' 31 | 32 | SITE_ID = 1 33 | 34 | # If you set this to False, Django will make some optimizations so as not 35 | # to load the internationalization machinery. 36 | USE_I18N = False 37 | 38 | # Absolute path to the directory that holds media. 39 | # Example: "/home/media/media.lawrence.com/" 40 | MEDIA_ROOT = _BASE_DIR + '/media/' 41 | MEDIA_URL = '/media/' 42 | 43 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a 44 | # trailing slash if there is a path component (optional in other cases). 45 | # Examples: "http://media.lawrence.com", "http://example.com/media/" 46 | MEDIA_URL = '/media/' 47 | 48 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a 49 | # trailing slash. 50 | # Examples: "http://foo.com/media/", "/media/". 51 | ADMIN_MEDIA_PREFIX = '/admin-media/' 52 | 53 | # Make this unique, and don't share it with anybody. 54 | SECRET_KEY = 'js-ep$t(8js4lekq=p)hi@x7sh8_$ogpkl53qeg6p2$@a%qzx@' 55 | 56 | # List of callables that know how to import templates from various sources. 57 | TEMPLATE_LOADERS = ( 58 | 'django.template.loaders.filesystem.Loader', 59 | 'django.template.loaders.app_directories.Loader', 60 | 'django.template.loaders.eggs.Loader', 61 | ) 62 | 63 | MIDDLEWARE_CLASSES = ( 64 | 'django.middleware.common.CommonMiddleware', 65 | 'django.middleware.locale.LocaleMiddleware', 66 | 'django.contrib.sessions.middleware.SessionMiddleware', 67 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 68 | 'django.middleware.doc.XViewMiddleware', 69 | 'django.middleware.cache.CacheMiddleware', 70 | 'gitcms.redirect.middleware.RedirectMiddleware', 71 | ) 72 | 73 | ROOT_URLCONF = 'urls' 74 | 75 | TEMPLATE_DIRS = ( 76 | # Don't forget to use absolute paths, not relative paths. 77 | _BASE_DIR + '/templates', 78 | ) 79 | 80 | INSTALLED_APPS = ( 81 | 'django.contrib.auth', 82 | 'django.contrib.contenttypes', 83 | 'django.contrib.sessions', 84 | 'django.contrib.sites', 85 | 'django.contrib.admin', 86 | 'django.contrib.markup', 87 | 88 | 'gitcms.tagging', 89 | 'gitcms.pages', 90 | 'gitcms.menus', 91 | 'gitcms.blog', 92 | 'gitcms.books', 93 | 'gitcms.conferences', 94 | 'gitcms.files', 95 | 'gitcms.publications', 96 | 'gitcms.redirect', 97 | ) 98 | 99 | 100 | GITDJANGO_DIRNAME = './content' 101 | DISQUS_SHORTNAME='testing' 102 | -------------------------------------------------------------------------------- /example-website/templates/base.html: -------------------------------------------------------------------------------- 1 | {% load menus_tags %} 2 | 3 | 4 | 5 | {% block head %} 6 | {% block title %}Luis Pedro Coelho{% endblock %} 7 | 8 | 9 | 10 | 11 | 12 | {% endblock %} 13 | 14 | 15 | 16 | 17 | 22 |
23 | 24 | 25 |
26 | 27 | {% autoescape off %} 28 |
29 | {% block content %} 30 | My content 31 | {% endblock %} 32 |
33 | {% endautoescape %} 34 | 35 | 40 |
 
41 | 47 | {% block bodyend %} 48 | {% endblock %} 49 | 50 | 51 | -------------------------------------------------------------------------------- /example-website/urls.py: -------------------------------------------------------------------------------- 1 | from . import settings 2 | from django.conf.urls import patterns, url, include 3 | from django.contrib import admin 4 | import gitcms.pages.urls 5 | import gitcms.files.urls 6 | import gitcms.blog.urls 7 | admin.autodiscover() 8 | 9 | urlpatterns = patterns('', 10 | (r'^media/(?P.+)$', 'django.views.static.serve', {'document_root': settings._BASE_DIR + '/media'}), 11 | (r'^admin/', include(admin.site.urls)), 12 | (r'^blog/?', include(gitcms.blog.urls)), 13 | ) 14 | urlpatterns += gitcms.files.urls.urlpatterns 15 | urlpatterns += gitcms.pages.urls.urlpatterns 16 | 17 | -------------------------------------------------------------------------------- /gitcms/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | luispedro.db 3 | -------------------------------------------------------------------------------- /gitcms/__init__.py: -------------------------------------------------------------------------------- 1 | from .gitcms_version import __version__ 2 | __all__ = ['__version__'] 3 | -------------------------------------------------------------------------------- /gitcms/blog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/blog/__init__.py -------------------------------------------------------------------------------- /gitcms/blog/admin.py: -------------------------------------------------------------------------------- 1 | from .models import BlogPost 2 | from django.contrib import admin 3 | 4 | admin.site.register(BlogPost) 5 | -------------------------------------------------------------------------------- /gitcms/blog/feeds.py: -------------------------------------------------------------------------------- 1 | from django.contrib.syndication.views import Feed 2 | from gitcms.blog.models import BlogPost 3 | from django.conf import settings 4 | 5 | 6 | class LatestFeed(Feed): 7 | title = getattr(settings, 'GITCMS_BLOG_FEED_NAME', 'Blog RSS channel') 8 | link = '/rss/' 9 | description = 'Updates on blog and items of interesting content' 10 | 11 | def items(self): 12 | limit = getattr(settings, 'LIMIT_RSS_ITEMS', 20) 13 | return BlogPost.objects.exclude(status='draft').order_by('-timestamp')[:limit] 14 | 15 | def item_title(self, post): 16 | return post.title 17 | 18 | def item_description(self, post): 19 | return post.content 20 | 21 | def item_link(self, post): 22 | return post.get_absolute_url() 23 | 24 | def item_pubdate(self, post): 25 | return post.timestamp 26 | -------------------------------------------------------------------------------- /gitcms/blog/load.py: -------------------------------------------------------------------------------- 1 | from .models import BlogPost 2 | from os import path, listdir 3 | import yaml 4 | import time 5 | 6 | from gitcms.parsedate import parsedatetime 7 | from gitcms.pages.load import preprocess_rst_content 8 | from gitcms.tagging.models import tag_for 9 | 10 | 11 | def loaddir(directory, clear=False): 12 | if clear: 13 | BlogPost.objects.all().delete() 14 | 15 | queue = listdir(directory) 16 | while queue: 17 | next = queue.pop() 18 | if next[0] == '.': continue 19 | if next in ('template.rst', 'template'): continue 20 | next = path.join(directory, next) 21 | if path.isdir(next): 22 | queue.extend([ 23 | path.join(next,f) for f in listdir(next) 24 | ]) 25 | continue 26 | 27 | filecontent = open(next).read() 28 | parts = filecontent.split('\n---\n', 1) 29 | if len(parts) != 2: 30 | raise IOError('gitcms.blog.load: expected "---" separator in file %s' % next) 31 | fields, content = parts 32 | fields = yaml.load(fields) 33 | fields['content'] = preprocess_rst_content(content) 34 | fields['timestamp'] = parsedatetime(fields['timestamp']) 35 | fields['timestamp'] = time.strftime('%Y-%m-%d %H:%M', fields['timestamp']) 36 | categories = fields.get('categories', '') 37 | if 'categories' in fields: del fields['categories'] 38 | ptags = [] 39 | if categories: 40 | for c in categories.split(): 41 | ptags.append(tag_for(c)) 42 | # if we arrived here and no errors, then it is safe 43 | # to add our post. 44 | # 45 | P = BlogPost(**fields) 46 | P.save() 47 | for t in ptags: 48 | P.tags.add(t) 49 | 50 | dependencies = ['tagging'] 51 | -------------------------------------------------------------------------------- /gitcms/blog/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from gitcms.tagging.models import Tag 3 | 4 | 5 | class BlogPost(models.Model): 6 | title = models.CharField(u'title', max_length=255) 7 | slug = models.CharField(u'slug', max_length=255) 8 | timestamp = models.DateTimeField(u'timestamp') 9 | tags = models.ManyToManyField(Tag) 10 | content = models.TextField(u'content') 11 | status = models.CharField(u'status', max_length=255) 12 | author = models.CharField(u'author', max_length=255) 13 | keywords = models.CharField(u'keywords', max_length=255) 14 | description = models.CharField(u'description', max_length=255) 15 | 16 | def __unicode__(self): 17 | return '%s (%s)' % (self.slug, self.title) 18 | 19 | @models.permalink 20 | def get_absolute_url(self): 21 | return ('blog-post', [self.timestamp.year, self.timestamp.month, self.slug]) 22 | -------------------------------------------------------------------------------- /gitcms/blog/templates/blog/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | 13 | 14 | 18 | blog comments powered by Disqus 19 | -------------------------------------------------------------------------------- /gitcms/blog/templates/blog/list.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load markup %} 3 | {% block title %}{{ title }}{% endblock %} 4 | {% block extra_head %} 5 | 6 | {% endblock %} 7 | {% block content %} 8 | 9 |

{{ pagetitle }}

10 | 11 | {% for post in posts %} 12 |
13 |

{{ post.title }}

14 | 15 | {% if reduced %} 16 | {{ post.content|truncatewords_html:20 }} 17 |

{{ post.title }}

18 | {% else %} 19 | {{ post.content }} 20 | {% endif %} 21 |

22 | 23 |
24 |
25 | {% endfor %} 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /gitcms/blog/templates/blog/post.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load disqus %} 3 | 4 | {% block extra_head %} 5 | 6 | 7 | {% endblock %} 8 | 9 | {% block title %}{{ post.title }}{% endblock %} 10 | 11 | {% block content %} 12 | {{ post.content }} 13 | 14 | {% disqus_thread post %} 15 | 16 |

Post filed in categories: 17 | {% for tag in post.tags.all %} 18 | {{ tag.name }} 19 | {% endfor %} 20 |

21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /gitcms/blog/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/blog/templatetags/__init__.py -------------------------------------------------------------------------------- /gitcms/blog/templatetags/disqus.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | import settings 3 | 4 | register = template.Library() 5 | 6 | if hasattr(settings,'DISQUS_SHORTNAME'): 7 | @register.inclusion_tag('blog/disqus.html') 8 | def disqus_thread(post): 9 | return { 10 | 'disqus_shortname' : settings.DISQUS_SHORTNAME, 11 | 'unique_identifier' : post.slug, 12 | } 13 | else: 14 | @register.simple_tag 15 | def disqus_thread(_): 16 | return '' 17 | 18 | 19 | -------------------------------------------------------------------------------- /gitcms/blog/tests/data/firstpost.rst: -------------------------------------------------------------------------------- 1 | title: First Post 2 | slug: first-post 3 | timestamp: April 4 2010 9:01 4 | categories: 5 | status: publishd 6 | --- 7 | 8 | First Post 9 | ---------- 10 | 11 | Subtitle 12 | ........ 13 | 14 | This is the best thing ever! 15 | -------------------------------------------------------------------------------- /gitcms/blog/tests/test_load.py: -------------------------------------------------------------------------------- 1 | import gitcms.blog.load 2 | from gitcms.blog.models import BlogPost 3 | from os.path import dirname 4 | 5 | _basedir = dirname(__file__) 6 | def test_simple_load(): 7 | gitcms.blog.load.loaddir(_basedir + '/data/') 8 | assert len(BlogPost.objects.all()) == 1 9 | 10 | -------------------------------------------------------------------------------- /gitcms/blog/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from . import views 3 | from . import feeds 4 | 5 | 6 | urlpatterns = patterns('', 7 | url(r'^tag/(?P.*)/', views.bytag, name='blog-tag'), 8 | url(r'^(?P[0-9]+)/(?P[0-9]+)/(?P[^/]*)/', views.post, name='blog-post'), 9 | url(r'^feed/', feeds.LatestFeed(), name='blog-feed'), 10 | url(r'^/?$', views.mostrecent, name='blog'), 11 | ) 12 | -------------------------------------------------------------------------------- /gitcms/blog/views.py: -------------------------------------------------------------------------------- 1 | from gitcms.tagging.models import Tag 2 | from django.template import RequestContext 3 | from django.shortcuts import get_object_or_404, render_to_response 4 | from gitcms.blog.models import BlogPost 5 | 6 | 7 | def bytag(request, tag): 8 | tag = get_object_or_404(Tag, slug=tag) 9 | posts = BlogPost.objects.exclude(status='draft').filter(tags=tag).order_by('-timestamp') 10 | return render_to_response( 11 | 'blog/tag_list.html', 12 | RequestContext(request, { 13 | 'tag' : tag, 14 | 'posts' : posts, 15 | })) 16 | 17 | def post(request, year, month, slug): 18 | post = get_object_or_404(BlogPost, slug=slug) 19 | return render_to_response( 20 | 'blog/post.html', 21 | RequestContext(request, { 22 | 'post' : post, 23 | })) 24 | 25 | def mostrecent(request): 26 | posts = BlogPost.objects.exclude(status='draft').order_by('-timestamp') 27 | return render_to_response( 28 | 'blog/list.html', 29 | RequestContext(request, { 30 | 'title' : 'New posts', 31 | 'pagetitle' : 'Latest posts', 32 | 'posts' : posts, 33 | })) 34 | -------------------------------------------------------------------------------- /gitcms/books/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/books/__init__.py -------------------------------------------------------------------------------- /gitcms/books/load.py: -------------------------------------------------------------------------------- 1 | from .models import Book 2 | import os 3 | from os import path 4 | import yaml 5 | import time 6 | 7 | from gitcms.parsedate import parsedate 8 | from gitcms.pages.load import preprocess_rst_content 9 | from gitcms.tagging.models import tag_for 10 | 11 | def loaddir(directory, clear=False): 12 | if clear: 13 | Book.objects.all().delete() 14 | 15 | queue = os.listdir(directory) 16 | while queue: 17 | next = queue.pop() 18 | if next[0] == '.': continue 19 | if next in ('categories', 'template'): continue 20 | next = path.join(directory, next) 21 | if path.isdir(next): 22 | queue.extend([ 23 | path.join(next,f) for f in os.listdir(next) 24 | ]) 25 | continue 26 | 27 | filecontent = file(next).read() 28 | header, content = filecontent.split('\n---\n') 29 | header = yaml.load(header) 30 | content = preprocess_rst_content(content) 31 | review_date = parsedate(header['review_date']) 32 | review_date = time.strftime('%Y-%m-%d', review_date) 33 | btags = [] 34 | for c in header.get('tags','').split(): 35 | btags.append(tag_for(c)) 36 | B = Book(slug=header['slug'], title=header['title'], booktitle=header['booktitle'], author=header['author'], content=content, review_date=review_date) 37 | B.save() 38 | for t in btags: 39 | B.tags.add(t) 40 | 41 | dependencies = ['tagging'] 42 | -------------------------------------------------------------------------------- /gitcms/books/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import ugettext_lazy as tr 3 | from gitcms.tagging.models import Tag 4 | 5 | class Book(models.Model): 6 | slug = models.SlugField(u'slug') 7 | title = models.CharField(u'title', max_length=255) 8 | booktitle = models.CharField(u'title', max_length=255) 9 | author = models.CharField(u'author', max_length=255) 10 | tags = models.ManyToManyField(Tag) 11 | content = models.TextField(u'content') 12 | review_date = models.DateField(u'ReviewDate') 13 | 14 | def __unicode__(self): 15 | return '' % self.title 16 | class Meta: 17 | verbose_name_plural = tr(u'Books') 18 | 19 | -------------------------------------------------------------------------------- /gitcms/books/templates/books/book.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block extra_head %} 3 | 4 | {% endblock %} 5 | {% block title %}{{ book.title }}{% endblock %} 6 | {% block content %} 7 | {{ book.content }} 8 | 9 |

Book tagged as: 10 | {% for cat in book.tags.all %} 11 | {{ tag.name }} 12 | {% endfor %} 13 |

14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /gitcms/books/templates/books/list.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load markup %} 3 | {% block content %} 4 | 5 |

{{ pagetitle }}

6 | 7 | 8 | {% for book in books %} 9 |
10 |

{{ book.title }}

11 | 12 | {{ book.content|truncatewords_html:20 }} 13 | 14 | 15 |

Read full review

16 |
17 | 18 |
19 |
20 | {% endfor %} 21 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /gitcms/books/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from . import views 3 | 4 | urlpatterns = patterns('', 5 | url(r'^(?P.*)/?', views.book, name='books'), 6 | ) 7 | -------------------------------------------------------------------------------- /gitcms/books/views.py: -------------------------------------------------------------------------------- 1 | from .models import Book 2 | from django.shortcuts import get_object_or_404, render_to_response 3 | 4 | def book(request, slug): 5 | book = get_object_or_404(Book, slug=slug) 6 | return render_to_response( 7 | 'books/book.html', 8 | { 9 | 'book' : book, 10 | }) 11 | -------------------------------------------------------------------------------- /gitcms/conferences/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/conferences/__init__.py -------------------------------------------------------------------------------- /gitcms/conferences/load.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import yaml 3 | import os 4 | from .models import Conference 5 | 6 | _months = [ 7 | 'January', 8 | 'February', 9 | 'March', 10 | 'April', 11 | 'May', 12 | 'June', 13 | 'July', 14 | 'August', 15 | 'September', 16 | 'October', 17 | 'November', 18 | 'December', 19 | ] 20 | 21 | def _parsedate(s): 22 | month, day, year = s.strip().split() 23 | month_idx = None 24 | day = int(day) 25 | year = int(year) 26 | for i,m in enumerate(_months): 27 | if m.startswith(month): 28 | if month_idx is not None: 29 | raise IOError('Month %s is ambiguous' % month) 30 | month_idx = i 31 | if month_idx is None: 32 | raise IOError("Could not parse month '%s'" % month) 33 | return datetime.date(year, month_idx + 1, day) 34 | 35 | 36 | def loaddir(directory, clear=False): 37 | if clear: 38 | Conference.objects.all().delete() 39 | for conffile in os.listdir(directory): 40 | if conffile[0] == '.': continue 41 | for conf in yaml.load_all(file(directory + '/' + conffile)): 42 | for dfield in ('start', 'end', 'submission_deadline'): 43 | conf[dfield] = _parsedate(conf[dfield]) 44 | C = Conference(**conf) 45 | C.save() 46 | -------------------------------------------------------------------------------- /gitcms/conferences/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Conference(models.Model): 4 | name = models.CharField(u'Name', max_length=255) 5 | short_name = models.CharField(u'Short Name', max_length=255) 6 | location = models.CharField(u'Location', max_length=255) 7 | start = models.DateField(u'Start') 8 | end = models.DateField(u'End') 9 | submission_deadline = models.DateField(u'Submission Deadline', blank=True, null=True) 10 | url = models.URLField(u'URL', blank=True, null=True) 11 | comment = models.TextField(u'Comment') 12 | def __unicode__(self): 13 | return self.name 14 | 15 | def summary(self): 16 | return '%s (%s)' % (self.name, self.short_name) 17 | 18 | -------------------------------------------------------------------------------- /gitcms/conferences/templates/conferences/conference_detail.html: -------------------------------------------------------------------------------- 1 |
2 | {% if conference.url %} 3 |

{{ conference.name }}
4 | {% else %} 5 |

{{ conference.name }}
6 | {% endif %} 7 | {{ conference.location }}
8 | {{ conference.start }} to {{ conference.end }}
9 | {% if conference.submission_deadline %} 10 | Submission deadline: {{ conference.submission_deadline }} 11 | {% endif %} 12 |

13 |
14 | -------------------------------------------------------------------------------- /gitcms/conferences/templates/conferences/list.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | {% for conference in conferences %} 4 | {% include "conferences/conference_detail.html" %} 5 | {% endfor %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /gitcms/conferences/tests/data/conferences: -------------------------------------------------------------------------------- 1 | name: International Symposium on Biomedical Imaging (ISBI) 2 | short_name: ISBI 3 | location: Rotterdam, The Netherlands 4 | start: April 14 2010 5 | end: April 17 2010 6 | submission_deadline: November 2 2009 7 | -------------------------------------------------------------------------------- /gitcms/conferences/tests/test_load.py: -------------------------------------------------------------------------------- 1 | import gitcms.conferences.load 2 | from gitcms.conferences.models import Conference 3 | from os.path import dirname 4 | _basedir = dirname(__file__) 5 | 6 | def test_load(): 7 | gitcms.conferences.load.loaddir(_basedir + '/data/', clear=True) 8 | assert len(Conference.objects.all()) == 1 9 | 10 | -------------------------------------------------------------------------------- /gitcms/conferences/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from . import views 3 | 4 | urlpatterns = patterns('', 5 | url(r'^conferences/?$', views.upcoming, name='conferences-index'), 6 | url(r'^conferences/upcoming/?$', views.upcoming, name='conferences-upcoming'), 7 | url(r'^conferences/upcoming/ical', views.upcomingical, name='conferences-ical'), 8 | url(r'^conferences/upcoming-submissions', views.upcoming_submissions, name='conferences-submissions'), 9 | ) 10 | -------------------------------------------------------------------------------- /gitcms/conferences/views.py: -------------------------------------------------------------------------------- 1 | from .models import Conference 2 | import datetime 3 | from django.shortcuts import get_object_or_404, render_to_response 4 | from django.http import HttpResponse 5 | 6 | def upcoming(request): 7 | conferences = Conference.objects.filter(start__gte=datetime.datetime.now()).order_by('start') 8 | return render_to_response( 9 | 'conferences/list.html', 10 | { 11 | 'conferences' : conferences, 12 | }) 13 | 14 | def upcoming_submissions(request): 15 | conferences = Conference.objects.filter(submission_deadline__gte=datetime.datetime.now()).order_by('submission_deadline') 16 | return render_to_response( 17 | 'conferences/list.html', 18 | { 19 | 'conferences' : conferences, 20 | }) 21 | 22 | def upcomingical(request): 23 | ''' 24 | upcomingical(request) 25 | 26 | Returns the calendar of conferences as an ical file. 27 | ''' 28 | try: 29 | import vobject 30 | except ImportError: 31 | return HttpResponse('import vobject failed in confereces/views.py:upcomingical') 32 | def _add_event(summary, start, end=None): 33 | if end is None: 34 | end = start 35 | rep = cal.add('vevent') 36 | rep.add('summary').value = summary 37 | rep.add('dtstart').value = start 38 | rep.add('dtend').value = end 39 | events = Conference.objects.filter(start__gte=datetime.datetime.now()).order_by('start') 40 | cal = vobject.iCalendar() 41 | for ev in events: 42 | _add_event(summary=ev.summary(), start=ev.start, end=ev.end) 43 | if ev.submission_deadline: 44 | _add_event(summary=('%s deadline' % ev.short_name), start=ev.submission_deadline) 45 | _add_event(summary=('%s deadline in 21 days' % ev.short_name), start=(ev.submission_deadline - datetime.timedelta(days=21))) 46 | response = HttpResponse(cal.serialize()) 47 | response['Content-Type'] = 'text/calendar' 48 | return response 49 | -------------------------------------------------------------------------------- /gitcms/files/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/files/__init__.py -------------------------------------------------------------------------------- /gitcms/files/load.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | from django.conf import settings 4 | 5 | 6 | _defaultfilesdir = 'media/files' 7 | _filesdir = getattr(settings, 'DJANGO_GITCMS_FILES', _defaultfilesdir) 8 | 9 | def loaddir(directory, clear=False): 10 | if os.path.exists(_filesdir): shutil.rmtree(_filesdir) 11 | shutil.copytree(directory, _filesdir) 12 | 13 | -------------------------------------------------------------------------------- /gitcms/files/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | import settings 3 | 4 | urlpatterns = patterns('', 5 | url(r'^files/(?P.+)$', 'django.views.static.serve', 6 | {'document_root': settings.MEDIA_ROOT + '/files'}, 7 | name='files'), 8 | ) 9 | 10 | -------------------------------------------------------------------------------- /gitcms/gitcms_version.py: -------------------------------------------------------------------------------- 1 | __version__ = '0.4' 2 | -------------------------------------------------------------------------------- /gitcms/menus/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/menus/__init__.py -------------------------------------------------------------------------------- /gitcms/menus/load.py: -------------------------------------------------------------------------------- 1 | from .models import Menu, MenuItem 2 | import os 3 | from os import path 4 | import yaml 5 | 6 | def loaddir(directory, clear=False): 7 | if clear: 8 | MenuItem.objects.all().delete() 9 | Menu.objects.all().delete() 10 | def _parse_children(parent, parent_obj): 11 | if 'children' not in parent: 12 | return 13 | for ch in parent['children']: 14 | child = MenuItem(name=ch['name'], url=ch['url'], title=ch.get('title', None), parent=parent_obj) 15 | child.save() 16 | _parse_children(ch, child) 17 | for menufile in os.listdir(directory): 18 | if menufile[0] == '.': continue 19 | for menu in yaml.load_all(open(path.join(directory,menufile))): 20 | fake_root = MenuItem(name='', url='fake-root-you-shouldnt-be-seeing-this-bro') 21 | fake_root.save() 22 | menu_obj = Menu(name=menu['name'], fake_root=fake_root) 23 | menu_obj.save() 24 | _parse_children(menu, fake_root) 25 | 26 | -------------------------------------------------------------------------------- /gitcms/menus/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import ugettext as tr 3 | 4 | class MenuItem(models.Model): 5 | name = models.CharField(tr('Name'), max_length=255) 6 | title = models.CharField(tr('Title'), max_length=255, null=True) 7 | url = models.CharField(tr('url'), max_length=255) 8 | parent = models.ForeignKey('self', related_name='children', null=True) 9 | 10 | class Menu(models.Model): 11 | name = models.CharField(tr('Name'), max_length=255) 12 | fake_root = models.ForeignKey(MenuItem) 13 | def _get_children(self): 14 | return self.fake_root.children.all() 15 | children = property(_get_children) 16 | 17 | -------------------------------------------------------------------------------- /gitcms/menus/templates/menus/menu.html: -------------------------------------------------------------------------------- 1 | {% if items %} 2 | {% for item in items %} 3 |

{{ item.name }}

4 | {% if item.children %} 5 | 10 | {% endif %} 11 | {% endfor %} 12 | {% endif %} 13 | -------------------------------------------------------------------------------- /gitcms/menus/templates/menus/tabs.html: -------------------------------------------------------------------------------- 1 | {% if items %} 2 | 11 | {% endif %} 12 | -------------------------------------------------------------------------------- /gitcms/menus/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/menus/templatetags/__init__.py -------------------------------------------------------------------------------- /gitcms/menus/templatetags/menus_tags.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | register = template.Library() 3 | 4 | from gitcms.menus.models import Menu 5 | 6 | @register.inclusion_tag('menus/menu.html') 7 | def show_menu(menu_name): 8 | menu = Menu.objects.get(name=menu_name) 9 | return { 'items' : menu.children } 10 | 11 | @register.inclusion_tag('menus/tabs.html') 12 | def show_tabs(menu_name): 13 | menu = Menu.objects.get(name=menu_name) 14 | items = menu.children 15 | for it in items: 16 | it.active = False 17 | return { 'items' : items } 18 | -------------------------------------------------------------------------------- /gitcms/menus/tests/data/menu.yaml: -------------------------------------------------------------------------------- 1 | name: Main Menu 2 | children: 3 | - name: Software 4 | url: software/ 5 | children: 6 | - name: Milk 7 | url: software/milk 8 | - name: Jug 9 | url: software/jug 10 | 11 | -------------------------------------------------------------------------------- /gitcms/menus/tests/test_load.py: -------------------------------------------------------------------------------- 1 | import gitcms.menus.load 2 | from gitcms.menus.models import Menu, MenuItem 3 | from os.path import dirname 4 | 5 | _basedir = dirname(__file__) 6 | def test_simple_load(): 7 | gitcms.menus.load.loaddir(_basedir + '/data/') 8 | assert len(Menu.objects.all()) 9 | assert len(MenuItem.objects.all()) 10 | menu = Menu.objects.all()[0] 11 | assert len(menu.children) == 1 12 | assert len(menu.children[0].children.all()) == 2 13 | -------------------------------------------------------------------------------- /gitcms/menus/views.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/menus/views.py -------------------------------------------------------------------------------- /gitcms/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/pages/__init__.py -------------------------------------------------------------------------------- /gitcms/pages/admin.py: -------------------------------------------------------------------------------- 1 | from .models import Article 2 | from django.contrib import admin 3 | admin.site.register(Article) 4 | -------------------------------------------------------------------------------- /gitcms/pages/load.py: -------------------------------------------------------------------------------- 1 | from .models import Article 2 | import os 3 | from os import path 4 | from gitcms.tagging.models import tag_for 5 | from .rest import preprocess_rst_content 6 | 7 | def loaddir(directory, clear=False): 8 | if clear: 9 | Article.objects.all().delete() 10 | 11 | queue = os.listdir(directory) 12 | urls = set() 13 | while queue: 14 | artfile = queue.pop() 15 | if artfile[0] == '.': continue 16 | if artfile in ('template', 'template.rst', 'template.txt'): continue 17 | artfile = path.join(directory, artfile) 18 | if path.isdir(artfile): 19 | queue.extend([ 20 | path.join(artfile,f) for f in os.listdir(artfile) 21 | ]) 22 | continue 23 | 24 | input = open(artfile) 25 | header = {} 26 | linenr = 0 27 | while True: 28 | line = input.readline().strip() 29 | linenr += 1 30 | if line in ('---', '..'): break 31 | if line.find(':') < 0: 32 | raise IOError('gitcms.pages.load: In file %s, line %s. No \':\' found!' % (artfile, linenr)) 33 | tag,value = line.split(':',1) 34 | value = value.strip() 35 | header[tag] = value 36 | blank = input.readline() 37 | linenr += 1 38 | if blank.strip(): 39 | raise IOError('Blank line expected while processing file (%s:%s)\nGot "%s"' % (artfile, linenr,blank)) 40 | content = input.read() 41 | content = preprocess_rst_content(content) 42 | 43 | url = header['url'] 44 | if url and url[-1] == '/': 45 | import warnings 46 | warnings.warn('''\ 47 | gitcms.pages.loaddir: Removing / at end of url (%s) 48 | 49 | (Both versions will work for accessing the page.) 50 | ''' % url) 51 | url = url[:-1] 52 | 53 | if url and url[0] == '/': 54 | import warnings 55 | warnings.warn('gitcms.pages.loaddir: Removing / at start of url ({0})' 56 | .format(url)) 57 | url = url[1:] 58 | 59 | if url in urls: 60 | raise IOError('gitcms.pages.loaddir: repeated URL detected (%s)' % url) 61 | 62 | taglist = [] 63 | for c in header.get('categories','').split(): 64 | taglist.append(tag_for(c)) 65 | # if we got so far, implies that our article is safe to store. 66 | urls.add(url) 67 | A = Article(title=header['title'], url=url, meta=header.get('meta', ''), author=header.get('author', ''), content=content) 68 | A.save() 69 | for c in taglist: 70 | A.tags.add(c) 71 | 72 | dependencies = ['tagging'] 73 | 74 | -------------------------------------------------------------------------------- /gitcms/pages/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import ugettext_lazy as tr 3 | from gitcms.tagging.models import Tag 4 | 5 | class Article(models.Model): 6 | title = models.CharField(u'title', max_length=255) 7 | url = models.CharField(u'url', max_length=255) 8 | meta = models.TextField(u'meta') 9 | author = models.TextField(u'author', max_length=255) 10 | tags = models.ManyToManyField(Tag) 11 | content = models.TextField(u'content') 12 | def __unicode__(self): 13 | return '%s (%s)' % (self.title, self.url) 14 | -------------------------------------------------------------------------------- /gitcms/pages/rest.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2009-2010 Luis Pedro Coelho 3 | # Part of django-gitcms 4 | # LICENSE: Affero GPL v3 5 | 6 | from docutils.core import publish_parts 7 | 8 | from django.conf import settings 9 | from django.utils.encoding import smart_str 10 | from django.utils.safestring import mark_safe 11 | 12 | 13 | _precontent = '''\ 14 | ********** 15 | Fake Title 16 | ********** 17 | +++++++++++++ 18 | Fake Subtitle 19 | +++++++++++++ 20 | 21 | ''' 22 | 23 | 24 | def preprocess_rst_content(value): 25 | # This is adapted from django source 26 | value = _precontent + value 27 | docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {}) 28 | parts = publish_parts(source=smart_str(value), writer_name="html4css1", settings_overrides=docutils_settings) 29 | return mark_safe(parts["fragment"]) 30 | 31 | -------------------------------------------------------------------------------- /gitcms/pages/sourcecode_directive.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | The Pygments reStructuredText directive 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | This fragment is a Docutils_ 0.5 directive that renders source code 7 | (to HTML only, currently) via Pygments. 8 | 9 | To use it, adjust the options below and copy the code into a module 10 | that you import on initialization. The code then automatically 11 | registers a ``sourcecode`` directive that you can use instead of 12 | normal code blocks like this:: 13 | 14 | .. sourcecode:: python 15 | 16 | My code goes here. 17 | 18 | If you want to have different code styles, e.g. one with line numbers 19 | and one without, add formatters with their names in the VARIANTS dict 20 | below. You can invoke them instead of the DEFAULT one by using a 21 | directive option:: 22 | 23 | .. sourcecode:: python 24 | :linenos: 25 | 26 | My code goes here. 27 | 28 | Look at the `directive documentation`_ to get all the gory details. 29 | 30 | .. _Docutils: http://docutils.sf.net/ 31 | .. _directive documentation: 32 | http://docutils.sourceforge.net/docs/howto/rst-directives.html 33 | 34 | :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. 35 | :license: BSD, see LICENSE for details. 36 | """ 37 | 38 | # Options 39 | # ~~~~~~~ 40 | 41 | # Set to True if you want inline CSS styles instead of classes 42 | INLINESTYLES = False 43 | 44 | from pygments.formatters import HtmlFormatter 45 | 46 | # The default formatter 47 | DEFAULT = HtmlFormatter(noclasses=INLINESTYLES) 48 | 49 | # Add name -> formatter pairs for every variant you want to use 50 | VARIANTS = { 51 | # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), 52 | } 53 | 54 | 55 | from docutils import nodes 56 | from docutils.parsers.rst import directives, Directive 57 | 58 | from pygments import highlight 59 | from pygments.lexers import get_lexer_by_name, TextLexer 60 | 61 | class Pygments(Directive): 62 | """ Source code syntax hightlighting. 63 | """ 64 | required_arguments = 1 65 | optional_arguments = 0 66 | final_argument_whitespace = True 67 | option_spec = dict([(key, directives.flag) for key in VARIANTS]) 68 | has_content = True 69 | 70 | def run(self): 71 | self.assert_has_content() 72 | try: 73 | lexer = get_lexer_by_name(self.arguments[0]) 74 | except ValueError: 75 | # no lexer found - use the text one instead of an exception 76 | lexer = TextLexer() 77 | # take an arbitrary option if more than one is given 78 | formatter = self.options and VARIANTS[self.options.keys()[0]] or DEFAULT 79 | parsed = highlight(u'\n'.join(self.content), lexer, formatter) 80 | return [nodes.raw('', parsed, format='html')] 81 | 82 | directives.register_directive('sourcecode', Pygments) 83 | 84 | -------------------------------------------------------------------------------- /gitcms/pages/templates/pages/article.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block extra_head %} 3 | 4 | 5 | {% endblock %} 6 | {% block title %}{{ article.title }}{% endblock %} 7 | {% block content %} 8 | {{ article.content }} 9 | 10 |

Article filed in categories: 11 | {% for tag in article.tags.all %} 12 | {{ tag.name }} 13 | {% endfor %} 14 |

15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /gitcms/pages/templates/pages/list.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load markup %} 3 | {% block title %}{{ article.title }}{% endblock %} 4 | {% block content %} 5 | 6 |

{{ pagetitle }}

7 | 8 | 9 | {% for art in articles %} 10 |
11 |

{{ art.title }}

12 | 13 | {{ art.content|truncatewords_html:20 }} 14 | 15 | 16 |

Read full article

17 |
18 | 19 |
20 |
21 | {% endfor %} 22 | 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /gitcms/pages/tests/data/article: -------------------------------------------------------------------------------- 1 | title: Curriculum Vitae 2 | url: this-is-my-title 3 | categories: 4 | .. 5 | 6 | Curriculum Vitae 7 | ---------------- 8 | 9 | Academic 10 | ........ 11 | 12 | I went to school. 13 | 14 | Work 15 | .... 16 | 17 | Will try it one day. 18 | -------------------------------------------------------------------------------- /gitcms/pages/tests/test_load.py: -------------------------------------------------------------------------------- 1 | import gitcms.pages.load 2 | from gitcms.pages.models import Article 3 | from os.path import dirname 4 | 5 | _basedir = dirname(__file__) 6 | def test_simple_load(): 7 | gitcms.pages.load.loaddir(_basedir + '/data/') 8 | assert len(Article.objects.all()) == 1 9 | 10 | -------------------------------------------------------------------------------- /gitcms/pages/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from . import views 3 | 4 | urlpatterns = patterns('', 5 | url(r'^tag/(?P.*)/?', views.bytag, name='simplecms-tag'), 6 | url(r'^(?P.*)/?', views.article, name='simplecms'), 7 | ) 8 | -------------------------------------------------------------------------------- /gitcms/pages/views.py: -------------------------------------------------------------------------------- 1 | from gitcms.tagging.models import Tag 2 | from gitcms.pages.models import Article 3 | from django.shortcuts import get_object_or_404, render_to_response 4 | 5 | def bytag(request, tag): 6 | tag = get_object_or_404(Tag, slug=tag) 7 | articles = Article.objects.filter(tags=tag) 8 | return render_to_response( 9 | 'pages/list.html', 10 | { 11 | 'pagetitle' : ('Articles tagged %s' % tag.name), 12 | 'articles' : articles, 13 | }) 14 | 15 | def article(request, url): 16 | if len(url) and url[-1] == '/': url = url[:-1] 17 | article = get_object_or_404(Article, url=url) 18 | return render_to_response( 19 | 'pages/article.html', 20 | { 21 | 'article' : article, 22 | }) 23 | -------------------------------------------------------------------------------- /gitcms/parsedate/__init__.py: -------------------------------------------------------------------------------- 1 | from .parsedate import parsedate, parsedatetime 2 | -------------------------------------------------------------------------------- /gitcms/parsedate/parsedate.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | __all__ = [ 4 | 'parsedate', 5 | 'parsedatetime', 6 | ] 7 | 8 | def _tryformats(rep, formats, erromsg): 9 | for f in formats: 10 | try: 11 | return time.strptime(rep, f) 12 | except: 13 | pass 14 | raise ValueError(erromsg) 15 | 16 | 17 | def parsedate(daterep): 18 | ''' 19 | time = parsedate(daterep) 20 | 21 | Parses a date written out in English. 22 | ''' 23 | return _tryformats(daterep, 24 | ['%d %b %Y', '%d %B %Y', '%b %d %Y', '%B %d %Y'], 25 | "Cannot parse '%s' as a date" % daterep) 26 | 27 | def parsedatetime(datetimerep): 28 | ''' 29 | time = parsedatetime(daterep) 30 | 31 | Parses a datetime written out in English. 32 | ''' 33 | return _tryformats(datetimerep, 34 | ['%d %b %Y %H:%M', '%d %B %Y %H:%M', '%b %d %Y %H:%M', '%B %d %Y %H:%M'], 35 | "Cannot parse '%s' as a datetime" % datetimerep) 36 | 37 | 38 | -------------------------------------------------------------------------------- /gitcms/parsedate/tests.py: -------------------------------------------------------------------------------- 1 | from . import parsedate 2 | def test_parsedate(): 3 | assert parsedate.parsedate('4 April 2010') == parsedate.parsedate('April 4 2010') 4 | assert parsedate.parsedatetime('4 April 2010 19:02') == parsedate.parsedatetime('April 4 2010 19:02') 5 | 6 | -------------------------------------------------------------------------------- /gitcms/publications/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/publications/__init__.py -------------------------------------------------------------------------------- /gitcms/publications/load.py: -------------------------------------------------------------------------------- 1 | import os 2 | from os import path 3 | import shutil 4 | from poster.encode import multipart_encode 5 | from poster.streaminghttp import register_openers 6 | from django.conf import settings 7 | import urllib.request, urllib.error, urllib.parse 8 | import errno 9 | register_openers() 10 | 11 | _bibfilesdir = path.join(getattr(settings, 'MEDIA_ROOT',''), 'bibtex') 12 | _jsfilesdir = path.join(getattr(settings, 'MEDIA_ROOT',''), 'bibtex-json') 13 | 14 | def _bibtex2json(bibtexfname): 15 | datagen, headers = multipart_encode({'file': file(bibtexfname) }) 16 | request = urllib.request.Request("http://simile.mit.edu/babel/translator?reader=bibtex&writer=bibtex-exhibit-json", datagen, headers) 17 | ans = urllib.request.urlopen(request) 18 | if ans.getcode() != 200: 19 | raise IOError('publications.load: simile remote call failed') 20 | return ans.read() 21 | 22 | def _maybemkdir(dirname): 23 | try: 24 | os.mkdir(dirname) 25 | except OSError as e: 26 | if e.errno != errno.EEXIST: 27 | raise 28 | 29 | def loaddir(directory, clear=False): 30 | if clear: 31 | if path.exists(_bibfilesdir): 32 | shutil.rmtree(_bibfilesdir) 33 | if path.exists(_jsfilesdir): 34 | shutil.rmtree(_jsfilesdir) 35 | _maybemkdir(_bibfilesdir) 36 | _maybemkdir(_jsfilesdir) 37 | for bibfile in os.listdir(directory): 38 | if bibfile[0] == '.': 39 | continue 40 | if not bibfile.endswith('.bib'): 41 | raise ValueError("publications: Don't know what to do with '%s'" % bibfile) 42 | shutil.copy(path.join(directory, bibfile), _bibfilesdir) 43 | jsonfile = path.join(_jsfilesdir, bibfile[:-len('.bib')] + '.json') 44 | jsonfile = file(jsonfile, 'w') 45 | jsonfile.write(_bibtex2json(path.join(directory,bibfile))) 46 | jsonfile.close() 47 | -------------------------------------------------------------------------------- /gitcms/publications/templates/publications/history.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /gitcms/publications/templates/publications/publications.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block head %} 3 | {{ block.super }} 4 | 5 | 6 | 14 | {% endblock %} 15 | {% block content %} 16 | 21 | 22 | 23 | 24 | 45 | 50 | 51 |
25 |
26 | 32 | 40 |
44 |
46 |
47 |
48 |
49 |
52 | {% endblock %} 53 | 54 | -------------------------------------------------------------------------------- /gitcms/publications/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | import settings 3 | from . import views 4 | 5 | 6 | urlpatterns = patterns('', 7 | url(r'^papers/(?P.+)$', views.papers, name='publications-paper'), 8 | url(r'^publications/?$', views.publications, {'collection' : 'luispedro'}, name='publications'), 9 | url(r'^publications/(?P.+)$', views.publications, name='publications-collection'), 10 | url(r'^publications/files/(?P.+)$', 'django.views.static.serve', 11 | {'document_root': settings.MEDIA_ROOT + '/publications/files'}, name='publications-files'), 12 | ) 13 | -------------------------------------------------------------------------------- /gitcms/publications/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render_to_response 2 | from django.http import HttpResponseRedirect 3 | 4 | 5 | def publications(request, collection): 6 | if collection == '__history__.html': 7 | return render_to_response( 8 | 'publications/history.html', 9 | { 10 | }) 11 | return render_to_response( 12 | 'publications/publications.html', 13 | { 14 | 'collection' : collection, 15 | }) 16 | 17 | 18 | def papers(request, paper): 19 | if paper == '': 20 | return HttpResponseRedirect('/publications/') 21 | return HttpResponseRedirect('/media/' + paper) 22 | -------------------------------------------------------------------------------- /gitcms/redirect/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/redirect/__init__.py -------------------------------------------------------------------------------- /gitcms/redirect/load.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import os 3 | from .models import Redirect 4 | 5 | def loaddir(directory, clear=False): 6 | if clear: 7 | Redirect.objects.all().delete() 8 | for redfile in os.listdir(directory): 9 | if redfile[0] == '.': continue 10 | for redirect in yaml.load_all(file(directory + '/' + redfile)): 11 | R = Redirect(**redirect) 12 | R.save() 13 | -------------------------------------------------------------------------------- /gitcms/redirect/middleware.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponsePermanentRedirect 2 | from .models import Redirect 3 | 4 | class RedirectMiddleware(object): 5 | ''' 6 | ''' 7 | def process_request(self, request): 8 | path = request.path 9 | if path[0] == '/': path = path[1:] 10 | redirect = Redirect.objects.filter(source=path) 11 | if not redirect: 12 | return None 13 | return HttpResponsePermanentRedirect('/'+redirect[0].target) 14 | -------------------------------------------------------------------------------- /gitcms/redirect/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class Redirect(models.Model): 4 | source = models.CharField(u'source', max_length=255) 5 | target = models.CharField(u'target', max_length=255) 6 | def __unicode__(self): 7 | return 'Redirect[ %s ==> %s ]' % (self.source, self.target) 8 | -------------------------------------------------------------------------------- /gitcms/tagging/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luispedro/django-gitcms/d845173112de6ddb939d7d73f7f6520f7529f3a2/gitcms/tagging/__init__.py -------------------------------------------------------------------------------- /gitcms/tagging/admin.py: -------------------------------------------------------------------------------- 1 | from .models import Tag 2 | from django.contrib import admin 3 | admin.site.register(Tag) 4 | -------------------------------------------------------------------------------- /gitcms/tagging/load.py: -------------------------------------------------------------------------------- 1 | from .models import Tag 2 | import yaml 3 | 4 | def loaddir(directory, clear=False): 5 | if clear: 6 | Tag.objects.all().delete() 7 | for cat in yaml.load(open(directory + '/tags')): 8 | C = Tag(name=cat['name'], slug=cat['slug']) 9 | C.save() 10 | -------------------------------------------------------------------------------- /gitcms/tagging/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.translation import ugettext_lazy as tr 3 | 4 | class Tag(models.Model): 5 | name = models.CharField(u'tag', max_length=255) 6 | slug = models.SlugField(u'slug') 7 | def __unicode__(self): 8 | return self.slug 9 | class Meta: 10 | verbose_name_plural = tr(u'Tags') 11 | 12 | def tag_for(slug): 13 | ''' 14 | tag = tag_for(slug) 15 | 16 | Returns the Tag object corresponding to slug 17 | 18 | Raises an exception if not found. 19 | ''' 20 | tags = Tag.objects.filter(slug=slug).all() 21 | if len(tags) == 1: 22 | return tags[0] 23 | if not tags: 24 | raise ValueError("gitcms.tagging.tag_for: No tag for slug '%s'" % slug) 25 | raise ValueError("gitcms.tagging.tag_for: Multiple tags for slug '%s' (%s)" % (slug, [t.name for t in tags])) 26 | 27 | -------------------------------------------------------------------------------- /gitcms/tagging/tests/data/categories: -------------------------------------------------------------------------------- 1 | - 2 | name: News 3 | slug: news 4 | - 5 | name: Category 6 | slug: category 7 | -------------------------------------------------------------------------------- /media/.gitignore: -------------------------------------------------------------------------------- 1 | bibtex 2 | files 3 | bibtex-json 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (C) 2008-2013, Luis Pedro Coelho 3 | # vim: set ts=4 sts=4 sw=4 expandtab smartindent: 4 | # Licence : Affero GPL v3 or later 5 | 6 | 7 | from sys import exit 8 | try: 9 | import setuptools 10 | except: 11 | print(''' 12 | setuptools not found. Please install it. 13 | 14 | On linux, the package is often called python-setuptools''') 15 | exit(1) 16 | 17 | exec(compile(open('gitcms/gitcms_version.py').read(), 18 | 'gitcms/gitcms_version.py', 'exec')) 19 | 20 | requires = [ 21 | 'django', 22 | 'pyyaml', 23 | 'docutils', 24 | 'pygments', 25 | ] 26 | 27 | long_description = open('README.rst').read() 28 | 29 | classifiers = [ 30 | 'Development Status :: 4 - Beta', 31 | 'Environment :: Other Environment', 32 | 'Framework :: Django', 33 | 'Programming Language :: Python', 34 | 'License :: OSI Approved :: GNU Affero General Public License v3', 35 | ] 36 | 37 | package_dir = {} 38 | package_data = {} 39 | for subpackage in ('conferences', 'blog', 'pages', 'menus', 'books', 'publications'): 40 | package_dir['gitcms.' + subpackage] = 'gitcms/' + subpackage 41 | package_data['gitcms.' + subpackage] = ['templates/%s/*.html' % subpackage] 42 | 43 | 44 | setuptools.setup(name = 'django-gitcms', 45 | version = __version__, 46 | description = 'Django Git CMS: A django based git-backed content management system', 47 | long_description = long_description, 48 | author = 'Luis Pedro Coelho', 49 | author_email = 'luis@luispedro.org', 50 | license = 'MIT', 51 | platforms = ['Any'], 52 | classifiers = classifiers, 53 | url = 'http://luispedro.org/software/git-cms', 54 | packages = setuptools.find_packages(exclude=['tests', 'example-website']), 55 | package_dir = package_dir, 56 | package_data = package_data, 57 | scripts = ['bin/django-gitcms-load-content'], 58 | test_suite = 'nose.collector', 59 | requires = requires, 60 | ) 61 | 62 | -------------------------------------------------------------------------------- /testsettings.py: -------------------------------------------------------------------------------- 1 | DATABASE_ENGINE = 'sqlite3' 2 | DATABASE_NAME = '' 3 | 4 | INSTALLED_APPS = ( 5 | 'django_nose', 6 | 'gitcms.pages', 7 | 'gitcms.blog', 8 | 'gitcms.conferences', 9 | 'gitcms.publications', 10 | 'gitcms.redirect', 11 | 'gitcms.menus', 12 | 'gitcms.tagging', 13 | ) 14 | 15 | TEST_RUNNER = 'django_nose.run_tests' 16 | 17 | --------------------------------------------------------------------------------