├── hnews ├── __init__.py ├── settings │ ├── __init__.py │ ├── production.py │ ├── local.py │ └── base.py ├── urls.py └── wsgi.py ├── news ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0003_new_vote.py │ ├── 0002_auto_20170905_2212.py │ ├── 0006_auto_20170910_2106.py │ ├── 0005_auto_20170909_1541.py │ ├── 0001_initial.py │ ├── 0007_auto_20180718_1144.py │ └── 0004_auto_20170909_1530.py ├── tests.py ├── static │ ├── fonts │ │ ├── icomoon.eot │ │ ├── icomoon.ttf │ │ ├── icomoon.woff │ │ └── icomoon.svg │ └── css │ │ └── style.css ├── apps.py ├── admin.py ├── templates │ ├── search.html │ ├── news │ │ ├── new_confirm_delete.html │ │ ├── comment_form.html │ │ ├── new_form.html │ │ ├── new_list.html │ │ └── new_detail.html │ └── base.html ├── models.py ├── urls.py ├── forms.py └── views.py ├── userprofiles ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── tests.py ├── apps.py ├── admin.py ├── urls.py ├── models.py ├── forms.py ├── templates │ ├── login.html │ └── registration.html └── views.py ├── Procfile ├── .gitignore ├── staticfiles ├── css │ ├── style.css.gz │ ├── style.6d054be835a1.css.gz │ ├── style.css │ ├── style.6d054be835a1.css │ └── style.e1a9e4742088.css ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.eot.gz │ ├── icomoon.svg.gz │ ├── icomoon.ttf.gz │ ├── icomoon.woff │ ├── icomoon.14ca41cf3180.ttf │ ├── icomoon.5a0c94785d69.eot │ ├── icomoon.bd8740b50bae.woff │ ├── icomoon.14ca41cf3180.ttf.gz │ ├── icomoon.50c10e0312fa.svg.gz │ ├── icomoon.5a0c94785d69.eot.gz │ ├── icomoon.svg │ └── icomoon.50c10e0312fa.svg ├── admin │ ├── css │ │ ├── rtl.css.gz │ │ ├── base.css.gz │ │ ├── fonts.css.gz │ │ ├── forms.css.gz │ │ ├── login.css.gz │ │ ├── widgets.css.gz │ │ ├── dashboard.css.gz │ │ ├── changelists.css.gz │ │ ├── base.6b517d0d5813.css.gz │ │ ├── fonts.494e4ec545c9.css.gz │ │ ├── forms.15ebfebbeb3d.css.gz │ │ ├── forms.2003a066ae02.css.gz │ │ ├── login.a846c0e2ef65.css.gz │ │ ├── rtl.4c867197b256.css.gz │ │ ├── widgets.5e372b41c483.css.gz │ │ ├── dashboard.7ac78187c567.css.gz │ │ ├── changelists.f6dc691f8d62.css.gz │ │ ├── fonts.css │ │ ├── dashboard.css │ │ ├── dashboard.7ac78187c567.css │ │ ├── fonts.494e4ec545c9.css │ │ ├── fonts.cc6140298ba7.css │ │ ├── login.css │ │ ├── login.a846c0e2ef65.css │ │ ├── rtl.css │ │ └── rtl.4c867197b256.css │ ├── img │ │ ├── LICENSE.gz │ │ ├── README.txt.gz │ │ ├── icon-no.svg.gz │ │ ├── icon-yes.svg.gz │ │ ├── search.svg.gz │ │ ├── icon-alert.svg.gz │ │ ├── icon-clock.svg.gz │ │ ├── icon-addlink.svg.gz │ │ ├── icon-calendar.svg.gz │ │ ├── icon-unknown.svg.gz │ │ ├── inline-delete.svg.gz │ │ ├── sorting-icons.svg.gz │ │ ├── tooltag-add.svg.gz │ │ ├── calendar-icons.svg.gz │ │ ├── icon-changelink.svg.gz │ │ ├── icon-deletelink.svg.gz │ │ ├── selector-icons.svg.gz │ │ ├── LICENSE.2c54f4e1ca1c.gz │ │ ├── gis │ │ │ ├── move_vertex_on.svg.gz │ │ │ ├── move_vertex_off.svg.gz │ │ │ ├── move_vertex_off.7a23bf31ef8a.svg.gz │ │ │ ├── move_vertex_on.0047eba25b67.svg.gz │ │ │ ├── move_vertex_on.svg │ │ │ ├── move_vertex_off.svg │ │ │ ├── move_vertex_off.7a23bf31ef8a.svg │ │ │ └── move_vertex_on.0047eba25b67.svg │ │ ├── icon-unknown-alt.svg.gz │ │ ├── tooltag-arrowright.svg.gz │ │ ├── README.837277fa1908.txt.gz │ │ ├── icon-no.439e821418cd.svg.gz │ │ ├── search.7cf54ff789c6.svg.gz │ │ ├── icon-alert.034cc7d8a67f.svg.gz │ │ ├── icon-clock.e1d4dfac3f2b.svg.gz │ │ ├── icon-yes.d2f9f035226a.svg.gz │ │ ├── icon-addlink.d519b3bab011.svg.gz │ │ ├── icon-unknown.a18cb4398978.svg.gz │ │ ├── tooltag-add.e59d620a9742.svg.gz │ │ ├── calendar-icons.39b290681a8b.svg.gz │ │ ├── icon-calendar.ac7aea671bea.svg.gz │ │ ├── icon-changelink.18d2fd706348.svg.gz │ │ ├── icon-deletelink.564ef9dc3854.svg.gz │ │ ├── inline-delete.fec1b761f254.svg.gz │ │ ├── selector-icons.b4555096cea2.svg.gz │ │ ├── sorting-icons.3a097b59f104.svg.gz │ │ ├── icon-unknown-alt.81536e128bb6.svg.gz │ │ ├── tooltag-arrowright.bbfb788a849e.svg.gz │ │ ├── tooltag-arrowright.svg │ │ ├── tooltag-arrowright.bbfb788a849e.svg │ │ ├── README.txt │ │ ├── icon-addlink.svg │ │ ├── tooltag-add.svg │ │ ├── README.837277fa1908.txt │ │ ├── tooltag-add.e59d620a9742.svg │ │ ├── icon-addlink.d519b3bab011.svg │ │ ├── icon-changelink.svg │ │ ├── icon-changelink.18d2fd706348.svg │ │ ├── icon-deletelink.svg │ │ ├── icon-deletelink.564ef9dc3854.svg │ │ ├── icon-yes.svg │ │ ├── icon-yes.d2f9f035226a.svg │ │ ├── search.svg │ │ ├── search.7cf54ff789c6.svg │ │ ├── icon-alert.svg │ │ ├── icon-alert.034cc7d8a67f.svg │ │ ├── icon-no.svg │ │ ├── inline-delete.svg │ │ ├── icon-no.439e821418cd.svg │ │ ├── inline-delete.fec1b761f254.svg │ │ ├── icon-unknown.svg │ │ ├── icon-unknown-alt.svg │ │ ├── icon-unknown.a18cb4398978.svg │ │ ├── icon-unknown-alt.81536e128bb6.svg │ │ ├── icon-clock.svg │ │ ├── icon-clock.e1d4dfac3f2b.svg │ │ ├── icon-calendar.svg │ │ ├── icon-calendar.ac7aea671bea.svg │ │ ├── calendar-icons.svg │ │ ├── LICENSE │ │ ├── calendar-icons.39b290681a8b.svg │ │ ├── LICENSE.2c54f4e1ca1c │ │ ├── sorting-icons.svg │ │ ├── sorting-icons.3a097b59f104.svg │ │ ├── selector-icons.svg │ │ └── selector-icons.b4555096cea2.svg │ ├── js │ │ ├── core.js.gz │ │ ├── actions.js.gz │ │ ├── cancel.js.gz │ │ ├── inlines.js.gz │ │ ├── urlify.js.gz │ │ ├── SelectBox.js.gz │ │ ├── calendar.js.gz │ │ ├── collapse.js.gz │ │ ├── timeparse.js.gz │ │ ├── actions.min.js.gz │ │ ├── change_form.js.gz │ │ ├── collapse.min.js.gz │ │ ├── inlines.min.js.gz │ │ ├── jquery.init.js.gz │ │ ├── prepopulate.js.gz │ │ ├── SelectFilter2.js.gz │ │ ├── popup_response.js.gz │ │ ├── prepopulate.min.js.gz │ │ ├── core.fd861d43f0f5.js.gz │ │ ├── prepopulate_init.js.gz │ │ ├── actions.32861b6cbdf9.js.gz │ │ ├── cancel.1d69cba4b4bf.js.gz │ │ ├── inlines.eda404ee376d.js.gz │ │ ├── urlify.411bc3bb651c.js.gz │ │ ├── vendor │ │ │ ├── jquery │ │ │ │ ├── jquery.js.gz │ │ │ │ ├── jquery.min.js.gz │ │ │ │ ├── LICENSE-JQUERY.txt.gz │ │ │ │ ├── jquery.aacc43d6f308.js.gz │ │ │ │ ├── jquery.min.33cabfa15c10.js.gz │ │ │ │ ├── LICENSE-JQUERY.a158210a2737.txt.gz │ │ │ │ ├── LICENSE-JQUERY.txt │ │ │ │ └── LICENSE-JQUERY.a158210a2737.txt │ │ │ └── xregexp │ │ │ │ ├── xregexp.js.gz │ │ │ │ ├── xregexp.min.js.gz │ │ │ │ ├── LICENSE-XREGEXP.txt.gz │ │ │ │ ├── xregexp.1865b1cf5085.js.gz │ │ │ │ ├── xregexp.min.c95393b8ca4d.js.gz │ │ │ │ ├── LICENSE-XREGEXP.d64cecf4f157.txt.gz │ │ │ │ ├── LICENSE-XREGEXP.txt │ │ │ │ └── LICENSE-XREGEXP.d64cecf4f157.txt │ │ ├── SelectBox.b49f008d186b.js.gz │ │ ├── calendar.9ac94d055fbd.js.gz │ │ ├── collapse.17d715df2104.js.gz │ │ ├── timeparse.51258861a46a.js.gz │ │ ├── actions.min.f51f04edab28.js.gz │ │ ├── admin │ │ │ ├── DateTimeShortcuts.js.gz │ │ │ ├── RelatedObjectLookups.js.gz │ │ │ ├── DateTimeShortcuts.1536fb6bea1d.js.gz │ │ │ └── RelatedObjectLookups.d2bdb1018963.js.gz │ │ ├── change_form.9e85003a1a38.js.gz │ │ ├── collapse.min.dc930adb2821.js.gz │ │ ├── inlines.min.d75b9ed03975.js.gz │ │ ├── jquery.init.95b62fa19378.js.gz │ │ ├── prepopulate.ff9208865444.js.gz │ │ ├── SelectFilter2.17009b6d4428.js.gz │ │ ├── popup_response.6ce3197f8fc8.js.gz │ │ ├── prepopulate.min.f4057ebb9b62.js.gz │ │ ├── prepopulate_init.0d3b53c37074.js.gz │ │ ├── cancel.js │ │ ├── cancel.1d69cba4b4bf.js │ │ ├── prepopulate.min.js │ │ ├── prepopulate.min.f4057ebb9b62.js │ │ ├── jquery.init.js │ │ ├── jquery.init.95b62fa19378.js │ │ ├── prepopulate_init.js │ │ ├── prepopulate_init.0d3b53c37074.js │ │ ├── popup_response.js │ │ ├── collapse.min.js │ │ ├── popup_response.6ce3197f8fc8.js │ │ ├── collapse.min.dc930adb2821.js │ │ ├── change_form.js │ │ ├── change_form.9e85003a1a38.js │ │ ├── collapse.js │ │ ├── collapse.17d715df2104.js │ │ ├── prepopulate.js │ │ ├── prepopulate.ff9208865444.js │ │ ├── actions.min.js │ │ ├── actions.min.f51f04edab28.js │ │ ├── timeparse.js │ │ ├── timeparse.51258861a46a.js │ │ ├── inlines.min.js │ │ ├── inlines.min.d75b9ed03975.js │ │ ├── SelectBox.js │ │ ├── SelectBox.b49f008d186b.js │ │ ├── actions.js │ │ └── actions.32861b6cbdf9.js │ └── fonts │ │ ├── LICENSE.txt.gz │ │ ├── Roboto-Bold-webfont.woff │ │ ├── Roboto-Light-webfont.woff │ │ ├── LICENSE.d273d63619c9.txt.gz │ │ ├── Roboto-Regular-webfont.woff │ │ ├── Roboto-Bold-webfont.2ad99072841e.woff │ │ ├── Roboto-Light-webfont.b446c2399bb6.woff │ │ ├── Roboto-Regular-webfont.ec39515ae8c6.woff │ │ ├── README.txt │ │ └── README.2c3d0bcdede2.txt └── staticfiles.json ├── README.md ├── Pipfile ├── manage.py └── Pipfile.lock /hnews/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hnews/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /userprofiles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /userprofiles/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn hnews.wsgi --log-file - -------------------------------------------------------------------------------- /news/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /userprofiles/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | db.sqlite3 4 | __pycache__ 5 | .DS_Store 6 | staticfiles 7 | .env -------------------------------------------------------------------------------- /news/static/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/news/static/fonts/icomoon.eot -------------------------------------------------------------------------------- /news/static/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/news/static/fonts/icomoon.ttf -------------------------------------------------------------------------------- /staticfiles/css/style.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/css/style.css.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.eot -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.ttf -------------------------------------------------------------------------------- /news/static/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/news/static/fonts/icomoon.woff -------------------------------------------------------------------------------- /staticfiles/admin/css/rtl.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/rtl.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/LICENSE.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/LICENSE.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/core.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/core.js.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.eot.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.eot.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.svg.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.ttf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.ttf.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.woff -------------------------------------------------------------------------------- /news/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class NewsConfig(AppConfig): 5 | name = 'New' 6 | -------------------------------------------------------------------------------- /staticfiles/admin/css/base.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/base.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/fonts.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/fonts.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/forms.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/forms.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/login.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/login.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/actions.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/cancel.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/cancel.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/inlines.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/inlines.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/urlify.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/urlify.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/widgets.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/widgets.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/README.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/README.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-no.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-no.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-yes.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-yes.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/search.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/search.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/SelectBox.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/SelectBox.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/calendar.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/calendar.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/collapse.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/timeparse.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/timeparse.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/dashboard.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/dashboard.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/LICENSE.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/LICENSE.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-alert.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-alert.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-clock.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-clock.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/actions.min.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/change_form.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/change_form.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/collapse.min.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/inlines.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/inlines.min.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/jquery.init.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/jquery.init.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/changelists.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/changelists.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-addlink.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-addlink.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-calendar.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-calendar.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-unknown.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/inline-delete.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/inline-delete.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/sorting-icons.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/sorting-icons.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-add.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/tooltag-add.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/SelectFilter2.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/SelectFilter2.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/popup_response.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/popup_response.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate.min.js.gz -------------------------------------------------------------------------------- /staticfiles/css/style.6d054be835a1.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/css/style.6d054be835a1.css.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.14ca41cf3180.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.14ca41cf3180.ttf -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.5a0c94785d69.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.5a0c94785d69.eot -------------------------------------------------------------------------------- /staticfiles/admin/img/calendar-icons.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/calendar-icons.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-changelink.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-changelink.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-deletelink.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-deletelink.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/selector-icons.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/selector-icons.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/core.fd861d43f0f5.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/core.fd861d43f0f5.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate_init.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate_init.js.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.bd8740b50bae.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.bd8740b50bae.woff -------------------------------------------------------------------------------- /userprofiles/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserprofilesConfig(AppConfig): 5 | name = 'Profile' 6 | -------------------------------------------------------------------------------- /staticfiles/admin/css/base.6b517d0d5813.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/base.6b517d0d5813.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/fonts.494e4ec545c9.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/fonts.494e4ec545c9.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/forms.15ebfebbeb3d.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/forms.15ebfebbeb3d.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/forms.2003a066ae02.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/forms.2003a066ae02.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/login.a846c0e2ef65.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/login.a846c0e2ef65.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/rtl.4c867197b256.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/rtl.4c867197b256.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/LICENSE.2c54f4e1ca1c.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/LICENSE.2c54f4e1ca1c.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_on.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/gis/move_vertex_on.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown-alt.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-unknown-alt.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-arrowright.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/tooltag-arrowright.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.32861b6cbdf9.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/actions.32861b6cbdf9.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/cancel.1d69cba4b4bf.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/cancel.1d69cba4b4bf.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/inlines.eda404ee376d.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/inlines.eda404ee376d.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/urlify.411bc3bb651c.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/urlify.411bc3bb651c.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/jquery.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/jquery.js.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.14ca41cf3180.ttf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.14ca41cf3180.ttf.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.50c10e0312fa.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.50c10e0312fa.svg.gz -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.5a0c94785d69.eot.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/fonts/icomoon.5a0c94785d69.eot.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/widgets.5e372b41c483.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/widgets.5e372b41c483.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Bold-webfont.woff -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Light-webfont.woff -------------------------------------------------------------------------------- /staticfiles/admin/img/README.837277fa1908.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/README.837277fa1908.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_off.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/gis/move_vertex_off.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-no.439e821418cd.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-no.439e821418cd.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/search.7cf54ff789c6.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/search.7cf54ff789c6.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/SelectBox.b49f008d186b.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/SelectBox.b49f008d186b.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/calendar.9ac94d055fbd.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/calendar.9ac94d055fbd.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.17d715df2104.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/collapse.17d715df2104.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/timeparse.51258861a46a.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/timeparse.51258861a46a.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/xregexp.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/xregexp.js.gz -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hnews 2 | hnews is another Hacker News clone for practice my skills with Django and is live [here](https://hnews-clone.herokuapp.com/) 3 | -------------------------------------------------------------------------------- /staticfiles/admin/css/dashboard.7ac78187c567.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/dashboard.7ac78187c567.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/LICENSE.d273d63619c9.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/LICENSE.d273d63619c9.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Regular-webfont.woff -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-alert.034cc7d8a67f.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-alert.034cc7d8a67f.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-clock.e1d4dfac3f2b.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-clock.e1d4dfac3f2b.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-yes.d2f9f035226a.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-yes.d2f9f035226a.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.min.f51f04edab28.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/actions.min.f51f04edab28.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/admin/DateTimeShortcuts.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/admin/DateTimeShortcuts.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/change_form.9e85003a1a38.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/change_form.9e85003a1a38.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.min.dc930adb2821.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/collapse.min.dc930adb2821.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/inlines.min.d75b9ed03975.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/inlines.min.d75b9ed03975.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/jquery.init.95b62fa19378.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/jquery.init.95b62fa19378.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.ff9208865444.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate.ff9208865444.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/jquery.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/jquery.min.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/css/changelists.f6dc691f8d62.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/css/changelists.f6dc691f8d62.css.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-addlink.d519b3bab011.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-addlink.d519b3bab011.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown.a18cb4398978.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-unknown.a18cb4398978.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-add.e59d620a9742.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/tooltag-add.e59d620a9742.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/SelectFilter2.17009b6d4428.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/SelectFilter2.17009b6d4428.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/admin/RelatedObjectLookups.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/admin/RelatedObjectLookups.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/popup_response.6ce3197f8fc8.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/popup_response.6ce3197f8fc8.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/xregexp.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/xregexp.min.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/calendar-icons.39b290681a8b.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/calendar-icons.39b290681a8b.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-calendar.ac7aea671bea.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-calendar.ac7aea671bea.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-changelink.18d2fd706348.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-changelink.18d2fd706348.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-deletelink.564ef9dc3854.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-deletelink.564ef9dc3854.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/inline-delete.fec1b761f254.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/inline-delete.fec1b761f254.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/selector-icons.b4555096cea2.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/selector-icons.b4555096cea2.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/sorting-icons.3a097b59f104.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/sorting-icons.3a097b59f104.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.min.f4057ebb9b62.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate.min.f4057ebb9b62.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate_init.0d3b53c37074.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/prepopulate_init.0d3b53c37074.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown-alt.81536e128bb6.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/icon-unknown-alt.81536e128bb6.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_on.0047eba25b67.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/gis/move_vertex_on.0047eba25b67.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-arrowright.bbfb788a849e.svg.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/img/tooltag-arrowright.bbfb788a849e.svg.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/jquery.aacc43d6f308.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/jquery.aacc43d6f308.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/xregexp.1865b1cf5085.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/xregexp.1865b1cf5085.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff -------------------------------------------------------------------------------- /staticfiles/admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/jquery.min.33cabfa15c10.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/jquery.min.33cabfa15c10.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/README.txt: -------------------------------------------------------------------------------- 1 | Roboto webfont source: https://www.google.com/fonts/specimen/Roboto 2 | Weights used in this project: Light (300), Regular (400), Bold (700) 3 | -------------------------------------------------------------------------------- /staticfiles/admin/js/admin/RelatedObjectLookups.d2bdb1018963.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/admin/RelatedObjectLookups.d2bdb1018963.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/xregexp.min.c95393b8ca4d.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/xregexp.min.c95393b8ca4d.js.gz -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.a158210a2737.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.a158210a2737.txt.gz -------------------------------------------------------------------------------- /staticfiles/admin/fonts/README.2c3d0bcdede2.txt: -------------------------------------------------------------------------------- 1 | Roboto webfont source: https://www.google.com/fonts/specimen/Roboto 2 | Weights used in this project: Light (300), Regular (400), Bold (700) 3 | -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.d64cecf4f157.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iKenshu/hnews/HEAD/staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.d64cecf4f157.txt.gz -------------------------------------------------------------------------------- /hnews/settings/production.py: -------------------------------------------------------------------------------- 1 | from .base import * 2 | 3 | DEBUG = False 4 | 5 | import dj_database_url 6 | DATABASES = {'default': dj_database_url.config()} 7 | 8 | ALLOWED_HOSTS = ['hnews-clone.herokuapp.com'] 9 | -------------------------------------------------------------------------------- /userprofiles/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import Profile 5 | 6 | @admin.register(Profile) 7 | class ProfileAdmin(admin.ModelAdmin): 8 | list_display = ('user', 'about') -------------------------------------------------------------------------------- /hnews/settings/local.py: -------------------------------------------------------------------------------- 1 | from .base import * 2 | 3 | ALLOWED_HOSTS = ['*'] 4 | 5 | DATABASES = { 6 | 'default': { 7 | 'ENGINE': 'django.db.backends.sqlite3', 8 | 'NAME': 'db.sqlite3', 9 | } 10 | } 11 | 12 | DEBUG = True 13 | -------------------------------------------------------------------------------- /hnews/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, include 2 | from django.contrib import admin 3 | 4 | urlpatterns = [ 5 | url(r'^admin/', admin.site.urls), 6 | url(r'^', include('news.urls')), 7 | url(r'^', include('userprofiles.urls')), 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /staticfiles/admin/js/cancel.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | $(function() { 4 | $('.cancel-link').click(function(e) { 5 | e.preventDefault(); 6 | window.history.back(); 7 | }); 8 | }); 9 | })(django.jQuery); 10 | -------------------------------------------------------------------------------- /staticfiles/admin/js/cancel.1d69cba4b4bf.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | $(function() { 4 | $('.cancel-link').click(function(e) { 5 | e.preventDefault(); 6 | window.history.back(); 7 | }); 8 | }); 9 | })(django.jQuery); 10 | -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-arrowright.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-arrowright.bbfb788a849e.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.org/simple" 3 | name = "pypi" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [requires] 9 | python_version = "3.6" 10 | 11 | [packages] 12 | dj-database-url = "==0.4.2" 13 | gunicorn = "==19.7.1" 14 | "psycopg2" = "==2.7.3.1" 15 | pytz = "==2017.2" 16 | whitenoise = "==3.3.0" 17 | Django = "==1.11.15" 18 | -------------------------------------------------------------------------------- /staticfiles/admin/img/README.txt: -------------------------------------------------------------------------------- 1 | All icons are taken from Font Awesome (http://fontawesome.io/) project. 2 | The Font Awesome font is licensed under the SIL OFL 1.1: 3 | - http://scripts.sil.org/OFL 4 | 5 | SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG 6 | Font-Awesome-SVG-PNG is licensed under the MIT license (see file license 7 | in current folder). 8 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-addlink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /userprofiles/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | 3 | from .views import SignUpView, SignInView, SignOutView 4 | 5 | app_name = 'Profile' 6 | urlpatterns = [ 7 | url(r'^signup/$', SignUpView.as_view(), name='sign_up'), 8 | url(r'^signin/$', SignInView.as_view(), name='sign_in'), 9 | url(r'^signout/$', SignOutView.as_view(), name='sign_out'), 10 | ] -------------------------------------------------------------------------------- /news/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import New, Comment 5 | 6 | 7 | @admin.register(New) 8 | class NewAdmin(admin.ModelAdmin): 9 | list_display = ('title', 'url', 'user') 10 | 11 | 12 | @admin.register(Comment) 13 | class CommentAdmin(admin.ModelAdmin): 14 | list_display = ('new', 'author', 'text') 15 | -------------------------------------------------------------------------------- /staticfiles/admin/img/README.837277fa1908.txt: -------------------------------------------------------------------------------- 1 | All icons are taken from Font Awesome (http://fontawesome.io/) project. 2 | The Font Awesome font is licensed under the SIL OFL 1.1: 3 | - http://scripts.sil.org/OFL 4 | 5 | SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG 6 | Font-Awesome-SVG-PNG is licensed under the MIT license (see file license 7 | in current folder). 8 | -------------------------------------------------------------------------------- /staticfiles/admin/img/tooltag-add.e59d620a9742.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-addlink.d519b3bab011.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.min.js: -------------------------------------------------------------------------------- 1 | (function(c){c.fn.prepopulate=function(e,f,g){return this.each(function(){var a=c(this),b=function(){if(!a.data("_changed")){var b=[];c.each(e,function(a,d){d=c(d);0 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/js/jquery.init.js: -------------------------------------------------------------------------------- 1 | /*global django:true, jQuery:false*/ 2 | /* Puts the included jQuery into our own namespace using noConflict and passing 3 | * it 'true'. This ensures that the included jQuery doesn't pollute the global 4 | * namespace (i.e. this preserves pre-existing values for both window.$ and 5 | * window.jQuery). 6 | */ 7 | var django = django || {}; 8 | django.jQuery = jQuery.noConflict(true); 9 | -------------------------------------------------------------------------------- /news/templates/search.html: -------------------------------------------------------------------------------- 1 |
2 | 10 | 11 | 12 |
-------------------------------------------------------------------------------- /staticfiles/admin/js/jquery.init.95b62fa19378.js: -------------------------------------------------------------------------------- 1 | /*global django:true, jQuery:false*/ 2 | /* Puts the included jQuery into our own namespace using noConflict and passing 3 | * it 'true'. This ensures that the included jQuery doesn't pollute the global 4 | * namespace (i.e. this preserves pre-existing values for both window.$ and 5 | * window.jQuery). 6 | */ 7 | var django = django || {}; 8 | django.jQuery = jQuery.noConflict(true); 9 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-changelink.18d2fd706348.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-deletelink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-deletelink.564ef9dc3854.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /news/templates/news/new_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |
5 | {% csrf_token %} 6 |

Are you sure you want delete {{ new.title }}?

7 | 8 | 9 |
10 | {% endblock content %} -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-yes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-yes.d2f9f035226a.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/search.7cf54ff789c6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-alert.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | src: url('../fonts/Roboto-Bold-webfont.woff'); 4 | font-weight: 700; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url('../fonts/Roboto-Regular-webfont.woff'); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | src: url('../fonts/Roboto-Light-webfont.woff'); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-alert.034cc7d8a67f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /news/migrations/0003_new_vote.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-06 20:24 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 | ('news', '0002_auto_20170905_2212'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='new', 17 | name='vote', 18 | field=models.IntegerField(default=1), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /hnews/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for hnews project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | from whitenoise.django import DjangoWhiteNoise 14 | 15 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hnews.settings") 16 | 17 | application = get_wsgi_application() 18 | application = DjangoWhiteNoise(application) 19 | -------------------------------------------------------------------------------- /staticfiles/admin/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* DASHBOARD */ 2 | 3 | .dashboard .module table th { 4 | width: 100%; 5 | } 6 | 7 | .dashboard .module table td { 8 | white-space: nowrap; 9 | } 10 | 11 | .dashboard .module table td a { 12 | display: block; 13 | padding-right: .6em; 14 | } 15 | 16 | /* RECENT ACTIONS MODULE */ 17 | 18 | .module ul.actionlist { 19 | margin-left: 0; 20 | } 21 | 22 | ul.actionlist li { 23 | list-style-type: none; 24 | overflow: hidden; 25 | text-overflow: ellipsis; 26 | -o-text-overflow: ellipsis; 27 | } 28 | -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate_init.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields'); 4 | $.each(fields, function(index, field) { 5 | $('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field'); 6 | $(field.id).data('dependency_list', field.dependency_list).prepopulate( 7 | field.dependency_ids, field.maxLength, field.allowUnicode 8 | ); 9 | }); 10 | })(django.jQuery); 11 | -------------------------------------------------------------------------------- /staticfiles/admin/css/dashboard.7ac78187c567.css: -------------------------------------------------------------------------------- 1 | /* DASHBOARD */ 2 | 3 | .dashboard .module table th { 4 | width: 100%; 5 | } 6 | 7 | .dashboard .module table td { 8 | white-space: nowrap; 9 | } 10 | 11 | .dashboard .module table td a { 12 | display: block; 13 | padding-right: .6em; 14 | } 15 | 16 | /* RECENT ACTIONS MODULE */ 17 | 18 | .module ul.actionlist { 19 | margin-left: 0; 20 | } 21 | 22 | ul.actionlist li { 23 | list-style-type: none; 24 | overflow: hidden; 25 | text-overflow: ellipsis; 26 | -o-text-overflow: ellipsis; 27 | } 28 | -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate_init.0d3b53c37074.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields'); 4 | $.each(fields, function(index, field) { 5 | $('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field'); 6 | $(field.id).data('dependency_list', field.dependency_list).prepopulate( 7 | field.dependency_ids, field.maxLength, field.allowUnicode 8 | ); 9 | }); 10 | })(django.jQuery); 11 | -------------------------------------------------------------------------------- /staticfiles/admin/css/fonts.494e4ec545c9.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | src: url("../fonts/Roboto-Bold-webfont.2ad99072841e.woff"); 4 | font-weight: 700; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url("../fonts/Roboto-Regular-webfont.ec39515ae8c6.woff"); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | src: url("../fonts/Roboto-Light-webfont.b446c2399bb6.woff"); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /staticfiles/admin/css/fonts.cc6140298ba7.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | src: url("../fonts/Roboto-Bold-webfont.2ad99072841e.woff"); 4 | font-weight: 700; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url("../fonts/Roboto-Regular-webfont.ec39515ae8c6.woff"); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | src: url("../fonts/Roboto-Light-webfont.b446c2399bb6.woff"); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-no.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/inline-delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-no.439e821418cd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/inline-delete.fec1b761f254.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /news/templates/news/comment_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 5 |

New comment {{comments__post.title}}

6 |

{{New.url}}

7 | 8 |
9 | {% csrf_token %} 10 | {% for field in form %} 11 |
12 | {{ field.errors }} 13 | 14 | {{ field }} 15 |
16 | {% endfor %} 17 | 18 |
19 | 20 | {% endblock content %} -------------------------------------------------------------------------------- /staticfiles/admin/js/popup_response.js: -------------------------------------------------------------------------------- 1 | /*global opener */ 2 | (function() { 3 | 'use strict'; 4 | var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); 5 | switch(initData.action) { 6 | case 'change': 7 | opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value); 8 | break; 9 | case 'delete': 10 | opener.dismissDeleteRelatedObjectPopup(window, initData.value); 11 | break; 12 | default: 13 | opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj); 14 | break; 15 | } 16 | })(); 17 | -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(b,c){0===a(c).find("div.errors").length&&a(c).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(b){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", 2 | [a(this).attr("id")]);return!1})})})(django.jQuery); 3 | -------------------------------------------------------------------------------- /staticfiles/admin/js/popup_response.6ce3197f8fc8.js: -------------------------------------------------------------------------------- 1 | /*global opener */ 2 | (function() { 3 | 'use strict'; 4 | var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); 5 | switch(initData.action) { 6 | case 'change': 7 | opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value); 8 | break; 9 | case 'delete': 10 | opener.dismissDeleteRelatedObjectPopup(window, initData.value); 11 | break; 12 | default: 13 | opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj); 14 | break; 15 | } 16 | })(); 17 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.min.dc930adb2821.js: -------------------------------------------------------------------------------- 1 | (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(b,c){0===a(c).find("div.errors").length&&a(c).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(b){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", 2 | [a(this).attr("id")]);return!1})})})(django.jQuery); 3 | -------------------------------------------------------------------------------- /news/migrations/0002_auto_20170905_2212.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-05 22:12 3 | from __future__ import unicode_literals 4 | 5 | from django.conf import settings 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | dependencies = [ 13 | ('news', '0001_initial'), 14 | ] 15 | 16 | operations = [ 17 | migrations.AlterField( 18 | model_name='new', 19 | name='user', 20 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown-alt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown.a18cb4398978.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /news/migrations/0006_auto_20170910_2106.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-10 21:06 3 | from __future__ import unicode_literals 4 | 5 | import datetime 6 | from django.db import migrations, models 7 | from django.utils.timezone import utc 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | dependencies = [ 13 | ('news', '0005_auto_20170909_1541'), 14 | ] 15 | 16 | operations = [ 17 | migrations.AlterField( 18 | model_name='comment', 19 | name='created_date', 20 | field=models.DateTimeField(default=datetime.datetime(2017, 9, 10, 21, 6, 26, 462798, tzinfo=utc)), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-unknown-alt.81536e128bb6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /news/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | from userprofiles.models import Profile 4 | 5 | 6 | class New(models.Model): 7 | user = models.ForeignKey(Profile) 8 | title = models.CharField(max_length=255) 9 | url = models.URLField() 10 | vote = models.IntegerField(default=1) 11 | 12 | class Meta: 13 | ordering = ['-vote'] 14 | 15 | def __str__(self): 16 | return self.title 17 | 18 | 19 | class Comment(models.Model): 20 | new = models.ForeignKey(New, related_name='comments') 21 | author = models.ForeignKey(Profile) 22 | text = models.TextField() 23 | created_date = models.DateTimeField(auto_now=True) 24 | 25 | def __str__(self): 26 | return self.text 27 | -------------------------------------------------------------------------------- /userprofiles/models.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import User 2 | from django.db import models 3 | from django.db.models.signals import post_save 4 | from django.dispatch import receiver 5 | 6 | 7 | class Profile(models.Model): 8 | user = models.OneToOneField(User, on_delete=models.CASCADE) 9 | about = models.TextField() 10 | 11 | def __str__(self): 12 | return self.user.username 13 | 14 | 15 | @receiver(post_save, sender=User) 16 | def create_user_profile(sender, instance, created, **kwargs): 17 | if created: 18 | Profile.objects.create(user=instance) 19 | 20 | 21 | @receiver(post_save, sender=User) 22 | def save_user_profile(sender, instance, **kwargs): 23 | instance.profile.save() 24 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-clock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /userprofiles/forms.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import User 2 | from django.contrib.auth.forms import UserCreationForm, AuthenticationForm 3 | from django import forms 4 | 5 | from .models import Profile 6 | 7 | class SignUpForm(UserCreationForm): 8 | def __init__(self, *args, **kwargs): 9 | super(SignUpForm, self).__init__(*args, **kwargs) 10 | for field in self.fields: 11 | self.fields[field].widget.attrs['class'] = 'form-control' 12 | 13 | class SignInForm(AuthenticationForm): 14 | def __init__(self, *args, **kwargs): 15 | super(SignInForm, self).__init__(*args, **kwargs) 16 | for field in self.fields: 17 | self.fields[field].widget.attrs['class'] = 'form-control' 18 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-clock.e1d4dfac3f2b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /userprofiles/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 27 | {% endblock content %} -------------------------------------------------------------------------------- /news/templates/news/new_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 5 | 28 | {% endblock content %} -------------------------------------------------------------------------------- /userprofiles/templates/registration.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 28 | {% endblock content %} -------------------------------------------------------------------------------- /staticfiles/admin/js/change_form.js: -------------------------------------------------------------------------------- 1 | /*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/ 2 | 3 | (function($) { 4 | 'use strict'; 5 | $(document).ready(function() { 6 | var modelName = $('#django-admin-form-add-constants').data('modelName'); 7 | $('body').on('click', '.add-another', function(e) { 8 | e.preventDefault(); 9 | var event = $.Event('django:add-another-related'); 10 | $(this).trigger(event); 11 | if (!event.isDefaultPrevented()) { 12 | showAddAnotherPopup(this); 13 | } 14 | }); 15 | 16 | if (modelName) { 17 | $('form#' + modelName + '_form :input:visible:enabled:first').focus(); 18 | } 19 | }); 20 | })(django.jQuery); 21 | -------------------------------------------------------------------------------- /news/static/fonts/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /staticfiles/admin/js/change_form.9e85003a1a38.js: -------------------------------------------------------------------------------- 1 | /*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/ 2 | 3 | (function($) { 4 | 'use strict'; 5 | $(document).ready(function() { 6 | var modelName = $('#django-admin-form-add-constants').data('modelName'); 7 | $('body').on('click', '.add-another', function(e) { 8 | e.preventDefault(); 9 | var event = $.Event('django:add-another-related'); 10 | $(this).trigger(event); 11 | if (!event.isDefaultPrevented()) { 12 | showAddAnotherPopup(this); 13 | } 14 | }); 15 | 16 | if (modelName) { 17 | $('form#' + modelName + '_form :input:visible:enabled:first').focus(); 18 | } 19 | }); 20 | })(django.jQuery); 21 | -------------------------------------------------------------------------------- /staticfiles/fonts/icomoon.50c10e0312fa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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", "hnews.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError: 10 | # The above import may fail for some other reason. Ensure that the 11 | # issue is really that Django is missing to avoid masking other 12 | # exceptions on Python 2. 13 | try: 14 | import django 15 | except ImportError: 16 | raise ImportError( 17 | "Couldn't import Django. Are you sure it's installed and " 18 | "available on your PYTHONPATH environment variable? Did you " 19 | "forget to activate a virtual environment?" 20 | ) 21 | raise 22 | execute_from_command_line(sys.argv) 23 | -------------------------------------------------------------------------------- /userprofiles/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-06 14:34 3 | from __future__ import unicode_literals 4 | 5 | from django.conf import settings 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | initial = True 13 | 14 | dependencies = [ 15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 16 | ] 17 | 18 | operations = [ 19 | migrations.CreateModel( 20 | name='Profile', 21 | fields=[ 22 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 23 | ('about', models.TextField()), 24 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 25 | ], 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /news/migrations/0005_auto_20170909_1541.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-09 15:41 3 | from __future__ import unicode_literals 4 | 5 | import datetime 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | from django.utils.timezone import utc 9 | 10 | 11 | class Migration(migrations.Migration): 12 | 13 | dependencies = [ 14 | ('news', '0004_auto_20170909_1530'), 15 | ] 16 | 17 | operations = [ 18 | migrations.AlterField( 19 | model_name='comment', 20 | name='created_date', 21 | field=models.DateTimeField(default=datetime.datetime(2017, 9, 9, 15, 41, 17, 509948, tzinfo=utc)), 22 | ), 23 | migrations.AlterField( 24 | model_name='comment', 25 | name='new', 26 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='news.New'), 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /news/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-05 21:48 3 | from __future__ import unicode_literals 4 | 5 | from django.conf import settings 6 | from django.db import migrations, models 7 | import django.db.models.deletion 8 | 9 | 10 | class Migration(migrations.Migration): 11 | 12 | initial = True 13 | 14 | dependencies = [ 15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 16 | ] 17 | 18 | operations = [ 19 | migrations.CreateModel( 20 | name='New', 21 | fields=[ 22 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 23 | ('title', models.CharField(max_length=255)), 24 | ('url', models.URLField()), 25 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 26 | ], 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /userprofiles/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, redirect 2 | from django.contrib.auth import login, authenticate 3 | from django.views.generic import CreateView 4 | from django.contrib.auth.views import LoginView, LogoutView 5 | 6 | from .forms import SignUpForm, SignInForm 7 | from .models import Profile 8 | 9 | # Create your views here. 10 | 11 | 12 | class SignUpView(CreateView): 13 | model = Profile 14 | form_class = SignUpForm 15 | template_name = 'registration.html' 16 | 17 | def form_valid(self, form): 18 | form.save() 19 | username = form.cleaned_data.get('username') 20 | password = form.cleaned_data.get('password1') 21 | user = authenticate(username=username, password=password) 22 | login(self.request, user) 23 | return redirect('New:list') 24 | 25 | 26 | class SignInView(LoginView): 27 | template_name = 'login.html' 28 | authentication_form = SignInForm 29 | 30 | 31 | class SignOutView(LogoutView): 32 | pass 33 | -------------------------------------------------------------------------------- /news/templates/news/new_list.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base.html" %} 3 | 4 | {% block content %} 5 |
    6 | {% for new in News %} 7 | 8 |
  1. 9 | 14 | 15 | 16 | 17 | {{ new.title }} 18 | 23 |
  2. 24 | {% endfor %} 25 |
26 | 27 | {% endblock content %} -------------------------------------------------------------------------------- /news/migrations/0007_auto_20180718_1144.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2018-07-18 11:44 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 | dependencies = [ 12 | ('news', '0006_auto_20170910_2106'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='comment', 18 | name='author', 19 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userprofiles.Profile'), 20 | ), 21 | migrations.AlterField( 22 | model_name='comment', 23 | name='created_date', 24 | field=models.DateTimeField(auto_now=True), 25 | ), 26 | migrations.AlterField( 27 | model_name='new', 28 | name='user', 29 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userprofiles.Profile'), 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_on.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-calendar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /staticfiles/admin/img/gis/move_vertex_on.0047eba25b67.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /staticfiles/admin/img/icon-calendar.ac7aea671bea.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /news/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, include 2 | 3 | from .views import ( 4 | NewList, 5 | NewAdd, 6 | NewEdit, 7 | NewDetail, 8 | VoteView, 9 | CommentView, 10 | NewDelete, 11 | ) 12 | 13 | app_name = 'New' 14 | urlpatterns = [ 15 | url( 16 | regex=r'^$', 17 | view=NewList.as_view(), 18 | name='list' 19 | ), 20 | url( 21 | regex=r'^add/', 22 | view=NewAdd.as_view(), 23 | name='add' 24 | ), 25 | url( 26 | regex=r'^edit/(?P\d+)/$', 27 | view=NewEdit.as_view(), 28 | name='edit' 29 | ), 30 | url( 31 | regex=r'^delete/(?P\d+)/$', 32 | view=NewDelete.as_view(), 33 | name='delete' 34 | ), 35 | url( 36 | regex=r'^detail/(?P\d+)/$', 37 | view=NewDetail.as_view(), 38 | name='detail' 39 | ), 40 | url( 41 | regex=r'^detail/(?P\d+)/comment$', 42 | view=CommentView.as_view(), 43 | name='comment' 44 | ), 45 | url( 46 | regex=r'^vote/(?P\d+)/$', 47 | view=VoteView.as_view(), 48 | name='vote' 49 | ), 50 | ] 51 | -------------------------------------------------------------------------------- /staticfiles/admin/img/calendar-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /staticfiles/admin/img/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Code Charm Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /staticfiles/admin/img/calendar-icons.39b290681a8b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /staticfiles/admin/img/LICENSE.2c54f4e1ca1c: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Code Charm Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /staticfiles/admin/img/sorting-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /news/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.forms import ModelForm 3 | 4 | from .models import New, Comment 5 | 6 | class NewForm(ModelForm): 7 | 8 | error_message = { 9 | 'url_exists': 'The url alredy exists' 10 | } 11 | 12 | class Meta: 13 | model = New 14 | fields = ('title', 'url') 15 | widgets = { 16 | 'title': forms.TextInput(attrs={'class': 'form-control'}), 17 | 'url': forms.TextInput(attrs={'class': 'form-control'}) 18 | } 19 | 20 | def clean(self): 21 | cleaned_data = super(NewForm, self).clean() 22 | print(cleaned_data) 23 | 24 | def clean_url(self): 25 | url = self.cleaned_data['url'] 26 | if New.objects.filter(url=url).exists(): 27 | raise forms.ValidationError('The URL alredy exists') 28 | return url 29 | 30 | class VoteForm(ModelForm): 31 | class Meta: 32 | model = New 33 | exclude = ('title', 'url') 34 | 35 | class CommentForm(ModelForm): 36 | class Meta: 37 | model = Comment 38 | fields = ('text', ) 39 | widgets = { 40 | 'text': forms.Textarea(attrs={'class': 'form-control'}) 41 | } -------------------------------------------------------------------------------- /staticfiles/admin/img/sorting-icons.3a097b59f104.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007-2012 Steven Levithan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/xregexp/LICENSE-XREGEXP.d64cecf4f157.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007-2012 Steven Levithan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.js: -------------------------------------------------------------------------------- 1 | /*global gettext*/ 2 | (function($) { 3 | 'use strict'; 4 | $(document).ready(function() { 5 | // Add anchor tag for Show/Hide link 6 | $("fieldset.collapse").each(function(i, elem) { 7 | // Don't hide if fields in this fieldset have errors 8 | if ($(elem).find("div.errors").length === 0) { 9 | $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + 11 | ')'); 12 | } 13 | }); 14 | // Add toggle to anchor tag 15 | $("fieldset.collapse a.collapse-toggle").click(function(ev) { 16 | if ($(this).closest("fieldset").hasClass("collapsed")) { 17 | // Show 18 | $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); 19 | } else { 20 | // Hide 21 | $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); 22 | } 23 | return false; 24 | }); 25 | }); 26 | })(django.jQuery); 27 | -------------------------------------------------------------------------------- /staticfiles/admin/js/collapse.17d715df2104.js: -------------------------------------------------------------------------------- 1 | /*global gettext*/ 2 | (function($) { 3 | 'use strict'; 4 | $(document).ready(function() { 5 | // Add anchor tag for Show/Hide link 6 | $("fieldset.collapse").each(function(i, elem) { 7 | // Don't hide if fields in this fieldset have errors 8 | if ($(elem).find("div.errors").length === 0) { 9 | $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + 11 | ')'); 12 | } 13 | }); 14 | // Add toggle to anchor tag 15 | $("fieldset.collapse a.collapse-toggle").click(function(ev) { 16 | if ($(this).closest("fieldset").hasClass("collapsed")) { 17 | // Show 18 | $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); 19 | } else { 20 | // Hide 21 | $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); 22 | } 23 | return false; 24 | }); 25 | }); 26 | })(django.jQuery); 27 | -------------------------------------------------------------------------------- /news/templates/news/new_detail.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 5 | 6 | 7 | 8 | {{ new.title }} 9 | 20 | 21 | Add new comment 22 | 23 | {% for comment in new.comments.all %} 24 |
    25 |
  • {{ comment }} 26 | 29 |
  • 30 |
31 | {% endfor %} 32 | 33 | {% endblock content %} -------------------------------------------------------------------------------- /news/static/css/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'icomoon'; 3 | src: url('../fonts/icomoon.eot?u4b6fy'); 4 | src: url('../fonts/icomoon.eot?u4b6fy#iefix') format('embedded-opentype'), 5 | url('../fonts/icomoon.ttf?u4b6fy') format('truetype'), 6 | url('../fonts/icomoon.woff?u4b6fy') format('woff'), 7 | url('../fonts/icomoon.svg?u4b6fy#icomoon') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | [class^="icon-"], [class*=" icon-"] { 13 | /* use !important to prevent issues with browser extensions that change fonts */ 14 | font-family: 'icomoon' !important; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | 22 | /* Better Font Rendering =========== */ 23 | -webkit-font-smoothing: antialiased; 24 | -moz-osx-font-smoothing: grayscale; 25 | } 26 | 27 | .icon-chevron-up:before { 28 | content: "\e900"; 29 | } 30 | 31 | a{ 32 | color: black; 33 | } 34 | 35 | .Link-detail{ 36 | color: gray; 37 | font-size: .7em; 38 | } 39 | .Link-link{ 40 | text-decoration: none; 41 | } 42 | ol li.list-group{ 43 | list-style: decimal inside; 44 | } 45 | ol li.list-group-item{ 46 | display: list-item; 47 | } 48 | .Link-form{ 49 | margin: 0 auto; 50 | padding: 1em; 51 | } -------------------------------------------------------------------------------- /staticfiles/css/style.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'icomoon'; 3 | src: url('../fonts/icomoon.eot?u4b6fy'); 4 | src: url('../fonts/icomoon.eot?u4b6fy#iefix') format('embedded-opentype'), 5 | url('../fonts/icomoon.ttf?u4b6fy') format('truetype'), 6 | url('../fonts/icomoon.woff?u4b6fy') format('woff'), 7 | url('../fonts/icomoon.svg?u4b6fy#icomoon') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | [class^="icon-"], [class*=" icon-"] { 13 | /* use !important to prevent issues with browser extensions that change fonts */ 14 | font-family: 'icomoon' !important; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | 22 | /* Better Font Rendering =========== */ 23 | -webkit-font-smoothing: antialiased; 24 | -moz-osx-font-smoothing: grayscale; 25 | } 26 | 27 | .icon-chevron-up:before { 28 | content: "\e900"; 29 | } 30 | 31 | a{ 32 | color: black; 33 | } 34 | 35 | .Link-detail{ 36 | color: gray; 37 | font-size: .7em; 38 | } 39 | .Link-link{ 40 | text-decoration: none; 41 | } 42 | ol li.list-group{ 43 | list-style: decimal inside; 44 | } 45 | ol li.list-group-item{ 46 | display: list-item; 47 | } 48 | .Link-form{ 49 | margin: 0 auto; 50 | padding: 1em; 51 | } -------------------------------------------------------------------------------- /staticfiles/css/style.6d054be835a1.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'icomoon'; 3 | src: url("../fonts/icomoon.5a0c94785d69.eot?u4b6fy"); 4 | src: url("../fonts/icomoon.5a0c94785d69.eot?u4b6fy#iefix") format('embedded-opentype'), 5 | url("../fonts/icomoon.14ca41cf3180.ttf?u4b6fy") format('truetype'), 6 | url("../fonts/icomoon.bd8740b50bae.woff?u4b6fy") format('woff'), 7 | url("../fonts/icomoon.50c10e0312fa.svg?u4b6fy#icomoon") format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | [class^="icon-"], [class*=" icon-"] { 13 | /* use !important to prevent issues with browser extensions that change fonts */ 14 | font-family: 'icomoon' !important; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | 22 | /* Better Font Rendering =========== */ 23 | -webkit-font-smoothing: antialiased; 24 | -moz-osx-font-smoothing: grayscale; 25 | } 26 | 27 | .icon-chevron-up:before { 28 | content: "\e900"; 29 | } 30 | 31 | a{ 32 | color: black; 33 | } 34 | 35 | .Link-detail{ 36 | color: gray; 37 | font-size: .7em; 38 | } 39 | .Link-link{ 40 | text-decoration: none; 41 | } 42 | ol li.list-group{ 43 | list-style: decimal inside; 44 | } 45 | ol li.list-group-item{ 46 | display: list-item; 47 | } 48 | .Link-form{ 49 | margin: 0 auto; 50 | padding: 1em; 51 | } -------------------------------------------------------------------------------- /staticfiles/css/style.e1a9e4742088.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'icomoon'; 3 | src: url("../fonts/icomoon.5a0c94785d69.eot?u4b6fy"); 4 | src: url("../fonts/icomoon.5a0c94785d69.eot?u4b6fy#iefix") format('embedded-opentype'), 5 | url("../fonts/icomoon.14ca41cf3180.ttf?u4b6fy") format('truetype'), 6 | url("../fonts/icomoon.bd8740b50bae.woff?u4b6fy") format('woff'), 7 | url("../fonts/icomoon.50c10e0312fa.svg?u4b6fy#icomoon") format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | 12 | [class^="icon-"], [class*=" icon-"] { 13 | /* use !important to prevent issues with browser extensions that change fonts */ 14 | font-family: 'icomoon' !important; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | 22 | /* Better Font Rendering =========== */ 23 | -webkit-font-smoothing: antialiased; 24 | -moz-osx-font-smoothing: grayscale; 25 | } 26 | 27 | .icon-chevron-up:before { 28 | content: "\e900"; 29 | } 30 | 31 | a{ 32 | color: black; 33 | } 34 | 35 | .Link-detail{ 36 | color: gray; 37 | font-size: .7em; 38 | } 39 | .Link-link{ 40 | text-decoration: none; 41 | } 42 | ol li.list-group{ 43 | list-style: decimal inside; 44 | } 45 | ol li.list-group-item{ 46 | display: list-item; 47 | } 48 | .Link-form{ 49 | margin: 0 auto; 50 | padding: 1em; 51 | } -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | ==== 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /staticfiles/admin/js/vendor/jquery/LICENSE-JQUERY.a158210a2737.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | ==== 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /news/migrations/0004_auto_20170909_1530.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.5 on 2017-09-09 15:30 3 | from __future__ import unicode_literals 4 | 5 | import datetime 6 | from django.conf import settings 7 | from django.db import migrations, models 8 | import django.db.models.deletion 9 | from django.utils.timezone import utc 10 | 11 | 12 | class Migration(migrations.Migration): 13 | 14 | dependencies = [ 15 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 16 | ('news', '0003_new_vote'), 17 | ] 18 | 19 | operations = [ 20 | migrations.CreateModel( 21 | name='Comment', 22 | fields=[ 23 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 24 | ('text', models.TextField()), 25 | ('created_date', models.DateTimeField(default=datetime.datetime(2017, 9, 9, 15, 30, 26, 169878, tzinfo=utc))), 26 | ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 27 | ], 28 | ), 29 | migrations.AlterModelOptions( 30 | name='new', 31 | options={'ordering': ['-vote']}, 32 | ), 33 | migrations.AddField( 34 | model_name='comment', 35 | name='new', 36 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='news.New'), 37 | ), 38 | ] 39 | -------------------------------------------------------------------------------- /staticfiles/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #f8f8f8; 5 | } 6 | 7 | .login #header { 8 | height: auto; 9 | padding: 5px 16px; 10 | } 11 | 12 | .login #header h1 { 13 | font-size: 18px; 14 | } 15 | 16 | .login #header h1 a { 17 | color: #fff; 18 | } 19 | 20 | .login #content { 21 | padding: 20px 20px 0; 22 | } 23 | 24 | .login #container { 25 | background: #fff; 26 | border: 1px solid #eaeaea; 27 | border-radius: 4px; 28 | overflow: hidden; 29 | width: 28em; 30 | min-width: 300px; 31 | margin: 100px auto; 32 | } 33 | 34 | .login #content-main { 35 | width: 100%; 36 | } 37 | 38 | .login .form-row { 39 | padding: 4px 0; 40 | float: left; 41 | width: 100%; 42 | border-bottom: none; 43 | } 44 | 45 | .login .form-row label { 46 | padding-right: 0.5em; 47 | line-height: 2em; 48 | font-size: 1em; 49 | clear: both; 50 | color: #333; 51 | } 52 | 53 | .login .form-row #id_username, .login .form-row #id_password { 54 | clear: both; 55 | padding: 8px; 56 | width: 100%; 57 | -webkit-box-sizing: border-box; 58 | -moz-box-sizing: border-box; 59 | box-sizing: border-box; 60 | } 61 | 62 | .login span.help { 63 | font-size: 10px; 64 | display: block; 65 | } 66 | 67 | .login .submit-row { 68 | clear: both; 69 | padding: 1em 0 0 9.4em; 70 | margin: 0; 71 | border: none; 72 | background: none; 73 | text-align: left; 74 | } 75 | 76 | .login .password-reset-link { 77 | text-align: center; 78 | } 79 | -------------------------------------------------------------------------------- /staticfiles/admin/css/login.a846c0e2ef65.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #f8f8f8; 5 | } 6 | 7 | .login #header { 8 | height: auto; 9 | padding: 5px 16px; 10 | } 11 | 12 | .login #header h1 { 13 | font-size: 18px; 14 | } 15 | 16 | .login #header h1 a { 17 | color: #fff; 18 | } 19 | 20 | .login #content { 21 | padding: 20px 20px 0; 22 | } 23 | 24 | .login #container { 25 | background: #fff; 26 | border: 1px solid #eaeaea; 27 | border-radius: 4px; 28 | overflow: hidden; 29 | width: 28em; 30 | min-width: 300px; 31 | margin: 100px auto; 32 | } 33 | 34 | .login #content-main { 35 | width: 100%; 36 | } 37 | 38 | .login .form-row { 39 | padding: 4px 0; 40 | float: left; 41 | width: 100%; 42 | border-bottom: none; 43 | } 44 | 45 | .login .form-row label { 46 | padding-right: 0.5em; 47 | line-height: 2em; 48 | font-size: 1em; 49 | clear: both; 50 | color: #333; 51 | } 52 | 53 | .login .form-row #id_username, .login .form-row #id_password { 54 | clear: both; 55 | padding: 8px; 56 | width: 100%; 57 | -webkit-box-sizing: border-box; 58 | -moz-box-sizing: border-box; 59 | box-sizing: border-box; 60 | } 61 | 62 | .login span.help { 63 | font-size: 10px; 64 | display: block; 65 | } 66 | 67 | .login .submit-row { 68 | clear: both; 69 | padding: 1em 0 0 9.4em; 70 | margin: 0; 71 | border: none; 72 | background: none; 73 | text-align: left; 74 | } 75 | 76 | .login .password-reset-link { 77 | text-align: center; 78 | } 79 | -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.js: -------------------------------------------------------------------------------- 1 | /*global URLify*/ 2 | (function($) { 3 | 'use strict'; 4 | $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) { 5 | /* 6 | Depends on urlify.js 7 | Populates a selected field with the values of the dependent fields, 8 | URLifies and shortens the string. 9 | dependencies - array of dependent fields ids 10 | maxLength - maximum length of the URLify'd string 11 | allowUnicode - Unicode support of the URLify'd string 12 | */ 13 | return this.each(function() { 14 | var prepopulatedField = $(this); 15 | 16 | var populate = function() { 17 | // Bail if the field's value has been changed by the user 18 | if (prepopulatedField.data('_changed')) { 19 | return; 20 | } 21 | 22 | var values = []; 23 | $.each(dependencies, function(i, field) { 24 | field = $(field); 25 | if (field.val().length > 0) { 26 | values.push(field.val()); 27 | } 28 | }); 29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); 30 | }; 31 | 32 | prepopulatedField.data('_changed', false); 33 | prepopulatedField.change(function() { 34 | prepopulatedField.data('_changed', true); 35 | }); 36 | 37 | if (!prepopulatedField.val()) { 38 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); 39 | } 40 | }); 41 | }; 42 | })(django.jQuery); 43 | -------------------------------------------------------------------------------- /staticfiles/admin/js/prepopulate.ff9208865444.js: -------------------------------------------------------------------------------- 1 | /*global URLify*/ 2 | (function($) { 3 | 'use strict'; 4 | $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) { 5 | /* 6 | Depends on urlify.js 7 | Populates a selected field with the values of the dependent fields, 8 | URLifies and shortens the string. 9 | dependencies - array of dependent fields ids 10 | maxLength - maximum length of the URLify'd string 11 | allowUnicode - Unicode support of the URLify'd string 12 | */ 13 | return this.each(function() { 14 | var prepopulatedField = $(this); 15 | 16 | var populate = function() { 17 | // Bail if the field's value has been changed by the user 18 | if (prepopulatedField.data('_changed')) { 19 | return; 20 | } 21 | 22 | var values = []; 23 | $.each(dependencies, function(i, field) { 24 | field = $(field); 25 | if (field.val().length > 0) { 26 | values.push(field.val()); 27 | } 28 | }); 29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); 30 | }; 31 | 32 | prepopulatedField.data('_changed', false); 33 | prepopulatedField.change(function() { 34 | prepopulatedField.data('_changed', true); 35 | }); 36 | 37 | if (!prepopulatedField.val()) { 38 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); 39 | } 40 | }); 41 | }; 42 | })(django.jQuery); 43 | -------------------------------------------------------------------------------- /news/templates/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Hecker News 10 | 11 | 12 | 13 | 14 |
15 |
16 | 46 | {% block content %} 47 | 48 | {% endblock content %} 49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.min.js: -------------------------------------------------------------------------------- 1 | (function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n(); 2 | a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){var a;c===g.length?(a=!0,l()):(a=!1,p());return a})};a(b.counterContainer).show(); 3 | a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().click(function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).click(function(c){c||(c=window.event);var d=c.target?c.target:c.srcElement;if(f&& 4 | a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){k=!0});a('form#changelist-form button[name="index"]').click(function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))}); 5 | a('form#changelist-form input[name="_save"]').click(function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})}; 6 | a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e=a("tr input.action-select");0 0: 87 | new.vote = new.vote + 1 88 | new.save() 89 | return redirect('New:list') 90 | return redirect('Profile:sign_up') 91 | 92 | 93 | @method_decorator(login_required, name='dispatch') 94 | class CommentView(CreateView): 95 | model = Comment 96 | form_class = CommentForm 97 | 98 | def get_success_url(self): 99 | return reverse_lazy('New:list') 100 | 101 | def form_valid(self, form): 102 | form.instance.author = self.request.user 103 | form.instance.new = New.objects.get(pk=self.kwargs['pk']) 104 | form.save() 105 | return super(CommentView, self).form_valid(form) 106 | -------------------------------------------------------------------------------- /staticfiles/admin/img/selector-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /staticfiles/admin/img/selector-icons.b4555096cea2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /staticfiles/admin/js/timeparse.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | var timeParsePatterns = [ 4 | // 9 5 | { 6 | re: /^\d{1,2}$/i, 7 | handler: function(bits) { 8 | if (bits[0].length === 1) { 9 | return '0' + bits[0] + ':00'; 10 | } else { 11 | return bits[0] + ':00'; 12 | } 13 | } 14 | }, 15 | // 13:00 16 | { 17 | re: /^\d{2}[:.]\d{2}$/i, 18 | handler: function(bits) { 19 | return bits[0].replace('.', ':'); 20 | } 21 | }, 22 | // 9:00 23 | { 24 | re: /^\d[:.]\d{2}$/i, 25 | handler: function(bits) { 26 | return '0' + bits[0].replace('.', ':'); 27 | } 28 | }, 29 | // 3 am / 3 a.m. / 3am 30 | { 31 | re: /^(\d+)\s*([ap])(?:.?m.?)?$/i, 32 | handler: function(bits) { 33 | var hour = parseInt(bits[1]); 34 | if (hour === 12) { 35 | hour = 0; 36 | } 37 | if (bits[2].toLowerCase() === 'p') { 38 | if (hour === 12) { 39 | hour = 0; 40 | } 41 | return (hour + 12) + ':00'; 42 | } else { 43 | if (hour < 10) { 44 | return '0' + hour + ':00'; 45 | } else { 46 | return hour + ':00'; 47 | } 48 | } 49 | } 50 | }, 51 | // 3.30 am / 3:15 a.m. / 3.00am 52 | { 53 | re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i, 54 | handler: function(bits) { 55 | var hour = parseInt(bits[1]); 56 | var mins = parseInt(bits[2]); 57 | if (mins < 10) { 58 | mins = '0' + mins; 59 | } 60 | if (hour === 12) { 61 | hour = 0; 62 | } 63 | if (bits[3].toLowerCase() === 'p') { 64 | if (hour === 12) { 65 | hour = 0; 66 | } 67 | return (hour + 12) + ':' + mins; 68 | } else { 69 | if (hour < 10) { 70 | return '0' + hour + ':' + mins; 71 | } else { 72 | return hour + ':' + mins; 73 | } 74 | } 75 | } 76 | }, 77 | // noon 78 | { 79 | re: /^no/i, 80 | handler: function(bits) { 81 | return '12:00'; 82 | } 83 | }, 84 | // midnight 85 | { 86 | re: /^mid/i, 87 | handler: function(bits) { 88 | return '00:00'; 89 | } 90 | } 91 | ]; 92 | 93 | function parseTimeString(s) { 94 | for (var i = 0; i < timeParsePatterns.length; i++) { 95 | var re = timeParsePatterns[i].re; 96 | var handler = timeParsePatterns[i].handler; 97 | var bits = re.exec(s); 98 | if (bits) { 99 | return handler(bits); 100 | } 101 | } 102 | return s; 103 | } 104 | 105 | window.parseTimeString = parseTimeString; 106 | })(); 107 | -------------------------------------------------------------------------------- /staticfiles/admin/js/timeparse.51258861a46a.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | var timeParsePatterns = [ 4 | // 9 5 | { 6 | re: /^\d{1,2}$/i, 7 | handler: function(bits) { 8 | if (bits[0].length === 1) { 9 | return '0' + bits[0] + ':00'; 10 | } else { 11 | return bits[0] + ':00'; 12 | } 13 | } 14 | }, 15 | // 13:00 16 | { 17 | re: /^\d{2}[:.]\d{2}$/i, 18 | handler: function(bits) { 19 | return bits[0].replace('.', ':'); 20 | } 21 | }, 22 | // 9:00 23 | { 24 | re: /^\d[:.]\d{2}$/i, 25 | handler: function(bits) { 26 | return '0' + bits[0].replace('.', ':'); 27 | } 28 | }, 29 | // 3 am / 3 a.m. / 3am 30 | { 31 | re: /^(\d+)\s*([ap])(?:.?m.?)?$/i, 32 | handler: function(bits) { 33 | var hour = parseInt(bits[1]); 34 | if (hour === 12) { 35 | hour = 0; 36 | } 37 | if (bits[2].toLowerCase() === 'p') { 38 | if (hour === 12) { 39 | hour = 0; 40 | } 41 | return (hour + 12) + ':00'; 42 | } else { 43 | if (hour < 10) { 44 | return '0' + hour + ':00'; 45 | } else { 46 | return hour + ':00'; 47 | } 48 | } 49 | } 50 | }, 51 | // 3.30 am / 3:15 a.m. / 3.00am 52 | { 53 | re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i, 54 | handler: function(bits) { 55 | var hour = parseInt(bits[1]); 56 | var mins = parseInt(bits[2]); 57 | if (mins < 10) { 58 | mins = '0' + mins; 59 | } 60 | if (hour === 12) { 61 | hour = 0; 62 | } 63 | if (bits[3].toLowerCase() === 'p') { 64 | if (hour === 12) { 65 | hour = 0; 66 | } 67 | return (hour + 12) + ':' + mins; 68 | } else { 69 | if (hour < 10) { 70 | return '0' + hour + ':' + mins; 71 | } else { 72 | return hour + ':' + mins; 73 | } 74 | } 75 | } 76 | }, 77 | // noon 78 | { 79 | re: /^no/i, 80 | handler: function(bits) { 81 | return '12:00'; 82 | } 83 | }, 84 | // midnight 85 | { 86 | re: /^mid/i, 87 | handler: function(bits) { 88 | return '00:00'; 89 | } 90 | } 91 | ]; 92 | 93 | function parseTimeString(s) { 94 | for (var i = 0; i < timeParsePatterns.length; i++) { 95 | var re = timeParsePatterns[i].re; 96 | var handler = timeParsePatterns[i].handler; 97 | var bits = re.exec(s); 98 | if (bits) { 99 | return handler(bits); 100 | } 101 | } 102 | return s; 103 | } 104 | 105 | window.parseTimeString = parseTimeString; 106 | })(); 107 | -------------------------------------------------------------------------------- /hnews/settings/base.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for hnews project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.11.5. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.11/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = os.environ.get('SECRET_KEY') 24 | 25 | # LOGIN urls 26 | 27 | LOGIN_URL = '/signup' 28 | LOGIN_REDIRECT_URL = '/' 29 | LOGOUT_REDIRECT_URL = '/' 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 42 | 'news', 43 | 'userprofiles', 44 | ] 45 | 46 | MIDDLEWARE = [ 47 | 'django.middleware.security.SecurityMiddleware', 48 | 'django.contrib.sessions.middleware.SessionMiddleware', 49 | 'django.middleware.common.CommonMiddleware', 50 | 'django.middleware.csrf.CsrfViewMiddleware', 51 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 52 | 'django.contrib.messages.middleware.MessageMiddleware', 53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 54 | ] 55 | 56 | ROOT_URLCONF = 'hnews.urls' 57 | 58 | TEMPLATES = [ 59 | { 60 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 61 | 'DIRS': [], 62 | 'APP_DIRS': True, 63 | 'OPTIONS': { 64 | 'context_processors': [ 65 | 'django.template.context_processors.debug', 66 | 'django.template.context_processors.request', 67 | 'django.contrib.auth.context_processors.auth', 68 | 'django.contrib.messages.context_processors.messages', 69 | ], 70 | }, 71 | }, 72 | ] 73 | 74 | WSGI_APPLICATION = 'hnews.wsgi.application' 75 | 76 | 77 | # Database 78 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases 79 | 80 | 81 | # Password validation 82 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 83 | 84 | AUTH_PASSWORD_VALIDATORS = [ 85 | { 86 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 87 | }, 88 | { 89 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 90 | }, 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 96 | }, 97 | ] 98 | 99 | 100 | # Internationalization 101 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ 102 | 103 | LANGUAGE_CODE = 'en-us' 104 | 105 | TIME_ZONE = 'UTC' 106 | 107 | USE_I18N = True 108 | 109 | USE_L10N = True 110 | 111 | USE_TZ = True 112 | 113 | 114 | # Static files (CSS, JavaScript, Images) 115 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ 116 | 117 | STATIC_URL = '/static/' 118 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') 119 | STATICFILES_DIRS = ( 120 | os.path.join(BASE_DIR, 'static'), 121 | ) 122 | STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' 123 | -------------------------------------------------------------------------------- /staticfiles/staticfiles.json: -------------------------------------------------------------------------------- 1 | {"paths": {"admin/js/vendor/xregexp/xregexp.js": "admin/js/vendor/xregexp/xregexp.1865b1cf5085.js", "admin/js/vendor/xregexp/xregexp.min.js": "admin/js/vendor/xregexp/xregexp.min.c95393b8ca4d.js", "admin/js/vendor/xregexp/LICENSE-XREGEXP.txt": "admin/js/vendor/xregexp/LICENSE-XREGEXP.d64cecf4f157.txt", "admin/js/vendor/jquery/jquery.js": "admin/js/vendor/jquery/jquery.aacc43d6f308.js", "admin/js/vendor/jquery/LICENSE-JQUERY.txt": "admin/js/vendor/jquery/LICENSE-JQUERY.a158210a2737.txt", "admin/js/vendor/jquery/jquery.min.js": "admin/js/vendor/jquery/jquery.min.33cabfa15c10.js", "admin/img/gis/move_vertex_off.svg": "admin/img/gis/move_vertex_off.7a23bf31ef8a.svg", "admin/img/gis/move_vertex_on.svg": "admin/img/gis/move_vertex_on.0047eba25b67.svg", "admin/js/admin/RelatedObjectLookups.js": "admin/js/admin/RelatedObjectLookups.d2bdb1018963.js", "admin/js/admin/DateTimeShortcuts.js": "admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js", "admin/img/icon-deletelink.svg": "admin/img/icon-deletelink.564ef9dc3854.svg", "admin/img/icon-calendar.svg": "admin/img/icon-calendar.ac7aea671bea.svg", "admin/img/calendar-icons.svg": "admin/img/calendar-icons.39b290681a8b.svg", "admin/img/sorting-icons.svg": "admin/img/sorting-icons.3a097b59f104.svg", "admin/img/icon-alert.svg": "admin/img/icon-alert.034cc7d8a67f.svg", "admin/img/icon-no.svg": "admin/img/icon-no.439e821418cd.svg", "admin/img/icon-addlink.svg": "admin/img/icon-addlink.d519b3bab011.svg", "admin/img/tooltag-arrowright.svg": "admin/img/tooltag-arrowright.bbfb788a849e.svg", "admin/img/selector-icons.svg": "admin/img/selector-icons.b4555096cea2.svg", "admin/img/search.svg": "admin/img/search.7cf54ff789c6.svg", "admin/img/tooltag-add.svg": "admin/img/tooltag-add.e59d620a9742.svg", "admin/img/LICENSE": "admin/img/LICENSE.2c54f4e1ca1c", "admin/img/icon-unknown-alt.svg": "admin/img/icon-unknown-alt.81536e128bb6.svg", "admin/img/README.txt": "admin/img/README.837277fa1908.txt", "admin/img/icon-yes.svg": "admin/img/icon-yes.d2f9f035226a.svg", "admin/img/icon-changelink.svg": "admin/img/icon-changelink.18d2fd706348.svg", "admin/img/icon-clock.svg": "admin/img/icon-clock.e1d4dfac3f2b.svg", "admin/img/inline-delete.svg": "admin/img/inline-delete.fec1b761f254.svg", "admin/img/icon-unknown.svg": "admin/img/icon-unknown.a18cb4398978.svg", "admin/css/rtl.css": "admin/css/rtl.4c867197b256.css", "admin/css/login.css": "admin/css/login.a846c0e2ef65.css", "admin/css/fonts.css": "admin/css/fonts.494e4ec545c9.css", "admin/css/forms.css": "admin/css/forms.2003a066ae02.css", "admin/css/base.css": "admin/css/base.6b517d0d5813.css", "admin/css/widgets.css": "admin/css/widgets.5e372b41c483.css", "admin/css/changelists.css": "admin/css/changelists.f6dc691f8d62.css", "admin/css/dashboard.css": "admin/css/dashboard.7ac78187c567.css", "admin/fonts/LICENSE.txt": "admin/fonts/LICENSE.d273d63619c9.txt", "admin/fonts/Roboto-Bold-webfont.woff": "admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff", "admin/fonts/Roboto-Regular-webfont.woff": "admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff", "admin/fonts/Roboto-Light-webfont.woff": "admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff", "admin/fonts/README.txt": "admin/fonts/README.2c3d0bcdede2.txt", "admin/js/jquery.init.js": "admin/js/jquery.init.95b62fa19378.js", "admin/js/prepopulate.min.js": "admin/js/prepopulate.min.f4057ebb9b62.js", "admin/js/collapse.js": "admin/js/collapse.17d715df2104.js", "admin/js/change_form.js": "admin/js/change_form.9e85003a1a38.js", "admin/js/SelectFilter2.js": "admin/js/SelectFilter2.17009b6d4428.js", "admin/js/calendar.js": "admin/js/calendar.9ac94d055fbd.js", "admin/js/cancel.js": "admin/js/cancel.1d69cba4b4bf.js", "admin/js/SelectBox.js": "admin/js/SelectBox.b49f008d186b.js", "admin/js/core.js": "admin/js/core.fd861d43f0f5.js", "admin/js/inlines.min.js": "admin/js/inlines.min.d75b9ed03975.js", "admin/js/timeparse.js": "admin/js/timeparse.51258861a46a.js", "admin/js/prepopulate_init.js": "admin/js/prepopulate_init.0d3b53c37074.js", "admin/js/collapse.min.js": "admin/js/collapse.min.dc930adb2821.js", "admin/js/urlify.js": "admin/js/urlify.411bc3bb651c.js", "admin/js/actions.js": "admin/js/actions.32861b6cbdf9.js", "admin/js/actions.min.js": "admin/js/actions.min.f51f04edab28.js", "admin/js/inlines.js": "admin/js/inlines.eda404ee376d.js", "admin/js/popup_response.js": "admin/js/popup_response.6ce3197f8fc8.js", "admin/js/prepopulate.js": "admin/js/prepopulate.ff9208865444.js", "css/style.css": "css/style.6d054be835a1.css", "fonts/icomoon.ttf": "fonts/icomoon.14ca41cf3180.ttf", "fonts/icomoon.svg": "fonts/icomoon.50c10e0312fa.svg", "fonts/icomoon.eot": "fonts/icomoon.5a0c94785d69.eot", "fonts/icomoon.woff": "fonts/icomoon.bd8740b50bae.woff"}, "version": "1.0"} -------------------------------------------------------------------------------- /staticfiles/admin/js/inlines.min.js: -------------------------------------------------------------------------------- 1 | (function(c){c.fn.formset=function(b){var a=c.extend({},c.fn.formset.defaults,b),d=c(this);b=d.parent();var k=function(a,g,l){var b=new RegExp("("+g+"-(\\d+|__prefix__))");g=g+"-"+l;c(a).prop("for")&&c(a).prop("for",c(a).prop("for").replace(b,g));a.id&&(a.id=a.id.replace(b,g));a.name&&(a.name=a.name.replace(b,g))},e=c("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off"),l=parseInt(e.val(),10),g=c("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),h=""===g.val()||0'+a.addText+""),m=b.find("tr:last a")):(d.filter(":last").after('"),m=d.filter(":last").next().find("a")));m.click(function(b){b.preventDefault();b=c("#"+a.prefix+"-empty"); 3 | var f=b.clone(!0);f.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+l);f.is("tr")?f.children(":last").append('"):f.is("ul")||f.is("ol")?f.append('
  • '+a.deleteText+"
  • "):f.children(":first").append(''+a.deleteText+"");f.find("*").each(function(){k(this,a.prefix,e.val())});f.insertBefore(c(b)); 4 | c(e).val(parseInt(e.val(),10)+1);l+=1;""!==g.val()&&0>=g.val()-e.val()&&m.parent().hide();f.find("a."+a.deleteCssClass).click(function(b){b.preventDefault();f.remove();--l;a.removed&&a.removed(f);c(document).trigger("formset:removed",[f,a.prefix]);b=c("."+a.formCssClass);c("#id_"+a.prefix+"-TOTAL_FORMS").val(b.length);(""===g.val()||0'+a.addText+""),m=b.find("tr:last a")):(d.filter(":last").after('"),m=d.filter(":last").next().find("a")));m.click(function(b){b.preventDefault();b=c("#"+a.prefix+"-empty"); 3 | var f=b.clone(!0);f.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+l);f.is("tr")?f.children(":last").append('"):f.is("ul")||f.is("ol")?f.append('
  • '+a.deleteText+"
  • "):f.children(":first").append(''+a.deleteText+"");f.find("*").each(function(){k(this,a.prefix,e.val())});f.insertBefore(c(b)); 4 | c(e).val(parseInt(e.val(),10)+1);l+=1;""!==g.val()&&0>=g.val()-e.val()&&m.parent().hide();f.find("a."+a.deleteCssClass).click(function(b){b.preventDefault();f.remove();--l;a.removed&&a.removed(f);c(document).trigger("formset:removed",[f,a.prefix]);b=c("."+a.formCssClass);c("#id_"+a.prefix+"-TOTAL_FORMS").val(b.length);(""===g.val()||0 b) { 122 | return 1; 123 | } 124 | if (a < b) { 125 | return -1; 126 | } 127 | } 128 | catch (e) { 129 | // silently fail on IE 'unknown' exception 130 | } 131 | return 0; 132 | } ); 133 | }, 134 | select_all: function(id) { 135 | var box = document.getElementById(id); 136 | var boxOptions = box.options; 137 | var boxOptionsLength = boxOptions.length; 138 | for (var i = 0; i < boxOptionsLength; i++) { 139 | boxOptions[i].selected = 'selected'; 140 | } 141 | } 142 | }; 143 | window.SelectBox = SelectBox; 144 | })(django.jQuery); 145 | -------------------------------------------------------------------------------- /staticfiles/admin/js/SelectBox.b49f008d186b.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 'use strict'; 3 | var SelectBox = { 4 | cache: {}, 5 | init: function(id) { 6 | var box = document.getElementById(id); 7 | var node; 8 | SelectBox.cache[id] = []; 9 | var cache = SelectBox.cache[id]; 10 | var boxOptions = box.options; 11 | var boxOptionsLength = boxOptions.length; 12 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 13 | node = boxOptions[i]; 14 | cache.push({value: node.value, text: node.text, displayed: 1}); 15 | } 16 | }, 17 | redisplay: function(id) { 18 | // Repopulate HTML select box from cache 19 | var box = document.getElementById(id); 20 | var node; 21 | $(box).empty(); // clear all options 22 | var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag 23 | var cache = SelectBox.cache[id]; 24 | for (var i = 0, j = cache.length; i < j; i++) { 25 | node = cache[i]; 26 | if (node.displayed) { 27 | var new_option = new Option(node.text, node.value, false, false); 28 | // Shows a tooltip when hovering over the option 29 | new_option.setAttribute("title", node.text); 30 | new_options += new_option.outerHTML; 31 | } 32 | } 33 | new_options += ''; 34 | box.outerHTML = new_options; 35 | }, 36 | filter: function(id, text) { 37 | // Redisplay the HTML select box, displaying only the choices containing ALL 38 | // the words in text. (It's an AND search.) 39 | var tokens = text.toLowerCase().split(/\s+/); 40 | var node, token; 41 | var cache = SelectBox.cache[id]; 42 | for (var i = 0, j = cache.length; i < j; i++) { 43 | node = cache[i]; 44 | node.displayed = 1; 45 | var node_text = node.text.toLowerCase(); 46 | var numTokens = tokens.length; 47 | for (var k = 0; k < numTokens; k++) { 48 | token = tokens[k]; 49 | if (node_text.indexOf(token) === -1) { 50 | node.displayed = 0; 51 | break; // Once the first token isn't found we're done 52 | } 53 | } 54 | } 55 | SelectBox.redisplay(id); 56 | }, 57 | delete_from_cache: function(id, value) { 58 | var node, delete_index = null; 59 | var cache = SelectBox.cache[id]; 60 | for (var i = 0, j = cache.length; i < j; i++) { 61 | node = cache[i]; 62 | if (node.value === value) { 63 | delete_index = i; 64 | break; 65 | } 66 | } 67 | cache.splice(delete_index, 1); 68 | }, 69 | add_to_cache: function(id, option) { 70 | SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); 71 | }, 72 | cache_contains: function(id, value) { 73 | // Check if an item is contained in the cache 74 | var node; 75 | var cache = SelectBox.cache[id]; 76 | for (var i = 0, j = cache.length; i < j; i++) { 77 | node = cache[i]; 78 | if (node.value === value) { 79 | return true; 80 | } 81 | } 82 | return false; 83 | }, 84 | move: function(from, to) { 85 | var from_box = document.getElementById(from); 86 | var option; 87 | var boxOptions = from_box.options; 88 | var boxOptionsLength = boxOptions.length; 89 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 90 | option = boxOptions[i]; 91 | var option_value = option.value; 92 | if (option.selected && SelectBox.cache_contains(from, option_value)) { 93 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); 94 | SelectBox.delete_from_cache(from, option_value); 95 | } 96 | } 97 | SelectBox.redisplay(from); 98 | SelectBox.redisplay(to); 99 | }, 100 | move_all: function(from, to) { 101 | var from_box = document.getElementById(from); 102 | var option; 103 | var boxOptions = from_box.options; 104 | var boxOptionsLength = boxOptions.length; 105 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 106 | option = boxOptions[i]; 107 | var option_value = option.value; 108 | if (SelectBox.cache_contains(from, option_value)) { 109 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); 110 | SelectBox.delete_from_cache(from, option_value); 111 | } 112 | } 113 | SelectBox.redisplay(from); 114 | SelectBox.redisplay(to); 115 | }, 116 | sort: function(id) { 117 | SelectBox.cache[id].sort(function(a, b) { 118 | a = a.text.toLowerCase(); 119 | b = b.text.toLowerCase(); 120 | try { 121 | if (a > b) { 122 | return 1; 123 | } 124 | if (a < b) { 125 | return -1; 126 | } 127 | } 128 | catch (e) { 129 | // silently fail on IE 'unknown' exception 130 | } 131 | return 0; 132 | } ); 133 | }, 134 | select_all: function(id) { 135 | var box = document.getElementById(id); 136 | var boxOptions = box.options; 137 | var boxOptionsLength = boxOptions.length; 138 | for (var i = 0; i < boxOptionsLength; i++) { 139 | boxOptions[i].selected = 'selected'; 140 | } 141 | } 142 | }; 143 | window.SelectBox = SelectBox; 144 | })(django.jQuery); 145 | -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.js: -------------------------------------------------------------------------------- 1 | /*global gettext, interpolate, ngettext*/ 2 | (function($) { 3 | 'use strict'; 4 | var lastChecked; 5 | 6 | $.fn.actions = function(opts) { 7 | var options = $.extend({}, $.fn.actions.defaults, opts); 8 | var actionCheckboxes = $(this); 9 | var list_editable_changed = false; 10 | var showQuestion = function() { 11 | $(options.acrossClears).hide(); 12 | $(options.acrossQuestions).show(); 13 | $(options.allContainer).hide(); 14 | }, 15 | showClear = function() { 16 | $(options.acrossClears).show(); 17 | $(options.acrossQuestions).hide(); 18 | $(options.actionContainer).toggleClass(options.selectedClass); 19 | $(options.allContainer).show(); 20 | $(options.counterContainer).hide(); 21 | }, 22 | reset = function() { 23 | $(options.acrossClears).hide(); 24 | $(options.acrossQuestions).hide(); 25 | $(options.allContainer).hide(); 26 | $(options.counterContainer).show(); 27 | }, 28 | clearAcross = function() { 29 | reset(); 30 | $(options.acrossInput).val(0); 31 | $(options.actionContainer).removeClass(options.selectedClass); 32 | }, 33 | checker = function(checked) { 34 | if (checked) { 35 | showQuestion(); 36 | } else { 37 | reset(); 38 | } 39 | $(actionCheckboxes).prop("checked", checked) 40 | .parent().parent().toggleClass(options.selectedClass, checked); 41 | }, 42 | updateCounter = function() { 43 | var sel = $(actionCheckboxes).filter(":checked").length; 44 | // data-actions-icnt is defined in the generated HTML 45 | // and contains the total amount of objects in the queryset 46 | var actions_icnt = $('.action-counter').data('actionsIcnt'); 47 | $(options.counterContainer).html(interpolate( 48 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { 49 | sel: sel, 50 | cnt: actions_icnt 51 | }, true)); 52 | $(options.allToggle).prop("checked", function() { 53 | var value; 54 | if (sel === actionCheckboxes.length) { 55 | value = true; 56 | showQuestion(); 57 | } else { 58 | value = false; 59 | clearAcross(); 60 | } 61 | return value; 62 | }); 63 | }; 64 | // Show counter by default 65 | $(options.counterContainer).show(); 66 | // Check state of checkboxes and reinit state if needed 67 | $(this).filter(":checked").each(function(i) { 68 | $(this).parent().parent().toggleClass(options.selectedClass); 69 | updateCounter(); 70 | if ($(options.acrossInput).val() === 1) { 71 | showClear(); 72 | } 73 | }); 74 | $(options.allToggle).show().click(function() { 75 | checker($(this).prop("checked")); 76 | updateCounter(); 77 | }); 78 | $("a", options.acrossQuestions).click(function(event) { 79 | event.preventDefault(); 80 | $(options.acrossInput).val(1); 81 | showClear(); 82 | }); 83 | $("a", options.acrossClears).click(function(event) { 84 | event.preventDefault(); 85 | $(options.allToggle).prop("checked", false); 86 | clearAcross(); 87 | checker(0); 88 | updateCounter(); 89 | }); 90 | lastChecked = null; 91 | $(actionCheckboxes).click(function(event) { 92 | if (!event) { event = window.event; } 93 | var target = event.target ? event.target : event.srcElement; 94 | if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) { 95 | var inrange = false; 96 | $(lastChecked).prop("checked", target.checked) 97 | .parent().parent().toggleClass(options.selectedClass, target.checked); 98 | $(actionCheckboxes).each(function() { 99 | if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) { 100 | inrange = (inrange) ? false : true; 101 | } 102 | if (inrange) { 103 | $(this).prop("checked", target.checked) 104 | .parent().parent().toggleClass(options.selectedClass, target.checked); 105 | } 106 | }); 107 | } 108 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked); 109 | lastChecked = target; 110 | updateCounter(); 111 | }); 112 | $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { 113 | list_editable_changed = true; 114 | }); 115 | $('form#changelist-form button[name="index"]').click(function(event) { 116 | if (list_editable_changed) { 117 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); 118 | } 119 | }); 120 | $('form#changelist-form input[name="_save"]').click(function(event) { 121 | var action_changed = false; 122 | $('select option:selected', options.actionContainer).each(function() { 123 | if ($(this).val()) { 124 | action_changed = true; 125 | } 126 | }); 127 | if (action_changed) { 128 | if (list_editable_changed) { 129 | return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); 130 | } else { 131 | return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); 132 | } 133 | } 134 | }); 135 | }; 136 | /* Setup plugin defaults */ 137 | $.fn.actions.defaults = { 138 | actionContainer: "div.actions", 139 | counterContainer: "span.action-counter", 140 | allContainer: "div.actions span.all", 141 | acrossInput: "div.actions input.select-across", 142 | acrossQuestions: "div.actions span.question", 143 | acrossClears: "div.actions span.clear", 144 | allToggle: "#action-toggle", 145 | selectedClass: "selected" 146 | }; 147 | $(document).ready(function() { 148 | var $actionsEls = $('tr input.action-select'); 149 | if ($actionsEls.length > 0) { 150 | $actionsEls.actions(); 151 | } 152 | }); 153 | })(django.jQuery); 154 | -------------------------------------------------------------------------------- /staticfiles/admin/js/actions.32861b6cbdf9.js: -------------------------------------------------------------------------------- 1 | /*global gettext, interpolate, ngettext*/ 2 | (function($) { 3 | 'use strict'; 4 | var lastChecked; 5 | 6 | $.fn.actions = function(opts) { 7 | var options = $.extend({}, $.fn.actions.defaults, opts); 8 | var actionCheckboxes = $(this); 9 | var list_editable_changed = false; 10 | var showQuestion = function() { 11 | $(options.acrossClears).hide(); 12 | $(options.acrossQuestions).show(); 13 | $(options.allContainer).hide(); 14 | }, 15 | showClear = function() { 16 | $(options.acrossClears).show(); 17 | $(options.acrossQuestions).hide(); 18 | $(options.actionContainer).toggleClass(options.selectedClass); 19 | $(options.allContainer).show(); 20 | $(options.counterContainer).hide(); 21 | }, 22 | reset = function() { 23 | $(options.acrossClears).hide(); 24 | $(options.acrossQuestions).hide(); 25 | $(options.allContainer).hide(); 26 | $(options.counterContainer).show(); 27 | }, 28 | clearAcross = function() { 29 | reset(); 30 | $(options.acrossInput).val(0); 31 | $(options.actionContainer).removeClass(options.selectedClass); 32 | }, 33 | checker = function(checked) { 34 | if (checked) { 35 | showQuestion(); 36 | } else { 37 | reset(); 38 | } 39 | $(actionCheckboxes).prop("checked", checked) 40 | .parent().parent().toggleClass(options.selectedClass, checked); 41 | }, 42 | updateCounter = function() { 43 | var sel = $(actionCheckboxes).filter(":checked").length; 44 | // data-actions-icnt is defined in the generated HTML 45 | // and contains the total amount of objects in the queryset 46 | var actions_icnt = $('.action-counter').data('actionsIcnt'); 47 | $(options.counterContainer).html(interpolate( 48 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { 49 | sel: sel, 50 | cnt: actions_icnt 51 | }, true)); 52 | $(options.allToggle).prop("checked", function() { 53 | var value; 54 | if (sel === actionCheckboxes.length) { 55 | value = true; 56 | showQuestion(); 57 | } else { 58 | value = false; 59 | clearAcross(); 60 | } 61 | return value; 62 | }); 63 | }; 64 | // Show counter by default 65 | $(options.counterContainer).show(); 66 | // Check state of checkboxes and reinit state if needed 67 | $(this).filter(":checked").each(function(i) { 68 | $(this).parent().parent().toggleClass(options.selectedClass); 69 | updateCounter(); 70 | if ($(options.acrossInput).val() === 1) { 71 | showClear(); 72 | } 73 | }); 74 | $(options.allToggle).show().click(function() { 75 | checker($(this).prop("checked")); 76 | updateCounter(); 77 | }); 78 | $("a", options.acrossQuestions).click(function(event) { 79 | event.preventDefault(); 80 | $(options.acrossInput).val(1); 81 | showClear(); 82 | }); 83 | $("a", options.acrossClears).click(function(event) { 84 | event.preventDefault(); 85 | $(options.allToggle).prop("checked", false); 86 | clearAcross(); 87 | checker(0); 88 | updateCounter(); 89 | }); 90 | lastChecked = null; 91 | $(actionCheckboxes).click(function(event) { 92 | if (!event) { event = window.event; } 93 | var target = event.target ? event.target : event.srcElement; 94 | if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) { 95 | var inrange = false; 96 | $(lastChecked).prop("checked", target.checked) 97 | .parent().parent().toggleClass(options.selectedClass, target.checked); 98 | $(actionCheckboxes).each(function() { 99 | if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) { 100 | inrange = (inrange) ? false : true; 101 | } 102 | if (inrange) { 103 | $(this).prop("checked", target.checked) 104 | .parent().parent().toggleClass(options.selectedClass, target.checked); 105 | } 106 | }); 107 | } 108 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked); 109 | lastChecked = target; 110 | updateCounter(); 111 | }); 112 | $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { 113 | list_editable_changed = true; 114 | }); 115 | $('form#changelist-form button[name="index"]').click(function(event) { 116 | if (list_editable_changed) { 117 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); 118 | } 119 | }); 120 | $('form#changelist-form input[name="_save"]').click(function(event) { 121 | var action_changed = false; 122 | $('select option:selected', options.actionContainer).each(function() { 123 | if ($(this).val()) { 124 | action_changed = true; 125 | } 126 | }); 127 | if (action_changed) { 128 | if (list_editable_changed) { 129 | return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); 130 | } else { 131 | return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); 132 | } 133 | } 134 | }); 135 | }; 136 | /* Setup plugin defaults */ 137 | $.fn.actions.defaults = { 138 | actionContainer: "div.actions", 139 | counterContainer: "span.action-counter", 140 | allContainer: "div.actions span.all", 141 | acrossInput: "div.actions input.select-across", 142 | acrossQuestions: "div.actions span.question", 143 | acrossClears: "div.actions span.clear", 144 | allToggle: "#action-toggle", 145 | selectedClass: "selected" 146 | }; 147 | $(document).ready(function() { 148 | var $actionsEls = $('tr input.action-select'); 149 | if ($actionsEls.length > 0) { 150 | $actionsEls.actions(); 151 | } 152 | }); 153 | })(django.jQuery); 154 | --------------------------------------------------------------------------------