├── CHANGELOG ├── LICENSE ├── Languages ├── README.md ├── TODO ├── log └── uwsgi.log ├── manage.py ├── nginx ├── gzip.conf ├── nginx.conf ├── uwsgi.service ├── uwsgi_params └── wikicoding_nginx.conf ├── tools ├── backup_mysql.sh ├── gen_pygments_css.py ├── gitcommit.sh ├── kill_uwsgi.sh ├── lang_list_util.py ├── nginx.sh ├── runuwsgi.sh ├── start_devserver.sh ├── startup.sh ├── stop_devserver.sh └── update_models.sh ├── wiki ├── __init__.py ├── admin.py ├── apps.py ├── conf │ ├── __init__.py │ └── settings.py ├── core │ ├── __init__.py │ ├── compat.py │ ├── diff.py │ ├── exceptions.py │ ├── http.py │ ├── markdown │ │ ├── __init__.py │ │ ├── mdx │ │ │ ├── __init__.py │ │ │ └── previewlinks.py │ │ └── wikicoding │ │ │ ├── __init__.py │ │ │ ├── template_reddit_hn.py │ │ │ ├── wikicodingindent.py │ │ │ └── wikicodinglinks.py │ ├── permissions.py │ ├── plugins │ │ ├── __init__.py │ │ ├── base.py │ │ ├── loader.py │ │ └── registry.py │ └── utils.py ├── decorators.py ├── editors │ ├── __init__.py │ ├── base.py │ └── markitup.py ├── forms.py ├── locale │ ├── da │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ ├── de │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ ├── es │ │ └── LC_MESSAGES │ │ │ └── django.po │ ├── fi │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ ├── ru │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ └── zh_CN │ │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── wikiviz.py ├── managers.py ├── models │ ├── __init__.py │ ├── article.py │ ├── language.py │ ├── pluginbase.py │ └── urlpath.py ├── plugins │ ├── __init__.py │ ├── attachments │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── forms.py │ │ ├── markdown_extensions.py │ │ ├── models.py │ │ ├── settings.py │ │ ├── south_migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_auto__chg_field_attachmentrevision_previous_revision__chg_field_attach.py │ │ │ ├── 0003_label_v01_rename.py │ │ │ └── __init__.py │ │ ├── templates │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ └── attachments │ │ │ │ ├── delete.html │ │ │ │ ├── history.html │ │ │ │ ├── index.html │ │ │ │ ├── render.html │ │ │ │ ├── replace.html │ │ │ │ └── search.html │ │ ├── tests │ │ │ ├── __init__.py │ │ │ └── test_views.py │ │ ├── urls.py │ │ ├── views.py │ │ └── wiki_plugin.py │ ├── haystack │ │ ├── __init__.py │ │ ├── search_indexes.py │ │ ├── templates │ │ │ ├── search │ │ │ │ └── indexes │ │ │ │ │ └── wiki │ │ │ │ │ └── article_text.txt │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ └── haystack │ │ │ │ └── search.html │ │ └── views.py │ ├── help │ │ ├── __init__.py │ │ ├── models.py │ │ ├── templates │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ └── help │ │ │ │ └── sidebar.html │ │ ├── views.py │ │ └── wiki_plugin.py │ ├── images │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── forms.py │ │ ├── markdown_extensions.py │ │ ├── models.py │ │ ├── settings.py │ │ ├── south_migrations │ │ │ ├── 0001_initial.py │ │ │ ├── 0002_auto__add_imagerevision__del_field_image_image.py │ │ │ ├── 0003_label_v01_rename.py │ │ │ └── __init__.py │ │ ├── static │ │ │ └── wiki │ │ │ │ ├── colorbox │ │ │ │ ├── example1 │ │ │ │ │ ├── colorbox.css │ │ │ │ │ ├── images │ │ │ │ │ │ ├── border.png │ │ │ │ │ │ ├── controls.png │ │ │ │ │ │ ├── ie6 │ │ │ │ │ │ │ ├── borderBottomCenter.png │ │ │ │ │ │ │ ├── borderBottomLeft.png │ │ │ │ │ │ │ ├── borderBottomRight.png │ │ │ │ │ │ │ ├── borderMiddleLeft.png │ │ │ │ │ │ │ ├── borderMiddleRight.png │ │ │ │ │ │ │ ├── borderTopCenter.png │ │ │ │ │ │ │ ├── borderTopLeft.png │ │ │ │ │ │ │ └── borderTopRight.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── loading_background.png │ │ │ │ │ │ └── overlay.png │ │ │ │ │ └── index.html │ │ │ │ └── jquery.colorbox-min.js │ │ │ │ └── js │ │ │ │ └── images.js │ │ ├── templates │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ └── images │ │ │ │ ├── index.html │ │ │ │ ├── purge.html │ │ │ │ ├── render.html │ │ │ │ ├── revision_add.html │ │ │ │ └── sidebar.html │ │ ├── templatetags │ │ │ ├── __init__.py │ │ │ ├── wiki_images_tags.py │ │ │ └── wiki_thumbnails.py │ │ ├── views.py │ │ └── wiki_plugin.py │ ├── links │ │ ├── __init__.py │ │ ├── mdx │ │ │ ├── __init__.py │ │ │ ├── djangowikilinks.py │ │ │ └── urlize.py │ │ ├── settings.py │ │ ├── templates │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ └── links │ │ │ │ └── sidebar.html │ │ ├── views.py │ │ └── wiki_plugin.py │ ├── macros │ │ ├── __init__.py │ │ ├── mdx │ │ │ ├── __init__.py │ │ │ ├── macro.py │ │ │ ├── toc.py │ │ │ └── wikilinks.py │ │ ├── settings.py │ │ ├── templates │ │ │ └── wiki │ │ │ │ └── plugins │ │ │ │ ├── macros │ │ │ │ ├── article_list.html │ │ │ │ └── sidebar.html │ │ │ │ └── templatetags │ │ │ │ └── article_list.html │ │ ├── templatetags │ │ │ ├── __init__.py │ │ │ └── wiki_macro_tags.py │ │ └── wiki_plugin.py │ ├── mediawikiimport │ │ ├── __init__.py │ │ └── management │ │ │ ├── __init__.py │ │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── mediawiki_import.py │ └── notifications │ │ ├── __init__.py │ │ ├── forms.py │ │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── wiki_notifications_create_defaults.py │ │ ├── models.py │ │ ├── settings.py │ │ ├── south_migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto__del_articlesubscription.py │ │ ├── 0003_conditionally_restore_articlesubscription.py │ │ ├── 0004_label_v01_rename.py │ │ └── __init__.py │ │ ├── static │ │ └── wiki │ │ │ └── plugins │ │ │ └── notifications │ │ │ └── js │ │ │ └── ui.js │ │ ├── templates │ │ └── wiki │ │ │ └── plugins │ │ │ └── notifications │ │ │ ├── menubaritem.html │ │ │ └── settings.html │ │ ├── util.py │ │ ├── views.py │ │ └── wiki_plugin.py ├── sitemap.py ├── south_migrations │ ├── 0001_initial.py │ └── __init__.py ├── static │ ├── admin │ │ ├── css │ │ │ ├── base.css │ │ │ ├── changelists.css │ │ │ ├── dashboard.css │ │ │ ├── forms.css │ │ │ ├── login.css │ │ │ ├── rtl.css │ │ │ └── widgets.css │ │ ├── img │ │ │ ├── changelist-bg.gif │ │ │ ├── changelist-bg_rtl.gif │ │ │ ├── default-bg-reverse.gif │ │ │ ├── default-bg.gif │ │ │ ├── deleted-overlay.gif │ │ │ ├── gis │ │ │ │ ├── move_vertex_off.png │ │ │ │ └── move_vertex_on.png │ │ │ ├── icon-no.gif │ │ │ ├── icon-unknown.gif │ │ │ ├── icon-yes.gif │ │ │ ├── icon_addlink.gif │ │ │ ├── icon_alert.gif │ │ │ ├── icon_calendar.gif │ │ │ ├── icon_changelink.gif │ │ │ ├── icon_clock.gif │ │ │ ├── icon_deletelink.gif │ │ │ ├── icon_error.gif │ │ │ ├── icon_searchbox.png │ │ │ ├── icon_success.gif │ │ │ ├── inline-delete.png │ │ │ ├── inline-restore-8bit.png │ │ │ ├── inline-restore.png │ │ │ ├── inline-splitter-bg.gif │ │ │ ├── nav-bg-grabber.gif │ │ │ ├── nav-bg-reverse.gif │ │ │ ├── nav-bg-selected.gif │ │ │ ├── nav-bg.gif │ │ │ ├── selector-icons.gif │ │ │ ├── selector-search.gif │ │ │ ├── sorting-icons.gif │ │ │ ├── tooltag-add.png │ │ │ └── tooltag-arrowright.png │ │ └── js │ │ │ ├── LICENSE-JQUERY.txt │ │ │ ├── SelectBox.js │ │ │ ├── SelectFilter2.js │ │ │ ├── actions.js │ │ │ ├── actions.min.js │ │ │ ├── admin │ │ │ ├── DateTimeShortcuts.js │ │ │ └── RelatedObjectLookups.js │ │ │ ├── calendar.js │ │ │ ├── collapse.js │ │ │ ├── collapse.min.js │ │ │ ├── core.js │ │ │ ├── inlines.js │ │ │ ├── inlines.min.js │ │ │ ├── jquery.init.js │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ ├── prepopulate.js │ │ │ ├── prepopulate.min.js │ │ │ ├── timeparse.js │ │ │ └── urlify.js │ ├── robots │ │ └── robots.txt │ └── wiki │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.min.css │ │ │ ├── wiki-bootstrap.css │ │ │ └── wiki-bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── js │ │ │ ├── bootstrap.js │ │ │ └── bootstrap.min.js │ │ └── less │ │ │ ├── alerts.less │ │ │ ├── badges.less │ │ │ ├── bootstrap.less │ │ │ ├── breadcrumbs.less │ │ │ ├── button-groups.less │ │ │ ├── buttons.less │ │ │ ├── carousel.less │ │ │ ├── close.less │ │ │ ├── code.less │ │ │ ├── component-animations.less │ │ │ ├── dropdowns.less │ │ │ ├── forms.less │ │ │ ├── glyphicons.less │ │ │ ├── grid.less │ │ │ ├── input-groups.less │ │ │ ├── jumbotron.less │ │ │ ├── labels.less │ │ │ ├── list-group.less │ │ │ ├── media.less │ │ │ ├── mixins.less │ │ │ ├── mixins │ │ │ ├── alerts.less │ │ │ ├── background-variant.less │ │ │ ├── border-radius.less │ │ │ ├── buttons.less │ │ │ ├── center-block.less │ │ │ ├── clearfix.less │ │ │ ├── forms.less │ │ │ ├── gradients.less │ │ │ ├── grid-framework.less │ │ │ ├── grid.less │ │ │ ├── hide-text.less │ │ │ ├── image.less │ │ │ ├── labels.less │ │ │ ├── list-group.less │ │ │ ├── nav-divider.less │ │ │ ├── nav-vertical-align.less │ │ │ ├── opacity.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── progress-bar.less │ │ │ ├── reset-filter.less │ │ │ ├── resize.less │ │ │ ├── responsive-visibility.less │ │ │ ├── size.less │ │ │ ├── tab-focus.less │ │ │ ├── table-row.less │ │ │ ├── text-emphasis.less │ │ │ ├── text-overflow.less │ │ │ └── vendor-prefixes.less │ │ │ ├── modals.less │ │ │ ├── navbar.less │ │ │ ├── navs.less │ │ │ ├── normalize.less │ │ │ ├── pager.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── popovers.less │ │ │ ├── print.less │ │ │ ├── progress-bars.less │ │ │ ├── responsive-embed.less │ │ │ ├── responsive-utilities.less │ │ │ ├── scaffolding.less │ │ │ ├── tables.less │ │ │ ├── theme.less │ │ │ ├── thumbnails.less │ │ │ ├── tooltip.less │ │ │ ├── type.less │ │ │ ├── utilities.less │ │ │ ├── variables.less │ │ │ ├── wells.less │ │ │ └── wiki │ │ │ ├── codehilite.less │ │ │ ├── typeahead.less │ │ │ ├── wiki-bootstrap.less │ │ │ └── wiki.less │ │ ├── css │ │ ├── all.css │ │ ├── base_site.css │ │ └── print.css │ │ ├── font-awesome │ │ ├── font │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ └── less │ │ │ ├── bordered-pulled.less │ │ │ ├── core.less │ │ │ ├── fixed-width.less │ │ │ ├── font-awesome.less │ │ │ ├── icons.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── mixins.less │ │ │ ├── path.less │ │ │ ├── rotated-flipped.less │ │ │ ├── spinning.less │ │ │ ├── stacked.less │ │ │ └── variables.less │ │ ├── img │ │ ├── avatar.png │ │ ├── favicon.ico │ │ └── github_icon.png │ │ ├── js │ │ ├── article.js │ │ ├── base_site.js │ │ ├── core.js │ │ ├── diff.js │ │ ├── diffview.js │ │ ├── editor.js │ │ ├── forms.js │ │ ├── jquery.min.js │ │ ├── jqueryui │ │ │ ├── images │ │ │ │ ├── animated-overlay.gif │ │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ │ └── ui-icons_ffffff_256x240.png │ │ │ ├── jquery-ui-1.10.0.custom.min.css │ │ │ └── jquery-ui-1.10.0.custom.min.js │ │ ├── respond.min.js │ │ └── typeahead.min.js │ │ ├── markitup │ │ ├── admin.init.js │ │ ├── frontend.init.js │ │ ├── jquery.markitup.js │ │ ├── sets │ │ │ ├── admin │ │ │ │ ├── images │ │ │ │ │ ├── bold.png │ │ │ │ │ ├── code.png │ │ │ │ │ ├── h1.png │ │ │ │ │ ├── h2.png │ │ │ │ │ ├── h3.png │ │ │ │ │ ├── h4.png │ │ │ │ │ ├── h5.png │ │ │ │ │ ├── h6.png │ │ │ │ │ ├── italic.png │ │ │ │ │ ├── link.png │ │ │ │ │ ├── list-bullet.png │ │ │ │ │ ├── list-numeric.png │ │ │ │ │ ├── picture.png │ │ │ │ │ ├── preview.png │ │ │ │ │ └── quotes.png │ │ │ │ ├── readme.txt │ │ │ │ ├── set.js │ │ │ │ └── style.css │ │ │ ├── default │ │ │ │ ├── images │ │ │ │ │ ├── bold.png │ │ │ │ │ ├── clean.png │ │ │ │ │ ├── image.png │ │ │ │ │ ├── italic.png │ │ │ │ │ ├── link.png │ │ │ │ │ ├── list-bullet.png │ │ │ │ │ ├── list-numeric.png │ │ │ │ │ ├── picture.png │ │ │ │ │ ├── preview.png │ │ │ │ │ └── stroke.png │ │ │ │ ├── set.js │ │ │ │ └── style.css │ │ │ └── frontend │ │ │ │ ├── images │ │ │ │ ├── bold.png │ │ │ │ ├── code.png │ │ │ │ ├── h1.png │ │ │ │ ├── h2.png │ │ │ │ ├── h3.png │ │ │ │ ├── h4.png │ │ │ │ ├── h5.png │ │ │ │ ├── h6.png │ │ │ │ ├── italic.png │ │ │ │ ├── link.png │ │ │ │ ├── list-bullet.png │ │ │ │ ├── list-numeric.png │ │ │ │ ├── picture.png │ │ │ │ ├── preview.png │ │ │ │ └── quotes.png │ │ │ │ ├── readme.txt │ │ │ │ ├── set.js │ │ │ │ └── style.css │ │ ├── skins │ │ │ ├── markitup │ │ │ │ ├── images │ │ │ │ │ ├── bg-container.png │ │ │ │ │ ├── bg-editor-bbcode.png │ │ │ │ │ ├── bg-editor-dotclear.png │ │ │ │ │ ├── bg-editor-html.png │ │ │ │ │ ├── bg-editor-json.png │ │ │ │ │ ├── bg-editor-markdown.png │ │ │ │ │ ├── bg-editor-textile.png │ │ │ │ │ ├── bg-editor-wiki.png │ │ │ │ │ ├── bg-editor-xml.png │ │ │ │ │ ├── bg-editor.png │ │ │ │ │ ├── handle.png │ │ │ │ │ ├── menu.png │ │ │ │ │ └── submenu.png │ │ │ │ └── style.css │ │ │ └── simple │ │ │ │ ├── images │ │ │ │ ├── handle.png │ │ │ │ ├── menu.png │ │ │ │ └── submenu.png │ │ │ │ ├── readme.txt │ │ │ │ └── style.css │ │ └── templates │ │ │ ├── preview.css │ │ │ └── preview.html │ │ └── wc_pygments │ │ └── pygments.css ├── templates │ └── wiki │ │ ├── accounts │ │ ├── login.html │ │ └── signup.html │ │ ├── article.html │ │ ├── base.html │ │ ├── base_site.html │ │ ├── category_page.html │ │ ├── create.html │ │ ├── create_root.html │ │ ├── delete.html │ │ ├── deleted.html │ │ ├── dir.html │ │ ├── edit.html │ │ ├── error.html │ │ ├── history.html │ │ ├── includes │ │ ├── anonymous_blocked.html │ │ ├── article_menu.html │ │ ├── breadcrumbs.html │ │ ├── create_button.html │ │ ├── editor.html │ │ ├── editor_sidebar.html │ │ ├── editormedia.html │ │ ├── form.html │ │ ├── formerrors.html │ │ ├── formfield.html │ │ ├── modals.html │ │ ├── pagination.html │ │ ├── render.html │ │ ├── revision_info.html │ │ ├── searchresult.html │ │ └── user_revision_info.html │ │ ├── permission_denied.html │ │ ├── preview_inline.html │ │ ├── recent_page.html │ │ ├── root_missing.html │ │ ├── search.html │ │ ├── settings.html │ │ ├── source.html │ │ ├── user_page.html │ │ └── view.html ├── templatetags │ ├── __init__.py │ └── wiki_tags.py ├── urls.py ├── views │ ├── __init__.py │ ├── accounts.py │ ├── article.py │ ├── category.py │ ├── mixins.py │ ├── recent.py │ └── user.py └── wc_pygments │ └── __init__.py └── wikicoding ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py /CHANGELOG: -------------------------------------------------------------------------------- 1 | 0.0.1 (June 1 2015) 2 | -------------------------------------------------------------------------------- /Languages: -------------------------------------------------------------------------------- 1 | ActionScript as 2 | Ada ada 3 | AppleScript scpt 4 | Assembly (ARM) arm 5 | Assembly (GAS) gas 6 | Assembly (NASM) nasm 7 | Awk awk 8 | Bash bash 9 | Befunge bf 10 | Boo boo 11 | BrainFuck brainfuck 12 | C c 13 | C# cs 14 | C++ cpp 15 | Clojure clj 16 | CoffeeScript coffee 17 | ColdFusion cfm 18 | Common Lisp lisp 19 | Coq coq 20 | Cryptol cryptol 21 | Cython pyx 22 | D d 23 | Dart dart 24 | Delphi delphi 25 | Dylan dylan 26 | Erlang erl 27 | F# fs 28 | Factor factor 29 | Fancy fy 30 | Fortran fortran 31 | GAP gap 32 | Go go 33 | Groovy groovy 34 | Haskell hs 35 | HTML html 36 | IDL idl 37 | Io io 38 | Java java 39 | JavaScript js 40 | Lasso lasso 41 | LLVM llvm 42 | Logtalk lgt 43 | Lua lua 44 | Matlab matlab 45 | Modelica modelica 46 | Modula-2 mod 47 | Nemerle n 48 | Nimrod nim 49 | Objective-C m 50 | Objective-J j 51 | OCaml mli 52 | Octave octave 53 | Perl pl 54 | PHP php 55 | PostScript ps 56 | PowerShell ps1 57 | Python py 58 | Python3 py3 59 | R r 60 | REBOL reb 61 | Red red 62 | Ruby rb 63 | Rust rs 64 | S s 65 | Scala scala 66 | Scheme scm 67 | Scilab sce 68 | Smalltalk st 69 | SNOBOL sno 70 | SQL sql 71 | Swift swift 72 | Tcl tcl 73 | Vala vala 74 | Verilog v 75 | VHDL vhdl 76 | Visual Basic.NET vb 77 | Visual FoxPro foxpro 78 | XQuery xq 79 | Zephir zephir 80 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | * Let users add category to articles. 2 | * Syntax highlighting as the user edits. 3 | * Compile/build program on each edit and display build status. 4 | -------------------------------------------------------------------------------- /log/uwsgi.log: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wikicoding.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /nginx/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip on; 2 | gzip_proxied any; 3 | gzip_http_version 1.1; 4 | # Compression level (1-9) 5 | gzip_comp_level 5; 6 | gzip_min_length 128; 7 | gzip_vary on; 8 | gzip_disable "MSIE [1-6]\.(?!.*SV1)"; 9 | gzip_types 10 | text/plain 11 | text/css 12 | text/js 13 | text/xml 14 | text/javascript 15 | text/x-component 16 | application/javascript 17 | application/x-javascript 18 | application/json 19 | application/xml 20 | application/xml+rss 21 | application/atom+xml 22 | application/rss+xml 23 | application/vnd.ms-fontobject 24 | application/x-font-ttf 25 | application/font-woff 26 | application/x-web-app-manifest+json 27 | application/xhtml+xml 28 | image/png 29 | image/gif 30 | image/jpg 31 | image/svg+xml 32 | image/x-icon 33 | font/opentype; 34 | -------------------------------------------------------------------------------- /nginx/uwsgi.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=uWSGI 3 | After=syslog.target 4 | 5 | [Service] 6 | ExecStart = /wikicoding/tools/runuwsgi.sh 7 | ExecStop = kill -INT `cat /run/uwsgi.pid` 8 | ExecReload = kill -TERM `cat /run/uwsgi.pid` 9 | Restart = always 10 | Type = notify 11 | NotifyAccess = main 12 | PIDFile = /run/uwsgi.pid 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /nginx/uwsgi_params: -------------------------------------------------------------------------------- 1 | 2 | uwsgi_param QUERY_STRING $query_string; 3 | uwsgi_param REQUEST_METHOD $request_method; 4 | uwsgi_param CONTENT_TYPE $content_type; 5 | uwsgi_param CONTENT_LENGTH $content_length; 6 | 7 | uwsgi_param REQUEST_URI $request_uri; 8 | uwsgi_param PATH_INFO $document_uri; 9 | uwsgi_param DOCUMENT_ROOT $document_root; 10 | uwsgi_param SERVER_PROTOCOL $server_protocol; 11 | uwsgi_param HTTPS $https if_not_empty; 12 | 13 | uwsgi_param REMOTE_ADDR $remote_addr; 14 | uwsgi_param REMOTE_PORT $remote_port; 15 | uwsgi_param SERVER_PORT $server_port; 16 | uwsgi_param SERVER_NAME $server_name; 17 | -------------------------------------------------------------------------------- /nginx/wikicoding_nginx.conf: -------------------------------------------------------------------------------- 1 | # wikicoding_nginx.conf 2 | 3 | # the upstream component nginx needs to connect to 4 | upstream django { 5 | server unix:///wikicoding/wikicoding.sock; 6 | # server 127.0.0.1:8001; 7 | } 8 | 9 | # configuration of the server 10 | server { 11 | listen 80; 12 | # the domain name it will serve for 13 | server_name <>; # IP address or FQDN 14 | charset utf-8; 15 | 16 | # max upload size 17 | client_max_body_size 75M; 18 | 19 | location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { 20 | root /wikicoding/wiki; 21 | expires max; 22 | add_header Pragma public; 23 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 24 | #add_header Vary "Accept-Encoding"; 25 | # add_header X-Proxy-Cache "HIT"; 26 | } 27 | 28 | location /static { 29 | alias /wikicoding/wiki/static; 30 | #add_header Vary "Accept-Encoding"; 31 | # add_header X-Proxy-Cache "MISS"; 32 | } 33 | 34 | location /robots.txt { 35 | alias /wikicoding/wiki/static/robots/robots.txt; 36 | } 37 | 38 | location /LICENSE { 39 | add_header Content-Type "text/plain; charset=utf-8"; 40 | alias /wikicoding/LICENSE; 41 | } 42 | 43 | # All non-static requests to the Django server. 44 | location / { 45 | uwsgi_pass django; 46 | include /wikicoding/nginx/uwsgi_params; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tools/backup_mysql.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | mysqldump -u <> -p <> wikicoding_db | gzip > `date +%Y%m%d%H%M`.sql.gz 4 | -------------------------------------------------------------------------------- /tools/gen_pygments_css.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import os 4 | import sys 5 | from pygments.formatters import HtmlFormatter 6 | 7 | path = os.path.join(os.path.dirname(__file__), "../static/wiki/wc_pygments/pygments.css") 8 | f = open(path, 'w') 9 | f.write(HtmlFormatter(style='colorful').get_style_defs('.wikicoding-code')) 10 | f.close() 11 | -------------------------------------------------------------------------------- /tools/gitcommit.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | COMMIT_MSG=${1:-"default msg"} 4 | git add --all . && git commit -m "$COMMIT_MSG" 5 | -------------------------------------------------------------------------------- /tools/kill_uwsgi.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | sudo kill -9 `ps aux | grep [u]wsgi | awk 'FNR == 2 {print $2}'` 4 | -------------------------------------------------------------------------------- /tools/lang_list_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import MySQLdb 4 | 5 | def main(): 6 | # Open database connection 7 | db = MySQLdb.connect("localhost","root","","wikicoding_db" ) 8 | 9 | # prepare a cursor object using cursor() method 10 | cursor = db.cursor() 11 | 12 | sql = "SELECT * FROM wiki_language ORDER BY language_displayname ASC" 13 | 14 | cursor.execute(sql) 15 | 16 | results = cursor.fetchall() 17 | 18 | s = "" 19 | fieldlens = [30, 38] 20 | 21 | for row in results: 22 | lang_di = row[0] 23 | lang_de = row[1] 24 | lang = row[2] 25 | #s += "[[%s:Hello_World|%s]], " % (lang, lang_di) 26 | #s += "%s%s%s%s\n\n" % (lang_di, '.' * (fieldlens[0]-len(lang_di)), lang, '.' * (fieldlens[1]-len(lang))) 27 | s += "| %s | %s | %s |\n" % (lang_di, lang, "") 28 | 29 | print(s) 30 | 31 | db.close() 32 | 33 | 34 | if __name__ == "__main__": 35 | main() 36 | -------------------------------------------------------------------------------- /tools/nginx.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | sudo nginx 3 | -------------------------------------------------------------------------------- /tools/runuwsgi.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | uwsgi --socket wikicoding.sock --chdir /wikicoding --module wikicoding.wsgi --uid nginx --gid nginx --chown-socket nginx:nginx --enable-threads --single-interpreter --logto /wikicoding/log/uwsgi.log 4 | -------------------------------------------------------------------------------- /tools/start_devserver.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | sudo python manage.py runserver 0.0.0.0:80 4 | -------------------------------------------------------------------------------- /tools/startup.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | sudo systemctl enable uwsgi.service 4 | sudo systemctl enable nginx.service 5 | sudo systemctl enable mysqld.service 6 | -------------------------------------------------------------------------------- /tools/stop_devserver.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | sudo kill -9 `ps aux | grep '[p]ython manage.py' | awk '{print $2}'` 4 | -------------------------------------------------------------------------------- /tools/update_models.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | python manage.py schemamigration wiki --auto 4 | python manage.py migrate wiki 5 | -------------------------------------------------------------------------------- /wiki/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django.apps import AppConfig 4 | from django.utils.translation import ugettext_lazy as _ 5 | 6 | 7 | class NotifcationsConfig(AppConfig): 8 | name = 'wiki.plugins.notifications' 9 | verbose_name = _("Wiki notifications") 10 | label = 'wiki_notifications' 11 | 12 | 13 | class ImagesConfig(AppConfig): 14 | name = 'wiki.plugins.images' 15 | verbose_name = _("Wiki images") 16 | label = 'wiki_images' 17 | 18 | 19 | class AttachmentsConfig(AppConfig): 20 | name = 'wiki.plugins.attachments' 21 | verbose_name = _("Wiki attachments") 22 | label = 'wiki_attachments' 23 | -------------------------------------------------------------------------------- /wiki/conf/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /wiki/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/core/__init__.py -------------------------------------------------------------------------------- /wiki/core/compat.py: -------------------------------------------------------------------------------- 1 | """Abstraction layer to deal with Django related changes in order to keep 2 | compatibility with several Django versions simultaneously.""" 3 | from __future__ import absolute_import 4 | from __future__ import unicode_literals 5 | from django import VERSION as DJANGO_VERSION 6 | from django.db import transaction 7 | from django.conf import settings as django_settings 8 | 9 | 10 | # Django 1.5+ 11 | if DJANGO_VERSION >= (1,5): 12 | USER_MODEL = getattr(django_settings, 'AUTH_USER_MODEL', 'auth.User') 13 | else: 14 | USER_MODEL = 'auth.User' 15 | 16 | def get_user_model(): 17 | 18 | if DJANGO_VERSION >= (1,5): 19 | from django.contrib.auth import get_user_model as gum 20 | return gum() 21 | else: 22 | from django.contrib.auth.models import User 23 | return User 24 | 25 | 26 | # Django 1.6 transaction API, required for 1.8+ 27 | def nop_decorator(func): 28 | return func 29 | 30 | # Where these are used in code, both old and new methods for transactions appear 31 | # to be used, but only one will actually do anything. When only Django 1.8+ 32 | # is supported, transaction_commit_on_success can be deleted. 33 | try: 34 | atomic = transaction.atomic # Does it exist? 35 | transaction_commit_on_success = nop_decorator 36 | except AttributeError: 37 | atomic = nop_decorator 38 | transaction_commit_on_success = transaction.commit_on_success 39 | -------------------------------------------------------------------------------- /wiki/core/diff.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | import difflib 4 | 5 | def simple_merge(txt1, txt2): 6 | """Merges two texts""" 7 | differ = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK) 8 | diff = differ.compare(txt1.splitlines(1), txt2.splitlines(1)) 9 | 10 | content = "".join([l[2:] for l in diff]) 11 | 12 | return content -------------------------------------------------------------------------------- /wiki/core/exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | # If no root URL is found, we raise this... 3 | class NoRootURL(Exception): 4 | pass 5 | 6 | # If there is more than one... 7 | class MultipleRootURLs(Exception): 8 | pass 9 | -------------------------------------------------------------------------------- /wiki/core/http.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | from __future__ import absolute_import 3 | import os 4 | import mimetypes 5 | from datetime import datetime 6 | 7 | from django.http import HttpResponse 8 | from django.utils.http import http_date 9 | from django.utils import dateformat 10 | 11 | from wiki.conf import settings 12 | 13 | def django_sendfile_response(request, filepath): 14 | from sendfile import sendfile 15 | return sendfile(request, filepath) 16 | 17 | 18 | def send_file(request, filepath, last_modified=None, filename=None): 19 | fullpath = filepath 20 | # Respect the If-Modified-Since header. 21 | statobj = os.stat(fullpath) 22 | if filename: 23 | mimetype, encoding = mimetypes.guess_type(filename) 24 | else: 25 | mimetype, encoding = mimetypes.guess_type(fullpath) 26 | 27 | mimetype = mimetype or 'application/octet-stream' 28 | 29 | if settings.USE_SENDFILE: 30 | response = django_sendfile_response(request, filepath) 31 | else: 32 | response = HttpResponse(open(fullpath, 'rb').read(), mimetype=mimetype) 33 | 34 | if not last_modified: 35 | response["Last-Modified"] = http_date(statobj.st_mtime) 36 | else: 37 | if isinstance(last_modified, datetime): 38 | last_modified = float(dateformat.format(last_modified, 'U')) 39 | response["Last-Modified"] = http_date(epoch_seconds=last_modified) 40 | 41 | response["Content-Length"] = statobj.st_size 42 | 43 | if encoding: 44 | response["Content-Encoding"] = encoding 45 | 46 | # TODO: Escape filename 47 | if filename: 48 | response["Content-Disposition"] = "attachment; filename=%s" % filename 49 | 50 | return response 51 | -------------------------------------------------------------------------------- /wiki/core/markdown/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | 3 | from wiki.conf import settings 4 | from wiki.core.markdown.mdx.previewlinks import PreviewLinksExtension 5 | from wiki.core.markdown.wikicoding import wikicodinglinks 6 | from wiki.core.markdown.wikicoding import wikicodingindent 7 | from wiki.core.markdown.wikicoding import template_reddit_hn 8 | from wiki.core.plugins import registry as plugin_registry 9 | import markdown 10 | 11 | 12 | class ArticleMarkdown(markdown.Markdown): 13 | def __init__(self, article, preview=False, *args, **kwargs): 14 | kwargs = settings.MARKDOWN_KWARGS 15 | kwargs['extensions'] = self.get_markdown_extensions() 16 | markdown.Markdown.__init__(self, *args, **kwargs) 17 | self.article = article 18 | self.preview = preview 19 | 20 | def core_extensions(self): 21 | """List of core extensions found in the mdx folder""" 22 | return [PreviewLinksExtension()] 23 | 24 | def get_markdown_extensions(self): 25 | kwargs = settings.MARKDOWN_KWARGS 26 | extensions = kwargs.get('extensions', []) 27 | extensions += self.core_extensions() 28 | extensions += plugin_registry.get_markdown_extensions() 29 | # add our wikicodinglink plugin 30 | extensions += [wikicodinglinks.WikiLinkExtension()] 31 | # add our wikicodingindent plugin 32 | extensions += [wikicodingindent.WikiIndentExtension()] 33 | # add our reddit-hn-top template 34 | extensions += [template_reddit_hn.RedditHNtoptenExtension()] 35 | return extensions 36 | 37 | 38 | def article_markdown(text, article, *args, **kwargs): 39 | md = ArticleMarkdown(article, *args, **kwargs) 40 | return md.convert(text) 41 | -------------------------------------------------------------------------------- /wiki/core/markdown/mdx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/core/markdown/mdx/__init__.py -------------------------------------------------------------------------------- /wiki/core/markdown/mdx/previewlinks.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | 3 | from markdown.treeprocessors import Treeprocessor 4 | import markdown 5 | 6 | 7 | class PreviewLinksExtension(markdown.Extension): 8 | """Markdown Extension that sets all anchor targets to _blank when in preview mode""" 9 | def extendMarkdown(self, md, md_globals): 10 | md.treeprocessors.add('previewlinks', PreviewLinksTree(md), "_end") 11 | 12 | 13 | class PreviewLinksTree(Treeprocessor): 14 | def run(self, root): 15 | if self.markdown.preview: 16 | for a in root.findall('.//a'): 17 | # Do not set target for links like href='#markdown' 18 | if not a.get('href').startswith('#'): 19 | a.set('target', '_blank') 20 | return root 21 | -------------------------------------------------------------------------------- /wiki/core/markdown/wikicoding/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/core/markdown/wikicoding/__init__.py -------------------------------------------------------------------------------- /wiki/core/markdown/wikicoding/wikicodingindent.py: -------------------------------------------------------------------------------- 1 | ''' 2 | WikicodingIndent Extension for Python-Markdown 3 | ============================================= 4 | 5 | Converts ':' at the beginning of a line to indentation. 6 | 7 | Original code Copyright Arjun Sreedharan 8 | 9 | License: [GPLv3] 10 | 11 | ''' 12 | 13 | 14 | from __future__ import absolute_import 15 | from __future__ import unicode_literals 16 | from markdown import Extension 17 | from markdown.inlinepatterns import Pattern 18 | from markdown.util import etree 19 | import re 20 | 21 | 22 | class WikiIndentExtension(Extension): 23 | def __init__(self, *args, **kwargs): 24 | super(WikiIndentExtension, self).__init__(*args, **kwargs) 25 | 26 | def extendMarkdown(self, md, md_globals): 27 | self.md = md 28 | # look for : at the beginning of line 29 | WIKILINDENT_RE = r'^(:+)' 30 | WikiIndentPattern = WikiIndent(WIKILINDENT_RE, self.getConfigs()) 31 | WikiIndentPattern.md = md 32 | md.inlinePatterns.add('wikicodingindent', WikiIndentPattern, "{% trans "This attachment is not permitted on this page." %} 7 | {% else %} 8 | {{ filename }} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /wiki/plugins/attachments/tests/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import django 4 | if django.VERSION < (1, 6): 5 | # New style autodiscovery of tests doesn't work for Django < 1.6 6 | from .test_views import * 7 | -------------------------------------------------------------------------------- /wiki/plugins/attachments/tests/test_views.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function, unicode_literals 2 | 3 | from io import BytesIO 4 | 5 | from django.core.files.uploadedfile import InMemoryUploadedFile 6 | from django.core.urlresolvers import reverse 7 | 8 | from wiki.tests.base import ArticleTestBase 9 | 10 | 11 | class AttachmentTests(ArticleTestBase): 12 | def test_upload(self): 13 | data = "This is a plain text file".encode('utf-8') 14 | filedata = BytesIO(data) 15 | filestream = InMemoryUploadedFile(filedata, None, 'test.txt', 'text', len(data), None) 16 | article = self.root_article 17 | url = reverse('wiki:attachments_index', kwargs={'path': ''}) 18 | response = self.c.post(url, 19 | {'description': 'My file', 20 | 'file': filestream, 21 | 'save': '1', 22 | }) 23 | self.assertRedirects(response, url) 24 | # Check the object was created. 25 | attachment = article.shared_plugins_set.all()[0].attachment 26 | self.assertEqual(attachment.original_filename, 'test.txt') 27 | self.assertEqual(attachment.current_revision.file.file.read(), 28 | data) 29 | -------------------------------------------------------------------------------- /wiki/plugins/attachments/urls.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django.conf.urls import patterns, url 4 | 5 | from wiki.plugins.attachments import views 6 | 7 | urlpatterns = patterns('', 8 | url(r'^$', views.AttachmentView.as_view(), name='attachments_index'), 9 | url(r'^search/$', views.AttachmentSearchView.as_view(), name='attachments_search'), 10 | url(r'^add/(?P\d+)/$', views.AttachmentAddView.as_view(), name='attachments_add'), 11 | url(r'^replace/(?P\d+)/$', views.AttachmentReplaceView.as_view(), name='attachments_replace'), 12 | url(r'^history/(?P\d+)/$', views.AttachmentHistoryView.as_view(), name='attachments_history'), 13 | url(r'^download/(?P\d+)/$', views.AttachmentDownloadView.as_view(), name='attachments_download'), 14 | url(r'^delete/(?P\d+)/$', views.AttachmentDeleteView.as_view(), name='attachments_delete'), 15 | url(r'^download/(?P\d+)/revision/(?P\d+)/$', views.AttachmentDownloadView.as_view(), name='attachments_download'), 16 | url(r'^change/(?P\d+)/revision/(?P\d+)/$', views.AttachmentChangeRevisionView.as_view(), name='attachments_revision_change'), 17 | ) -------------------------------------------------------------------------------- /wiki/plugins/attachments/wiki_plugin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | from __future__ import absolute_import 4 | from django.conf.urls import patterns, url, include 5 | from django.utils.translation import ugettext as _ 6 | 7 | from wiki.core.plugins import registry 8 | from wiki.core.plugins.base import BasePlugin 9 | from wiki.plugins.attachments import views 10 | from wiki.plugins.attachments import models 11 | from wiki.plugins.attachments import settings 12 | from wiki.plugins.attachments.markdown_extensions import AttachmentExtension 13 | from wiki.plugins.notifications.settings import ARTICLE_EDIT 14 | from wiki.plugins.notifications.util import truncate_title 15 | 16 | 17 | class AttachmentPlugin(BasePlugin): 18 | 19 | slug = settings.SLUG 20 | urlpatterns = { 21 | 'article': patterns('', 22 | url('', include('wiki.plugins.attachments.urls')), 23 | ) 24 | } 25 | 26 | article_tab = (_('Attachments'), "fa fa-file") 27 | article_view = views.AttachmentView().dispatch 28 | 29 | # List of notifications to construct signal handlers for. This 30 | # is handled inside the notifications plugin. 31 | notifications = [{ 32 | 'model': models.AttachmentRevision, 33 | 'message': lambda obj: ( 34 | _("A file was changed: %s") 35 | if not obj.deleted 36 | else 37 | _("A file was deleted: %s") 38 | ) % truncate_title(obj.get_filename()), 39 | 'key': ARTICLE_EDIT, 40 | 'created': True, 41 | 'get_article': lambda obj: obj.attachment.article} 42 | ] 43 | 44 | markdown_extensions = [AttachmentExtension()] 45 | 46 | def __init__(self): 47 | #print "I WAS LOADED!" 48 | pass 49 | 50 | registry.register(AttachmentPlugin) 51 | 52 | -------------------------------------------------------------------------------- /wiki/plugins/haystack/search_indexes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from haystack import indexes 4 | from wiki import models 5 | 6 | 7 | class ArticleIndex(indexes.SearchIndex, indexes.Indexable): 8 | text = indexes.CharField(document=True, use_template=True) 9 | created = indexes.DateTimeField(model_attr='created') 10 | modified = indexes.DateTimeField(model_attr='modified') 11 | 12 | #default because indexing fails with whoosh. see. 13 | #http://stackoverflow.com/questions/11995367/how-do-i-use-a-boolean-field-in-django-haystack-search-query 14 | #https://github.com/toastdriven/django-haystack/issues/382 15 | other_read = indexes.BooleanField(model_attr='other_read',default=False) 16 | group_read = indexes.BooleanField(model_attr='group_read',default=False) 17 | 18 | owner_id = indexes.IntegerField(model_attr='owner__id', null=True) 19 | group_id = indexes.IntegerField(model_attr='group__id', null=True) 20 | 21 | 22 | def get_model(self): 23 | return models.Article 24 | 25 | def index_queryset(self, using=None): 26 | """Used when the entire index for model is updated.""" 27 | return self.get_model().objects.all() 28 | -------------------------------------------------------------------------------- /wiki/plugins/haystack/templates/search/indexes/wiki/article_text.txt: -------------------------------------------------------------------------------- 1 | {{ object.current_revision.title }} 2 | {{ object.render|striptags }} 3 | -------------------------------------------------------------------------------- /wiki/plugins/haystack/templates/wiki/plugins/haystack/search.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/search.html" %} 2 | 3 | {% block wiki_search_loop %} 4 | {% with article.object as article %} 5 | {% include "wiki/includes/searchresult.html" %} 6 | {% endwith %} 7 | {% endblock %} 8 | 9 | -------------------------------------------------------------------------------- /wiki/plugins/haystack/views.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from haystack.backends import SQ 4 | from wiki.views.article import SearchView 5 | from haystack.query import SearchQuerySet 6 | from haystack.inputs import AutoQuery 7 | from wiki.core import permissions 8 | from wiki import models 9 | 10 | 11 | class HaystackSearchView(SearchView): 12 | 13 | template_name = 'wiki/plugins/haystack/search.html' 14 | 15 | def get_queryset(self): 16 | qs = SearchQuerySet().all() 17 | if self.request.user.is_authenticated(): 18 | if not permissions.can_moderate(models.URLPath.root().article, self.request.user): 19 | qs = qs.filter( 20 | SQ(owner_id=self.request.user.id) | 21 | ( 22 | SQ(group_id__in=self.request.user.groups.values_list('id', flat=True)) 23 | & SQ(group_read=True) 24 | ) | 25 | SQ(other_read=True) 26 | ) 27 | else: 28 | qs = qs.exclude(other_read=False) 29 | 30 | qs = qs.filter(content=AutoQuery(self.query)) 31 | qs = qs.load_all() 32 | return qs 33 | -------------------------------------------------------------------------------- /wiki/plugins/help/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/help/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/help/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from django.db import models 3 | 4 | # Create your models here. 5 | -------------------------------------------------------------------------------- /wiki/plugins/help/templates/wiki/plugins/help/sidebar.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}

{% trans "Adding new articles" %}

2 |

3 | {% trans "To create a new wiki article, create a link to it. Clicking the link gives you the creation page." %} 4 |

5 |
[Article Name](wiki:ArticleName)
6 |

{% trans "An external link" %}

7 |
[Link](http://google.com)
8 | 9 |

{% trans "Headers" %}

10 |

{% trans "Use these codes for headers and to automatically generate Tables of Contents." %}

11 |
Hugest header
12 | ===========
13 | 
14 | Huger header
15 | ------------
16 | 
17 | # Hugest Header
18 | ## Huger header
19 | ### Huge header
20 | #### Small header
21 | 
22 | [TOC]
23 | 
24 | 25 |

{% trans "Typography" %}

26 | 27 |
*emphasis* or _emphasis_
28 |
**strong** or __strong__
29 | 30 |

{% trans "Lists" %}

31 | 32 |
- Unordered List
33 |     - Sub Item 1
34 |     - Sub Item 2
35 |
1. Ordered
36 | 2. List
37 | 38 |

{% trans "Tables" %}

39 | 40 |
41 | First Header  | Second Header
42 | ------------- | -------------
43 | Content Cell  | Content Cell
44 | Content Cell  | Content Cell
45 | 
46 | -------------------------------------------------------------------------------- /wiki/plugins/help/views.py: -------------------------------------------------------------------------------- 1 | # Create your views here. 2 | -------------------------------------------------------------------------------- /wiki/plugins/help/wiki_plugin.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | # -*- coding: utf-8 -*- 4 | from django.utils.translation import ugettext as _ 5 | 6 | from wiki.core.plugins import registry 7 | from wiki.core.plugins.base import BasePlugin 8 | 9 | class HelpPlugin(BasePlugin): 10 | 11 | slug = 'help' 12 | 13 | sidebar = {'headline': _('Help'), 14 | 'icon_class': 'fa-question-circle', 15 | 'template': 'wiki/plugins/help/sidebar.html', 16 | 'form_class': None, 17 | 'get_form_kwargs': (lambda a: {})} 18 | 19 | markdown_extensions = [] 20 | 21 | def __init__(self): 22 | pass 23 | 24 | registry.register(HelpPlugin) 25 | 26 | -------------------------------------------------------------------------------- /wiki/plugins/images/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | default_app_config = 'wiki.apps.ImagesConfig' -------------------------------------------------------------------------------- /wiki/plugins/images/admin.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django.contrib import admin 4 | from django import forms 5 | from . import models 6 | 7 | class ImageForm(forms.ModelForm): 8 | 9 | class Meta: 10 | model = models.Image 11 | exclude = () 12 | 13 | def __init__(self, *args, **kwargs): 14 | super(ImageForm, self).__init__(*args, **kwargs) 15 | if self.instance.pk: 16 | revisions = models.ImageRevision.objects.filter(plugin=self.instance) 17 | self.fields['current_revision'].queryset = revisions 18 | else: 19 | self.fields['current_revision'].queryset = models.ImageRevision.objects.none() 20 | self.fields['current_revision'].widget = forms.HiddenInput() 21 | 22 | 23 | class ImageRevisionInline(admin.TabularInline): 24 | model = models.ImageRevision 25 | extra = 1 26 | fields = ('image', 'locked', 'deleted') 27 | 28 | class ImageAdmin(admin.ModelAdmin): 29 | form = ImageForm 30 | inlines = (ImageRevisionInline,) 31 | 32 | admin.site.register(models.Image, ImageAdmin) 33 | -------------------------------------------------------------------------------- /wiki/plugins/images/settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django import VERSION 4 | from django.conf import settings as django_settings 5 | from wiki.conf import settings as wiki_settings 6 | 7 | SLUG = 'images' 8 | 9 | # This is deprecated in django 1.7+ 10 | APP_LABEL = 'images' if VERSION < (1, 7) else None 11 | 12 | # Where to store images 13 | IMAGE_PATH = getattr(django_settings, 'WIKI_IMAGES_PATH', "wiki/images/%aid/") 14 | 15 | # Storage backend to use, default is to use the same as the rest of the 16 | # wiki, which is set in WIKI_STORAGE_BACKEND, but you can override it 17 | # with WIKI_IMAGES_STORAGE_BACKEND 18 | STORAGE_BACKEND = getattr(django_settings, 'WIKI_IMAGES_STORAGE_BACKEND', wiki_settings.STORAGE_BACKEND) 19 | 20 | # Should the upload path be obscurified? If so, a random hash will be added to the path 21 | # such that someone can not guess the location of files (if you have 22 | # restricted permissions and the files are still located within the web server's 23 | IMAGE_PATH_OBSCURIFY = getattr(django_settings, 'WIKI_IMAGES_PATH_OBSCURIFY', True) 24 | 25 | # Allow anonymous users upload access (not nice on an open network) 26 | # WIKI_IMAGES_ANONYMOUS can override this, otherwise the default 27 | # in wiki.conf.settings is used. 28 | ANONYMOUS = getattr( django_settings, 'WIKI_IMAGES_ANONYMOUS', wiki_settings.ANONYMOUS_UPLOAD ) -------------------------------------------------------------------------------- /wiki/plugins/images/south_migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/south_migrations/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/border.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/controls.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomCenter.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomLeft.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderBottomRight.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderMiddleLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderMiddleLeft.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderMiddleRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderMiddleRight.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopCenter.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopLeft.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/ie6/borderTopRight.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/loading.gif -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/loading_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/loading_background.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/colorbox/example1/images/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/static/wiki/colorbox/example1/images/overlay.png -------------------------------------------------------------------------------- /wiki/plugins/images/static/wiki/js/images.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('.wiki-article .thumbnail').each(function() { 3 | caption = $(this).children('.caption').html(); 4 | $(this).children('a').colorbox({width:"75%", height:"75%", title: caption}) 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /wiki/plugins/images/templates/wiki/plugins/images/purge.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/article.html" %} 2 | {% load wiki_tags i18n humanize wiki_thumbnails %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Purge deletion" %}: {{ image }}{% endblock %} 6 | 7 | {% block wiki_contents_tab %} 8 | {% thumbnail image.current_revision.imagerevision.image "250x250" as thumb %} 9 |

10 | {{ revision.get_filename }} 11 |

12 | {% endthumbnail %} 13 |

14 | {% trans "Purge image: Completely remove image file and all revisions." %} 15 |

16 |
17 | {% wiki_form form %} 18 |
19 |
20 |
21 | 22 | 23 | {% trans "Go back" %} 24 | 25 | 29 |
30 |
31 |
32 | 33 | {% endblock %} 34 | 35 | -------------------------------------------------------------------------------- /wiki/plugins/images/templates/wiki/plugins/images/render.html: -------------------------------------------------------------------------------- 1 | {% load wiki_thumbnails i18n %}{% comment %} 2 | This template is used for the markdown extension that renders images and captions. 3 | 4 | NB! Watch out for line breaks, markdown might add
s and

s. 5 | {% endcomment %}{% with image.current_revision.imagerevision as revision %}{% spaceless %} 6 |

7 | {% thumbnail revision.image "250x250" as thumb %} 8 | 9 | {{ revision.get_filename }} 10 | 11 | {% empty %} 12 |
13 | {% trans "Image not found" %} 14 |
15 | {% endthumbnail %} 16 |
17 | {{ caption|safe }} 18 |
19 |
20 | {% endspaceless %}{% endwith %} 21 | -------------------------------------------------------------------------------- /wiki/plugins/images/templates/wiki/plugins/images/revision_add.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/article.html" %} 2 | {% load wiki_tags i18n humanize wiki_thumbnails %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Replace image" %}: {{ image }}{% endblock %} 6 | 7 | {% block wiki_contents_tab %} 8 | {% thumbnail image.current_revision.imagerevision.image "250x250" as thumb %} 9 |

10 | {{ revision.get_filename }} 11 |

12 | {% endthumbnail %} 13 |

14 | {% trans "Choose an image file to replace current image." %} 15 |

16 |
17 | {% wiki_form form %} 18 |
19 |
20 |
21 | 22 | 23 | {% trans "Go back" %} 24 | 25 | 29 |
30 |
31 |
32 | 33 | {% endblock %} 34 | 35 | -------------------------------------------------------------------------------- /wiki/plugins/images/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/images/templatetags/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/images/templatetags/wiki_images_tags.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django import template 4 | 5 | from wiki.plugins.images import models 6 | from wiki.plugins.images import settings 7 | 8 | register = template.Library() 9 | 10 | @register.filter 11 | def images_for_article(article): 12 | return models.Image.objects.filter(article=article, current_revision__deleted=False).order_by('-current_revision__created') 13 | 14 | @register.filter 15 | def images_can_add(article, user): 16 | if not settings.ANONYMOUS and (not user or user.is_anonymous()): 17 | return False 18 | return article.can_write(user) -------------------------------------------------------------------------------- /wiki/plugins/images/templatetags/wiki_thumbnails.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from sorl.thumbnail.templatetags.thumbnail import register 3 | -------------------------------------------------------------------------------- /wiki/plugins/links/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/links/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/links/mdx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/links/mdx/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/links/settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django.conf import settings as django_settings 4 | 5 | LOOKUP_LEVEL = getattr(django_settings, 'WIKI_LINKS_LOOKUP_LEVEL', 2) 6 | -------------------------------------------------------------------------------- /wiki/plugins/links/templates/wiki/plugins/links/sidebar.html: -------------------------------------------------------------------------------- 1 | {% load i18n sekizai_tags %} 2 | {% load url from future %} 3 |

{% trans "Link to another wiki page" %}

4 | 5 |

6 | {% trans "Type in something from another wiki page's title and auto-complete will help you create a tag for you wiki link. Tags for links look like this:" %}
7 |

8 | 9 |
[Title of link](wiki:ArticleSlug)
10 | 11 |
12 | 13 | 14 | 17 | 18 |
19 | 20 |
21 | 22 |

{% trans "An external link" %}

23 | 24 |

25 | {% trans "You can link to another website simply by inserting an address wikicoding.org or http://wikicoding.org or by using the markdown syntax:" %}
26 |

27 |
[Clickable text](http://wikicoding.org)
28 | 29 | {% addtoblock "js" %}{% endaddtoblock %} 30 | {% addtoblock "js" %} 31 | 44 | {% endaddtoblock %} 45 | -------------------------------------------------------------------------------- /wiki/plugins/links/views.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from wiki.decorators import json_view, get_article 4 | from django.views.generic.base import View 5 | from django.utils.decorators import method_decorator 6 | 7 | from wiki import models 8 | 9 | class QueryUrlPath(View): 10 | 11 | # TODO: get_article does not actually support JSON responses 12 | @method_decorator(json_view) 13 | @method_decorator(get_article(can_read=True)) 14 | def dispatch(self, request, article, *args, **kwargs): 15 | max_num = kwargs.pop('max_num', 20) 16 | # TODO: Move this import when circularity issue is resolved 17 | # https://github.com/benjaoming/django-wiki/issues/23 18 | query = request.GET.get('query', None) 19 | 20 | if query: 21 | matches = models.URLPath.objects.can_read(request.user).active().filter( 22 | article__current_revision__title__contains=query, 23 | article__current_revision__deleted=False, 24 | ) 25 | matches = matches.select_related_common() 26 | return [("[%s](wiki:%s)") % (m.article.current_revision.title, '/'+m.path.strip("/")) for m in matches[:max_num]] 27 | 28 | return [] 29 | 30 | -------------------------------------------------------------------------------- /wiki/plugins/links/wiki_plugin.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | # -*- coding: utf-8 -*- 4 | from django.conf.urls import patterns, url 5 | from django.utils.translation import ugettext as _ 6 | 7 | from wiki.core.plugins import registry 8 | from wiki.core.plugins.base import BasePlugin 9 | from wiki.plugins.links import views 10 | from wiki.plugins.links import settings 11 | from wiki.plugins.links.mdx.urlize import makeExtension as urlize_makeExtension 12 | from wiki.plugins.links.mdx.djangowikilinks import WikiPathExtension 13 | from django.core.urlresolvers import reverse_lazy 14 | 15 | class LinkPlugin(BasePlugin): 16 | 17 | slug = 'links' 18 | urlpatterns = { 19 | 'article': patterns('', 20 | url(r'^json/query-urlpath/$', views.QueryUrlPath.as_view(), name='links_query_urlpath'), 21 | ) 22 | } 23 | 24 | sidebar = {'headline': _('Links'), 25 | 'icon_class': 'fa-bookmark', 26 | 'template': 'wiki/plugins/links/sidebar.html', 27 | 'form_class': None, 28 | 'get_form_kwargs': (lambda a: {})} 29 | 30 | wikipath_config = [ 31 | ('base_url', reverse_lazy('wiki:get', kwargs={'path': ''}) ), 32 | ('default_level', settings.LOOKUP_LEVEL ), 33 | ] 34 | 35 | markdown_extensions = [urlize_makeExtension(), WikiPathExtension(wikipath_config)] 36 | 37 | def __init__(self): 38 | pass 39 | 40 | registry.register(LinkPlugin) 41 | 42 | -------------------------------------------------------------------------------- /wiki/plugins/macros/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/macros/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/macros/mdx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/macros/mdx/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/macros/settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | # -*- coding: utf-8 -*- 4 | from django.conf import settings as django_settings 5 | 6 | SLUG = 'macros' 7 | APP_LABEL = 'wiki' 8 | 9 | METHODS = getattr(django_settings, 'WIKI_PLUGINS_METHODS', ('article_list', 'toc',)) -------------------------------------------------------------------------------- /wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html: -------------------------------------------------------------------------------- 1 | {% load i18n wiki_macro_tags %} 2 | 3 | {% if article_children %} 4 |
5 |
    6 | 7 | {% for child in article_children %} 8 | {% article_list child depth %} 9 | {% empty %} 10 | {% trans "Nothing below this level" %} 11 | {% endfor %} 12 |
      13 |
14 | {% endif %} 15 | -------------------------------------------------------------------------------- /wiki/plugins/macros/templates/wiki/plugins/macros/sidebar.html: -------------------------------------------------------------------------------- 1 | {% load i18n wiki_macro_tags %} 2 | {% allowed_macros as macros %} 3 | 4 | {% for macro in macros %} 5 |

{{ macro.short_description }}

6 | {{ macro.help_text|linebreaks|safe }} 7 | {% if macro.example_code %} 8 |
{{ macro.example_code }}
9 | {% endif %} 10 | {% if macro.args %} 11 | 12 | {% for arg,description in macro.args.items %} 13 | 14 | 15 | 16 | 17 | {% endfor %} 18 |
{{ arg }}{{ description }}
19 | {% endif %} 20 | {% endfor %} 21 | -------------------------------------------------------------------------------- /wiki/plugins/macros/templates/wiki/plugins/templatetags/article_list.html: -------------------------------------------------------------------------------- 1 | {% load wiki_macro_tags %} 2 | {% load url from future %} 3 | 4 |
  • 5 | 6 | {{ parent.article.current_revision.title }} 7 | {% if not parent.article.other_read %}{% endif %} 8 | 9 | {% if parent.article.other_read %} 10 | {% with parent.children.active as children %} 11 | {% if parent.level < depth and children.count %} 12 |
      13 | {% for child in parent.children.active %} 14 | {% article_list child depth %} 15 | {% endfor %} 16 |
    17 | {% endif %} 18 | {% endwith %} 19 | {% endif %} 20 |
  • 21 | -------------------------------------------------------------------------------- /wiki/plugins/macros/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/macros/templatetags/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/macros/templatetags/wiki_macro_tags.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django import template 4 | from wiki.plugins.macros import settings 5 | from wiki.plugins.macros.mdx.macro import MacroPreprocessor 6 | 7 | register = template.Library() 8 | 9 | 10 | @register.inclusion_tag( 11 | 'wiki/plugins/templatetags/article_list.html', 12 | takes_context=True 13 | ) 14 | def article_list(context, urlpath, depth): 15 | context['parent'] = urlpath 16 | context['depth'] = depth 17 | return context 18 | 19 | 20 | @register.assignment_tag 21 | def allowed_macros(): 22 | for method in settings.METHODS: 23 | try: 24 | yield getattr(MacroPreprocessor, method).meta 25 | except AttributeError: 26 | continue 27 | 28 | 29 | -------------------------------------------------------------------------------- /wiki/plugins/macros/wiki_plugin.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | # -*- coding: utf-8 -*- 4 | from django.utils.translation import ugettext as _ 5 | 6 | from wiki.core.plugins import registry 7 | from wiki.core.plugins.base import BasePlugin 8 | from wiki.plugins.macros import settings 9 | 10 | from wiki.plugins.macros.mdx.macro import MacroExtension 11 | from wiki.plugins.macros.mdx.toc import WikiTocExtension 12 | # from wiki.plugins.macros.mdx.wikilinks import WikiLinkExtension 13 | 14 | class MacroPlugin(BasePlugin): 15 | 16 | slug = settings.SLUG 17 | 18 | sidebar = {'headline': _('Macros'), 19 | 'icon_class': 'fa-play', 20 | 'template': 'wiki/plugins/macros/sidebar.html', 21 | 'form_class': None, 22 | 'get_form_kwargs': (lambda a: {})} 23 | 24 | markdown_extensions = [MacroExtension(), WikiTocExtension()] 25 | 26 | def __init__(self): 27 | pass 28 | 29 | registry.register(MacroPlugin) 30 | -------------------------------------------------------------------------------- /wiki/plugins/mediawikiimport/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/mediawikiimport/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/mediawikiimport/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/mediawikiimport/management/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/mediawikiimport/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/mediawikiimport/management/commands/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/notifications/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | default_app_config = 'wiki.apps.NotifcationsConfig' -------------------------------------------------------------------------------- /wiki/plugins/notifications/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/notifications/management/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/notifications/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/notifications/management/commands/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/notifications/settings.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from django import VERSION 4 | 5 | # This is deprecated in django 1.7+ 6 | APP_LABEL = 'notifications' if VERSION < (1, 7) else None 7 | 8 | # Key for django_nyt - changing it will break any existing notifications. 9 | ARTICLE_EDIT = "article_edit" 10 | 11 | SLUG = 'notifications' -------------------------------------------------------------------------------- /wiki/plugins/notifications/south_migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/plugins/notifications/south_migrations/__init__.py -------------------------------------------------------------------------------- /wiki/plugins/notifications/templates/wiki/plugins/notifications/menubaritem.html: -------------------------------------------------------------------------------- 1 | {% load i18n sekizai_tags %}{% load url from future %} 2 | 3 |
  • 4 |
  • {% trans "No notifications" %}
  • 5 |
  • 6 |
  • 7 | 8 | 9 | {% trans "Clear notifications list" %} 10 | 11 |
  • 12 |
  • 13 | 14 | 15 | {% trans "Notification settings" %} 16 | 17 |
  • 18 | {% addtoblock "js" %} 19 | 24 | {% endaddtoblock %} 25 | {% addtoblock "js" %}{% endaddtoblock %} 26 | -------------------------------------------------------------------------------- /wiki/plugins/notifications/templates/wiki/plugins/notifications/settings.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load wiki_tags i18n humanize %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Notifications" %}: {{ article.current_revision.title }}{% endblock %} 6 | 7 | {% block wiki_contents %} 8 | 9 |

    {% trans "Your notification settings" %}

    10 |

    11 | {% trans "Manage how often you receive notifications" %} 12 |

    13 | 14 |
    15 | {% include "wiki/includes/formerrors.html" with form=formset.management_form %} 16 | {% csrf_token %} 17 | {{ formset.management_form }} 18 | {% for form in formset %} 19 |
    20 | {% trans "Settings for" %} {{ form.instance.articlesubscriptions.count }} {% trans "articles" %} 21 | {% include "wiki/includes/formerrors.html" with form=form %} 22 | {% for field in form %} 23 | {% include "wiki/includes/formfield.html" %} 24 | {% endfor %} 25 |
    26 | {% empty %} 27 | {% trans "You are not subscribed to any notifications yet." %} 28 | {% endfor %} 29 | {% if formset.forms %} 30 |
    31 |
    32 |
    33 | 37 |
    38 |
    39 | {% endif %} 40 |
    41 | 42 |
    43 |
    44 | {% endblock %} 45 | 46 | -------------------------------------------------------------------------------- /wiki/plugins/notifications/util.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | from __future__ import absolute_import 3 | from django.utils.translation import ugettext as _ 4 | 5 | def get_title(article): 6 | """Utility function to format the title of an article...""" 7 | return truncate_title(article.title) 8 | 9 | def truncate_title(title): 10 | """Truncate a title (of an article, file, image etc) to be displayed in notifications messages.""" 11 | if not title: 12 | return _("(none)") 13 | if len(title) > 25: 14 | return "%s..." % title[:22] 15 | return title 16 | -------------------------------------------------------------------------------- /wiki/plugins/notifications/wiki_plugin.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import unicode_literals 3 | from wiki.core.plugins import registry 4 | from wiki.core.plugins.base import BasePlugin 5 | 6 | from django.conf.urls import patterns, url 7 | 8 | from . import settings, views 9 | 10 | class NotifyPlugin(BasePlugin): 11 | 12 | slug = settings.SLUG 13 | urlpatterns = { 14 | 'root': patterns('', 15 | url(r'^$', views.NotificationSettings.as_view(), name='notification_settings'), 16 | ) 17 | } 18 | 19 | article_view = views.NotificationSettings().dispatch 20 | 21 | settings_form = 'wiki.plugins.notifications.forms.SubscriptionForm' 22 | 23 | def __init__(self): 24 | pass 25 | 26 | registry.register(NotifyPlugin) -------------------------------------------------------------------------------- /wiki/sitemap.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | from wiki import models 3 | from django.contrib import sitemaps 4 | from django.contrib.auth.models import User 5 | from django.core.urlresolvers import reverse 6 | 7 | 8 | class WikiSitemap(sitemaps.Sitemap): 9 | 10 | def items(self): 11 | return models.urlpath.URLPath.objects.all() 12 | 13 | def changefreq(self, obj): 14 | return "daily" 15 | 16 | def priority(self, obj): 17 | if obj.language == '_' and obj.path.strip('/') == "": 18 | return 0.0 19 | if obj.language == '_' and obj.path.strip('/') == "Main_Page": 20 | return 1.0 21 | return 0.5 22 | 23 | def lastmod(self, obj): 24 | return datetime.datetime.now() 25 | 26 | def location(self, obj): 27 | language = obj.language 28 | path = obj.path 29 | if language == '_': 30 | return "/wiki/%s" % path 31 | return reverse("wiki:get", kwargs={'language': language, 'path': path}) 32 | -------------------------------------------------------------------------------- /wiki/south_migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/south_migrations/__init__.py -------------------------------------------------------------------------------- /wiki/static/admin/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* DASHBOARD */ 2 | 3 | .dashboard .module table th { 4 | width: 100%; 5 | } 6 | 7 | .dashboard .module table td { 8 | white-space: nowrap; 9 | } 10 | 11 | .dashboard .module table td a { 12 | display: block; 13 | padding-right: .6em; 14 | } 15 | 16 | /* RECENT ACTIONS MODULE */ 17 | 18 | .module ul.actionlist { 19 | margin-left: 0; 20 | } 21 | 22 | ul.actionlist li { 23 | list-style-type: none; 24 | } 25 | 26 | ul.actionlist li { 27 | overflow: hidden; 28 | text-overflow: ellipsis; 29 | -o-text-overflow: ellipsis; 30 | } 31 | -------------------------------------------------------------------------------- /wiki/static/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #eee; 5 | } 6 | 7 | .login #container { 8 | background: white; 9 | border: 1px solid #ccc; 10 | width: 28em; 11 | min-width: 300px; 12 | margin-left: auto; 13 | margin-right: auto; 14 | margin-top: 100px; 15 | } 16 | 17 | .login #content-main { 18 | width: 100%; 19 | } 20 | 21 | .login form { 22 | margin-top: 1em; 23 | } 24 | 25 | .login .form-row { 26 | padding: 4px 0; 27 | float: left; 28 | width: 100%; 29 | } 30 | 31 | .login .form-row label { 32 | padding-right: 0.5em; 33 | line-height: 2em; 34 | font-size: 1em; 35 | clear: both; 36 | color: #333; 37 | } 38 | 39 | .login .form-row #id_username, .login .form-row #id_password { 40 | clear: both; 41 | padding: 6px; 42 | width: 100%; 43 | -webkit-box-sizing: border-box; 44 | -moz-box-sizing: border-box; 45 | box-sizing: border-box; 46 | } 47 | 48 | .login span.help { 49 | font-size: 10px; 50 | display: block; 51 | } 52 | 53 | .login .submit-row { 54 | clear: both; 55 | padding: 1em 0 0 9.4em; 56 | } 57 | 58 | .login .password-reset-link { 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /wiki/static/admin/img/changelist-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/changelist-bg.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/changelist-bg_rtl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/changelist-bg_rtl.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/default-bg-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/default-bg-reverse.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/default-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/default-bg.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/deleted-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/deleted-overlay.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/gis/move_vertex_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/gis/move_vertex_off.png -------------------------------------------------------------------------------- /wiki/static/admin/img/gis/move_vertex_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/gis/move_vertex_on.png -------------------------------------------------------------------------------- /wiki/static/admin/img/icon-no.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon-no.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon-unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon-unknown.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon-yes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon-yes.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_addlink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_addlink.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_alert.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_calendar.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_changelink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_changelink.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_clock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_clock.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_deletelink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_deletelink.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_error.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_error.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_searchbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_searchbox.png -------------------------------------------------------------------------------- /wiki/static/admin/img/icon_success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/icon_success.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/inline-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/inline-delete.png -------------------------------------------------------------------------------- /wiki/static/admin/img/inline-restore-8bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/inline-restore-8bit.png -------------------------------------------------------------------------------- /wiki/static/admin/img/inline-restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/inline-restore.png -------------------------------------------------------------------------------- /wiki/static/admin/img/inline-splitter-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/inline-splitter-bg.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/nav-bg-grabber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/nav-bg-grabber.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/nav-bg-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/nav-bg-reverse.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/nav-bg-selected.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/nav-bg-selected.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/nav-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/nav-bg.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/selector-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/selector-icons.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/selector-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/selector-search.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/sorting-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/sorting-icons.gif -------------------------------------------------------------------------------- /wiki/static/admin/img/tooltag-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/tooltag-add.png -------------------------------------------------------------------------------- /wiki/static/admin/img/tooltag-arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/admin/img/tooltag-arrowright.png -------------------------------------------------------------------------------- /wiki/static/admin/js/LICENSE-JQUERY.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 John Resig, http://jquery.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /wiki/static/admin/js/collapse.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(document).ready(function() { 3 | // Add anchor tag for Show/Hide link 4 | $("fieldset.collapse").each(function(i, elem) { 5 | // Don't hide if fields in this fieldset have errors 6 | if ($(elem).find("div.errors").length == 0) { 7 | $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + 9 | ')'); 10 | } 11 | }); 12 | // Add toggle to anchor tag 13 | $("fieldset.collapse a.collapse-toggle").click(function(ev) { 14 | if ($(this).closest("fieldset").hasClass("collapsed")) { 15 | // Show 16 | $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); 17 | } else { 18 | // Hide 19 | $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); 20 | } 21 | return false; 22 | }); 23 | }); 24 | })(django.jQuery); 25 | -------------------------------------------------------------------------------- /wiki/static/admin/js/collapse.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){a(b).find("div.errors").length==0&&a(b).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", 2 | [a(this).attr("id")]);return false})})})(django.jQuery); 3 | -------------------------------------------------------------------------------- /wiki/static/admin/js/jquery.init.js: -------------------------------------------------------------------------------- 1 | /* Puts the included jQuery into our own namespace using noConflict and passing 2 | * it 'true'. This ensures that the included jQuery doesn't pollute the global 3 | * namespace (i.e. this preserves pre-existing values for both window.$ and 4 | * window.jQuery). 5 | */ 6 | var django = django || {}; 7 | django.jQuery = jQuery.noConflict(true); 8 | -------------------------------------------------------------------------------- /wiki/static/admin/js/prepopulate.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $.fn.prepopulate = function(dependencies, maxLength) { 3 | /* 4 | Depends on urlify.js 5 | Populates a selected field with the values of the dependent fields, 6 | URLifies and shortens the string. 7 | dependencies - array of dependent fields ids 8 | maxLength - maximum length of the URLify'd string 9 | */ 10 | return this.each(function() { 11 | var prepopulatedField = $(this); 12 | 13 | var populate = function () { 14 | // Bail if the field's value has been changed by the user 15 | if (prepopulatedField.data('_changed')) { 16 | return; 17 | } 18 | 19 | var values = []; 20 | $.each(dependencies, function(i, field) { 21 | field = $(field); 22 | if (field.val().length > 0) { 23 | values.push(field.val()); 24 | } 25 | }); 26 | prepopulatedField.val(URLify(values.join(' '), maxLength)); 27 | }; 28 | 29 | prepopulatedField.data('_changed', false); 30 | prepopulatedField.change(function() { 31 | prepopulatedField.data('_changed', true); 32 | }); 33 | 34 | if (!prepopulatedField.val()) { 35 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); 36 | } 37 | }); 38 | }; 39 | })(django.jQuery); 40 | -------------------------------------------------------------------------------- /wiki/static/admin/js/prepopulate.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.fn.prepopulate=function(e,g){return this.each(function(){var a=b(this),d=function(){if(!a.data("_changed")){var f=[];b.each(e,function(h,c){c=b(c);c.val().length>0&&f.push(c.val())});a.val(URLify(f.join(" "),g))}};a.data("_changed",false);a.change(function(){a.data("_changed",true)});a.val()||b(e.join(",")).keyup(d).change(d).focus(d)})}})(django.jQuery); 2 | -------------------------------------------------------------------------------- /wiki/static/robots/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /_accounts/* 3 | Disallow: /wiki/_/* 4 | Disallow: /raw/* 5 | Disallow: /*/_edit/$ 6 | Disallow: /*/_history/$ 7 | Disallow: *?page=* 8 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | .list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .list-group-item > & { 53 | float: right; 54 | } 55 | .list-group-item > & + & { 56 | margin-right: 5px; 57 | } 58 | .nav-pills > li > a > & { 59 | margin-left: 3px; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | tr&.in { display: table-row; } 24 | tbody&.in { display: table-row-group; } 25 | } 26 | 27 | .collapsing { 28 | position: relative; 29 | height: 0; 30 | overflow: hidden; 31 | .transition-property(~"height, visibility"); 32 | .transition-duration(.35s); 33 | .transition-timing-function(ease); 34 | } 35 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container &, 39 | .container-fluid & { 40 | padding-left: (@jumbotron-padding * 2); 41 | padding-right: (@jumbotron-padding * 2); 42 | } 43 | 44 | h1, 45 | .h1 { 46 | font-size: (@font-size-base * 4.5); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media-right, 11 | .media > .pull-right { 12 | padding-left: 10px; 13 | } 14 | 15 | .media-left, 16 | .media > .pull-left { 17 | padding-right: 10px; 18 | } 19 | 20 | .media-left, 21 | .media-right, 22 | .media-body { 23 | display: table-cell; 24 | vertical-align: top; 25 | } 26 | 27 | .media-middle { 28 | vertical-align: middle; 29 | } 30 | 31 | .media-bottom { 32 | vertical-align: bottom; 33 | } 34 | 35 | // Reset margins on headings for tighter default spacing 36 | .media-heading { 37 | margin-top: 0; 38 | margin-bottom: 5px; 39 | } 40 | 41 | // Media list variation 42 | // 43 | // Undo default ul/ol styles 44 | .media-list { 45 | padding-left: 0; 46 | list-style: none; 47 | } 48 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | 26 | // Modifier class for 16:9 aspect ratio 27 | &.embed-responsive-16by9 { 28 | padding-bottom: 56.25%; 29 | } 30 | 31 | // Modifier class for 4:3 aspect ratio 32 | &.embed-responsive-4by3 { 33 | padding-bottom: 75%; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /wiki/static/wiki/bootstrap/less/wiki/wiki-bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * This is django-wiki's LESS rules built on top of 3 | * Bootstrap. Please do not modify the original Bootstrap 4 | * files as we try to maintain a simple and clean copy of 5 | * Bootstrap!! 6 | */ 7 | 8 | // CSS Reset 9 | @import "../bootstrap.less"; 10 | @import "wiki.less"; 11 | -------------------------------------------------------------------------------- /wiki/static/wiki/css/base_site.css: -------------------------------------------------------------------------------- 1 | .wiki-navbar {background-color: #f5f5f5; border-bottom: 1px solid #e5e5e5;} 2 | .wiki-search-form{ width: auto;} 3 | .linenos { width: 1%; white-space: nowrap;} 4 | .wikicoding-codetable pre {background-color: #FFFFFF; border: #FFFFFF; max-height: none;} 5 | .wikicoding-code pre {white-space: pre-wrap;} 6 | .wiki-control textarea {height: initial !important; font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif; font-size: 14px !important; border-radius: 0px !important;} 7 | .rh-master { background: #cedff2; padding: 0.2em 0.4em; border: 1px solid #a3b0bf;} 8 | .rh {margin-bottom: 5%} 9 | .reddit-top, .hn-top {border: 1px solid #cedff2; background: #f5faff; vertical-align: top; padding-left: 2%;} 10 | .wiki-catlinks {border: 1px solid #aaa; background-color: #f9f9f9; padding: 5px; margin-top: 5%; clear: both;} 11 | -------------------------------------------------------------------------------- /wiki/static/wiki/css/print.css: -------------------------------------------------------------------------------- 1 | .navbar, 2 | .nav-tabs li a, 3 | #article-breadcrumbs 4 | {display: none;} 5 | 6 | #article-menu li 7 | { 8 | display: none; 9 | } 10 | 11 | #article-title-li 12 | { 13 | display: block !important; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/font-awesome/font/FontAwesome.otf -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/font-awesome/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/font-awesome/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/font-awesome/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal 14px/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "spinning.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal 14px/1 FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | } 12 | 13 | .fa-icon-rotate(@degrees, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 15 | -webkit-transform: rotate(@degrees); 16 | -ms-transform: rotate(@degrees); 17 | transform: rotate(@degrees); 18 | } 19 | 20 | .fa-icon-flip(@horiz, @vert, @rotation) { 21 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 22 | -webkit-transform: scale(@horiz, @vert); 23 | -ms-transform: scale(@horiz, @vert); 24 | transform: scale(@horiz, @vert); 25 | } 26 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 9 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 10 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | @-webkit-keyframes fa-spin { 10 | 0% { 11 | -webkit-transform: rotate(0deg); 12 | transform: rotate(0deg); 13 | } 14 | 100% { 15 | -webkit-transform: rotate(359deg); 16 | transform: rotate(359deg); 17 | } 18 | } 19 | 20 | @keyframes fa-spin { 21 | 0% { 22 | -webkit-transform: rotate(0deg); 23 | transform: rotate(0deg); 24 | } 25 | 100% { 26 | -webkit-transform: rotate(359deg); 27 | transform: rotate(359deg); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /wiki/static/wiki/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /wiki/static/wiki/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/img/avatar.png -------------------------------------------------------------------------------- /wiki/static/wiki/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/img/favicon.ico -------------------------------------------------------------------------------- /wiki/static/wiki/img/github_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/img/github_icon.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/article.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | $('.wiki-article .article-list ul, .wiki-article .toc ul').each(function() { 4 | $(this).addClass('nav'); 5 | $(this).addClass('nav-list'); 6 | }); 7 | 8 | }); 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/js/core.js: -------------------------------------------------------------------------------- 1 | function ajaxError(){} 2 | 3 | $.ajaxSetup({ 4 | timeout: 7000, 5 | cache: false, 6 | error: function(e, xhr, settings, exception) { 7 | ajaxError(); 8 | } 9 | }); 10 | 11 | function jsonWrapper(url, callback) { 12 | $.getJSON(url, function(data) { 13 | if (data == null) { 14 | ajaxError(); 15 | } else { 16 | callback(data); 17 | } 18 | }); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /wiki/static/wiki/js/diff.js: -------------------------------------------------------------------------------- 1 | 2 | function get_diff_json(url, put_in_element) { 3 | jsonWrapper(url, function (data) { 4 | if (!$(put_in_element).find('.diff-container tbody').length > 0) { 5 | $(put_in_element).parentsUntil('.panel-group').find('.progress').show(0 , function() { 6 | tbody = pydifferviewer.as_tbody({differ_output: data.diff}); 7 | $(put_in_element).find('.diff-container table').append( 8 | tbody 9 | ); 10 | if (data.other_changes) { 11 | for (var i=0; i < data.other_changes.length; i++) { 12 | $(put_in_element).find('dl').append($('
    '+data.other_changes[i][0]+'
    ' + 13 | '
    '+data.other_changes[i][1]+'
    ' )); 14 | } 15 | } 16 | put_in_element.find('.diff-container').show('fast', function() {put_in_element.collapse('show');}); 17 | $(put_in_element).parentsUntil('.panel-group').find('.progress').detach(); 18 | }); 19 | } else { 20 | put_in_element.find('.diff-container').show('fast', function() {put_in_element.collapse('toggle');}); 21 | } 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /wiki/static/wiki/js/editor.js: -------------------------------------------------------------------------------- 1 | $.fn.extend({ 2 | insertAtCaret: function(myValue){ 3 | return this.each(function(i) { 4 | if (document.selection) { 5 | //For browsers like Internet Explorer 6 | this.focus(); 7 | sel = document.selection.createRange(); 8 | sel.text = myValue; 9 | this.focus(); 10 | } 11 | else if (this.selectionStart || this.selectionStart == '0') { 12 | //For browsers like Firefox and Webkit based 13 | var startPos = this.selectionStart; 14 | var endPos = this.selectionEnd; 15 | var scrollTop = this.scrollTop; 16 | this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length); 17 | this.focus(); 18 | this.selectionStart = startPos + myValue.length; 19 | this.selectionEnd = startPos + myValue.length; 20 | this.scrollTop = scrollTop; 21 | } else { 22 | this.value += myValue; 23 | this.focus(); 24 | } 25 | }) 26 | }, 27 | 28 | wrapSelection: function(openWrap, closeWrap){ 29 | return this.each(function(i) { 30 | if (document.selection) { 31 | //For browsers like Internet Explorer 32 | this.focus(); 33 | sel = document.selection.createRange(); 34 | sel.text = openWrap + sel.text + closeWrap; 35 | this.focus(); 36 | } 37 | else if (this.selectionStart || this.selectionStart == '0') { 38 | //For browsers like Firefox and Webkit based 39 | var startPos = this.selectionStart; 40 | var endPos = this.selectionEnd; 41 | var scrollTop = this.scrollTop; 42 | this.value = this.value.substring(0, startPos) + openWrap + this.value.substring(startPos,endPos) + closeWrap + this.value.substring(endPos,this.value.length); 43 | this.focus(); 44 | this.selectionStart = startPos + openWrap.length; 45 | this.selectionEnd = endPos + openWrap.length; 46 | this.scrollTop = scrollTop; 47 | } else { 48 | this.value += openWrap + closeWrap; 49 | this.focus(); 50 | } 51 | }) 52 | } 53 | }); 54 | 55 | -------------------------------------------------------------------------------- /wiki/static/wiki/js/forms.js: -------------------------------------------------------------------------------- 1 | // Bootstrap-specific js for wiki form widgets 2 | 3 | function setBtnGroupVal(elem) { 4 | btngroup = $(elem).parents('.btn-group'); 5 | selected_a = btngroup.find('a[selected]'); 6 | if (selected_a.length > 0) { 7 | val = selected_a.attr('data-value'); 8 | label = selected_a.html(); 9 | } else { 10 | btngroup.find('a').first().attr('selected', 'selected'); 11 | setBtnGroupVal(elem); 12 | } 13 | btngroup.find('input').val(val); 14 | btngroup.find('.btn-group-label').html(label); 15 | } 16 | $(document).ready(function() { 17 | $('.btn-group-form input').each(function() { 18 | setBtnGroupVal(this); 19 | }); 20 | $('.btn-group-form li a').click(function() { 21 | $(this).parent().siblings().find('a').attr('selected', false); 22 | $(this).attr('selected', true); 23 | setBtnGroupVal(this); 24 | }); 25 | }) 26 | -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/animated-overlay.gif -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /wiki/static/wiki/js/jqueryui/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/js/jqueryui/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/admin.init.js: -------------------------------------------------------------------------------- 1 | jQuery = django.jQuery; 2 | 3 | 4 | django.jQuery(document).ready(function() { 5 | django.jQuery(".markItUp").markItUp(mySettings); 6 | }); 7 | 8 | 9 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/frontend.init.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $(".markItUp").markItUp(mySettings); 3 | }); 4 | 5 | 6 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/bold.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/code.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h1.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h2.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h3.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h4.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h5.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/h6.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/italic.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/link.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/list-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/list-bullet.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/list-numeric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/list-numeric.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/picture.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/preview.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/images/quotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/admin/images/quotes.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/readme.txt: -------------------------------------------------------------------------------- 1 | Markup language: 2 | Markdown 3 | 4 | Description: 5 | A basic Markdown markup set with Headings, Bold, Italic, Picture, Link, List, Quotes, Code, Preview button. 6 | 7 | Install: 8 | - Download the zip file 9 | - Unzip it in your markItUp! sets folder 10 | - Modify your JS link to point at this set.js 11 | - Modify your CSS link to point at this style.css -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/admin/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | 6 | /*label[for=id_content] {float: none; clear: both; width: 100%; display: block;}*/ 7 | 8 | textarea.markItUp {width: 500px; padding: 0;} 9 | .inline-related textarea.markItUp {width: 450px; padding: 0;} 10 | .inline-related .markItUp {width: 450px;} 11 | .inline-related .markItUpContainer {float: none;} 12 | 13 | .markItUpContainer {float: left;} 14 | .markItUpHeader ul {margin-left: 0 !important; padding-left: 0 !important;} 15 | 16 | .markItUp .markItUpButton1 a { 17 | background-image:url(images/h1.png); 18 | } 19 | .markItUp .markItUpButton2 a { 20 | background-image:url(images/h2.png); 21 | } 22 | .markItUp .markItUpButton3 a { 23 | background-image:url(images/h3.png); 24 | } 25 | .markItUp .markItUpButton4 a { 26 | background-image:url(images/h4.png); 27 | } 28 | .markItUp .markItUpButton5 a { 29 | background-image:url(images/h5.png); 30 | } 31 | .markItUp .markItUpButton6 a { 32 | background-image:url(images/h6.png); 33 | } 34 | 35 | .markItUp .markItUpButton7 a { 36 | background-image:url(images/bold.png); 37 | } 38 | .markItUp .markItUpButton8 a { 39 | background-image:url(images/italic.png); 40 | } 41 | 42 | .markItUp .markItUpButton9 a { 43 | background-image:url(images/list-bullet.png); 44 | } 45 | .markItUp .markItUpButton10 a { 46 | background-image:url(images/list-numeric.png); 47 | } 48 | 49 | .markItUp .markItUpButton11 a { 50 | background-image:url(images/picture.png); 51 | } 52 | .markItUp .markItUpButton12 a { 53 | background-image:url(images/link.png); 54 | } 55 | 56 | .markItUp .markItUpButton13 a { 57 | background-image:url(images/quotes.png); 58 | } 59 | .markItUp .markItUpButton14 a { 60 | background-image:url(images/code.png); 61 | } 62 | 63 | .markItUp .preview a { 64 | background-image:url(images/preview.png); 65 | } 66 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/bold.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/clean.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/image.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/italic.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/link.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/list-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/list-bullet.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/list-numeric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/list-numeric.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/picture.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/preview.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/images/stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/default/images/stroke.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/set.js: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // markItUp! 3 | // ---------------------------------------------------------------------------- 4 | // Copyright (C) 2011 Jay Salvat 5 | // http://markitup.jaysalvat.com/ 6 | // ---------------------------------------------------------------------------- 7 | // Html tags 8 | // http://en.wikipedia.org/wiki/html 9 | // ---------------------------------------------------------------------------- 10 | // Basic set. Feel free to add more tags 11 | // ---------------------------------------------------------------------------- 12 | var mySettings = { 13 | onShiftEnter: {keepDefault:false, replaceWith:'
    \n'}, 14 | onCtrlEnter: {keepDefault:false, openWith:'\n

    ', closeWith:'

    '}, 15 | onTab: {keepDefault:false, replaceWith:' '}, 16 | markupSet: [ 17 | {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, 18 | {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, 19 | {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, 20 | {separator:'---------------' }, 21 | {name:'Bulleted List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:'
      \n', closeBlockWith:'\n
    '}, 22 | {name:'Numeric List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:'
      \n', closeBlockWith:'\n
    '}, 23 | {separator:'---------------' }, 24 | {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, 25 | {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, 26 | {separator:'---------------' }, 27 | {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, 28 | {name:'Preview', className:'preview', call:'preview'} 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/default/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | .markItUp .markItUpButton1 a { 6 | background-image:url(images/bold.png); 7 | } 8 | .markItUp .markItUpButton2 a { 9 | background-image:url(images/italic.png); 10 | } 11 | .markItUp .markItUpButton3 a { 12 | background-image:url(images/stroke.png); 13 | } 14 | 15 | .markItUp .markItUpButton4 a { 16 | background-image:url(images/list-bullet.png); 17 | } 18 | .markItUp .markItUpButton5 a { 19 | background-image:url(images/list-numeric.png); 20 | } 21 | 22 | .markItUp .markItUpButton6 a { 23 | background-image:url(images/picture.png); 24 | } 25 | .markItUp .markItUpButton7 a { 26 | background-image:url(images/link.png); 27 | } 28 | 29 | .markItUp .markItUpButton8 a { 30 | background-image:url(images/clean.png); 31 | } 32 | .markItUp .preview a { 33 | background-image:url(images/preview.png); 34 | } 35 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/bold.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/code.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h1.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h2.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h3.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h4.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h5.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/h6.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/italic.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/link.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/list-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/list-bullet.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/list-numeric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/list-numeric.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/picture.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/preview.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/images/quotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/sets/frontend/images/quotes.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/readme.txt: -------------------------------------------------------------------------------- 1 | Markup language: 2 | Markdown 3 | 4 | Description: 5 | A basic Markdown markup set with Headings, Bold, Italic, Picture, Link, List, Quotes, Code, Preview button. 6 | 7 | Install: 8 | - Download the zip file 9 | - Unzip it in your markItUp! sets folder 10 | - Modify your JS link to point at this set.js 11 | - Modify your CSS link to point at this style.css -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/sets/frontend/style.css: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------- 2 | // markItUp! 3 | // By Jay Salvat - http://markitup.jaysalvat.com/ 4 | // ------------------------------------------------------------------*/ 5 | 6 | /*label[for=id_content] {float: none; clear: both; width: 100%; display: block;}*/ 7 | 8 | .markItUp {padding: 0; width: auto;} 9 | 10 | textarea.markItUp {font-size: 16px; padding: 10px; float: none; display: block; width: 100%; height: 400px; font-size: 13px; color: #222; margin-top: 10px;} 11 | 12 | .markItUpContainer {margin-right: 20px; width: -20px;} 13 | 14 | .markItUp .markItUpButton1 a { 15 | background-image:url(images/h1.png); 16 | } 17 | .markItUp .markItUpButton2 a { 18 | background-image:url(images/h2.png); 19 | } 20 | .markItUp .markItUpButton3 a { 21 | background-image:url(images/h3.png); 22 | } 23 | .markItUp .markItUpButton4 a { 24 | background-image:url(images/h4.png); 25 | } 26 | .markItUp .markItUpButton5 a { 27 | background-image:url(images/h5.png); 28 | } 29 | .markItUp .markItUpButton6 a { 30 | background-image:url(images/h6.png); 31 | } 32 | 33 | .markItUp .markItUpButton7 a { 34 | background-image:url(images/bold.png); 35 | } 36 | .markItUp .markItUpButton8 a { 37 | background-image:url(images/italic.png); 38 | } 39 | 40 | .markItUp .markItUpButton9 a { 41 | background-image:url(images/list-bullet.png); 42 | } 43 | .markItUp .markItUpButton10 a { 44 | background-image:url(images/list-numeric.png); 45 | } 46 | 47 | /*.markItUp .markItUpButton11 a { 48 | background-image:url(images/picture.png); 49 | } 50 | .markItUp .markItUpButton12 a { 51 | background-image:url(images/link.png); 52 | }*/ 53 | 54 | .markItUp .markItUpButton11 a { 55 | background-image:url(images/quotes.png); 56 | } 57 | .markItUp .markItUpButton12 a { 58 | background-image:url(images/code.png); 59 | } 60 | 61 | .markItUp .preview a { 62 | background-image:url(images/preview.png); 63 | } 64 | -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-container.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-bbcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-bbcode.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-dotclear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-dotclear.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-html.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-json.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-markdown.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-textile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-textile.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-wiki.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor-xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor-xml.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/bg-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/bg-editor.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/handle.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/menu.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/markitup/images/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/markitup/images/submenu.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/simple/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/simple/images/handle.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/simple/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/simple/images/menu.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/simple/images/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/static/wiki/markitup/skins/simple/images/submenu.png -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/skins/simple/readme.txt: -------------------------------------------------------------------------------- 1 | Skin: 2 | Simple and neutral Skin 3 | 4 | Install: 5 | - Download the zip file 6 | - Unzip it in your markItUp! skins folder 7 | - Modify your CSS link to point at this skin -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/templates/preview.css: -------------------------------------------------------------------------------- 1 | /* preview style examples */ 2 | body { 3 | background-color:#EFEFEF; 4 | font:70% Verdana, Arial, Helvetica, sans-serif; 5 | } -------------------------------------------------------------------------------- /wiki/static/wiki/markitup/templates/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | markItUp! preview template 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /wiki/templates/wiki/accounts/login.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load i18n wiki_tags sekizai_tags %} 3 | {% load url from future %} 4 | {% block wiki_pagetitle %}{% trans "Log in" %}{% endblock %} 5 | 6 | {% block wiki_contents %} 7 |
    8 |
    9 |
    10 |

    {% trans "Please log in" %}

    11 |
    12 | {% wiki_form form %} 13 |
    14 |
    15 |
    16 | 20 |
    21 |
    22 |
    23 | 24 |

    25 | {% trans "Don't have an account?" %} {% trans "Sign up" %} » 26 |

    27 | 28 |
    29 |
    30 |
    31 | 32 | {% addtoblock "js" %} 33 | 36 | {% endaddtoblock %} 37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /wiki/templates/wiki/accounts/signup.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load i18n wiki_tags sekizai_tags %} 3 | {% block wiki_pagetitle %}{% trans "Sign up" %}{% endblock %} 4 | 5 | {% block wiki_contents %} 6 |

    {% trans "Sign up" %}

    7 |
    8 | {% wiki_form form %} 9 |
    10 |
    11 |
    12 | 16 |
    17 |
    18 |
    19 | {% addtoblock "js" %} 20 | 26 | {% endaddtoblock %} 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /wiki/templates/wiki/base.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base_site.html" %} 2 | 3 | {# Intentionally empty, to allow easy customization with no copy-paste #} 4 | -------------------------------------------------------------------------------- /wiki/templates/wiki/category_page.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base_site.html" %} 2 | {% load wiki_tags i18n sekizai_tags %} 3 | {% load url from future %} 4 | 5 | 6 | {% block wiki_pagetitle %}{% trans "Category" %}: {{ category|get_displayname }}{% block wiki_pagetitle_suffix %} - Wikicoding, the wikipedia of code{% endblock %}{% endblock %} 7 | 8 | {% block wiki_contents %} 9 |
    10 |

    11 | {% trans "Category" %}: 12 | {{ category|get_displayname }} 13 |

    14 |
    15 | 34 |
    35 |
    36 | 37 | {% endblock %} 38 | -------------------------------------------------------------------------------- /wiki/templates/wiki/create_root.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load wiki_tags i18n sekizai_tags %} 3 | 4 | {% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %} 5 | 6 | {% block wiki_contents %} 7 | 8 | {% addtoblock "js" %} 9 | {% for js in editor.Media.js %} 10 | 11 | {% endfor %} 12 | {% endaddtoblock %} 13 | 14 | {% addtoblock "css" %} 15 | {% for media, srcs in editor.Media.css.items %} 16 | {% for src in srcs %} 17 | 18 | {% endfor %} 19 | {% endfor %} 20 | {% endaddtoblock %} 21 | 22 |

    {% trans "Congratulations!" %}

    23 |

    24 | {% trans "You have django-wiki installed... but there are no articles. So it's time to create the first one, the root article." %} 25 | {% trans "In the beginning, it will only be editable by administrators, but you can define permissions after." %} 26 |

    27 | 28 | 29 | 30 |
    31 | {% wiki_form form %} 32 |
    33 |
    34 |
    35 | 36 |
    37 |
    38 |
    39 | 40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /wiki/templates/wiki/deleted.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load wiki_tags i18n sekizai_tags %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Article deleted" %}{% endblock %} 6 | 7 | {% block wiki_contents %} 8 | 14 |

    {% trans "Article Deleted" %}

    15 | 16 |

    17 | {% trans "The article you were looking for has been deleted." %} 18 |

    19 | 20 |
    21 | 22 | {% if not article.current_revision.locked or article|can_delete:user %} 23 |
    24 |
    25 |

    {% trans "Restore" %}

    26 |

    {% trans "You may restore this article and its children by clicking restore." %}

    27 |

    28 | 29 | 30 | {% trans "Restore" %} 31 | 32 |

    33 |
    34 |
    35 | {% endif %} 36 | 37 | {% if article|can_moderate:user %} 38 |
    39 |
    40 |

    {% trans "Purge deletion" %}

    41 |

    {% trans "You may remove this article and any children permanently and free their slugs by clicking the below button. This action cannot be undone." %}

    42 |
    43 | {% csrf_token %} 44 | {% wiki_form purge_form %} 45 | 49 |
    50 |
    51 |
    52 | {% endif %} 53 | 54 |
    55 | 56 | {% endblock %} 57 | -------------------------------------------------------------------------------- /wiki/templates/wiki/error.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load wiki_tags i18n %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% if article %}{{ article.current_revision.title }}{% else %}{% trans "Error" %}{% endif %}{% endblock %} 6 | 7 | {% block wiki_breadcrumbs %} 8 | {% include "wiki/includes/breadcrumbs.html" %} 9 | {% endblock %} 10 | 11 | {% block wiki_contents %} 12 | 13 | {% if error_type == "ancestors_missing" %} 14 | 15 |

    {% trans "Not found" %}

    16 | 17 |
    18 |

    {% trans "This article was not found, and neither was its parent article." %}

    19 |

    20 | {% trans "Start page" %} 21 |

    22 |
    23 | 24 | {% else %} 25 | 26 |

    {% trans "Error" %}

    27 | 28 |
    29 | {% if not error_msg %} 30 |

    {% trans "There was some sort of error accessing this page. Sorry!" %}

    31 | {% else %} 32 |

    {{ error_msg }}

    33 | {% endif %} 34 |
    35 | 36 | {% if article %} 37 |

    38 | {% trans "Back to" %} {{ article.current_revision.title }} 39 |

    40 | {% endif %} 41 | 42 | 43 | {% endif %} 44 | 45 | {% endblock %} 46 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/anonymous_blocked.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load url from future %} 3 | 4 | {% url 'wiki:signup' as signup_url %} 5 | {% url 'wiki:login' as login_url %} 6 | {% if login_url and signup_url %} 7 | {% blocktrans %} 8 | You need to log in or sign up to use this function. 9 | {% endblocktrans %} 10 | {% else %} 11 | {% trans "You need to log in or sign up to use this function." %} 12 | {% endif %} 13 | 14 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/article_menu.html: -------------------------------------------------------------------------------- 1 | {% load i18n wiki_tags %}{% load url from future %} 2 | 3 | {% with selected_tab as selected %} 4 | 5 |
  • 6 | 7 | 8 | 9 | 10 |
  • 11 | 12 | {% if article|can_write:user and not article.current_revision.locked %} 13 |
  • 14 | 15 | 16 | 17 | 18 |
  • 19 | {% else %} 20 |
  • 21 | 22 | 23 | 24 | 25 |
  • 26 | {% endif %} 27 | 28 | {% if urlpath.language != "_" %} 29 |
  • 30 | 31 | 32 | 33 | 34 |
  • 35 | {% endif %} 36 | 37 |
  • 38 | 39 | 40 | 41 | 42 |
  • 43 | 44 | {% endwith %} 45 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/create_button.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% load url from future %} 2 |
    3 | 10 |
    11 |
    12 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/editor.html: -------------------------------------------------------------------------------- 1 | {% load wiki_tags i18n sekizai_tags %} 2 | {% include "wiki/includes/editormedia.html" %} 3 | 4 | {% wiki_form form %} 5 | {% addtoblock "js" %} 6 | 11 | {% endaddtoblock %} 12 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/editor_sidebar.html: -------------------------------------------------------------------------------- 1 | {% load i18n sekizai_tags %} 2 | {% addtoblock "js" %} 3 | 13 | {% endaddtoblock %} 14 | 15 |
    16 | 17 | {% for plugin, plugin_form in sidebar %} 18 | 19 |
    20 | 21 | 26 | 27 |
    28 |
    29 | {% if plugin.sidebar.template %} 30 | {% with plugin_form as form and plugin as plugin %} 31 | 35 | {% endwith %} 36 | {% endif %} 37 |
    38 |
    39 | 40 |
    41 | {% endfor %} 42 |
    43 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/editormedia.html: -------------------------------------------------------------------------------- 1 | {% load sekizai_tags %} 2 | {% addtoblock "js" %} 3 | 4 | {% for js in editor.Media.js %} 5 | 6 | {% endfor %} 7 | {% endaddtoblock %} 8 | 9 | {% addtoblock "css" %} 10 | {% for media, srcs in editor.Media.css.items %} 11 | {% for src in srcs %} 12 | 13 | {% endfor %} 14 | {% endfor %} 15 | {% endaddtoblock %} 16 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/form.html: -------------------------------------------------------------------------------- 1 | {% csrf_token %}{% load sekizai_tags %} 2 | 3 | {% include "wiki/includes/formerrors.html" %} 4 | 5 | {% addtoblock "js" %} 6 | {{ form.media.js }} 7 | {% endaddtoblock %} 8 | 9 | {% addtoblock "css" %} 10 | {{ form.media.css }} 11 | {% endaddtoblock %} 12 | 13 | {% for field in form %} 14 | 15 | {% include "wiki/includes/formfield.html" %} 16 | 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/formerrors.html: -------------------------------------------------------------------------------- 1 | {% if form.non_field_errors %} 2 | {% if form_error_title %}

    {{ form_error_title }}

    {% endif %} 3 | {% for error_message in form.non_field_errors %} 4 |
    5 | {{ error_message }} 6 |
    7 | {% endfor %} 8 | {% endif %} 9 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/formfield.html: -------------------------------------------------------------------------------- 1 | {% if field.is_hidden %} 2 | {{ field }} 3 | {% else %} 4 | 5 |
    6 |
    7 | {% if field.label %} 8 | 11 | {% endif %} 12 |
    13 |
    14 | {{ field }} {% if field.field.required %}*{% endif %} 15 | {% if field.errors %} 16 | {% for error in field.errors %} 17 |
    {{ error }}
    18 | {% endfor %} 19 | {% endif %} 20 | {% if field.help_text %} 21 |

    {{ field.help_text|safe }}

    22 | {% endif %} 23 |
    24 |
    25 | {% endif %} 26 | 27 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/modals.html: -------------------------------------------------------------------------------- 1 | {% load sekizai_tags %} 2 | {% addtoblock "js" %} 3 | 4 | 28 | {% endaddtoblock %} 29 | {% addtoblock "css" %} 30 | 31 | {% endaddtoblock %} 32 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/pagination.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% if is_paginated %} 3 |
      4 | {% for pc in paginator.page_range %} 5 |
    • {{ pc }}
    • 6 | {% endfor %} 7 |
    8 | {% endif %} 9 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/render.html: -------------------------------------------------------------------------------- 1 | {% load wiki_tags i18n cache sekizai_tags %} 2 | 3 | {% addtoblock "js" %} 4 | 5 | {% endaddtoblock %} 6 | 7 |
    8 | {% if not preview %} 9 | {% if article.current_revision %} 10 | {{ article.get_cached_content }} 11 | {% endif %} 12 | {% else %} 13 | {{ content|default:"" }} 14 | {% endif %} 15 |
    16 | 17 | {% for plugin in plugins %} 18 | {% if plugin.RenderMedia.css %} 19 | {% addtoblock "css" %} 20 | {% for media, url in plugin.RenderMedia.css.items %} 21 | 22 | {% endfor %} 23 | {% endaddtoblock %} 24 | {% endif %} 25 | {% if plugin.RenderMedia.js %} 26 | {% addtoblock "js" %} 27 | {% for url in plugin.RenderMedia.js %} 28 | 29 | {% endfor %} 30 | {% endaddtoblock %} 31 | {% endif %} 32 | {% endfor %} 33 | 34 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/revision_info.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | 3 | This reusable code is shared between different templates and different inheritors of 4 | BaseRevision. 5 | 6 | {% endcomment %} 7 | 8 | 9 | {% load wiki_tags i18n %} 10 | {% if not hidedate %}{{ revision.created }}{% endif %} {#% if not hidenumber %#}{#{ revision.revision_number }#} {#% trans "by" %#}{#% endif %#} 11 | 12 | {% if revision.user %} 13 | {{ revision.user }} 14 | {% else %} 15 | {{ revision.ip_address|default:_("anonymous") }} 16 | {% endif %} 17 | 18 | {% if revision == current_revision %} 19 | * 20 | {% endif %} 21 | 22 | {% if revision.user_message %} 23 | ({{ revision.user_message}}) 24 | {% elif revision.automatic_log %} 25 | ({{ revision.automatic_log }}) 26 | {% endif %} 27 | 28 | {% if revision.deleted %} 29 | {% trans "deleted" %} 30 | {% endif %} 31 | {% if revision.previous_revision.deleted and not revision.deleted %} 32 | {% trans "restored" %} 33 | {% endif %} 34 | {% if revision.locked %} 35 | {% trans "locked" %} 36 | {% endif %} 37 | {% if revision.previous_revision.locked and not revision.locked %} 38 | {% trans "unlocked" %} 39 | {% endif %} 40 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/searchresult.html: -------------------------------------------------------------------------------- 1 | {% load wiki_tags i18n humanize %} 2 | {% load url from future %} 3 | 4 | 5 | 6 | {% for urlpath in article.urlpath_set.all %} 7 | {{ article.current_revision.title }} 8 | 9 | {{ urlpath.language|get_displayname }} 10 | 11 | 12 |
    13 | {% empty %} 14 | {{ article.current_revision.title }} 15 | {% endfor %} 16 | {% if article.current_revision.deleted %} 17 | 18 | {% endif %} 19 | {% if article.current_revision.locked %} 20 | 21 | {% endif %} 22 |

    {{ article.current_revision.content|get_content_snippet:search_query }}

    23 | 24 | 25 | {{ article.current_revision.created|naturaltime }} 26 | 27 | 28 | -------------------------------------------------------------------------------- /wiki/templates/wiki/includes/user_revision_info.html: -------------------------------------------------------------------------------- 1 | {% load wiki_tags i18n %} 2 | {% load url from future %} 3 | 4 | 5 | {{ revision.modified}} 6 | 7 | 8 | 9 | {{ revision.title }} 10 | 11 | 12 | 13 | {% if revision.user_message %} 14 | ({{ revision.user_message}}) 15 | {% elif revision.automatic_log %} 16 | ({{ revision.automatic_log }}) 17 | {% endif %} 18 | 19 | {% if revision|get_language_from_rev != "_" %} 20 | 21 | {% else %} 22 | 23 | {% endif %} 24 | 25 | {{ revision|get_language_displayname_from_rev }} 26 | 27 | 28 | -------------------------------------------------------------------------------- /wiki/templates/wiki/permission_denied.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/base.html" %} 2 | {% load wiki_tags i18n %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}Permission Denied{% endblock %} 6 | 7 | {% block wiki_contents %} 8 |

    {% trans "Permission Denied" %}

    9 |

    10 | 11 | {% trans "Sorry, you don't have permission to access this page." %} 12 |

    13 | {% if article.current_revision.locked %} 14 |

    15 | 16 | {% trans "This article is locked for editing." %} 17 |

    18 | {% endif %} 19 | 20 |

    21 | 22 | {% trans "Back to article" %} 23 | 24 |

    25 | 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /wiki/templates/wiki/root_missing.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/create_root.html" %} 2 | {% load i18n wiki_tags %} 3 | 4 | {% block wiki_contents %} 5 | 6 |
    7 |
    8 |
    9 | 10 |

    {% trans "Congratulations!" %}

    11 |

    12 | {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %} 13 |

    14 | 15 | {% if not user.is_superuser %} 16 |

    17 | {% trans "Not to worry! You simply have to login with a superuser account and create the first article in the root of the URL hierarchy." %} 18 |

    19 | {% login_url as wiki_login_url %} 20 | {% if wiki_login_url %} 21 | {% trans "Click here to login" %} 22 | {% endif %} 23 | 24 | {% else %} 25 | 26 |

    27 | {% trans "But since you're logged in as a superuser, we should really get started..." %} 28 |

    29 | {% trans "Yes, I'll go and create the first article" %} 30 | {% trans "No thanks, I'd rather read the documentation" %} 31 | 32 | {% endif %} 33 |
    34 |
    35 |
    36 | 37 | {% endblock %} 38 | -------------------------------------------------------------------------------- /wiki/templates/wiki/settings.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/article.html" %} 2 | {% load wiki_tags i18n %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Settings" %}: {{ article.current_revision.title }}{% endblock %} 6 | 7 | {% block wiki_contents_tab %} 8 | 9 | {% for form in forms %} 10 |
    11 | 12 | {% wiki_form form %} 13 |
    14 |
    15 |
    16 | 20 |
    21 |
    22 |
    23 | {% endfor %} 24 | 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /wiki/templates/wiki/source.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/article.html" %} 2 | {% load wiki_tags i18n humanize %} 3 | {% load url from future %} 4 | 5 | {% block wiki_pagetitle %}{% trans "Source of" %} {{ article.current_revision.title }}{% endblock %} 6 | 7 | {% block wiki_contents_tab %} 8 | 9 | {% if article.current_revision.locked %} 10 |

    {% trans "This article is currently locked for editing." %}

    11 | {% endif %} 12 | 13 |
    14 |   {{ article.current_revision.content }}
    15 | 
    16 | 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /wiki/templates/wiki/view.html: -------------------------------------------------------------------------------- 1 | {% extends "wiki/article.html" %} 2 | {% load wiki_tags i18n sekizai_tags %} 3 | 4 | 5 | {% block wiki_contents_tab %} 6 | 7 | {% wiki_render article %} 8 | 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /wiki/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/templatetags/__init__.py -------------------------------------------------------------------------------- /wiki/views/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wiki/views/__init__.py -------------------------------------------------------------------------------- /wiki/views/category.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Handle category page 4 | """ 5 | 6 | from __future__ import unicode_literals 7 | from __future__ import absolute_import 8 | from django.http import HttpResponse 9 | from django.utils.translation import ugettext as _ 10 | from django.views.generic.list import ListView 11 | 12 | from wiki import models 13 | 14 | class CategoryPage(ListView): 15 | template_name="wiki/category_page.html" 16 | allow_empty = True 17 | context_object_name = 'urlpaths' 18 | paginate_by = 20 19 | 20 | def get_queryset(self): 21 | self.category = self.kwargs["category"].strip("/") 22 | self.category = "_" if self.category == "text_article" else self.category 23 | return models.URLPath.objects.filter(language=self.category).order_by('slug') 24 | 25 | def get_context_data(self, **kwargs): 26 | context = super(CategoryPage, self).get_context_data(**kwargs) 27 | context['category'] = self.category 28 | return context 29 | 30 | def dispatch(self, request, category, *args, **kwargs): 31 | return super(CategoryPage, self).dispatch(request, category, *args, **kwargs) 32 | -------------------------------------------------------------------------------- /wiki/views/mixins.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | from __future__ import absolute_import 3 | from django.views.generic.base import TemplateResponseMixin 4 | 5 | from wiki.core.plugins import registry 6 | from wiki.conf import settings 7 | 8 | class ArticleMixin(TemplateResponseMixin): 9 | """A mixin that receives an article object as a parameter (usually from a wiki 10 | decorator) and puts this information as an instance attribute and in the 11 | template context.""" 12 | 13 | def dispatch(self, request, article, *args, **kwargs): 14 | self.urlpath = kwargs.pop('urlpath', None) 15 | self.article = article 16 | self.children_slice = [] 17 | if settings.SHOW_MAX_CHILDREN > 0: 18 | try: 19 | for child in self.article.get_children(max_num=settings.SHOW_MAX_CHILDREN+1, 20 | articles__article__current_revision__deleted=False, 21 | user_can_read=request.user): 22 | self.children_slice.append(child) 23 | except AttributeError as e: 24 | raise Exception("Attribute error most likely caused by wrong MPTT version. Use 0.5.3+.\n\n" + str(e)) 25 | return super(ArticleMixin, self).dispatch(request, *args, **kwargs) 26 | 27 | def get_context_data(self, **kwargs): 28 | kwargs['urlpath'] = self.urlpath 29 | kwargs['article'] = self.article 30 | kwargs['article_tabs'] = registry.get_article_tabs() 31 | kwargs['children_slice'] = self.children_slice[:20] 32 | kwargs['children_slice_more'] = len(self.children_slice) > 20 33 | kwargs['plugins'] = registry.get_plugins() 34 | 35 | return kwargs 36 | -------------------------------------------------------------------------------- /wiki/views/recent.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Handle recent revisions page 4 | """ 5 | 6 | from __future__ import unicode_literals 7 | from __future__ import absolute_import 8 | from django.http import HttpResponse 9 | from django.utils.translation import ugettext as _ 10 | from django.views.generic.list import ListView 11 | 12 | from wiki import models 13 | 14 | class RecentPage(ListView): 15 | template_name="wiki/recent_page.html" 16 | allow_empty = True 17 | context_object_name = 'revisions' 18 | paginate_by = 50 19 | 20 | def get_queryset(self): 21 | return models.ArticleRevision.objects.all().order_by('-created') 22 | 23 | def get_context_data(self, **kwargs): 24 | context = super(RecentPage, self).get_context_data(**kwargs) 25 | return context 26 | 27 | def dispatch(self, request, *args, **kwargs): 28 | return super(RecentPage, self).dispatch(request, *args, **kwargs) 29 | -------------------------------------------------------------------------------- /wiki/views/user.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Handle user contribution page 4 | """ 5 | 6 | from __future__ import unicode_literals 7 | from __future__ import absolute_import 8 | from django.contrib.auth.models import User 9 | from django.utils.translation import ugettext as _ 10 | from django.views.generic.list import ListView 11 | 12 | from wiki import models 13 | 14 | from wiki.core.compat import get_user_model 15 | User = get_user_model() 16 | 17 | import socket 18 | 19 | class UserPage(ListView): 20 | template_name="wiki/user_page.html" 21 | allow_empty = True 22 | context_object_name = 'revisions' 23 | paginate_by = 20 24 | 25 | def get_queryset(self): 26 | username = self.kwargs["username"].strip("/") 27 | try: 28 | socket.inet_aton(username) 29 | # is an ip address 30 | self.ip_address = username 31 | return models.ArticleRevision.objects.all().filter(ip_address=self.ip_address).order_by('-created') 32 | except socket.error: 33 | # probably username 34 | self.userpage_user = User.objects.filter(username__iexact=username)[0] 35 | return models.ArticleRevision.objects.all().filter(user_id=self.userpage_user.pk).order_by('-created') 36 | 37 | def get_context_data(self, **kwargs): 38 | context = super(UserPage, self).get_context_data(**kwargs) 39 | if hasattr(self, 'ip_address'): 40 | context['userpage_user'] = {'username': self.ip_address}, 41 | context['usertype'] = 'ip_address' 42 | else: 43 | context['userpage_user'] = self.userpage_user 44 | context['usertype'] = 'username' 45 | return context 46 | 47 | def dispatch(self, request, username, *args, **kwargs): 48 | return super(UserPage, self).dispatch(request, username, *args, **kwargs) 49 | -------------------------------------------------------------------------------- /wiki/wc_pygments/__init__.py: -------------------------------------------------------------------------------- 1 | from pygments import highlight 2 | from pygments.lexers import get_lexer_by_name, guess_lexer 3 | from pygments.formatters import HtmlFormatter 4 | 5 | def codeformat(code, language): 6 | # well, asm is supported - but I can't stand gas, make sure we get nasm 7 | # nasm rocks 8 | lexers_not_of_same_name = { 9 | 'arm': 'nasm', 10 | 'scpt': 'applescript', 11 | 'cs': 'csharp', 12 | 'fs': 'fsharp', 13 | 'lgt': 'logtalk', 14 | 'mod': 'modula2', 15 | 'm': 'objective-c', 16 | 'n': 'nemerle', 17 | 'j': 'objective-j', 18 | 'mli': 'ocaml', 19 | 'ps': 'postscript', 20 | 'ps1': 'powershell', 21 | 'reb': 'rebol', 22 | 'rs': 'rust', 23 | 'sce': 'scilab', 24 | 'sno' : 'snobol', 25 | 'vb': 'vbnet' 26 | } 27 | 28 | if language in lexers_not_of_same_name: 29 | language = lexers_not_of_same_name[language] 30 | 31 | lexer = get_lexer_by_name(language, stripall=False, stripnl=False, ensurenl=True) 32 | formatter = HtmlFormatter(linenos=True, style='colorful', cssclass="wikicoding-code") 33 | return highlight(code, lexer, formatter) 34 | -------------------------------------------------------------------------------- /wikicoding/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arjun024/wikicoding/7a381caf105434503ad1b734be389b0c60b66018/wikicoding/__init__.py -------------------------------------------------------------------------------- /wikicoding/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | from django.views.generic.base import RedirectView 3 | from django.contrib import admin 4 | admin.autodiscover() 5 | 6 | urlpatterns = patterns('', 7 | # Examples: 8 | # url(r'^$', 'wikicoding.views.home', name='home'), 9 | # url(r'^blog/', include('blog.urls')), 10 | 11 | url(r'^admin/', include(admin.site.urls)), 12 | ) 13 | 14 | ################################################# 15 | # For requests to / and /wiki/ # 16 | # Immediately isssue HTTP 301 Moved Permanently # 17 | # to /wiki/Main_Page # 18 | ################################################# 19 | 20 | urlpatterns += patterns('', 21 | url(r'^$', RedirectView.as_view(url='/wiki/Main_Page/', permanent=True), name='get'), 22 | url(r'^wiki/$', RedirectView.as_view(url='/wiki/Main_Page/', permanent=True), name='get'), 23 | url(r'^wiki/_/(?P[^/]+/)$', 24 | RedirectView.as_view(url='/wiki/%(remainder)s', query_string=True, permanent=True), name='get'), 25 | url(r'^accounts/profile/$', RedirectView.as_view(url='/wiki/Main_Page/', permanent=True), name='get'), 26 | ) 27 | 28 | from wiki.urls import get_pattern as get_wiki_pattern 29 | from django_nyt.urls import get_pattern as get_nyt_pattern 30 | urlpatterns += patterns('', 31 | # (r'^notifications/', get_nyt_pattern()), 32 | (r'', get_wiki_pattern()) 33 | ) 34 | -------------------------------------------------------------------------------- /wikicoding/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for wikicoding project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wikicoding.settings") 12 | 13 | from django.core.wsgi import get_wsgi_application 14 | application = get_wsgi_application() 15 | --------------------------------------------------------------------------------