├── DCRM ├── __init__.py ├── .env └── wsgi.py ├── WEIPDCRM ├── jobs.py ├── __init__.py ├── apis │ ├── __init__.py │ ├── contenttype.py │ ├── release.py │ ├── permission.py │ ├── section.py │ ├── os_version.py │ ├── device_type.py │ ├── group.py │ ├── photo.py │ ├── build.py │ ├── site.py │ ├── user.py │ ├── comment.py │ ├── gallery.py │ └── setting.py ├── forms │ ├── __init__.py │ └── admin │ │ ├── __init__.py │ │ └── upload.py ├── manage │ ├── __init__.py │ └── admin │ │ ├── __init__.py │ │ ├── os_version.py │ │ └── device_type.py ├── models │ └── __init__.py ├── styles │ ├── __init__.py │ └── DefaultStyle │ │ ├── __init__.py │ │ ├── views │ │ ├── __init__.py │ │ ├── chart.py │ │ ├── search.py │ │ └── section_list.py │ │ ├── templatetags │ │ ├── __init__.py │ │ ├── section_list.py │ │ └── global_settings.py │ │ ├── static │ │ ├── img │ │ │ ├── qq.png │ │ │ ├── alipay.png │ │ │ ├── blank.gif │ │ │ ├── cydia.png │ │ │ ├── email.png │ │ │ ├── paypal.png │ │ │ ├── safari.png │ │ │ ├── weibo.png │ │ │ ├── CydiaIcon.png │ │ │ ├── IconsetW.png │ │ │ ├── facebook.png │ │ │ ├── package.png │ │ │ ├── telegram.png │ │ │ ├── twitter.png │ │ │ ├── IconsetW_1x.png │ │ │ ├── IconsetSmiles.png │ │ │ ├── default_avatar.png │ │ │ ├── IconsetSmiles_1x.png │ │ │ ├── emoji_spritesheet_0.png │ │ │ ├── emoji_spritesheet_1.png │ │ │ ├── emoji_spritesheet_2.png │ │ │ ├── emoji_spritesheet_3.png │ │ │ ├── emoji_spritesheet_4.png │ │ │ └── default-package-icon.png │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── js │ │ │ └── main.js │ │ └── css │ │ │ └── content-list.css │ │ ├── locale │ │ ├── ar │ │ │ └── LC_MESSAGES │ │ │ │ └── django.mo │ │ ├── en │ │ │ └── LC_MESSAGES │ │ │ │ └── django.mo │ │ └── zh_Hans │ │ │ └── LC_MESSAGES │ │ │ └── django.mo │ │ └── templates │ │ ├── search.html │ │ ├── grid-list.html │ │ ├── index.html │ │ ├── pagination.html │ │ ├── package │ │ └── history.html │ │ ├── pagination-in-section.html │ │ ├── section-list.html │ │ └── section.html ├── views │ ├── __init__.py │ ├── admin │ │ ├── __init__.py │ │ ├── help │ │ │ ├── __init__.py │ │ │ └── about.py │ │ └── release.py │ └── error.py ├── migrations │ ├── __init__.py │ ├── 0005_auto_20170325_1619.py │ ├── 0030_build_is_finished.py │ ├── 0032_setting_gpg_password.py │ ├── 0017_setting_version_history.py │ ├── 0006_auto_20170325_1620.py │ ├── 0015_auto_20170327_0055.py │ ├── 0021_auto_20170415_1136.py │ ├── 0031_auto_20190725_1447.py │ ├── 0012_auto_20170326_0544.py │ ├── 0010_auto_20170326_0542.py │ ├── 0011_auto_20170326_0543.py │ ├── 0018_auto_20170402_1511.py │ ├── 0029_auto_20190723_1715.py │ ├── 0008_auto_20170326_0344.py │ ├── 0035_auto_20200301_1619.py │ ├── 0003_auto_20170325_1615.py │ ├── 0004_auto_20170325_1616.py │ ├── 0033_package_view.py │ ├── 0002_auto_20170325_1613.py │ ├── 0026_package_view.py │ ├── 0016_auto_20170402_0546.py │ ├── 0036_auto_20200531_0030.py │ ├── 0024_auto_20170814_1706.py │ ├── 0007_auto_20170326_0340.py │ ├── 0009_auto_20170326_0531.py │ ├── 0019_auto_20170407_1814.py │ └── 0022_auto_20170812_2207.py ├── templatetags │ ├── __init__.py │ ├── to_slug.py │ ├── content_type.py │ ├── package_title_style.py │ ├── package_title_script.py │ ├── build_submit_row.py │ └── setting_submit_row.py ├── templates │ ├── admin │ │ ├── section │ │ │ └── change_form.html │ │ ├── build │ │ │ ├── change_form.html │ │ │ ├── change_action.html │ │ │ └── change_list.html │ │ ├── version │ │ │ ├── package_title_script.html │ │ │ ├── package_title_style.html │ │ │ ├── change_list.html │ │ │ └── change_form.html │ │ ├── setting │ │ │ ├── change_action.html │ │ │ └── change_form.html │ │ ├── device_type │ │ │ └── change_form.html │ │ ├── os_version │ │ │ └── change_form.html │ │ ├── release │ │ │ └── change_form.html │ │ ├── new_change_form.html │ │ └── help │ │ │ └── about.html │ └── error │ │ ├── 404.html │ │ ├── 400.html │ │ ├── 500.html │ │ └── base.html ├── static │ └── img │ │ └── CydiaIcon.png ├── locale │ ├── ar │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── en │ │ └── LC_MESSAGES │ │ │ └── django.mo │ └── zh_Hans │ │ └── LC_MESSAGES │ │ └── django.mo ├── tests.py ├── permissions.py ├── tools.py └── context_processors.py ├── test └── __init__.py ├── suit ├── tests │ ├── __init__.py │ ├── urls.py │ ├── test_routes.py │ ├── test_menu.py │ └── settings.py ├── templatetags │ ├── __init__.py │ ├── suit_tags.py │ └── suit_menu.py ├── __init__.py ├── static │ ├── admin │ │ └── css │ │ │ ├── dashboard.css │ │ │ ├── forms.css │ │ │ ├── login.css │ │ │ └── changelists.css │ └── suit │ │ └── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── roboto-v15-latin-100.woff │ │ ├── roboto-v15-latin-300.woff │ │ ├── roboto-v15-latin-500.woff │ │ ├── roboto-v15-latin-700.woff │ │ ├── roboto-v15-latin-900.woff │ │ ├── roboto-v15-latin-100.woff2 │ │ ├── roboto-v15-latin-300.woff2 │ │ ├── roboto-v15-latin-500.woff2 │ │ ├── roboto-v15-latin-700.woff2 │ │ ├── roboto-v15-latin-900.woff2 │ │ ├── roboto-v15-latin-regular.woff │ │ └── roboto-v15-latin-regular.woff2 ├── templates │ ├── admin │ │ ├── base_site.html │ │ ├── auth │ │ │ └── user │ │ │ │ ├── add_form.html │ │ │ │ └── change_password.html │ │ ├── filter_horizontal.html │ │ ├── change_list.html │ │ └── change_list_results.html │ └── suit │ │ ├── change_form_includes.html │ │ ├── menu_item.html │ │ ├── menu.html │ │ └── search_form.html ├── sass │ ├── components │ │ ├── _cards.scss │ │ ├── _icons.scss │ │ ├── _alerts.scss │ │ ├── _buttons.scss │ │ ├── _tables.scss │ │ ├── _tabs.scss │ │ ├── _confirmations.scss │ │ ├── _breadcrumbs.scss │ │ └── _sortables.scss │ ├── _mixins.scss │ ├── suit.scss │ ├── layout │ │ ├── _vertical.scss │ │ ├── _content.scss │ │ └── _footer.scss │ └── pages │ │ └── _changeform.scss ├── compat.py ├── admin_filters.py ├── template.py └── config.py ├── docker ├── nginx │ └── certs │ │ └── .gitkeep ├── pure-ftpd │ ├── passwd │ │ └── .gitkeep │ └── ssl │ │ └── .gitkeep ├── mysql │ └── conf.d │ │ ├── mysql.cnf │ │ ├── docker.cnf │ │ ├── mysqldump.cnf │ │ └── default.cnf └── DCRM │ └── .env ├── suit_redactor ├── __init__.py ├── models.py ├── static │ └── suit-redactor │ │ └── redactor │ │ ├── ensure.jquery.js │ │ └── style.css └── widgets.py ├── preferences ├── tests │ ├── __init__.py │ ├── settings │ │ ├── __init__.py │ │ ├── 19.py │ │ └── 110.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0001_initial.py │ ├── requirements │ │ ├── 110.txt │ │ └── 19.txt │ ├── models.py │ ├── admin.py │ ├── urls.py │ └── manage.py ├── migrations │ ├── __init__.py │ ├── 0002_auto_20170110_0843.py │ └── 0001_initial.py ├── __init__.py ├── context_processors.py ├── admin.py └── managers.py ├── fluent_comments ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── templatetags │ ├── __init__.py │ └── gravatar.py ├── south_migrations │ └── __init__.py ├── locale │ ├── ar │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── cs │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── en │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── nl │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── sk │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── zh │ │ └── LC_MESSAGES │ │ │ └── django.mo │ └── zh_Hans │ │ └── LC_MESSAGES │ │ └── django.mo ├── static │ └── fluent_comments │ │ └── img │ │ └── ajax-wait.gif ├── forms │ ├── default.py │ └── __init__.py ├── templates │ ├── comments │ │ ├── list.html │ │ ├── deleted.html │ │ ├── flagged.html │ │ ├── comment_notification_email.txt │ │ ├── posted.html │ │ ├── preview.html │ │ └── form.html │ └── fluent_comments │ │ └── templatetags │ │ ├── flat_list.html │ │ ├── ajax_comment_tags.html │ │ └── threaded_list.html ├── urls.py ├── __init__.py └── utils.py ├── docs ├── logo.png ├── DCRM_Logo.sketch ├── How to Host a Cydia™ Repository - Jay Freeman (saurik).pdf └── Bringing Debian APT to the iPhone - Jay Freeman (saurik).pdf ├── .vscode └── settings.json ├── .gnupg └── .gitkeep ├── locale ├── ar │ └── LC_MESSAGES │ │ └── django.mo ├── en │ └── LC_MESSAGES │ │ └── django.mo └── zh_hans │ └── LC_MESSAGES │ └── django.mo ├── static └── .gitkeep ├── temp └── .gitkeep ├── upload └── .gitkeep ├── resources └── .gitkeep ├── .idea ├── vcs.xml ├── sqldialects.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml ├── misc.xml ├── runConfigurations │ ├── DCRM_Docker.xml │ └── DCRM.xml ├── dataSources.xml └── DCRM.iml ├── Dockerfile ├── uwsgi.ini ├── manage.py ├── uwsgi-run.sh └── requirements.txt /DCRM/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/jobs.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /suit/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/forms/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/manage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/models/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/nginx/certs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /suit_redactor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/forms/admin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/manage/admin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/views/admin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/pure-ftpd/passwd/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/pure-ftpd/ssl/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /preferences/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /suit/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/views/admin/help/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fluent_comments/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /preferences/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /preferences/tests/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/mysql/conf.d/mysql.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | -------------------------------------------------------------------------------- /fluent_comments/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /preferences/tests/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fluent_comments/south_migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /preferences/tests/requirements/110.txt: -------------------------------------------------------------------------------- 1 | django==1.11.28 2 | -------------------------------------------------------------------------------- /preferences/tests/requirements/19.txt: -------------------------------------------------------------------------------- 1 | django==1.11.28 2 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/docs/logo.png -------------------------------------------------------------------------------- /docker/mysql/conf.d/docker.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | skip-host-cache 3 | skip-name-resolve 4 | -------------------------------------------------------------------------------- /suit_redactor/models.py: -------------------------------------------------------------------------------- 1 | # Just an empty models.py file, so that we can run tests 2 | -------------------------------------------------------------------------------- /docs/DCRM_Logo.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/docs/DCRM_Logo.sketch -------------------------------------------------------------------------------- /suit/__init__.py: -------------------------------------------------------------------------------- 1 | VERSION = '2.0a1' 2 | default_app_config = 'suit.apps.DjangoSuitConfig' 3 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/section/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/Users/Darwin/Projects/DCRM/venv/bin/python3.7" 3 | } -------------------------------------------------------------------------------- /.gnupg/.gitkeep: -------------------------------------------------------------------------------- 1 | This is an empty directory if you use Docker. 2 | All files will be stored in Docker volumes. 3 | -------------------------------------------------------------------------------- /WEIPDCRM/static/img/CydiaIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/static/img/CydiaIcon.png -------------------------------------------------------------------------------- /docker/mysql/conf.d/mysqldump.cnf: -------------------------------------------------------------------------------- 1 | [mysqldump] 2 | quick 3 | quote-names 4 | max_allowed_packet = 16M 5 | -------------------------------------------------------------------------------- /locale/ar/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/locale/ar/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- 1 | This is an empty directory if you use Docker. 2 | All files will be stored in Docker volumes. 3 | -------------------------------------------------------------------------------- /suit/static/admin/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* Overridden by Django Suit empty stylesheet to reset original style. */ 2 | -------------------------------------------------------------------------------- /suit/static/admin/css/forms.css: -------------------------------------------------------------------------------- 1 | /* Overridden by Django Suit empty stylesheet to reset original style. */ 2 | -------------------------------------------------------------------------------- /suit/static/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* Overridden by Django Suit empty stylesheet to reset original style. */ 2 | -------------------------------------------------------------------------------- /temp/.gitkeep: -------------------------------------------------------------------------------- 1 | This is an empty directory if you use Docker. 2 | All files will be stored in Docker volumes. 3 | -------------------------------------------------------------------------------- /upload/.gitkeep: -------------------------------------------------------------------------------- 1 | This is an empty directory if you use Docker. 2 | All files will be stored in Docker volumes. 3 | -------------------------------------------------------------------------------- /resources/.gitkeep: -------------------------------------------------------------------------------- 1 | This is an empty directory if you use Docker. 2 | All files will be stored in Docker volumes. 3 | -------------------------------------------------------------------------------- /suit/static/admin/css/changelists.css: -------------------------------------------------------------------------------- 1 | /* Overridden by Django Suit empty stylesheet to reset original style. */ 2 | -------------------------------------------------------------------------------- /locale/zh_hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/locale/zh_hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /suit/static/suit/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /WEIPDCRM/locale/ar/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/locale/ar/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /WEIPDCRM/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /WEIPDCRM/locale/zh_Hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/locale/zh_Hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /suit/templates/admin/base_site.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/base.html' %} 2 | {# Workaround to avoid circular template extends errors #} 3 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/qq.png -------------------------------------------------------------------------------- /fluent_comments/locale/ar/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/ar/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /fluent_comments/locale/cs/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/cs/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /fluent_comments/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /fluent_comments/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /fluent_comments/locale/sk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/sk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /fluent_comments/locale/zh/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/zh/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /suit/static/suit/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /suit/static/suit/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /suit/static/suit/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-100.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-100.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-300.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-500.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-700.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-900.woff -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/alipay.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/blank.gif -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/cydia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/cydia.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/email.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/paypal.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/safari.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/weibo.png -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-100.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-100.woff2 -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-300.woff2 -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-500.woff2 -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-700.woff2 -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-900.woff2 -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/CydiaIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/CydiaIcon.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/IconsetW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/IconsetW.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/facebook.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/package.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/telegram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/telegram.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/twitter.png -------------------------------------------------------------------------------- /fluent_comments/locale/zh_Hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/locale/zh_Hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-regular.woff -------------------------------------------------------------------------------- /suit/static/suit/fonts/roboto-v15-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/suit/static/suit/fonts/roboto-v15-latin-regular.woff2 -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/IconsetW_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/IconsetW_1x.png -------------------------------------------------------------------------------- /docker/mysql/conf.d/default.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character-set-server = utf8 3 | collation-server = utf8_unicode_ci 4 | skip-character-set-client-handshake 5 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/IconsetSmiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/IconsetSmiles.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/default_avatar.png -------------------------------------------------------------------------------- /fluent_comments/static/fluent_comments/img/ajax-wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/fluent_comments/static/fluent_comments/img/ajax-wait.gif -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/locale/ar/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/locale/ar/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/IconsetSmiles_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/IconsetSmiles_1x.png -------------------------------------------------------------------------------- /suit/sass/components/_cards.scss: -------------------------------------------------------------------------------- 1 | .card { 2 | @include suit-box-shadow(); 3 | border: none; 4 | .card-header { 5 | color: $card-cap-color; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_0.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_1.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_2.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_3.png -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/emoji_spritesheet_4.png -------------------------------------------------------------------------------- /docs/How to Host a Cydia™ Repository - Jay Freeman (saurik).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/docs/How to Host a Cydia™ Repository - Jay Freeman (saurik).pdf -------------------------------------------------------------------------------- /suit/compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3. 3 | from urllib.parse import parse_qs 4 | except ImportError: 5 | # Python 2.6+ 6 | from urlparse import parse_qs 7 | -------------------------------------------------------------------------------- /suit_redactor/static/suit-redactor/redactor/ensure.jquery.js: -------------------------------------------------------------------------------- 1 | if (!window.jQuery && django && django.jQuery) { 2 | window.jQuery = window.$ = django.jQuery; 3 | } 4 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/locale/zh_Hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/locale/zh_Hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/img/default-package-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/img/default-package-icon.png -------------------------------------------------------------------------------- /docs/Bringing Debian APT to the iPhone - Jay Freeman (saurik).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/docs/Bringing Debian APT to the iPhone - Jay Freeman (saurik).pdf -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/82Flex/DCRM/HEAD/WEIPDCRM/styles/DefaultStyle/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /suit/tests/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | from django.contrib import admin 3 | 4 | urlpatterns = [ 5 | url(r'^admin/', include(admin.site.urls)), 6 | ] 7 | -------------------------------------------------------------------------------- /preferences/tests/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from preferences.models import Preferences 3 | 4 | 5 | class MyPreferences(Preferences): 6 | portal_contact_email = models.EmailField() 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY requirements.txt ./ 6 | RUN pip install --no-cache-dir -r requirements.txt 7 | 8 | COPY . . 9 | CMD ["./uwsgi-run.sh"] 10 | 11 | -------------------------------------------------------------------------------- /.idea/sqldialects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/build/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | 3 | {% load build_submit_row i18n admin_urls %} 4 | 5 | {% block submit_buttons_bottom %} 6 | {% submit_row %} 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/version/package_title_script.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% if filtered_by_package %} 3 | {% blocktrans %} 4 |

Package: {{ filtered_by_package }}

5 | {% endblocktrans %} 6 | {% endif %} 7 | -------------------------------------------------------------------------------- /preferences/tests/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from preferences.admin import PreferencesAdmin 4 | from preferences.tests.models import MyPreferences 5 | 6 | admin.site.register(MyPreferences, PreferencesAdmin) 7 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/version/package_title_style.html: -------------------------------------------------------------------------------- 1 | {% if filtered_by_package %} 2 | 7 | {% endif %} 8 | -------------------------------------------------------------------------------- /preferences/__init__.py: -------------------------------------------------------------------------------- 1 | class Preferences(object): 2 | """ 3 | Placeholder class to which preferences properties are added 4 | dynamically through a signal. See models.py 5 | """ 6 | pass 7 | 8 | preferences = Preferences() 9 | -------------------------------------------------------------------------------- /preferences/tests/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include 2 | from django.contrib import admin 3 | 4 | admin.autodiscover() 5 | 6 | urlpatterns = patterns( 7 | '', 8 | (r'^admin/', include(admin.site.urls)), 9 | ) 10 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/error/404.html: -------------------------------------------------------------------------------- 1 | {% extends "error/base.html" %} 2 | {% load i18n %} 3 | {% block errortitle %}404 {% trans 'Not Found' %}{% endblock %} 4 | {% block errorcode %}404{% endblock %} 5 | {% block errortext %}{% trans 'Not Found' %}{% endblock %} 6 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/error/400.html: -------------------------------------------------------------------------------- 1 | {% extends "error/base.html" %} 2 | {% load i18n %} 3 | {% block errortitle %}400 {% trans 'Bad Request' %}{% endblock %} 4 | {% block errorcode %}400{% endblock %} 5 | {% block errortext %}{% trans 'Bad Request' %}{% endblock %} 6 | -------------------------------------------------------------------------------- /uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | 3 | chdir = /usr/src/app 4 | module = DCRM.wsgi 5 | 6 | master = true 7 | processes = 4 8 | enable-threads = true 9 | threads = 2 10 | thunder-lock = true 11 | socket = :8001 12 | vaccum = true 13 | uid = root 14 | gid = root 15 | 16 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/setting/change_action.html: -------------------------------------------------------------------------------- 1 | {% load i18n admin_urls %} 2 | 3 |
4 | {% if show_save %} 5 | 6 | {% endif %} 7 |
8 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/error/500.html: -------------------------------------------------------------------------------- 1 | {% extends "error/base.html" %} 2 | {% load i18n %} 3 | {% block errortitle %}500 {% trans 'Internal Server Error' %}{% endblock %} 4 | {% block errorcode %}500{% endblock %} 5 | {% block errortext %}{% trans 'Internal Server Error' %}{% endblock %} 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /preferences/context_processors.py: -------------------------------------------------------------------------------- 1 | from preferences import preferences 2 | 3 | 4 | def preferences_cp(request): 5 | """ 6 | Adds preferences to template context when used 7 | through TEMPLATE_CONTEXT_PROCESSORS setting. 8 | """ 9 | return {'preferences': preferences} 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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", "DCRM.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /fluent_comments/forms/default.py: -------------------------------------------------------------------------------- 1 | from fluent_comments.forms.base import AbstractCommentForm, CommentFormHelper 2 | 3 | 4 | class DefaultCommentForm(AbstractCommentForm): 5 | """ 6 | A simple contact form, backed by a model to save all data (in case email fails). 7 | """ 8 | helper = CommentFormHelper() 9 | -------------------------------------------------------------------------------- /preferences/tests/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", "project.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /suit/tests/test_routes.py: -------------------------------------------------------------------------------- 1 | from datetime import timedelta 2 | 3 | from django.core.urlresolvers import reverse 4 | from django.test import TestCase 5 | 6 | class RoutesTestCase(TestCase): 7 | def test_login(self): 8 | response = self.client.get(reverse('admin:login')) 9 | self.assertContains(response, 'Log in') 10 | -------------------------------------------------------------------------------- /docker/DCRM/.env: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # THIS DOTENV FILE IS ONLY USED IN DOCKER COMPOSE 3 | 4 | # DATABASE 5 | DCRM_MYSQL_NAME=DCRM 6 | DCRM_MYSQL_USER=dcrm 7 | DCRM_MYSQL_PASSWORD=dcrm_user_password 8 | DCRM_MYSQL_HOST=dcrm-db 9 | 10 | # REDIS 11 | DCRM_REDIS_HOST=dcrm-redis 12 | 13 | # MEMCACHED 14 | DCRM_MEMCACHED_HOST=dcrm-memcached 15 | 16 | -------------------------------------------------------------------------------- /suit/templates/suit/change_form_includes.html: -------------------------------------------------------------------------------- 1 | {% for template, tab_position, tab in adminform.model_admin.suit_form_includes %} 2 | {% if position == tab_position or position == 'bottom' and not tab_position %} 3 |
{% include template %}
4 | {% endif %} 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /suit/tests/test_menu.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from suit.menu import ParentItem 3 | 4 | 5 | class TestMenuTestCase(TestCase): 6 | def setUp(self): 7 | pass 8 | 9 | def test_method(self): 10 | """ 11 | Just a dummy test case to satisfy Travis until all the tests are finished 12 | """ 13 | self.assertEqual(ParentItem(app='abc')._key(), 'abc') 14 | -------------------------------------------------------------------------------- /suit/templates/admin/auth/user/add_form.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_form.html" %} 2 | {% load i18n %} 3 | 4 | {% block form_top %} 5 | {{ block.super }} 6 | 7 | {% if not is_popup %} 8 |

{% trans "First, enter a username and password. Then, you'll be able to edit more user options." %}

9 | {% else %} 10 |

{% trans "Enter a username and password." %}

11 | {% endif %} 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations/DCRM_Docker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/device_type/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | {% load i18n admin_urls %} 3 | 4 | {% block object-tools %} 5 | {{ block.super }} 6 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/os_version/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | {% load i18n admin_urls %} 3 | 4 | {% block object-tools %} 5 | {{ block.super }} 6 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/dcrm 9 | 10 | 11 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/list.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | 3 | Since we support both flat comments, and threadedcomments, 4 | the 'fluent_comments_list' templatetag loads the proper template. 5 | 6 | It either loads: 7 | - fluent_comments/templatetags/flat_html.html 8 | - fluent_comments/templatetags/threaded_list.html 9 | 10 | Both reuse comments/comment.html eventually. 11 | To style comments, consider overwriting the comment.html template. 12 | 13 | {% endcomment %} 14 | {% load fluent_comments_tags %}{% fluent_comments_list %} -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0005_auto_20170325_1619.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-25 15:19 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0004_auto_20170325_1616'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='setting', 17 | old_name='alipay', 18 | new_name='alipay_url', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /fluent_comments/urls.py: -------------------------------------------------------------------------------- 1 | from .compat import urls as base_comments_urls 2 | from . import views 3 | 4 | try: 5 | # Django 1.6 requires this 6 | from django.conf.urls import url, include 7 | except ImportError: 8 | # Django 1.3 compatibility, kept in minor release 9 | from django.conf.urls.defaults import url, include 10 | 11 | 12 | urlpatterns = [ 13 | url(r'^post/ajax/$', views.post_comment_ajax, name='comments-post-comment-ajax'), 14 | url(r'', include(base_comments_urls)), # django_comments.urls or django.contrib.comments.urls 15 | ] 16 | -------------------------------------------------------------------------------- /suit/sass/components/_icons.scss: -------------------------------------------------------------------------------- 1 | @mixin fa-icon-font() { 2 | font-family: FontAwesome; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | text-rendering: auto; 6 | } 7 | $icon-ok: "\f00c"; 8 | $icon-remove: "\f00d"; 9 | $icon-cog: "\f013"; 10 | $icon-home: "\f015"; 11 | $icon-plus: "\f067"; 12 | $icon-plus-circle: "\f055"; 13 | $icon-pencil: "\f040"; 14 | $icon-chevron-up: "\f077"; 15 | $icon-chevron-down: "\f078"; 16 | $icon-search: "\f002"; 17 | $icon-calendar: "\f073"; 18 | $icon-calendar-o: "\f133"; 19 | $icon-time: "\f017"; 20 | -------------------------------------------------------------------------------- /preferences/migrations/0002_auto_20170110_0843.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.2 on 2017-01-10 08:43 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('preferences', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='preferences', 17 | name='sites', 18 | field=models.ManyToManyField(blank=True, to='sites.Site'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /suit/sass/components/_alerts.scss: -------------------------------------------------------------------------------- 1 | .errornote { 2 | @extend .alert; 3 | @extend .alert-danger; 4 | } 5 | .messagelist { 6 | @include reset-list(); 7 | display: block; 8 | margin: 1rem $grid-gutter-width-base 0; 9 | li { 10 | @extend .alert; 11 | &:last-child { 12 | margin-bottom: 0; 13 | } 14 | &.success { 15 | @extend .alert-success; 16 | } 17 | &.info { 18 | @extend .alert-info; 19 | } 20 | &.warning { 21 | @extend .alert-warning; 22 | } 23 | &.danger, &.error { 24 | @extend .alert-danger; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/build/change_action.html: -------------------------------------------------------------------------------- 1 | {% load i18n admin_urls %} 2 | 3 |
4 | {% if show_delete_link %} 5 | {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %} 6 | 9 | {% endif %} 10 | {% if show_save and not change %} 11 | 12 | {% endif %} 13 |
14 | -------------------------------------------------------------------------------- /fluent_comments/templates/fluent_comments/templatetags/flat_list.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | 3 | The normal list, spiced up. 4 | This is included via comments/list.html 5 | 6 | The id="comments-..." is required for JavaScript, 7 | the 'comments/comment.html template is also used by the Ajax view. 8 | 9 | {% endcomment %} 10 | {% load fluent_comments_tags %} 11 |
12 | {% for comment in comment_list %}{% render_comment comment %}{% endfor %} 13 |
14 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0030_build_is_finished.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.22 on 2019-07-24 10:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0029_auto_20190723_1715'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='build', 17 | name='is_finished', 18 | field=models.BooleanField(default=False, verbose_name='Job Finished'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /fluent_comments/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('django_comments', '__first__'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='FluentComment', 16 | fields=[ 17 | ], 18 | options={ 19 | 'proxy': True, 20 | }, 21 | bases=('django_comments.comment',), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/build/change_list.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_list.html" %} 2 | {% load i18n admin_urls admin_static admin_list %} 3 | {% block object-tools %} 4 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /suit_redactor/static/suit-redactor/redactor/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | 7 | /* =Typography 8 | -----------------------------------------------------------------------------*/ 9 | body { 10 | font-family: Helvetica, Arial, sans-serif; 11 | font-size: 14px; 12 | } 13 | 14 | 15 | /* =Layout 16 | -----------------------------------------------------------------------------*/ 17 | #page { 18 | width: 940px; 19 | margin: 50px auto; 20 | } 21 | 22 | /* =Misc 23 | -----------------------------------------------------------------------------*/ 24 | .list li { 25 | margin: 10px 0; 26 | } 27 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0032_setting_gpg_password.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.22 on 2019-07-25 08:15 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0031_auto_20190725_1447'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='gpg_password', 18 | field=models.CharField(blank=True, default='', max_length=255, verbose_name='GPG Password'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/setting/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | 3 | {% load setting_submit_row i18n admin_urls %} 4 | {% block object-tools-items %} 5 | {% if settings.ENABLE_API %} 6 |
  • 7 | 8 | {% trans "API" %} 9 | 10 |
  • 11 | {% endif %} 12 | {{ block.super }} 13 | {% endblock %} 14 | {% block submit_buttons_bottom %} 15 | {# Currently only way extending submit_row.html is by custom template tag #} 16 | {% submit_row %} 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/search.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n staticfiles %} 3 | {% block title %}{% trans 'Search' %}{% endblock %} 4 | {% block breadcrumbs %} 5 | {% trans 'Home' %} 6 | {% trans 'Search Result' %} 7 | {% endblock %} 8 | {% block content %} 9 |
    10 | {% trans "Search" as the_title %} 11 |

    {{ the_title }} {{ request }}

    12 | {% include 'grid-list.html' %} 13 |
    14 |
    15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /suit/sass/_mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-list() { 2 | list-style: none; 3 | margin: 0; 4 | padding: 0; 5 | } 6 | @mixin suit-box-shadow($darken: 5%) { 7 | box-shadow: 0 1px 0 0 darken($body-bg, $darken); 8 | } 9 | @mixin text-semibold() { font-weight: 500; } 10 | .text-lighter { font-weight: 200; } 11 | .text-light { font-weight: 300; } 12 | .text-normal { font-weight: 400; } 13 | .text-semibold { @include text-semibold(); } 14 | .text-light-bold { 15 | @extend .text-light; 16 | strong { 17 | @extend .text-semibold; 18 | } 19 | } 20 | @mixin hide-text-indent() { 21 | text-indent: 100%; 22 | white-space: nowrap; 23 | overflow: hidden; 24 | } 25 | -------------------------------------------------------------------------------- /uwsgi-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${DCRM_WORKER}" = "none" ]; then 4 | sleep 15 # wait for db to be ready 5 | python manage.py collectstatic --no-input 6 | python manage.py migrate --no-input 7 | uwsgi --ini uwsgi.ini 8 | elif [ "${DCRM_WORKER}" = "default" ]; then 9 | sleep 30 # wait for main app to launch 10 | python manage.py rqworker default 11 | elif [ "${DCRM_WORKER}" = "high" ]; then 12 | sleep 30 # wait for main app to launch 13 | python manage.py rqworker high 14 | elif [ "${DCRM_WORKER}" = "scheduler" ]; then 15 | sleep 30 # wait for main app to launch 16 | python manage.py rqscheduler 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /fluent_comments/forms/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import AbstractCommentForm, CommentFormHelper 2 | from .default import DefaultCommentForm 3 | from .compact import CompactLabelsCommentForm, CompactCommentForm 4 | from .helper import CommentFormHelper, SubmitButton, PreviewButton, CompactLabelsCommentFormHelper 5 | 6 | FluentCommentForm = DefaultCommentForm # noqa, for backwards compatibility 7 | 8 | __all__ = ( 9 | 'AbstractCommentForm', 10 | 'CommentFormHelper', 11 | 'DefaultCommentForm', 12 | 'CompactLabelsCommentFormHelper', 13 | 'CompactLabelsCommentForm', 14 | 'CompactCommentForm', 15 | 'SubmitButton', 16 | 'PreviewButton', 17 | ) 18 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0017_setting_version_history.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-02 13:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0016_auto_20170402_0546'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='version_history', 18 | field=models.BooleanField(default=False, help_text='Enable version history module', verbose_name='Version History'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /suit/sass/components/_buttons.scss: -------------------------------------------------------------------------------- 1 | 2 | .btn-round { 3 | border-radius: 40px; 4 | } 5 | @mixin btn-mixin($state, $icon: none, $size: none, $round: false) { 6 | display: inline-block; 7 | @extend .btn; 8 | @extend .btn-#{$state}; 9 | @if $size { 10 | @extend .btn-#{$size} !optional; 11 | } 12 | @if $round { 13 | border-radius: 70px; 14 | } 15 | @if $icon { 16 | &:before { 17 | margin-right: 3px; 18 | display: inline-block; 19 | @include fa-icon-font(); 20 | content: $icon; 21 | } 22 | } 23 | } 24 | 25 | .btn-outline-danger { 26 | border-color: transparentize($brand-danger, .25); 27 | background-color: #fff; 28 | } 29 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0006_auto_20170325_1620.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-25 15:20 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0005_auto_20170325_1619'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='qq_group_number', 18 | field=models.CharField(help_text='Show QQ Group link in mobile package info page', max_length=255, null=True, verbose_name='QQ Group Number'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0015_auto_20170327_0055.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 22:55 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0014_auto_20170326_1544'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='advanced_mode', 18 | field=models.BooleanField(default=False, help_text='Check it to generate awesome depiction page for each version.', verbose_name='Auto Depiction'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0021_auto_20170415_1136.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-15 03:36 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0020_auto_20170415_1133'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='favicon', 18 | field=models.FileField(blank=True, help_text='Choose an Icon (*.png) to upload', max_length=255, null=True, upload_to='favicon', verbose_name='Favicon'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/release/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | 3 | {% load i18n admin_urls %} 4 | 5 | {% block object-tools %} 6 | {{ block.super }} 7 | 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0031_auto_20190725_1447.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.22 on 2019-07-25 06:47 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0030_build_is_finished'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='build', 17 | name='details', 18 | field=models.TextField(blank=True, default='Fast Build', help_text='Tell others what did you do this time before you rebuild the repository.', null=True, verbose_name='Details'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/new_change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/change_form.html' %} 2 | {% load i18n admin_urls %} 3 | 4 | {% block object-tools-items %} 5 |
  • 6 | {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} 7 | 8 | {% trans "History" %} 9 |
  • 10 | {% if has_absolute_url %} 11 |
  • 12 | 13 | {% trans "View on site" %} 14 |
  • 15 | {% endif %} 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0012_auto_20170326_0544.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 03:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0011_auto_20170326_0543'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='copyright_year', 18 | field=models.PositiveIntegerField(help_text='If input 2016, the final display is \xa9 2016-2017, leave a blank will display the current year.', null=True, verbose_name='Starting Year of Copyright'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /suit/sass/components/_tables.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | background-color: #fff; 3 | } 4 | .table-inverse { 5 | color: $gray-lighter; 6 | background-color: #fff; 7 | th, 8 | td, 9 | thead th { 10 | border-color: $table-border-color; 11 | font-weight: normal; 12 | } 13 | thead th { 14 | background-color: $inverse-lightest; 15 | } 16 | &:not(.table-bordered) { 17 | thead th:not(:first-child) { 18 | box-shadow: inset 1px 0 0 rgba(255, 255, 255, .2); 19 | } 20 | } 21 | tbody { 22 | th, td { 23 | color: $body-color; 24 | }; 25 | } 26 | } 27 | .thead-inverse { 28 | th { 29 | background-color: $inverse-lightest; 30 | color: $gray-lighter; 31 | font-weight: normal; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0010_auto_20170326_0542.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 03:42 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0009_auto_20170326_0531'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='copyright_year', 18 | field=models.CharField(help_text='If input 2016, the final display is \xa9 2016-2017, leave a blank will display the current year.', max_length=255, null=True, verbose_name='Starting Year of Copyright'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /DCRM/.env: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # SECURITY 4 | # disable it for production 5 | DCRM_DEBUG=1 6 | # force https -> True 7 | DCRM_SECURE_SSL=0 8 | # your domain here 9 | DCRM_HOST=apt.82flex.com 10 | DCRM_SECRET_KEY=random_dcrm_secret_key 11 | 12 | # FEATURES 13 | DCRM_ENABLE_REDIS=1 14 | DCRM_ENABLE_CACHE=1 15 | DCRM_ENABLE_API=1 16 | 17 | # THEME & LANGUAGE 18 | DCRM_THEME=DefaultStyle 19 | # ar: Arabic, en: English, zh-Hans: Simplified Chinese 20 | DCRM_LANGUAGE_CODE=zh-Hans 21 | DCRM_TIME_ZONE=Asia/Shanghai 22 | 23 | # DATABASE 24 | DCRM_MYSQL_NAME=DCRM 25 | DCRM_MYSQL_USER=root 26 | DCRM_MYSQL_PASSWORD=toor 27 | DCRM_MYSQL_HOST=127.0.0.1 28 | 29 | # REDIS 30 | DCRM_REDIS_HOST=127.0.0.1 31 | 32 | # MEMCACHED 33 | DCRM_MEMCACHED_HOST=127.0.0.1 34 | 35 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0011_auto_20170326_0543.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 03:43 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0010_auto_20170326_0542'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='copyright_year', 18 | field=models.PositiveIntegerField(help_text='If input 2016, the final display is \xa9 2016-2017, leave a blank will display the current year.', max_length=255, null=True, verbose_name='Starting Year of Copyright'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /preferences/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.12 on 2017-01-03 12:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ('sites', '0002_alter_domain_unique'), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Preferences', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('sites', models.ManyToManyField(blank=True, null=True, to='sites.Site')), 22 | ], 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /suit/templates/admin/filter_horizontal.html: -------------------------------------------------------------------------------- 1 | {% load i18n suit_tags %} 2 | 3 | 15 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0018_auto_20170402_1511.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-02 13:11 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0017_setting_version_history'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='setting', 17 | name='comments', 18 | ), 19 | migrations.AddField( 20 | model_name='setting', 21 | name='enable_comments', 22 | field=models.BooleanField(default=False, help_text='Enable comments module', verbose_name='Comments'), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /fluent_comments/templates/fluent_comments/templatetags/ajax_comment_tags.html: -------------------------------------------------------------------------------- 1 | {% load i18n staticfiles %} 2 | {% trans "cancel reply" %} 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0029_auto_20190723_1715.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.22 on 2019-07-23 09:15 3 | from __future__ import unicode_literals 4 | 5 | import WEIPDCRM.models.setting 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('WEIPDCRM', '0028_auto_20190722_2242'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='setting', 18 | name='rest_api', 19 | field=models.BooleanField(default=True, help_text='Upload packages using HTTP, manage your repositories, snapshots and comments etc.', validators=[WEIPDCRM.models.setting.validate_rest_api], verbose_name='Enable Rest API'), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0008_auto_20170326_0344.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 01:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0007_auto_20170326_0340'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='setting', 17 | name='qq_group_number', 18 | ), 19 | migrations.AddField( 20 | model_name='setting', 21 | name='qq_group_url', 22 | field=models.URLField(help_text='Show QQ Group link in mobile package info page', max_length=255, null=True, verbose_name='QQ Group URL'), 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0035_auto_20200301_1619.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.28 on 2020-03-01 08:19 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0034_apple_products_20200301'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='devicetype', 17 | options={'ordering': ['-id'], 'verbose_name': 'Device Type', 'verbose_name_plural': 'Device Types'}, 18 | ), 19 | migrations.AlterModelOptions( 20 | name='osversion', 21 | options={'ordering': ['-id'], 'verbose_name': 'iOS Version', 'verbose_name_plural': 'iOS Versions'}, 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/deleted.html: -------------------------------------------------------------------------------- 1 | {% extends "comments/base.html" %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Thanks for removing" %}.{% endblock %} 5 | 6 | {% block extrahead %} 7 | {{ block.super }} 8 | 9 | {% endblock %} 10 | 11 | {% block content %} 12 |

    {% trans "Thanks for removing the comment" %}

    13 |

    14 | {% blocktrans %} 15 | Thanks for taking the time to improve the quality of discussion on our site.
    16 | You will be sent back to the article... 17 | {% endblocktrans %} 18 |

    19 | 20 |

    {% trans "Back to the article" %}

    21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/flagged.html: -------------------------------------------------------------------------------- 1 | {% extends "comments/base.html" %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Thanks for flagging" %}.{% endblock %} 5 | 6 | {% block extrahead %} 7 | {{ block.super }} 8 | 9 | {% endblock %} 10 | 11 | {% block content %} 12 |

    {% trans "Thanks for flagging the comment" %}

    13 |

    14 | {% blocktrans %} 15 | Thanks for taking the time to improve the quality of discussion on our site.
    16 | You will be sent back to the article... 17 | {% endblocktrans %} 18 |

    19 | 20 |

    {% trans "Back to the article" %}

    21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0003_auto_20170325_1615.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-25 15:15 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0002_auto_20170325_1613'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='weibo_name', 18 | field=models.CharField(max_length=128, null=True, verbose_name='Weibo Name'), 19 | ), 20 | migrations.AddField( 21 | model_name='setting', 22 | name='weibo_url', 23 | field=models.URLField(max_length=128, null=True, verbose_name='Weibo URL'), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0004_auto_20170325_1616.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-25 15:16 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0003_auto_20170325_1615'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='alipay', 18 | field=models.URLField(max_length=255, null=True, verbose_name='Alipay URL'), 19 | ), 20 | migrations.AlterField( 21 | model_name='setting', 22 | name='weibo_url', 23 | field=models.URLField(max_length=255, null=True, verbose_name='Weibo URL'), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /suit/sass/suit.scss: -------------------------------------------------------------------------------- 1 | @import 'variables'; 2 | @import 'vendor'; 3 | @import 'mixins'; 4 | 5 | @import 'components/icons'; 6 | @import 'components/buttons'; 7 | @import 'components/forms'; 8 | @import 'components/sortables'; 9 | @import 'components/widgets'; 10 | @import 'components/alerts'; 11 | @import 'components/confirmations'; 12 | @import 'components/submit_row'; 13 | @import 'components/breadcrumbs'; 14 | @import 'components/results'; 15 | @import 'components/tabs'; 16 | @import 'components/tables'; 17 | @import 'components/cards'; 18 | 19 | @import 'layout/vertical'; 20 | @import 'layout/header'; 21 | @import 'layout/navbars'; 22 | @import 'layout/content'; 23 | @import 'layout/footer'; 24 | 25 | 26 | @import 'pages/login'; 27 | @import 'pages/dashboard'; 28 | @import 'pages/changelist'; 29 | @import 'pages/changeform'; 30 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0033_package_view.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0032_setting_gpg_password'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RunSQL( 16 | "DROP VIEW `package_view`;" 17 | ), 18 | migrations.RunSQL( 19 | "CREATE VIEW `package_view` AS SELECT `id`, `c_name`, `created_at`, `c_package`, `c_version`, `c_section_id`, `enabled`, `online_icon`, `c_description`, `download_times` AS `download_count` FROM `WEIPDCRM_version` WHERE `id` IN (SELECT MAX(`id`) FROM `WEIPDCRM_version` WHERE `enabled` = TRUE GROUP BY `c_package`) GROUP BY `c_package` ORDER BY `c_package` DESC;" 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /preferences/tests/settings/19.py: -------------------------------------------------------------------------------- 1 | INSTALLED_APPS = [ 2 | "django.contrib.auth", 3 | "django.contrib.sessions", 4 | "django.contrib.contenttypes", 5 | "django.contrib.admin", 6 | "django.contrib.sites", 7 | "preferences", 8 | "preferences.tests", 9 | ] 10 | 11 | DATABASES = { 12 | "default": { 13 | "ENGINE": "django.db.backends.sqlite3", 14 | } 15 | } 16 | 17 | MIDDLEWARE_CLASSES = ( 18 | "django.middleware.common.CommonMiddleware", 19 | "django.middleware.csrf.CsrfViewMiddleware", 20 | "django.contrib.sessions.middleware.SessionMiddleware", 21 | "django.contrib.auth.middleware.AuthenticationMiddleware", 22 | ) 23 | 24 | TEMPLATE_CONTEXT_PROCESSORS = ( 25 | "preferences.context_processors.preferences_cp", 26 | ) 27 | 28 | ROOT_URLCONF = "preferences.tests.urls" 29 | 30 | SECRET_KEY = "test_secret_key" 31 | -------------------------------------------------------------------------------- /preferences/tests/settings/110.py: -------------------------------------------------------------------------------- 1 | INSTALLED_APPS = [ 2 | "django.contrib.auth", 3 | "django.contrib.sessions", 4 | "django.contrib.contenttypes", 5 | "django.contrib.admin", 6 | "django.contrib.sites", 7 | "preferences", 8 | "preferences.tests", 9 | ] 10 | 11 | DATABASES = { 12 | "default": { 13 | "ENGINE": "django.db.backends.sqlite3", 14 | } 15 | } 16 | 17 | MIDDLEWARE_CLASSES = ( 18 | "django.middleware.common.CommonMiddleware", 19 | "django.middleware.csrf.CsrfViewMiddleware", 20 | "django.contrib.sessions.middleware.SessionMiddleware", 21 | "django.contrib.auth.middleware.AuthenticationMiddleware", 22 | ) 23 | 24 | TEMPLATE_CONTEXT_PROCESSORS = ( 25 | "preferences.context_processors.preferences_cp", 26 | ) 27 | 28 | ROOT_URLCONF = "preferences.tests.urls" 29 | 30 | SECRET_KEY = "test_secret_key" 31 | -------------------------------------------------------------------------------- /suit/templates/admin/change_list.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/change_list.html' %} 2 | {% load i18n admin_list suit_list %} 3 | 4 | {% block search %}{% suit_search_form cl %}{% endblock %} 5 | 6 | {% block filters %} 7 | {% if cl.has_filters %} 8 |
    9 |

    {% trans 'Filter' %}

    10 | {% for spec in cl.filter_specs|suit_list_filter_vertical:cl %} 11 | {% admin_list_filter cl spec %} 12 | {% endfor %} 13 |
    14 | {% endif %} 15 | {% endblock %} 16 | 17 | {% block footer %} 18 | {{ block.super }} 19 | 20 | {% if cl.has_filters %} 21 | 25 | {% endif %} 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /suit/sass/components/_tabs.scss: -------------------------------------------------------------------------------- 1 | .nav-tabs-suit { 2 | margin-bottom: 1rem; 3 | .nav-item { 4 | &:first-child { 5 | margin-left: .75rem; 6 | } 7 | + .nav-item { 8 | margin-left: .3rem; 9 | } 10 | } 11 | .nav-link { 12 | border-radius: 2px; 13 | padding: 0.65em 1.5em; 14 | background-color: #fff; 15 | border-color: $nav-tabs-border-color; 16 | @include hover-focus { 17 | $border-hover: lighten(desaturate($link-color-brighter, 45%), 15%); 18 | //$border-hover: #fff; 19 | border-color: $border-hover $border-hover $nav-tabs-border-color; 20 | } 21 | &.active { 22 | &, &:focus { 23 | color: #222; 24 | @extend .text-semibold; 25 | } 26 | } 27 | &.has-error { 28 | &, &.active, &:focus { 29 | color: $state-danger-text; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0002_auto_20170325_1613.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-25 15:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='qq_group_name', 18 | field=models.CharField(max_length=128, null=True, verbose_name='QQ Group Name'), 19 | ), 20 | migrations.AddField( 21 | model_name='setting', 22 | name='qq_group_number', 23 | field=models.FloatField(help_text='Show QQ Group link in mobile package info page', null=True, verbose_name='QQ Group Number'), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /suit/sass/components/_confirmations.scss: -------------------------------------------------------------------------------- 1 | body.delete-confirmation { 2 | .content-wrap { 3 | display: block; 4 | @extend .alert; 5 | @extend .alert-danger; 6 | margin: 1.5rem $nav-padding-horizontal; 7 | //padding: 1.5rem $header-padding-horizontal; 8 | h1, h2, ul { 9 | display: block; 10 | float: none; 11 | } 12 | h1 { 13 | font-size: $font-size-h2; 14 | } 15 | h2 { 16 | margin-top: 1.2rem; 17 | font-size: $font-size-h5; 18 | } 19 | form { 20 | margin-top: 2rem; 21 | } 22 | input[type='button'], input[type='submit'], button { 23 | @extend .btn; 24 | @extend .btn-lg; 25 | margin-right: 1.5rem; 26 | } 27 | input[type='button'], button { 28 | @extend .btn-secondary; 29 | } 30 | input[type='submit'] { 31 | @extend .btn-danger; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/version/change_list.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_list.html" %} 2 | {% load i18n admin_urls admin_static admin_list package_title_style package_title_script %} 3 | {% block extrastyle %} 4 | {{ block.super }} 5 | {% package_title_style %} 6 | {% endblock %} 7 | {% block content_title %} 8 | {% package_title_script %} 9 | {% endblock %} 10 | {% block object-tools %} 11 | {% if not has_add_permission %} 12 | 22 | {% endif %} 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0026_package_view.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-02 13:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0025_auto_20180404_1515'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RunSQL( 16 | "DROP VIEW `package_view`;" 17 | ), 18 | migrations.RunSQL( 19 | "CREATE VIEW `package_view` AS SELECT `id`, `c_name`, `created_at`, `c_package`, `c_version`, `c_section_id`, `enabled`, `online_icon`, `c_description`, `download_times` AS `download_count` FROM `WEIPDCRM_version` WHERE `enabled` = TRUE AND `id` IN (SELECT MAX(`id`) FROM `WEIPDCRM_version` GROUP BY `c_package`) GROUP BY `c_package` ORDER BY `c_package` DESC;" 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /WEIPDCRM/tests.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django.test import TestCase 22 | 23 | # Create your tests here. 24 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0016_auto_20170402_0546.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-02 03:46 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0015_auto_20170327_0055'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='redirect_resources', 18 | field=models.IntegerField(choices=[(0, 'None'), (1, 'Moved'), (2, 'Accel')], default=0, help_text='None - Read resources and return, without partical support, not recommended.
    Moved - Return 301/302 responses and redirect to the real resource urls.
    Accel - Redirect resource requests to WEB servers without changing urls.', verbose_name='Redirect Methods'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0036_auto_20200531_0030.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.29 on 2020-05-30 16:30 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0035_auto_20200301_1619'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='show_advertisement', 18 | field=models.BooleanField(default=False, help_text='Check it to display advertisement.', verbose_name='Show Advertisement'), 19 | ), 20 | migrations.AddField( 21 | model_name='setting', 22 | name='show_notice', 23 | field=models.BooleanField(default=False, help_text='Check it to display notice.', verbose_name='Show Notice'), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0024_auto_20170814_1706.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-08-14 09:06 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0023_auto_20170813_0014'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='telegram_name', 18 | field=models.CharField(blank=True, max_length=128, null=True, verbose_name='Telegram Name'), 19 | ), 20 | migrations.AddField( 21 | model_name='setting', 22 | name='telegram_url', 23 | field=models.URLField(blank=True, help_text='Display Telegram link on the package info page.', max_length=255, null=True, verbose_name='Telegram URL'), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /preferences/tests/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.6 on 2017-01-03 07:07 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | initial = True 12 | 13 | dependencies = [ 14 | ('preferences', '0001_initial'), 15 | ] 16 | 17 | operations = [ 18 | migrations.CreateModel( 19 | name='MyPreferences', 20 | fields=[ 21 | ('preferences_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='preferences.Preferences')), 22 | ('portal_contact_email', models.EmailField(max_length=254)), 23 | ], 24 | bases=('preferences.preferences',), 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/comment_notification_email.txt: -------------------------------------------------------------------------------- 1 | {% autoescape off %}{% comment %} 2 | {% endcomment %}A new comment has been posted on your site "{{ site }}, to the page entitled "{{ content_object }}". 3 | Link to the page: http://{{ site.domain }}{{ content_object.get_absolute_url }} 4 | 5 | IP-address: 95.97.240.121{% if comment.title %} 6 | Title: {{ comment.title }}{% endif %} 7 | Name: {{ comment.user_name|default:comment.user }} 8 | Email: {{ comment.user_email }} 9 | Homepage: {{ comment.user_url }} 10 | Moderated: {{ comment.is_public|yesno:'no,yes' }} 11 | 12 | Comment: 13 | {{ comment.comment }} 14 | 15 | ---- 16 | You have the following options available: 17 | View comment -- http://{{ site.domain }}{{ comment.get_absolute_url }} 18 | Flag comment -- http://{{ site.domain }}{% url 'comments-flag' comment.pk %} 19 | Delete comment -- http://{{ site.domain }}{% url 'comments-delete' comment.pk %} 20 | {% endautoescape %} 21 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/posted.html: -------------------------------------------------------------------------------- 1 | {% extends "comments/base.html" %}{% load i18n fluent_comments_tags %} 2 | 3 | {% block title %}{% trans "Thanks for commenting" %}{% endblock %} 4 | 5 | {% block extrahead %} 6 | {{ block.super }} 7 | 8 | {% endblock %} 9 | 10 | {% block content %} 11 |

    {% trans "Thanks for posting your comment" %}

    12 |

    13 | {% blocktrans %} 14 | We have received your comment, and posted it on the web site.
    15 | You will be sent back to the article... 16 | {% endblocktrans %} 17 |

    18 | 19 | {# Use identical formatting to normal comment list #} 20 |
    21 | {% render_comment comment %} 22 |
    23 | 24 |

    {% trans "Back to the article" %}

    25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /WEIPDCRM/permissions.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework.permissions import BasePermission 22 | 23 | 24 | class DenyAny(BasePermission): 25 | def has_permission(self, request, view): 26 | return False 27 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/to_slug.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | register = template.Library() 23 | 24 | 25 | @register.filter 26 | def to_slug(value): 27 | return value.replace(".", "-") 28 | 29 | -------------------------------------------------------------------------------- /DCRM/wsgi.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | import os 22 | 23 | from django.core.wsgi import get_wsgi_application 24 | 25 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DCRM.settings") 26 | 27 | application = get_wsgi_application() 28 | -------------------------------------------------------------------------------- /suit/templates/suit/menu_item.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
  • 3 | {% if suit_layout == 'vertical' %}{% endif %}{% trans parent_item.label|capfirst %} 5 | 6 | {% if parent_item.children %} 7 | {% if not parent_item.is_active or suit_layout == 'vertical' %} 8 | 16 | {% endif %} 17 | {% endif %} 18 |
  • 19 | -------------------------------------------------------------------------------- /preferences/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.core.urlresolvers import reverse 3 | from django.shortcuts import redirect 4 | from django.utils.decorators import method_decorator 5 | from django.views.decorators.csrf import csrf_protect 6 | 7 | csrf_protect_m = method_decorator(csrf_protect) 8 | 9 | 10 | class PreferencesAdmin(admin.ModelAdmin): 11 | 12 | @csrf_protect_m 13 | def changelist_view(self, request, extra_context=None): 14 | """ 15 | If we only have a single preference object redirect to it, 16 | otherwise display listing. 17 | """ 18 | model = self.model 19 | if model.objects.all().count() > 1: 20 | return super(PreferencesAdmin, self).changelist_view(request) 21 | else: 22 | obj = model.singleton.get() 23 | return redirect( 24 | reverse( 25 | 'admin:%s_%s_change' % ( 26 | model._meta.app_label, model._meta.model_name 27 | ), 28 | args=(obj.id,) 29 | ) 30 | ) 31 | -------------------------------------------------------------------------------- /WEIPDCRM/tools.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | import errno 22 | import os 23 | 24 | 25 | def mkdir_p(path): 26 | try: 27 | os.makedirs(path, mode=0o755) 28 | except OSError as exc: # Python >2.5 29 | if exc.errno == errno.EEXIST and os.path.isdir(path): 30 | pass 31 | else: 32 | raise 33 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/content_type.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from django.contrib.contenttypes.models import ContentType 23 | 24 | register = template.Library() 25 | 26 | 27 | @register.filter 28 | def content_type(obj): 29 | if not obj: 30 | return None 31 | return ContentType.objects.get_for_model(obj).id 32 | -------------------------------------------------------------------------------- /suit_redactor/widgets.py: -------------------------------------------------------------------------------- 1 | # from django.core.serializers import json 2 | from django.forms import Textarea 3 | from django.utils.safestring import mark_safe 4 | from django.contrib.staticfiles.templatetags.staticfiles import static 5 | 6 | try: 7 | import json 8 | except ImportError: 9 | import django.utils.simplejson as json 10 | 11 | 12 | class RedactorWidget(Textarea): 13 | class Media: 14 | css = { 15 | 'all': (static('suit-redactor/redactor/redactor.css'),) 16 | } 17 | js = ( 18 | static('suit-redactor/redactor/ensure.jquery.js'), 19 | static('suit-redactor/redactor/redactor.min.js'), 20 | ) 21 | 22 | def __init__(self, attrs=None, editor_options={}): 23 | super(RedactorWidget, self).__init__(attrs) 24 | self.editor_options = editor_options 25 | 26 | def render(self, name, value, attrs=None): 27 | output = super(RedactorWidget, self).render(name, value, attrs) 28 | output += mark_safe( 29 | '' 30 | % (name, json.dumps(self.editor_options))) 31 | return output 32 | -------------------------------------------------------------------------------- /fluent_comments/templates/fluent_comments/templatetags/threaded_list.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | 3 | The template for threadedcomments, spiced up. 4 | This is included via comments/list.html 5 | 6 | The id="comments-..." is required for JavaScript, 7 | the 'comments/comment.html template is also used by the Ajax view. 8 | 9 | {% endcomment %} 10 | {% load fluent_comments_tags threadedcomments_tags staticfiles %} 11 |
    13 | {% for comment in comment_list|fill_tree|annotate_tree %} 14 | {% ifchanged comment.parent_id %} 15 | {% else %} 16 | 17 | {% endifchanged %} 18 | {% if not comment.open and not comment.close %} 19 | 20 | {% endif %} 21 | {% if comment.open %} 22 |
      {% endif %} 23 |
    • 24 | {% render_comment comment %}
    25 | {% for close in comment.close %} 26 | 27 | 28 | {% endfor %} 29 | {% endfor %} 30 | 31 | -------------------------------------------------------------------------------- /.idea/runConfigurations/DCRM.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 25 | -------------------------------------------------------------------------------- /WEIPDCRM/context_processors.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from __future__ import unicode_literals 22 | 23 | from django.conf import settings 24 | from django.contrib import admin 25 | 26 | 27 | def admin_context(request): 28 | if request.user.is_superuser: 29 | return { 30 | **admin.site.each_context(request=request), 31 | 'settings': settings 32 | } 33 | return {} 34 | -------------------------------------------------------------------------------- /suit/sass/layout/_vertical.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | body.suit_layout_vertical:not(.login) { 6 | display: flex; 7 | min-height: 100vh; 8 | //flex-direction: column; 9 | #container { 10 | flex: 1; 11 | display: flex; 12 | position: relative; 13 | align-content: flex-start; 14 | #header { 15 | display: flex; 16 | flex-direction: column; 17 | width: $vertical-menu-width; 18 | flex-shrink: 0; 19 | } 20 | #content { 21 | flex: 1; 22 | align-items: flex-start; 23 | align-content: flex-start; 24 | flex-wrap: wrap; 25 | padding-bottom: $footer-height + 30px; // Footer compensation 26 | padding-top: 4rem; // Breadcrumbs compensation 27 | } 28 | #footer { 29 | left: $vertical-menu-width; 30 | bottom: 0; 31 | right: 0; 32 | position: absolute; 33 | flex-wrap: wrap; 34 | flex-basis: 100%; 35 | //width: 100%; 36 | } 37 | 38 | } 39 | > #footer { 40 | 41 | } 42 | &.dashboard:not([class*="app-"]) { 43 | #container { 44 | #content { 45 | padding-top: $grid-gutter-width-base; 46 | } 47 | } 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templatetags/section_list.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from WEIPDCRM.models.section import Section 23 | register = template.Library() 24 | 25 | 26 | @register.simple_tag(takes_context=True) 27 | def section_list(context): 28 | context['section_num'] = Section.objects.all().count() 29 | context['section_list'] = Section.objects.all().order_by('name')[:12] 30 | return '' 31 | -------------------------------------------------------------------------------- /preferences/managers.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from django.db import models 3 | from django.contrib.sites.models import Site 4 | 5 | 6 | class SingletonManager(models.Manager): 7 | """ 8 | Returns only a single preferences object per site. 9 | """ 10 | def get_queryset(self): 11 | """ 12 | Return the first preferences object for the current site. 13 | If preferences do not exist create it. 14 | """ 15 | queryset = super(SingletonManager, self).get_queryset() 16 | 17 | # Get current site 18 | current_site = None 19 | if getattr(settings, 'SITE_ID', None) is not None: 20 | current_site = Site.objects.get_current() 21 | 22 | # If site found limit queryset to site. 23 | if current_site is not None: 24 | queryset = queryset.filter(sites=settings.SITE_ID) 25 | 26 | try: 27 | queryset.get() 28 | except self.model.DoesNotExist: 29 | # Create object (for current site) if it doesn't exist. 30 | obj = self.model.objects.create() 31 | if current_site is not None: 32 | obj.sites.add(current_site) 33 | 34 | return queryset 35 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0007_auto_20170326_0340.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 01:40 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0006_auto_20170325_1620'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='setting', 17 | name='alipay_url', 18 | field=models.URLField(help_text='Show donate via Alipay link in mobile package info page', max_length=255, null=True, verbose_name='Alipay URL'), 19 | ), 20 | migrations.AlterField( 21 | model_name='setting', 22 | name='qq_group_number', 23 | field=models.URLField(help_text='Show QQ Group link in mobile package info page', max_length=255, null=True, verbose_name='QQ Group Number'), 24 | ), 25 | migrations.AlterField( 26 | model_name='setting', 27 | name='weibo_url', 28 | field=models.URLField(help_text='Show Weibo link in mobile package info page', max_length=255, null=True, verbose_name='Weibo URL'), 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/grid-list.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 |
    3 | {% for package in package_list %} 4 | 25 | {% endfor %} 26 |
    -------------------------------------------------------------------------------- /WEIPDCRM/templates/error/base.html: -------------------------------------------------------------------------------- 1 | 2 | {% load i18n %} 3 | 4 | 5 | 6 | 7 | 8 | {% block errortitle %}{% endblock %} | DCRM 9 | 10 | 11 | 12 |
    13 |

    {% block errorcode %}{% endblock %}

    14 |

    {% block errortext %}{% endblock %}

    15 |

    Power By DCRM

    16 |
    17 | 18 | 19 | -------------------------------------------------------------------------------- /suit/admin_filters.py: -------------------------------------------------------------------------------- 1 | from django.utils.translation import ugettext_lazy as _ 2 | from django.contrib.admin import FieldListFilter 3 | 4 | 5 | class IsNullFieldListFilter(FieldListFilter): 6 | notnull_label = _('Is present') 7 | isnull_label = _('Is Null') 8 | 9 | def __init__(self, field, request, params, model, model_admin, field_path): 10 | self.lookup_kwarg = '%s__isnull' % field_path 11 | self.lookup_val = request.GET.get(self.lookup_kwarg, None) 12 | super(IsNullFieldListFilter, self).__init__(field, 13 | request, params, model, 14 | model_admin, field_path) 15 | 16 | def expected_parameters(self): 17 | return [self.lookup_kwarg] 18 | 19 | def choices(self, cl): 20 | for lookup, title in ( 21 | (None, _('All')), 22 | ('False', self.notnull_label), 23 | ('True', self.isnull_label), 24 | ): 25 | yield { 26 | 'selected': self.lookup_val == lookup, 27 | 'query_string': cl.get_query_string({ 28 | self.lookup_kwarg: lookup, 29 | }), 30 | 'display': title, 31 | } 32 | -------------------------------------------------------------------------------- /WEIPDCRM/forms/admin/upload.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from __future__ import unicode_literals 22 | 23 | from django import forms 24 | 25 | 26 | class UploadForm(forms.Form): 27 | """ 28 | A simple form, just designed to receive and validate the package file. 29 | """ 30 | package = forms.FileField() 31 | 32 | 33 | class ImageForm(forms.Form): 34 | """ 35 | A simple form, just designed to receive and validate the image file. 36 | """ 37 | image = forms.FileField() 38 | 39 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/contenttype.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework import serializers, viewsets 22 | from django.contrib.contenttypes.models import ContentType 23 | 24 | 25 | class ContentTypeSerializer(serializers.ModelSerializer): 26 | class Meta: 27 | model = ContentType 28 | exclude = [] 29 | 30 | 31 | class ContentTypeViewSet(viewsets.ReadOnlyModelViewSet): 32 | queryset = ContentType.objects.all() 33 | serializer_class = ContentTypeSerializer 34 | pagination_class = None 35 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/package_title_style.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from django.template import Context 23 | 24 | register = template.Library() 25 | 26 | 27 | @register.inclusion_tag("admin/version/package_title_style.html", takes_context=True) 28 | def package_title_style(context): 29 | ctx = Context(context) 30 | if 'c_package__exact' in context.request.GET: 31 | ctx.update({ 32 | "filtered_by_package": context.request.GET['c_package__exact'] 33 | }) 34 | return ctx 35 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/package_title_script.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from django.template import Context 23 | 24 | register = template.Library() 25 | 26 | 27 | @register.inclusion_tag("admin/version/package_title_script.html", takes_context=True) 28 | def package_title_script(context): 29 | ctx = Context(context) 30 | if 'c_package__exact' in context.request.GET: 31 | ctx.update({ 32 | "filtered_by_package": context.request.GET['c_package__exact'] 33 | }) 34 | return ctx 35 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/build_submit_row.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from django.contrib.admin.templatetags.admin_modify import submit_row as django_submit_row 23 | register = template.Library() 24 | 25 | 26 | @register.inclusion_tag('admin/build/change_action.html', takes_context=True) 27 | def submit_row(context): 28 | """ 29 | Currently only way of overriding Django admin submit_line.html is by replacing 30 | submit_row template tag in change_form.html 31 | """ 32 | return django_submit_row(context) 33 | -------------------------------------------------------------------------------- /WEIPDCRM/templatetags/setting_submit_row.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from django.contrib.admin.templatetags.admin_modify import submit_row as django_submit_row 23 | register = template.Library() 24 | 25 | 26 | @register.inclusion_tag('admin/setting/change_action.html', takes_context=True) 27 | def submit_row(context): 28 | """ 29 | Currently only way of overriding Django admin submit_line.html is by replacing 30 | submit_row template tag in change_form.html 31 | """ 32 | return django_submit_row(context) 33 | -------------------------------------------------------------------------------- /suit/sass/layout/_content.scss: -------------------------------------------------------------------------------- 1 | body.change-form { 2 | #container { 3 | br.clear:last-child { 4 | display: none; 5 | } 6 | } 7 | } 8 | #content { 9 | padding: 1.5rem $header-padding-horizontal; 10 | display: flex; 11 | flex-direction: row; 12 | flex-wrap: wrap; 13 | justify-content: flex-start; 14 | align-content: flex-end; 15 | align-items: flex-start; 16 | .content-wrap { 17 | body.dashboard & { 18 | display: flex; 19 | } 20 | flex-basis: 100%; 21 | > h1 { 22 | flex-basis: 100%; 23 | &:first-child { 24 | display: none; 25 | } 26 | } 27 | } 28 | 29 | #content-main { 30 | flex-grow: 1; 31 | } 32 | #content-related { 33 | flex-grow: 1; 34 | } 35 | } 36 | #content-main { 37 | > .object-tools { 38 | @include reset-list(); 39 | position: relative; 40 | overflow: hidden; 41 | z-index: 6; 42 | > li { 43 | display: inline; 44 | &:not(:first-child) { 45 | margin-left: .5rem; 46 | } 47 | > a { 48 | &:not([class*="btn-"]) { 49 | @extend .btn-round; 50 | @include btn-mixin(info, none, sm, round=true); 51 | &.addlink { 52 | @include btn-mixin(success, $icon-plus-circle, sm, round=true); 53 | } 54 | } 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/preview.html: -------------------------------------------------------------------------------- 1 | {% extends "comments/base.html" %}{% load i18n crispy_forms_tags comments %} 2 | 3 | {% block title %}{% trans "Preview your comment" %}{% endblock %} 4 | 5 | {% block content %} 6 |
    {% csrf_token %} 7 | {% if next %}
    {% endif %} 8 | 9 | {% if form.errors %} 10 |

    {% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}

    11 | {% else %} 12 |

    {% trans "Preview of your comment" %}

    13 | 14 |
    {{ comment|linebreaks }}
    15 | 16 |
    17 | 18 |
    19 | 20 |

    {% trans "Or make changes" %}:

    21 | {% endif %} 22 | 23 | {{ form|crispy }} 24 | 25 |
    26 | 27 | 28 |
    29 |
    30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /suit/templatetags/suit_tags.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | from django.utils.safestring import mark_safe 3 | from suit import config 4 | 5 | register = template.Library() 6 | 7 | 8 | @register.filter(name='suit_conf') 9 | def suit_conf(name, request): 10 | value = config.get_config(name, request) 11 | return mark_safe(value) if isinstance(value, str) else value 12 | 13 | 14 | @register.filter(name='suit_body_class') 15 | def suit_body_class(value, request): 16 | css_classes = [] 17 | config_vars_to_add = ['toggle_changelist_top_actions', 'form_submit_on_right', 'layout'] 18 | for each in config_vars_to_add: 19 | suit_conf_param = getattr(config.get_config(None, request), each, None) 20 | if suit_conf_param: 21 | value = each if isinstance(suit_conf_param, bool) \ 22 | else '_'.join((each, suit_conf_param)) 23 | css_classes.append('suit_%s' % value) 24 | return ' '.join(css_classes) 25 | 26 | 27 | @register.assignment_tag 28 | def suit_conf_value(name, model_admin=None): 29 | if model_admin: 30 | value_by_ma = getattr(model_admin, 'suit_%s' % name.lower(), None) 31 | if value_by_ma in ('center', 'right'): 32 | config.set_config_value(name, value_by_ma) 33 | else: 34 | config.reset_config_value(name) 35 | return suit_conf(name) 36 | -------------------------------------------------------------------------------- /fluent_comments/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | API for :ref:`custom-comment-app-api` 3 | """ 4 | form_class = None 5 | model_class = None 6 | 7 | # following PEP 440 8 | __version__ = "1.4.2" 9 | 10 | 11 | def get_model(): 12 | """ 13 | Return the model to use for commenting. 14 | """ 15 | global model_class 16 | if model_class is None: 17 | from fluent_comments import appsettings 18 | if appsettings.USE_THREADEDCOMMENTS: 19 | from threadedcomments.models import ThreadedComment 20 | model_class = ThreadedComment 21 | else: 22 | # Our proxy model that performs select_related('user') for the comments 23 | from fluent_comments.models import FluentComment 24 | model_class = FluentComment 25 | 26 | return model_class 27 | 28 | 29 | def get_form(): 30 | """ 31 | Return the form to use for commenting. 32 | """ 33 | global form_class 34 | from fluent_comments import appsettings 35 | if form_class is None: 36 | if appsettings.FLUENT_COMMENTS_FORM_CLASS: 37 | from fluent_comments.utils import import_symbol 38 | form_class = import_symbol(appsettings.FLUENT_COMMENTS_FORM_CLASS, 'FLUENT_COMMENTS_FORM_CLASS') 39 | else: 40 | from fluent_comments.forms import FluentCommentForm 41 | form_class = FluentCommentForm 42 | 43 | return form_class 44 | -------------------------------------------------------------------------------- /.idea/DCRM.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/release.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework import serializers, viewsets 22 | from rest_framework.pagination import LimitOffsetPagination 23 | from WEIPDCRM.models.release import Release 24 | 25 | 26 | class ReleaseSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = Release 29 | fields = '__all__' 30 | 31 | _icon_link = serializers.URLField(source='icon_link', read_only=True) 32 | 33 | 34 | class ReleaseViewSet(viewsets.ModelViewSet): 35 | queryset = Release.objects.all() 36 | serializer_class = ReleaseSerializer 37 | pagination_class = LimitOffsetPagination 38 | -------------------------------------------------------------------------------- /suit/templates/admin/auth/user/change_password.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/auth/user/change_password.html" %} 2 | {% load i18n static %} 3 | {% load admin_urls %} 4 | 5 | {% block content %}
    6 |
    {% csrf_token %}{% block form_top %}{% endblock %} 7 |
    8 | {% if is_popup %}{% endif %} 9 | {% if form.errors %} 10 |

    11 | {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} 12 |

    13 | {% endif %} 14 | 15 |

    {% blocktrans with username=original %}Enter a new password for the user {{ username }}.{% endblocktrans %}

    16 | 17 |
    18 | 19 |
    20 | {{ form.password1.errors }} 21 | {{ form.password1.label_tag }} {{ form.password1 }} 22 | {% if form.password1.help_text %} 23 |
    {{ form.password1.help_text|safe }}
    24 | {% endif %} 25 |
    26 | 27 |
    28 | {{ form.password2.errors }} 29 | {{ form.password2.label_tag }} {{ form.password2 }} 30 |
    31 | 32 |
    33 | 34 |
    35 | 36 |
    37 | 38 |
    39 |
    40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/permission.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django.contrib.auth.models import Permission 22 | from rest_framework import serializers, viewsets 23 | from WEIPDCRM.apis.contenttype import ContentTypeSerializer 24 | 25 | 26 | class PermissionSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = Permission 29 | exclude = [] 30 | 31 | _content_type = ContentTypeSerializer(source='content_type', many=False, read_only=True) 32 | 33 | 34 | class PermissionViewSet(viewsets.ReadOnlyModelViewSet): 35 | queryset = Permission.objects.all() 36 | serializer_class = PermissionSerializer 37 | pagination_class = None 38 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templatetags/global_settings.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django import template 22 | from preferences import preferences 23 | from django.contrib.sites.models import Site 24 | from django.conf import settings 25 | from DCRM.settings import LANGUAGE_CODE 26 | register = template.Library() 27 | 28 | rtl_support = ['ar'] 29 | 30 | 31 | @register.simple_tag(takes_context=True) 32 | def global_settings(context): 33 | context['settings'] = preferences.Setting 34 | current_site = Site.objects.get(id=settings.SITE_ID) 35 | context['site'] = current_site.domain 36 | context['rtl_support'] = LANGUAGE_CODE in rtl_support 37 | return '' 38 | -------------------------------------------------------------------------------- /suit/templates/suit/menu.html: -------------------------------------------------------------------------------- 1 | {% load i18n suit_menu suit_tags %} 2 | 3 | {% get_menu request as menu %} 4 | {% with suit_layout='layout'|suit_conf:request %} 5 |
    6 |
      7 | {% if menu %} 8 | {% for parent_item in menu %} 9 | {% if not parent_item.align_right or suit_layout == 'vertical' %} 10 | {% include 'suit/menu_item.html' %} 11 | {% endif %} 12 | {% endfor %} 13 | {% endif %} 14 |
    15 | {% if menu.aligned_right_menu_items %} 16 |
      17 | {% for parent_item in menu.aligned_right_menu_items %} 18 | {% include 'suit/menu_item.html' %} 19 | {% endfor %} 20 |
    21 | {% endif %} 22 |
    23 | {% if suit_layout == 'horizontal' and menu and menu.active_parent_item %} 24 |
    25 |
      26 | {% for child_item in menu.active_parent_item.children %} 27 | 28 | {{ child_item.label }} 30 | 31 | {% endfor %} 32 |
    33 |
    34 | {% endif %} 35 | {% endwith %} 36 | -------------------------------------------------------------------------------- /WEIPDCRM/views/admin/help/about.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django.contrib import admin 22 | from django.contrib.admin.views.decorators import staff_member_required 23 | from django.shortcuts import render 24 | from django.utils.translation import ugettext as _ 25 | 26 | 27 | @staff_member_required 28 | def about_view(request): 29 | """ 30 | :param request: Django Request 31 | :return: Django HttpResponse 32 | :rtype: HttpResponse 33 | """ 34 | context = admin.site.each_context(request) 35 | context.update({ 36 | 'title': _('About'), 37 | 'version': "4.1", 38 | }) 39 | 40 | template = 'admin/help/about.html' 41 | return render(request, template, context) 42 | -------------------------------------------------------------------------------- /suit/sass/layout/_footer.scss: -------------------------------------------------------------------------------- 1 | /* Sticky footer styles */ 2 | @include media-breakpoint-up(sm) { 3 | html { 4 | position: relative; 5 | min-height: 100%; 6 | } 7 | body { 8 | &.suit_layout_horizontal, &.login { 9 | margin-bottom: $footer-height; 10 | #footer { 11 | position: absolute; 12 | left: 0; 13 | right: 0; 14 | bottom: 0; 15 | width: 100%; 16 | min-height: $footer-height; 17 | margin-top: -$footer-height; 18 | } 19 | } 20 | } 21 | } 22 | 23 | /* Styles */ 24 | .footer { 25 | min-height: $footer-height; 26 | background-color: darken($body-bg, 5%); 27 | color: $gray; 28 | font-size: $font-size-sm; 29 | > .container-fluid { 30 | padding: 1rem $grid-gutter-width-base; 31 | > .row { 32 | justify-content: center; 33 | align-content: center; 34 | align-items: center; 35 | > div { 36 | &:not(:first-child) { 37 | @include media-breakpoint-down(xs) { 38 | margin-top: .75rem; 39 | } 40 | } 41 | } 42 | } 43 | } 44 | .footer-links { 45 | a { 46 | white-space: nowrap; 47 | &:not(:last-child) { 48 | margin-right: .75rem; 49 | } 50 | } 51 | } 52 | } 53 | 54 | /* Override BS4 [hidden] in reboot.scss to show Django debug toolbar */ 55 | #djDebug { 56 | &[hidden], [hidden][style*="display: block"], [hidden][style*="display:block"] { 57 | display: block !important; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/section.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework import serializers, viewsets 22 | from rest_framework.pagination import LimitOffsetPagination 23 | from WEIPDCRM.models.section import Section 24 | 25 | 26 | class SectionSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = Section 29 | fields = '__all__' 30 | 31 | _icon_link = serializers.URLField(source='icon_link', read_only=True) 32 | _absolute_url = serializers.URLField(source='get_absolute_url', read_only=True) 33 | 34 | 35 | class SectionViewSet(viewsets.ModelViewSet): 36 | queryset = Section.objects.all() 37 | serializer_class = SectionSerializer 38 | pagination_class = LimitOffsetPagination 39 | -------------------------------------------------------------------------------- /WEIPDCRM/views/error.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng & 0xJacky 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | 20 | Notice: You have used class-based views, that's awesome. 21 | If not necessary, you can try function-based views. 22 | You may add lines above as license. 23 | """ 24 | 25 | from django.shortcuts import render_to_response 26 | from django.views.decorators.csrf import csrf_exempt 27 | 28 | 29 | @csrf_exempt 30 | def bad_request(request): 31 | return render_to_response('error/400.html', status=400) 32 | 33 | 34 | @csrf_exempt 35 | def page_not_found(request): 36 | return render_to_response('error/404.html', status=404) 37 | 38 | 39 | @csrf_exempt 40 | def server_error(request): 41 | return render_to_response('error/500.html', status=500) 42 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n staticfiles %} 3 | {% block title %}{% trans 'Index' %}{% endblock %} 4 | {% block breadcrumbs %} 5 | {% trans 'Home' %} 6 | {% endblock %} 7 | {% block content %} 8 | 16 |
    17 |

    {% trans "Package List" %}

    18 | {% include 'grid-list.html' %} 19 |
    20 | {% include 'pagination.html' %} 21 |
    22 | {% endblock %} 23 | {% block footerscript %} 24 | 40 | {% endblock %} -------------------------------------------------------------------------------- /fluent_comments/templatetags/gravatar.py: -------------------------------------------------------------------------------- 1 | """ 2 | DCRM - Darwin Cydia Repository Manager 3 | Copyright (C) 2017 WU Zheng & 0xJacky 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published 7 | by the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Affero General Public License for more details. 14 | 15 | You should have received a copy of the GNU Affero General Public License 16 | along with this program. If not, see . 17 | """ 18 | 19 | import hashlib 20 | from urllib.parse import urlencode 21 | from django import template 22 | from DCRM.settings import LANGUAGE_CODE 23 | register = template.Library() 24 | 25 | # return only the URL of the gravatar 26 | # TEMPLATE USE: {{ email|gravatar_url:150 }} 27 | @register.filter 28 | def gravatar_url(email, size=128): 29 | # Optimize for Chinese 30 | url = "https://cdn.v2ex.com/gravatar/" if LANGUAGE_CODE == 'zh-Hans' else "https://www.gravatar.com/avatar/" 31 | # default image, doc: https://en.gravatar.com/site/implement/images/ 32 | default = 'mm' 33 | return url + "%s?%s" % (hashlib.md5(email.lower().encode()).hexdigest(), urlencode({'d': default, 's': str(size)})) 34 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | certifi==2020.4.5.1 3 | chardet==3.0.4 4 | Click==7.1.2 5 | croniter==0.3.32 6 | Django==1.11.29 # fixed 7 | #django-contrib-comments==1.9.2 8 | git+git://github.com/django/django-contrib-comments.git@f498cee0e04a4bcd4e061b25805c83ef08e9e536#egg=django-contrib-comments 9 | django-crispy-forms==1.9.1 10 | django-filter==2.2.0 11 | django-fluent-comments==2.1 12 | django-memcache-status==2.2 13 | django-model-utils==3.2.0 # fixed 14 | #django-photologue==3.11 15 | git+git://github.com/richardbarran/django-photologue.git@743d7ab78b720d9f8afa4dc3933163dffc690aae#egg=django-photologue 16 | django-redis-cache==2.1.1 17 | django-rq==2.1.0 # fixed 18 | #django-rq-scheduler==1.1.3 19 | git+git://github.com/Lessica/django-rq-scheduler.git@eeed256c7d37bce46cd30b24458c149528b4b180#egg=django-rq-scheduler 20 | django-sortedm2m==3.0.0 21 | django-tag-parser==3.2 22 | #django-threadedcomments==1.2 23 | git+git://github.com/Lessica/django-threadedcomments.git@266100f85570701ee6134e531ee1293584680c11#egg=django-threadedcomments 24 | djangorestframework==3.11.0 25 | ExifRead==2.1.2 26 | generic==1.0.0 27 | idna==2.9 28 | mysqlclient==1.4.6 29 | olefile==0.46 30 | packaging==20.4 31 | Pillow==7.1.2 32 | pyparsing==2.4.7 33 | python-akismet==0.4.2 34 | python-dateutil==2.8.1 35 | python-debian==0.1.37 36 | python-dotenv==0.13.0 37 | python-memcached==1.59 38 | pytz==2020.1 39 | redis==3.5.2 40 | requests==2.23.0 41 | rq==1.3.0 # fixed 42 | rq-scheduler==0.9.1 # fixed 43 | six==1.15.0 44 | sqlparse==0.3.1 45 | urllib3==1.25.9 46 | uWSGI==2.0.18 47 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/js/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | DCRM - Darwin Cydia Repository Manager 3 | Copyright (C) 2017 WU Zheng & 0xJacky 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU Affero General Public License as published 7 | by the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Affero General Public License for more details. 14 | 15 | You should have received a copy of the GNU Affero General Public License 16 | along with this program. If not, see . 17 | */ 18 | $(function() { 19 | $(".search-btn").click(function() { 20 | var $input = $(".search-input"); 21 | if ($(".search").hasClass("active")) { 22 | var value = $(".search-input").val(); 23 | if (value == "" || value == "null" || value == "NULL") { 24 | $(".search").removeClass("active"); 25 | $input.hide(); 26 | $(".links").show(); 27 | } else { 28 | $("#search-form").submit(); 29 | } 30 | } else { 31 | $("#search-form").show(); 32 | $input.show(); 33 | $(".search").addClass("active"); 34 | $(".links").hide(); 35 | } 36 | }); 37 | }); -------------------------------------------------------------------------------- /suit/sass/pages/_changeform.scss: -------------------------------------------------------------------------------- 1 | body.change-form { 2 | #content-main { 3 | > .object-tools { 4 | float: right; 5 | margin-top: -2.85rem; 6 | margin-bottom: 20px; 7 | overflow: hidden; 8 | li { 9 | display: inline-block; 10 | &.list-item { 11 | display: none; 12 | } 13 | } 14 | } 15 | > .object-tools + form { 16 | width: 100%; 17 | clear: both; 18 | } 19 | } 20 | &.suit_form_submit_on_right { 21 | // Hide object-tools from top in 2column layout 22 | #content-main { 23 | > .object-tools { 24 | margin-top: 0; 25 | li.heading { 26 | display: none; 27 | } 28 | @include media-breakpoint-up(lg) { 29 | display: none; 30 | } 31 | } 32 | } 33 | .edit-row { 34 | display: flex; 35 | > div { 36 | margin: 0 $grid-gutter-width-base/2; 37 | flex-wrap: wrap; 38 | &.col-left { 39 | flex: 1; 40 | } 41 | &.col-right { 42 | width: 22%; 43 | @include media-breakpoint-only(lg) { 44 | width: 25%; 45 | } 46 | @include media-breakpoint-down(md) { 47 | width: auto; 48 | flex: 1; 49 | flex-basis: 100%; 50 | } 51 | } 52 | } 53 | 54 | } 55 | } 56 | } 57 | // History table 58 | table#change-history { 59 | @extend .table; 60 | @extend #result_list; 61 | thead { 62 | > tr th { 63 | padding: $table-th-padding !important; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /suit/tests/settings.py: -------------------------------------------------------------------------------- 1 | DATABASES = { 2 | 'default': { 3 | 'ENGINE': 'django.db.backends.sqlite3', 4 | 'NAME': ':memory:', 5 | } 6 | } 7 | 8 | INSTALLED_APPS = [ 9 | 'suit', 10 | 'django.contrib.admin', 11 | 'django.contrib.sessions', 12 | 'django.contrib.auth', 13 | 'django.contrib.contenttypes', 14 | 'django.contrib.sites', 15 | ] 16 | 17 | MIDDLEWARE_CLASSES = [ 18 | 'django.middleware.security.SecurityMiddleware', 19 | 'django.contrib.sessions.middleware.SessionMiddleware', 20 | 'django.middleware.common.CommonMiddleware', 21 | 'django.middleware.csrf.CsrfViewMiddleware', 22 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 23 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 24 | 'django.contrib.messages.middleware.MessageMiddleware', 25 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 26 | ] 27 | 28 | TEMPLATES = [ 29 | { 30 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 31 | 'DIRS': [], 32 | 'APP_DIRS': True, 33 | 'OPTIONS': { 34 | 'context_processors': [ 35 | 'django.template.context_processors.debug', 36 | 'django.template.context_processors.request', 37 | 'django.contrib.auth.context_processors.auth', 38 | 'django.contrib.messages.context_processors.messages', 39 | ], 40 | }, 41 | }, 42 | ] 43 | 44 | SITE_ID = 1 45 | SECRET_KEY = 'secret-key' 46 | 47 | ROOT_URLCONF = 'suit.tests.urls' 48 | # STATIC_URL = '/site_media/static/' 49 | -------------------------------------------------------------------------------- /suit/sass/components/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | .breadcrumbs { 2 | font-size: $font-size-sm; 3 | color: $header-muted-color; 4 | position: relative; 5 | li { 6 | float: left; 7 | } 8 | a { 9 | color: $link-color; 10 | display: inline-block; 11 | margin: 0 .2rem; 12 | &:first-child { 13 | margin-left: 0; 14 | } 15 | } 16 | } 17 | body.suit_layout_vertical { 18 | #container { 19 | > .breadcrumbs { 20 | display: block; 21 | position: absolute; 22 | padding: 1.5rem $grid-gutter-width-base; 23 | left: $vertical-menu-width; 24 | } 25 | > .messagelist { 26 | display: none; 27 | } 28 | #content { 29 | .breadcrumbs { 30 | display: none; 31 | } 32 | .messagelist { 33 | margin: 0 0 $grid-gutter-width-base/2 0; 34 | } 35 | } 36 | } 37 | /*&.change-form { 38 | #container { 39 | > .breadcrumbs { 40 | display: none; 41 | } 42 | } 43 | #content { 44 | .breadcrumbs { 45 | } 46 | } 47 | }*/ 48 | } 49 | 50 | body.suit_layout_horizontal { 51 | .breadcrumbs { 52 | padding: 1.5rem $nav-padding-horizontal 0; 53 | } 54 | &.change-list { 55 | .breadcrumbs { 56 | display: none; 57 | } 58 | } 59 | &.change-form { 60 | #content { 61 | .breadcrumbs { 62 | display: none; 63 | padding: 1.5rem 0; 64 | position: relative; 65 | z-index: 6; 66 | li { 67 | float: left; 68 | } 69 | } 70 | .messagelist { 71 | display: none; 72 | } 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/os_version.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django_filters.rest_framework import DjangoFilterBackend 22 | from rest_framework import serializers, viewsets 23 | from WEIPDCRM.models.os_version import OSVersion 24 | 25 | 26 | class OSVersionSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = OSVersion 29 | fields = '__all__' 30 | 31 | 32 | class OSVersionViewSet(viewsets.ModelViewSet): 33 | serializer_class = OSVersionSerializer 34 | pagination_class = None 35 | filter_backends = [DjangoFilterBackend] 36 | filterset_fields = ['enabled', 'descriptor'] 37 | 38 | def get_queryset(self): 39 | queryset = OSVersion.objects.all() 40 | if not self.request.user.is_superuser: 41 | queryset = queryset.filter(enabled=True) 42 | return queryset 43 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/device_type.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django_filters.rest_framework import DjangoFilterBackend 22 | from rest_framework import serializers, viewsets 23 | from WEIPDCRM.models.device_type import DeviceType 24 | 25 | 26 | class DeviceTypeSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = DeviceType 29 | fields = '__all__' 30 | 31 | 32 | class DeviceTypeViewSet(viewsets.ModelViewSet): 33 | serializer_class = DeviceTypeSerializer 34 | pagination_class = None 35 | filter_backends = [DjangoFilterBackend] 36 | filterset_fields = ['enabled', 'platform', 'subtype'] 37 | 38 | def get_queryset(self): 39 | queryset = DeviceType.objects.all() 40 | if not self.request.user.is_superuser: 41 | queryset = queryset.filter(enabled=True) 42 | return queryset 43 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/group.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django.contrib.auth.models import Group 22 | from rest_framework import serializers, viewsets, permissions 23 | from rest_framework.pagination import LimitOffsetPagination 24 | 25 | 26 | class GroupSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = Group 29 | exclude = [] 30 | 31 | 32 | class GroupViewSet(viewsets.ModelViewSet): 33 | queryset = Group.objects.all() 34 | serializer_class = GroupSerializer 35 | pagination_class = LimitOffsetPagination 36 | 37 | def get_permissions(self): 38 | if self.action == 'list' or self.action == 'retrieve': 39 | permission_classes = [permissions.IsAuthenticated] 40 | else: 41 | permission_classes = [permissions.IsAdminUser] 42 | return [permission() for permission in permission_classes] -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/views/chart.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng & 0xJacky 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | 20 | Notice: You have used class-based views, that's awesome. 21 | If not necessary, you can try function-based views. 22 | You may add lines above as license. 23 | """ 24 | 25 | from __future__ import unicode_literals 26 | 27 | from django.views.generic import ListView 28 | from WEIPDCRM.models.package import Package 29 | 30 | 31 | class ChartView(ListView): 32 | model = Package 33 | context_object_name = 'package_list' 34 | ordering = '-download_count' 35 | template_name = 'chart.html' 36 | 37 | def get_queryset(self): 38 | """ 39 | Get 12 packages ordering by download times. 40 | 41 | :return: QuerySet 42 | """ 43 | queryset = super(ChartView, self).get_queryset()[:12] 44 | return queryset 45 | 46 | -------------------------------------------------------------------------------- /WEIPDCRM/manage/admin/os_version.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from __future__ import unicode_literals 22 | 23 | from django.contrib import admin 24 | from django.contrib.admin.actions import delete_selected 25 | from django.utils.translation import ugettext_lazy as _ 26 | 27 | 28 | class OSVersionAdmin(admin.ModelAdmin): 29 | actions = [delete_selected] 30 | list_display = ('descriptor', 'build', 'created_at') 31 | search_fields = ['descriptor', 'build'] 32 | readonly_fields = ['created_at'] 33 | fieldsets = [ 34 | (_('General'), { 35 | 'fields': ['enabled', 'descriptor', 'build'] 36 | }), 37 | (_('Appearance'), { 38 | 'fields': ['icon'] 39 | }), 40 | (_('History'), { 41 | 'fields': ['created_at'] 42 | }), 43 | ] 44 | change_form_template = "admin/os_version/change_form.html" 45 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/photo.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django_filters.rest_framework import DjangoFilterBackend 22 | from photologue.models import Photo 23 | from rest_framework import serializers, viewsets 24 | from rest_framework.pagination import LimitOffsetPagination 25 | 26 | 27 | class PhotoSerializer(serializers.ModelSerializer): 28 | class Meta: 29 | model = Photo 30 | exclude = ['sites', 'effect'] 31 | 32 | 33 | class PhotoViewSet(viewsets.ModelViewSet): 34 | serializer_class = PhotoSerializer 35 | pagination_class = LimitOffsetPagination 36 | filter_backends = [DjangoFilterBackend] 37 | filterset_fields = ['slug', 'is_public'] 38 | 39 | def get_queryset(self): 40 | queryset = Photo.objects.all() 41 | if not self.request.user.is_superuser: 42 | queryset = queryset.filter(is_public=True) 43 | return queryset 44 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/static/css/content-list.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width: 985px) { 2 | .widget-area { 3 | display: none; 4 | } 5 | 6 | .container .content { 7 | padding-top: 90px; 8 | margin-bottom: 15px; 9 | } 10 | } 11 | 12 | @media screen and (max-width: 694px) { 13 | .container .content { 14 | padding-top: 58px; 15 | } 16 | 17 | .container .content .list .list-item { 18 | width: 90%; 19 | height: 38px; 20 | padding: 0 16px; 21 | margin-bottom: 10px; 22 | } 23 | 24 | .container .content .content-list { 25 | margin-bottom: 15px; 26 | min-height: 100px; 27 | width: 100%; 28 | border-radius: 0; 29 | } 30 | 31 | .container .content .title { 32 | display: none; 33 | } 34 | 35 | .container .list { 36 | padding: 20px 0 0; 37 | } 38 | 39 | .container .content .list .list-item .icon { 40 | float: left; 41 | height: 30px; 42 | width: 30px; 43 | } 44 | 45 | .container .content .list .list-item .icon img { 46 | height: 30px; 47 | width: 30px; 48 | } 49 | 50 | .container .content .list .list-item .tag { 51 | display: none; 52 | } 53 | 54 | .container .content .list .list-item .title { 55 | float: left; 56 | text-align: left; 57 | padding-left: 10px; 58 | } 59 | 60 | .container .content .list .list-item .title-tag { 61 | height: auto; 62 | } 63 | 64 | .container .content .list .list-item .go { 65 | display: block; 66 | float: right; 67 | color: #444; 68 | } 69 | } -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/pagination.html: -------------------------------------------------------------------------------- 1 | {% load paginate_tags %}{% paginate %} 2 | 49 | -------------------------------------------------------------------------------- /WEIPDCRM/manage/admin/device_type.py: -------------------------------------------------------------------------------- 1 | # coding:utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from __future__ import unicode_literals 22 | 23 | from django.contrib import admin 24 | from django.contrib.admin.actions import delete_selected 25 | from django.utils.translation import ugettext_lazy as _ 26 | 27 | 28 | class DeviceTypeAdmin(admin.ModelAdmin): 29 | actions = [delete_selected] 30 | list_display = ('descriptor', 'subtype', 'platform', 'created_at') 31 | search_fields = ['descriptor', 'subtype', 'platform'] 32 | readonly_fields = ['created_at'] 33 | fieldsets = [ 34 | (_('General'), { 35 | 'fields': ['enabled', 'descriptor', 'subtype', 'platform'] 36 | }), 37 | (_('Appearance'), { 38 | 'fields': ['icon'] 39 | }), 40 | (_('History'), { 41 | 'fields': ['created_at'] 42 | }), 43 | ] 44 | change_form_template = "admin/device_type/change_form.html" 45 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/views/search.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng & 0xJacky 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | 20 | Notice: You have used class-based views, that's awesome. 21 | If not necessary, you can try function-based views. 22 | You may add lines above as license. 23 | """ 24 | 25 | from __future__ import unicode_literals 26 | 27 | from django.shortcuts import render 28 | from django.http import HttpResponseBadRequest 29 | from django.template.context_processors import csrf 30 | 31 | from WEIPDCRM.models.package import Package 32 | 33 | 34 | def search_view(request): 35 | context = {} 36 | if request.POST: 37 | context.update(csrf(request)) 38 | context['request'] = request.POST['package'] 39 | context['package_list'] = Package.objects.filter(c_name__icontains=request.POST['package'])[:24] 40 | else: 41 | return HttpResponseBadRequest() 42 | return render(request, 'search.html', context) 43 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/build.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework import serializers, viewsets, permissions 22 | from rest_framework.pagination import LimitOffsetPagination 23 | from WEIPDCRM.models.build import Build 24 | from WEIPDCRM.permissions import DenyAny 25 | 26 | 27 | class BuildSerializer(serializers.ModelSerializer): 28 | class Meta: 29 | model = Build 30 | fields = '__all__' 31 | 32 | 33 | class BuildViewSet(viewsets.ModelViewSet): 34 | queryset = Build.objects.all() 35 | serializer_class = BuildSerializer 36 | pagination_class = LimitOffsetPagination 37 | 38 | # TODO: allow build changes (create only) 39 | def get_permissions(self): 40 | if self.action == 'list' or self.action == 'retrieve': 41 | permission_classes = [permissions.AllowAny] 42 | else: 43 | permission_classes = [DenyAny] 44 | return [permission() for permission in permission_classes] 45 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/site.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | from django.contrib.sites.models import Site 21 | from rest_framework import serializers, viewsets, permissions 22 | 23 | from WEIPDCRM.permissions import DenyAny 24 | 25 | 26 | class SiteSerializer(serializers.ModelSerializer): 27 | class Meta: 28 | model = Site 29 | exclude = [] 30 | 31 | 32 | class SiteViewSet(viewsets.ModelViewSet): 33 | queryset = Site.objects.all() 34 | serializer_class = SiteSerializer 35 | pagination_class = None 36 | 37 | def get_permissions(self): 38 | if self.action == 'partial_update' or self.action == 'update': 39 | permission_classes = [permissions.IsAdminUser] 40 | elif self.action == 'list' or self.action == 'retrieve': 41 | permission_classes = [permissions.IsAuthenticated] 42 | else: 43 | permission_classes = [DenyAny] 44 | return [permission() for permission in permission_classes] 45 | -------------------------------------------------------------------------------- /suit/templates/admin/change_list_results.html: -------------------------------------------------------------------------------- 1 | {% load i18n admin_static suit_list %} 2 | {% if result_hidden_fields %} 3 |
    {# DIV for HTML validation #} 4 | {% for item in result_hidden_fields %}{{ item }}{% endfor %} 5 |
    6 | {% endif %} 7 | {% if results %} 8 |
    9 | 10 | 11 | 12 | {% for header in result_headers|headers_handler:cl %} 13 | {% endfor %} 26 | 27 | 28 | 29 | {% for result in results|cells_handler:cl %} 30 | {% if result.form.non_field_errors %} 31 | 32 | {% endif %} 33 | {% for item in result %}{{ item }}{% endfor %} 34 | {% endfor %} 35 | 36 |
    14 | {% if header.sortable %} 15 | {% if header.sort_priority > 0 %} 16 |
    17 | 18 | {% if num_sorted_fields > 1 %}{{ header.sort_priority }}{% endif %} 19 | 20 |
    21 | {% endif %} 22 | {% endif %} 23 |
    {% if header.sortable %}{{ header.text|capfirst }}{% else %}{{ header.text|capfirst }}{% endif %}
    24 |
    25 |
    {{ result.form.non_field_errors }}
    37 |
    38 | {% endif %} 39 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/package/history.html: -------------------------------------------------------------------------------- 1 | {% extends "package/package.html" %} 2 | {% load i18n staticfiles %} 3 | {% block title %}{% blocktrans with package_info.c_name as c_name %}History {{ c_name }}{% endblocktrans %}{% endblock %} 4 | 5 | {% block content %} 6 |
    7 | {% for version in version_list %} 8 |
    9 |
    10 |

    {{ version.c_version }}

    11 | {{ version.created_at | date:"Y-m-d H:i:s" }} 12 |
    13 |
    14 |

    {{ version.update_logs | linebreaksbr }}

    15 | 16 | {% trans "View this version" %} 17 | 18 |
    19 | {% endfor %} 20 |
    21 | {% endblock %} 22 | {% block footerscript %} 23 | 41 | {% endblock %} -------------------------------------------------------------------------------- /suit/templates/suit/search_form.html: -------------------------------------------------------------------------------- 1 | {% load i18n static suit_list %} 2 | {% if cl.search_fields %} 3 |
    4 | 30 |
    31 | {% endif %} 32 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/user.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django.contrib.auth.models import User 22 | from rest_framework import serializers, viewsets, permissions 23 | from rest_framework.pagination import LimitOffsetPagination 24 | from WEIPDCRM.apis.group import GroupSerializer 25 | 26 | 27 | class UserSerializer(serializers.ModelSerializer): 28 | class Meta: 29 | model = User 30 | exclude = ['password'] 31 | 32 | _groups = GroupSerializer(source='groups', many=True, read_only=True) 33 | 34 | 35 | class UserViewSet(viewsets.ModelViewSet): 36 | queryset = User.objects.all() 37 | serializer_class = UserSerializer 38 | pagination_class = LimitOffsetPagination 39 | 40 | def get_permissions(self): 41 | if self.action == 'list' or self.action == 'retrieve': 42 | permission_classes = [permissions.IsAuthenticated] 43 | else: 44 | permission_classes = [permissions.IsAdminUser] 45 | return [permission() for permission in permission_classes] 46 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/pagination-in-section.html: -------------------------------------------------------------------------------- 1 | {% load paginate_tags %}{% paginate %} 2 | 49 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/comment.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from django_filters.rest_framework import DjangoFilterBackend 22 | from rest_framework import serializers, viewsets, routers, permissions 23 | from rest_framework.pagination import LimitOffsetPagination 24 | from rest_framework.permissions import BasePermission 25 | from threadedcomments.models import ThreadedComment 26 | 27 | 28 | class CommentSerializer(serializers.ModelSerializer): 29 | class Meta: 30 | model = ThreadedComment 31 | exclude = ['site', 'user'] 32 | 33 | 34 | class CommentViewSet(viewsets.ModelViewSet): 35 | queryset = ThreadedComment.objects.all() 36 | # permission_classes = [AllowAny] 37 | serializer_class = CommentSerializer 38 | pagination_class = LimitOffsetPagination 39 | filter_backends = [DjangoFilterBackend] 40 | filterset_fields = ['content_type', 'object_pk', 41 | 'user_name', 'user_email', 42 | 'is_public', 'is_removed', 43 | 'parent', 'last_child'] 44 | -------------------------------------------------------------------------------- /suit/sass/components/_sortables.scss: -------------------------------------------------------------------------------- 1 | /* TabularInlines Sortables */ 2 | .inline-sortable { 3 | white-space: nowrap; 4 | a { 5 | color: #000; 6 | padding: .3rem .4rem 0 .2rem; 7 | #result_list & { 8 | padding-top: .05rem; 9 | } 10 | display: inline-block; 11 | opacity: .4; 12 | &:last-child { 13 | padding: 0; 14 | } 15 | &:hover { 16 | opacity: .7; 17 | } 18 | } 19 | } 20 | // For debugging purposes 21 | .suit-sortable { 22 | //display: block !important; 23 | color: $body-color; 24 | } 25 | .selected td { 26 | .inline-sortable a { 27 | color: #fff; 28 | &:hover { 29 | } 30 | } 31 | } 32 | tr:first-child td .inline-sortable .sortable-up { 33 | visibility: hidden; 34 | cursor: default; 35 | } 36 | .tabular { 37 | // Class added by sortable JS 38 | tr.last-sortable, 39 | tr.form-row:nth-last-child(2) 40 | // Can't use following 3rd child as it will be wrong if max inlines limit is reached 41 | //tr.form-row:nth-last-child(3), 42 | { 43 | td .inline-sortable .sortable-down { 44 | visibility: hidden; 45 | cursor: default; 46 | } 47 | } 48 | } 49 | #result_list tr:last-child { 50 | td .inline-sortable .sortable-down { 51 | visibility: hidden; 52 | cursor: default; 53 | } 54 | } 55 | /* StackedInline sortables */ 56 | .stacked-inline-sortable { 57 | float: left; 58 | :first-child { 59 | padding-right: 1px; 60 | } 61 | &:nth-last-child(2) { 62 | margin-right: 10px; 63 | } 64 | a { 65 | color: $gray-lighter; 66 | &:hover { 67 | color: #fff; 68 | } 69 | } 70 | } 71 | .inline-group > div:first-of-type .stacked-inline-sortable .sortable-up, 72 | .inline-group > div:nth-last-child(3) .stacked-inline-sortable .sortable-down { 73 | opacity: .15 !important; 74 | cursor: default; 75 | } 76 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/gallery.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | from django_filters.rest_framework import DjangoFilterBackend 21 | from photologue.models import Gallery 22 | from rest_framework import serializers, viewsets 23 | from rest_framework.pagination import LimitOffsetPagination 24 | 25 | from WEIPDCRM.apis.photo import PhotoSerializer 26 | 27 | 28 | class GallerySerializer(serializers.ModelSerializer): 29 | class Meta: 30 | model = Gallery 31 | exclude = ['sites'] 32 | 33 | _photos = PhotoSerializer(source='photos', many=True, read_only=True) 34 | 35 | 36 | class GalleryViewSet(viewsets.ModelViewSet): 37 | queryset = Gallery.objects.all() 38 | serializer_class = GallerySerializer 39 | pagination_class = LimitOffsetPagination 40 | filter_backends = [DjangoFilterBackend] 41 | filterset_fields = ['slug', 'is_public'] 42 | 43 | def get_queryset(self): 44 | queryset = Gallery.objects.all() 45 | if not self.request.user.is_superuser: 46 | queryset = queryset.filter(is_public=True) 47 | return queryset 48 | -------------------------------------------------------------------------------- /suit/template.py: -------------------------------------------------------------------------------- 1 | from os.path import dirname, join, abspath 2 | from django.template.loaders.filesystem import Loader as FilesystemLoader 3 | 4 | _cache = {} 5 | 6 | 7 | class Loader(FilesystemLoader): 8 | is_usable = True 9 | 10 | def get_template_sources(self, template_name, template_dirs=None): 11 | """ 12 | Returns the absolute paths to "template_name" in the specified app. 13 | If the name does not contain an app name (no colon), an empty list 14 | is returned. 15 | The parent FilesystemLoader.load_template_source() will take care 16 | of the actual loading for us. 17 | """ 18 | if not ':' in template_name: 19 | return [] 20 | app_name, template_name = template_name.split(":", 1) 21 | template_dir = get_app_template_dir(app_name) 22 | if template_dir: 23 | return [join(template_dir, template_name)] 24 | else: 25 | return [] 26 | 27 | 28 | def get_app_template_dir(app_name): 29 | """Get the template directory for an application 30 | 31 | We do not use django.db.models.get_app, because this will fail if an 32 | app does not have any models. 33 | 34 | Returns a full path, or None if the app was not found. 35 | """ 36 | from django.conf import settings 37 | from importlib import import_module 38 | if app_name in _cache: 39 | return _cache[app_name] 40 | template_dir = None 41 | for app in settings.INSTALLED_APPS: 42 | if app.split('.')[-1] == app_name: 43 | # Do not hide import errors; these should never happen at this point 44 | # anyway 45 | mod = import_module(app) 46 | template_dir = join(abspath(dirname(mod.__file__)), 'templates') 47 | break 48 | _cache[app_name] = template_dir 49 | return template_dir 50 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/section-list.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n staticfiles %} 3 | {% block title %}{% trans 'Section List' %}{% endblock %} 4 | {% block stylesheet %} 5 | {{ block.super }} 6 | 7 | {% endblock %} 8 | {% block breadcrumbs %} 9 | {% trans 'Home' %} 10 | {% trans 'Section List' %} 11 | {% endblock %} 12 | {% block content %} 13 |
    14 |

    {% trans 'Section List' %}

    15 |
    16 | {% for section in section_list %} 17 | 33 | {% endfor %} 34 |
    35 |
    36 | {% include 'pagination.html' %} 37 |
    38 | {% endblock %} 39 | {% block section_list %}{% endblock %} 40 | -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/help/about.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/base_site.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block breadcrumbs %} 6 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 |
    14 |
    15 | {% trans "About DCRM" %} 16 |
    17 |
    18 |

    {% trans "Darwin Cydia Repository Manager (DCRM)" %}

    19 |

    20 | {% blocktrans %} 21 | Version: {{ version }}
    22 | Open source Repository Manager for Cydia™/APT.

    23 | 24 | Designer: @i_82
    25 | Frontend: @0xJacky
    26 | Special Thanks: Saurik/Django/Django Suit/Django RQ

    27 | Copyright © 2020 Zheng Wu. All Rights Reserved.
    28 | {% endblocktrans %} 29 |

    30 |

    {% blocktrans %}This program is free software, you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation either version 3 of the License.{% endblocktrans %}

    31 | View on Github 32 |
    33 |
    34 | {% endblock %} -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0009_auto_20170326_0531.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-03-26 03:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0008_auto_20170326_0344'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='setting', 17 | name='copyright_name', 18 | field=models.CharField(help_text='Corpyright name is displayed on the footer of the page, leave a blank will display the source name.', max_length=255, null=True, verbose_name='Copyright Name'), 19 | ), 20 | migrations.AddField( 21 | model_name='setting', 22 | name='copyright_year', 23 | field=models.FloatField(help_text='If input 2016, the final display is \xa9 2010-1490499101, leave a blank will display \xa9 %d', max_length=255, null=True, verbose_name='Starting Year of Copyright'), 24 | ), 25 | migrations.AddField( 26 | model_name='setting', 27 | name='footer_icp', 28 | field=models.CharField(help_text='ICP Number is displayed on the footer of the page.', max_length=255, null=True, verbose_name='ICP Number'), 29 | ), 30 | migrations.AlterField( 31 | model_name='setting', 32 | name='qq_group_url', 33 | field=models.URLField(help_text='Show QQ Group link in mobile package info page.', max_length=255, null=True, verbose_name='QQ Group URL'), 34 | ), 35 | migrations.AlterField( 36 | model_name='setting', 37 | name='weibo_url', 38 | field=models.URLField(help_text='Show Weibo link in mobile package info page.', max_length=255, null=True, verbose_name='Weibo URL'), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0019_auto_20170407_1814.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-04-07 16:14 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0018_auto_20170402_1511'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='package', 17 | options={'managed': False, 'verbose_name': '\u8f6f\u4ef6\u5305', 'verbose_name_plural': 'Packages'}, 18 | ), 19 | migrations.AlterField( 20 | model_name='osversion', 21 | name='descriptor', 22 | field=models.CharField(help_text='Example: 10.2', max_length=255, verbose_name='\u7248\u672c'), 23 | ), 24 | migrations.AlterField( 25 | model_name='release', 26 | name='description', 27 | field=models.TextField(blank=True, help_text='On the package source screen a short description is listed of the repository. This description may eventually work similarly to that of a package (with a long/short variety and the aforementioned encoding), but for right now only the shorter description is displayed directly on the list.', verbose_name='\u63cf\u8ff0'), 28 | ), 29 | migrations.AlterField( 30 | model_name='release', 31 | name='support', 32 | field=models.URLField(blank=True, help_text='Official site to provide support.', max_length=255, null=True, verbose_name='\u652f\u6301'), 33 | ), 34 | migrations.AlterField( 35 | model_name='release', 36 | name='version', 37 | field=models.CharField(default='0.0.1-1', help_text='This is an arbitrary version number that nothing actually parses. I am going to look into seeing how required it is.', max_length=255, verbose_name='\u7248\u672c'), 38 | ), 39 | ] 40 | -------------------------------------------------------------------------------- /WEIPDCRM/migrations/0022_auto_20170812_2207.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.10.5 on 2017-08-12 14:07 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('WEIPDCRM', '0021_auto_20170415_1136'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='package', 17 | options={'managed': False, 'verbose_name': '\u8f6f\u4ef6\u5305', 'verbose_name_plural': 'Packages'}, 18 | ), 19 | migrations.AlterField( 20 | model_name='osversion', 21 | name='descriptor', 22 | field=models.CharField(help_text='Example: 10.2', max_length=255, verbose_name='\u7248\u672c'), 23 | ), 24 | migrations.AlterField( 25 | model_name='release', 26 | name='description', 27 | field=models.TextField(blank=True, help_text='On the package source screen a short description is listed of the repository. This description may eventually work similarly to that of a package (with a long/short variety and the aforementioned encoding), but for right now only the shorter description is displayed directly on the list.', verbose_name='\u63cf\u8ff0'), 28 | ), 29 | migrations.AlterField( 30 | model_name='release', 31 | name='support', 32 | field=models.URLField(blank=True, help_text='Official site to provide support.', max_length=255, null=True, verbose_name='\u652f\u6301'), 33 | ), 34 | migrations.AlterField( 35 | model_name='release', 36 | name='version', 37 | field=models.CharField(default='0.0.1-1', help_text='This is an arbitrary version number that nothing actually parses. I am going to look into seeing how required it is.', max_length=255, verbose_name='\u7248\u672c'), 38 | ), 39 | ] 40 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/templates/section.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n staticfiles %} 3 | {% block title %}{% trans 'Section' %} {{ c_section.name }}{% endblock %} 4 | {% block stylesheet %} 5 | {{ block.super }} 6 | 7 | {% endblock %} 8 | {% block breadcrumbs %} 9 | {% trans 'Home' %} 10 | {{ c_section.name }} 11 | {% endblock %} 12 | {% block content %} 13 |
    14 |

    {{ c_section.name }}

    15 | 37 |
    38 | {% include 'pagination-in-section.html' %} 39 |
    40 | {% endblock %} -------------------------------------------------------------------------------- /WEIPDCRM/templates/admin/version/change_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/new_change_form.html' %} 2 | {% load i18n admin_urls content_type to_slug %} 3 | {% block object-tools-items %} 4 |
  • 5 | {% if original.gallery %} 6 | 7 | {% trans "Upload Screenshot" %} 8 | 9 | 10 | {% trans "Screenshots" %} 11 | 12 | {% else %} 13 | 14 | {% trans "Upload Screenshot" %} 15 | 16 | {% endif %} 17 | 18 | {% trans "Comments" %} 19 | 20 | 21 | {% trans "Package" %} 22 | 23 |
  • 24 | {{ block.super }} 25 | {% endblock %} 26 | {% block object-tools %} 27 | {{ block.super }} 28 | 39 | {% endblock %} 40 | -------------------------------------------------------------------------------- /fluent_comments/templates/comments/form.html: -------------------------------------------------------------------------------- 1 | {% load comments i18n crispy_forms_tags fluent_comments_tags staticfiles %} 2 | 3 | {% if not form.target_object|comments_are_open %} 4 |

    {% trans "Comments are closed." %}

    5 | {% else %} 6 | {% if not form.helper or not form.helper.form_tag %} 7 |
    9 | {% if next %}
    {% endif %} 10 | {% endif %} 11 | 12 | {% block comment_form %} 13 | {% block form_fields %} 14 | {% crispy form %} 15 | {% endblock %} 16 | 24 | {% block form_actions %} 25 | {% if not form.helper.inputs %} 26 |
    27 |
    28 | 29 | {% ajax_comment_tags for form.target_object %} 30 |
    31 |
    32 |
    33 | {% else %} 34 | {% ajax_comment_tags for form.target_object %} 35 | {% endif %} 36 | {% endblock %} 37 | {% endblock %} 38 | 39 | {% if not form.helper or not form.helper.form_tag %} 40 |
    41 | {% endif %} 42 | {% endif %} 43 | -------------------------------------------------------------------------------- /WEIPDCRM/views/admin/release.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from __future__ import unicode_literals 22 | 23 | from django.contrib.admin.views.decorators import staff_member_required 24 | 25 | from django.utils.translation import ugettext_lazy as _ 26 | from django.contrib import messages 27 | from django.shortcuts import redirect 28 | from django.urls import reverse 29 | from django.utils.safestring import mark_safe 30 | 31 | from WEIPDCRM.models.release import Release 32 | from WEIPDCRM.models.setting import Setting 33 | 34 | 35 | @staff_member_required 36 | def set_default_view(request, release_id): 37 | """ 38 | :param release_id: The release 39 | :param request: Django Request 40 | :return: Redirect Response 41 | """ 42 | release_instance = Release.objects.get(id=release_id) 43 | 44 | messages.info(request, mark_safe(_( 45 | "Active release \"{release}\" has been set.").format( 46 | release_url=release_instance.get_admin_url(), 47 | release=str(release_instance) 48 | ) 49 | )) 50 | 51 | setting_instance = Setting.objects.get() 52 | setting_instance.active_release = release_instance 53 | setting_instance.save() 54 | 55 | return redirect(setting_instance.get_admin_url()) 56 | -------------------------------------------------------------------------------- /fluent_comments/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Internal utils 3 | """ 4 | import sys 5 | import traceback 6 | 7 | from django.contrib.contenttypes.models import ContentType 8 | from django.core.exceptions import ImproperlyConfigured 9 | from fluent_comments import appsettings 10 | 11 | try: 12 | from importlib import import_module 13 | except ImportError: 14 | from django.utils.importlib import import_module # Python 2.6 compatibility 15 | 16 | 17 | def get_comment_template_name(comment): 18 | """ 19 | Internal function for the rendering of comments. 20 | """ 21 | ctype = ContentType.objects.get_for_id(comment.content_type_id) 22 | return [ 23 | "comments/%s/%s/comment.html" % (ctype.app_label, ctype.model), 24 | "comments/%s/comment.html" % ctype.app_label, 25 | "comments/comment.html" 26 | ] 27 | 28 | 29 | def get_comment_context_data(comment, action=None): 30 | """ 31 | Internal function for the rendering of comments. 32 | """ 33 | return { 34 | 'comment': comment, 35 | 'action': action, 36 | 'preview': (action == 'preview'), 37 | 'USE_THREADEDCOMMENTS': appsettings.USE_THREADEDCOMMENTS, 38 | } 39 | 40 | 41 | def import_symbol(import_path, setting_name): 42 | """ 43 | Import a class or function by name. 44 | """ 45 | mod_name, class_name = import_path.rsplit('.', 1) 46 | 47 | # import module 48 | try: 49 | mod = import_module(mod_name) 50 | cls = getattr(mod, class_name) 51 | except ImportError as e: 52 | __, __, exc_traceback = sys.exc_info() 53 | frames = traceback.extract_tb(exc_traceback) 54 | if len(frames) > 1 and any('importlib' not in f[0] for f in frames[1:]): 55 | raise # import error is a level deeper. 56 | 57 | raise ImproperlyConfigured("{0} does not point to an existing class: {1}".format(setting_name, import_path)) 58 | except AttributeError: 59 | raise ImproperlyConfigured("{0} does not point to an existing class: {1}".format(setting_name, import_path)) 60 | 61 | return cls 62 | 63 | -------------------------------------------------------------------------------- /WEIPDCRM/apis/setting.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | """ 20 | 21 | from rest_framework import serializers, viewsets, permissions 22 | from WEIPDCRM.apis.release import ReleaseSerializer 23 | from WEIPDCRM.apis.site import SiteSerializer 24 | from WEIPDCRM.models.setting import Setting 25 | from WEIPDCRM.permissions import DenyAny 26 | 27 | 28 | class SettingSerializer(serializers.ModelSerializer): 29 | class Meta: 30 | model = Setting 31 | exclude = [] 32 | 33 | _favicon_link = serializers.URLField(source='favicon_link', read_only=True) 34 | _active_release = ReleaseSerializer(source='active_release', many=False, read_only=True) 35 | sites = SiteSerializer(many=True, read_only=True) 36 | 37 | 38 | class SettingViewSet(viewsets.ModelViewSet): 39 | queryset = Setting.objects.all() 40 | serializer_class = SettingSerializer 41 | pagination_class = None 42 | 43 | def get_permissions(self): 44 | if self.action == 'partial_update' or self.action == 'update': 45 | permission_classes = [permissions.IsAdminUser] 46 | elif self.action == 'list' or self.action == 'retrieve': 47 | permission_classes = [permissions.IsAuthenticated] 48 | else: 49 | permission_classes = [DenyAny] 50 | return [permission() for permission in permission_classes] 51 | -------------------------------------------------------------------------------- /suit/config.py: -------------------------------------------------------------------------------- 1 | from django.apps import apps 2 | from django.template import VariableDoesNotExist 3 | from suit.apps import DjangoSuitConfig 4 | 5 | 6 | def get_config_instance(app_name=None): 7 | """ 8 | :rtype: DjangoSuitConfig() 9 | """ 10 | try: 11 | config = apps.get_app_config(app_name or 'suit') 12 | if isinstance(config, DjangoSuitConfig): 13 | return config 14 | except LookupError: 15 | pass 16 | return apps.get_app_config('suit') 17 | 18 | 19 | #: :type: DjangoSuitConfig() 20 | suit_config_cls = DjangoSuitConfig 21 | 22 | 23 | def get_config(param=None, request=None): 24 | suit_config = get_config_instance(get_current_app(request) if request else None) 25 | 26 | # Allow overriding suit config by request 27 | # Used only for demo purposes 28 | req_key = '__suit_config_by_request' 29 | if request and not hasattr(req_key, req_key): 30 | setattr(request, req_key, True) 31 | for k, v in request.GET.items(): 32 | if k.startswith('__suit_'): 33 | setattr(suit_config, k[7:], v) 34 | 35 | if param: 36 | value = getattr(suit_config, param, None) 37 | if value is None: 38 | value = getattr(suit_config_cls, param, None) 39 | return value 40 | 41 | return suit_config 42 | 43 | 44 | def get_current_app(request): 45 | try: 46 | return request.current_app 47 | except (VariableDoesNotExist, AttributeError): 48 | pass 49 | return None 50 | 51 | 52 | def set_config_value(name, value): 53 | config = get_config() 54 | # Store previous value to reset later if needed 55 | prev_value_key = '_%s' % name 56 | if not hasattr(config, prev_value_key): 57 | setattr(config, prev_value_key, getattr(config, name)) 58 | setattr(config, name, value) 59 | 60 | 61 | def reset_config_value(name): 62 | config = get_config() 63 | prev_value_key = '_%s' % name 64 | if hasattr(config, prev_value_key): 65 | setattr(config, name, getattr(config, prev_value_key)) 66 | del config.__dict__[prev_value_key] 67 | -------------------------------------------------------------------------------- /WEIPDCRM/styles/DefaultStyle/views/section_list.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | """ 4 | DCRM - Darwin Cydia Repository Manager 5 | Copyright (C) 2017 WU Zheng 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Affero General Public License as published 9 | by the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Affero General Public License for more details. 16 | 17 | You should have received a copy of the GNU Affero General Public License 18 | along with this program. If not, see . 19 | 20 | Notice: You have used class-based views, that's awesome. 21 | If not necessary, you can try function-based views. 22 | You may add lines above as license. 23 | """ 24 | 25 | from __future__ import unicode_literals 26 | 27 | from django.views.generic import ListView 28 | from django.views.decorators.vary import vary_on_headers 29 | from django.views.decorators.clickjacking import xframe_options_exempt 30 | from WEIPDCRM.models.section import Section 31 | 32 | class SectionListView(ListView): 33 | allow_empty = True 34 | paginate_by = 12 35 | ordering = 'name' 36 | model = Section 37 | context_object_name = 'section_list' 38 | template_name = 'section-list.html' 39 | 40 | @xframe_options_exempt 41 | def get(self, request, *args, **kwargs): 42 | return super(SectionListView, self).get(request, *args, **kwargs) 43 | 44 | def get_context_data(self, **kwargs): 45 | """ 46 | Merge global settings to current context 47 | """ 48 | context = super(SectionListView, self).get_context_data(**kwargs) 49 | context['url_name'] = "section_list_page" 50 | context['page'] = (self.kwargs.get('page') or 1) 51 | context['section_num'] = Section.objects.all().count() 52 | return context 53 | -------------------------------------------------------------------------------- /suit/templatetags/suit_menu.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from django import template 3 | from django.contrib.admin import AdminSite 4 | from django.http import HttpRequest 5 | from django.core.urlresolvers import reverse, resolve 6 | from suit.menu import MenuManager 7 | 8 | register = template.Library() 9 | 10 | 11 | @register.assignment_tag(takes_context=True) 12 | def get_menu(context, request): 13 | """ 14 | :type request: WSGIRequest 15 | """ 16 | if not isinstance(request, HttpRequest): 17 | return None 18 | 19 | # Django 1.9+ 20 | available_apps = context.get('available_apps') 21 | if not available_apps: 22 | 23 | # Django 1.8 on app index only 24 | available_apps = context.get('app_list') 25 | 26 | # Django 1.8 on rest of the pages 27 | if not available_apps: 28 | try: 29 | from django.contrib import admin 30 | template_response = get_admin_site(request.current_app).index(request) 31 | available_apps = template_response.context_data['app_list'] 32 | except Exception: 33 | pass 34 | 35 | if not available_apps: 36 | logging.warn('Django Suit was unable to retrieve apps list for menu.') 37 | 38 | return MenuManager(available_apps, context, request) 39 | 40 | 41 | def get_admin_site(current_app): 42 | """ 43 | Method tries to get actual admin.site class, if any custom admin sites 44 | were used. Couldn't find any other references to actual class other than 45 | in func_closer dict in index() func returned by resolver. 46 | """ 47 | try: 48 | resolver_match = resolve(reverse('%s:index' % current_app)) 49 | # Django 1.9 exposes AdminSite instance directly on view function 50 | if hasattr(resolver_match.func, 'admin_site'): 51 | return resolver_match.func.admin_site 52 | 53 | for func_closure in resolver_match.func.__closure__: 54 | if isinstance(func_closure.cell_contents, AdminSite): 55 | return func_closure.cell_contents 56 | except: 57 | pass 58 | from django.contrib import admin 59 | return admin.site 60 | --------------------------------------------------------------------------------