diff --git a/hunt/Pipfile b/hunt/Pipfile new file mode 100644 index 0000000..70d2d4f --- /dev/null +++ b/hunt/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +Django = "~=3.2" +psycopg2-binary = "~=2.8.6" +social-auth-app-django = "~=4.0.0" +gunicorn = "*" +whitenoise = "*" +django-ckeditor = "*" \ No newline at end of file diff --git a/hunt/Pipfile.lock b/hunt/Pipfile.lock new file mode 100644 index 0000000..56161cb --- /dev/null +++ b/hunt/Pipfile.lock @@ -0,0 +1,296 @@ +{ + "_meta": { + "hash": { + "sha256": "91d9b3fd6ebf46b5342b7ad4b05cbcb362e289f9ec1abf7e931ab806a9751afe" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "asgiref": { + "hashes": [ + "sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9", + "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214" + ], + "version": "==3.4.1" + }, + "certifi": { + "hashes": [ + "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee", + "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8" + ], + "version": "==2021.5.30" + }, + "cffi": { + "hashes": [ + "sha256:06c54a68935738d206570b20da5ef2b6b6d92b38ef3ec45c5422c0ebaf338d4d", + "sha256:0c0591bee64e438883b0c92a7bed78f6290d40bf02e54c5bf0978eaf36061771", + "sha256:19ca0dbdeda3b2615421d54bef8985f72af6e0c47082a8d26122adac81a95872", + "sha256:22b9c3c320171c108e903d61a3723b51e37aaa8c81255b5e7ce102775bd01e2c", + "sha256:26bb2549b72708c833f5abe62b756176022a7b9a7f689b571e74c8478ead51dc", + "sha256:33791e8a2dc2953f28b8d8d300dde42dd929ac28f974c4b4c6272cb2955cb762", + "sha256:3c8d896becff2fa653dc4438b54a5a25a971d1f4110b32bd3068db3722c80202", + "sha256:4373612d59c404baeb7cbd788a18b2b2a8331abcc84c3ba40051fcd18b17a4d5", + "sha256:487d63e1454627c8e47dd230025780e91869cfba4c753a74fda196a1f6ad6548", + "sha256:48916e459c54c4a70e52745639f1db524542140433599e13911b2f329834276a", + "sha256:4922cd707b25e623b902c86188aca466d3620892db76c0bdd7b99a3d5e61d35f", + "sha256:55af55e32ae468e9946f741a5d51f9896da6b9bf0bbdd326843fec05c730eb20", + "sha256:57e555a9feb4a8460415f1aac331a2dc833b1115284f7ded7278b54afc5bd218", + "sha256:5d4b68e216fc65e9fe4f524c177b54964af043dde734807586cf5435af84045c", + "sha256:64fda793737bc4037521d4899be780534b9aea552eb673b9833b01f945904c2e", + "sha256:6d6169cb3c6c2ad50db5b868db6491a790300ade1ed5d1da29289d73bbe40b56", + "sha256:7bcac9a2b4fdbed2c16fa5681356d7121ecabf041f18d97ed5b8e0dd38a80224", + "sha256:80b06212075346b5546b0417b9f2bf467fea3bfe7352f781ffc05a8ab24ba14a", + "sha256:818014c754cd3dba7229c0f5884396264d51ffb87ec86e927ef0be140bfdb0d2", + "sha256:8eb687582ed7cd8c4bdbff3df6c0da443eb89c3c72e6e5dcdd9c81729712791a", + "sha256:99f27fefe34c37ba9875f224a8f36e31d744d8083e00f520f133cab79ad5e819", + "sha256:9f3e33c28cd39d1b655ed1ba7247133b6f7fc16fa16887b120c0c670e35ce346", + "sha256:a8661b2ce9694ca01c529bfa204dbb144b275a31685a075ce123f12331be790b", + "sha256:a9da7010cec5a12193d1af9872a00888f396aba3dc79186604a09ea3ee7c029e", + "sha256:aedb15f0a5a5949ecb129a82b72b19df97bbbca024081ed2ef88bd5c0a610534", + "sha256:b315d709717a99f4b27b59b021e6207c64620790ca3e0bde636a6c7f14618abb", + "sha256:ba6f2b3f452e150945d58f4badd92310449876c4c954836cfb1803bdd7b422f0", + "sha256:c33d18eb6e6bc36f09d793c0dc58b0211fccc6ae5149b808da4a62660678b156", + "sha256:c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd", + "sha256:c9e005e9bd57bc987764c32a1bee4364c44fdc11a3cc20a40b93b444984f2b87", + "sha256:d2ad4d668a5c0645d281dcd17aff2be3212bc109b33814bbb15c4939f44181cc", + "sha256:d950695ae4381ecd856bcaf2b1e866720e4ab9a1498cba61c602e56630ca7195", + "sha256:e22dcb48709fc51a7b58a927391b23ab37eb3737a98ac4338e2448bef8559b33", + "sha256:e8c6a99be100371dbb046880e7a282152aa5d6127ae01783e37662ef73850d8f", + "sha256:e9dc245e3ac69c92ee4c167fbdd7428ec1956d4e754223124991ef29eb57a09d", + "sha256:eb687a11f0a7a1839719edd80f41e459cc5366857ecbed383ff376c4e3cc6afd", + "sha256:eb9e2a346c5238a30a746893f23a9535e700f8192a68c07c0258e7ece6ff3728", + "sha256:ed38b924ce794e505647f7c331b22a693bee1538fdf46b0222c4717b42f744e7", + "sha256:f0010c6f9d1a4011e429109fda55a225921e3206e7f62a0c22a35344bfd13cca", + "sha256:f0c5d1acbfca6ebdd6b1e3eded8d261affb6ddcf2186205518f1428b8569bb99", + "sha256:f10afb1004f102c7868ebfe91c28f4a712227fe4cb24974350ace1f90e1febbf", + "sha256:f174135f5609428cc6e1b9090f9268f5c8935fddb1b25ccb8255a2d50de6789e", + "sha256:f3ebe6e73c319340830a9b2825d32eb6d8475c1dac020b4f0aa774ee3b898d1c", + "sha256:f627688813d0a4140153ff532537fbe4afea5a3dffce1f9deb7f91f848a832b5", + "sha256:fd4305f86f53dfd8cd3522269ed7fc34856a8ee3709a5e28b2836b2db9d4cd69" + ], + "version": "==1.14.6" + }, + "charset-normalizer": { + "hashes": [ + "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6", + "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f" + ], + "markers": "python_version >= '3'", + "version": "==2.0.6" + }, + "cryptography": { + "hashes": [ + "sha256:0a7dcbcd3f1913f664aca35d47c1331fce738d44ec34b7be8b9d332151b0b01e", + "sha256:1eb7bb0df6f6f583dd8e054689def236255161ebbcf62b226454ab9ec663746b", + "sha256:21ca464b3a4b8d8e86ba0ee5045e103a1fcfac3b39319727bc0fc58c09c6aff7", + "sha256:34dae04a0dce5730d8eb7894eab617d8a70d0c97da76b905de9efb7128ad7085", + "sha256:3520667fda779eb788ea00080124875be18f2d8f0848ec00733c0ec3bb8219fc", + "sha256:3fa3a7ccf96e826affdf1a0a9432be74dc73423125c8f96a909e3835a5ef194a", + "sha256:5b0fbfae7ff7febdb74b574055c7466da334a5371f253732d7e2e7525d570498", + "sha256:695104a9223a7239d155d7627ad912953b540929ef97ae0c34c7b8bf30857e89", + "sha256:8695456444f277af73a4877db9fc979849cd3ee74c198d04fc0776ebc3db52b9", + "sha256:94cc5ed4ceaefcbe5bf38c8fba6a21fc1d365bb8fb826ea1688e3370b2e24a1c", + "sha256:94fff993ee9bc1b2440d3b7243d488c6a3d9724cc2b09cdb297f6a886d040ef7", + "sha256:9965c46c674ba8cc572bc09a03f4c649292ee73e1b683adb1ce81e82e9a6a0fb", + "sha256:a00cf305f07b26c351d8d4e1af84ad7501eca8a342dedf24a7acb0e7b7406e14", + "sha256:a305600e7a6b7b855cd798e00278161b681ad6e9b7eca94c721d5f588ab212af", + "sha256:cd65b60cfe004790c795cc35f272e41a3df4631e2fb6b35aa7ac6ef2859d554e", + "sha256:d2a6e5ef66503da51d2110edf6c403dc6b494cc0082f85db12f54e9c5d4c3ec5", + "sha256:d9ec0e67a14f9d1d48dd87a2531009a9b251c02ea42851c060b25c782516ff06", + "sha256:f44d141b8c4ea5eb4dbc9b3ad992d45580c1d22bf5e24363f2fbf50c2d7ae8a7" + ], + "version": "==3.4.8" + }, + "defusedxml": { + "hashes": [ + "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69", + "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61" + ], + "version": "==0.7.1" + }, + "django": { + "hashes": [ + "sha256:95b318319d6997bac3595517101ad9cc83fe5672ac498ba48d1a410f47afecd2", + "sha256:e93c93565005b37ddebf2396b4dc4b6913c1838baa82efdfb79acedd5816c240" + ], + "index": "pypi", + "version": "==3.2.7" + }, + "django-ckeditor": { + "hashes": [ + "sha256:346b26b9d60dc8a88524d0eaaf406f4e91a4b3c22d208ae87aa032bf500b251c", + "sha256:f0d108f67a81a04e26d8de11255fe314f51026eaf8eb0534a807512ae3c21620" + ], + "index": "pypi", + "version": "==6.1.0" + }, + "django-js-asset": { + "hashes": [ + "sha256:8ec12017f26eec524cab436c64ae73033368a372970af4cf42d9354fcb166bdd", + "sha256:c163ae80d2e0b22d8fb598047cd0dcef31f81830e127cfecae278ad574167260" + ], + "version": "==1.2.2" + }, + "gunicorn": { + "hashes": [ + "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e", + "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8" + ], + "index": "pypi", + "version": "==20.1.0" + }, + "idna": { + "hashes": [ + "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a", + "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3" + ], + "markers": "python_version >= '3'", + "version": "==3.2" + }, + "oauthlib": { + "hashes": [ + "sha256:42bf6354c2ed8c6acb54d971fce6f88193d97297e18602a3a886603f9d7730cc", + "sha256:8f0215fcc533dd8dd1bee6f4c412d4f0cd7297307d43ac61666389e3bc3198a3" + ], + "version": "==3.1.1" + }, + "psycopg2-binary": { + "hashes": [ + "sha256:0deac2af1a587ae12836aa07970f5cb91964f05a7c6cdb69d8425ff4c15d4e2c", + "sha256:0e4dc3d5996760104746e6cfcdb519d9d2cd27c738296525d5867ea695774e67", + "sha256:11b9c0ebce097180129e422379b824ae21c8f2a6596b159c7659e2e5a00e1aa0", + "sha256:15978a1fbd225583dd8cdaf37e67ccc278b5abecb4caf6b2d6b8e2b948e953f6", + "sha256:1fabed9ea2acc4efe4671b92c669a213db744d2af8a9fc5d69a8e9bc14b7a9db", + "sha256:2dac98e85565d5688e8ab7bdea5446674a83a3945a8f416ad0110018d1501b94", + "sha256:42ec1035841b389e8cc3692277a0bd81cdfe0b65d575a2c8862cec7a80e62e52", + "sha256:6422f2ff0919fd720195f64ffd8f924c1395d30f9a495f31e2392c2efafb5056", + "sha256:6a32f3a4cb2f6e1a0b15215f448e8ce2da192fd4ff35084d80d5e39da683e79b", + "sha256:7312e931b90fe14f925729cde58022f5d034241918a5c4f9797cac62f6b3a9dd", + "sha256:7d92a09b788cbb1aec325af5fcba9fed7203897bbd9269d5691bb1e3bce29550", + "sha256:833709a5c66ca52f1d21d41865a637223b368c0ee76ea54ca5bad6f2526c7679", + "sha256:89705f45ce07b2dfa806ee84439ec67c5d9a0ef20154e0e475e2b2ed392a5b83", + "sha256:8cd0fb36c7412996859cb4606a35969dd01f4ea34d9812a141cd920c3b18be77", + "sha256:950bc22bb56ee6ff142a2cb9ee980b571dd0912b0334aa3fe0fe3788d860bea2", + "sha256:a0c50db33c32594305b0ef9abc0cb7db13de7621d2cadf8392a1d9b3c437ef77", + "sha256:a0eb43a07386c3f1f1ebb4dc7aafb13f67188eab896e7397aa1ee95a9c884eb2", + "sha256:aaa4213c862f0ef00022751161df35804127b78adf4a2755b9f991a507e425fd", + "sha256:ac0c682111fbf404525dfc0f18a8b5f11be52657d4f96e9fcb75daf4f3984859", + "sha256:ad20d2eb875aaa1ea6d0f2916949f5c08a19c74d05b16ce6ebf6d24f2c9f75d1", + "sha256:b4afc542c0ac0db720cf516dd20c0846f71c248d2b3d21013aa0d4ef9c71ca25", + "sha256:b8a3715b3c4e604bcc94c90a825cd7f5635417453b253499664f784fc4da0152", + "sha256:ba28584e6bca48c59eecbf7efb1576ca214b47f05194646b081717fa628dfddf", + "sha256:ba381aec3a5dc29634f20692349d73f2d21f17653bda1decf0b52b11d694541f", + "sha256:bd1be66dde2b82f80afb9459fc618216753f67109b859a361cf7def5c7968729", + "sha256:c2507d796fca339c8fb03216364cca68d87e037c1f774977c8fc377627d01c71", + "sha256:cec7e622ebc545dbb4564e483dd20e4e404da17ae07e06f3e780b2dacd5cee66", + "sha256:d14b140a4439d816e3b1229a4a525df917d6ea22a0771a2a78332273fd9528a4", + "sha256:d1b4ab59e02d9008efe10ceabd0b31e79519da6fb67f7d8e8977118832d0f449", + "sha256:d5227b229005a696cc67676e24c214740efd90b148de5733419ac9aaba3773da", + "sha256:e1f57aa70d3f7cc6947fd88636a481638263ba04a742b4a37dd25c373e41491a", + "sha256:e74a55f6bad0e7d3968399deb50f61f4db1926acf4a6d83beaaa7df986f48b1c", + "sha256:e82aba2188b9ba309fd8e271702bd0d0fc9148ae3150532bbb474f4590039ffb", + "sha256:ee69dad2c7155756ad114c02db06002f4cded41132cc51378e57aad79cc8e4f4", + "sha256:f5ab93a2cb2d8338b1674be43b442a7f544a0971da062a5da774ed40587f18f5" + ], + "index": "pypi", + "version": "==2.8.6" + }, + "pycparser": { + "hashes": [ + "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0", + "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705" + ], + "version": "==2.20" + }, + "pyjwt": { + "hashes": [ + "sha256:934d73fbba91b0483d3857d1aff50e96b2a892384ee2c17417ed3203f173fca1", + "sha256:fba44e7898bbca160a2b2b501f492824fc8382485d3a6f11ba5d0c1937ce6130" + ], + "version": "==2.1.0" + }, + "python3-openid": { + "hashes": [ + "sha256:33fbf6928f401e0b790151ed2b5290b02545e8775f982485205a066f874aaeaf", + "sha256:6626f771e0417486701e0b4daff762e7212e820ca5b29fcc0d05f6f8736dfa6b" + ], + "version": "==3.2.0" + }, + "pytz": { + "hashes": [ + "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da", + "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798" + ], + "version": "==2021.1" + }, + "requests": { + "hashes": [ + "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", + "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7" + ], + "version": "==2.26.0" + }, + "requests-oauthlib": { + "hashes": [ + "sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d", + "sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a", + "sha256:fa6c47b933f01060936d87ae9327fead68768b69c6c9ea2109c48be30f2d4dbc" + ], + "version": "==1.3.0" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "version": "==1.16.0" + }, + "social-auth-app-django": { + "hashes": [ + "sha256:2c69e57df0b30c9c1823519c5f1992cbe4f3f98fdc7d95c840e091a752708840", + "sha256:567ad0e028311541d7dfed51d3bf2c60440a6fd236d5d4d06c5a618b3d6c57c5", + "sha256:df5212370bd250108987c4748419a1a1d0cec750878856c2644c36aaa0fd3e58" + ], + "index": "pypi", + "version": "==4.0.0" + }, + "social-auth-core": { + "hashes": [ + "sha256:5ab43b3b15dce5f059db69cc3082c216574739f0edbc98629c8c6e8769c67eb4", + "sha256:983b53167ac56e7ba4909db555602a6e7a98c97ca47183bb222eb85ba627bf2b" + ], + "version": "==4.1.0" + }, + "sqlparse": { + "hashes": [ + "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", + "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" + ], + "version": "==0.4.2" + }, + "urllib3": { + "hashes": [ + "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4", + "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f" + ], + "version": "==1.26.6" + }, + "whitenoise": { + "hashes": [ + "sha256:d234b871b52271ae7ed6d9da47ffe857c76568f11dd30e28e18c5869dbd11e12", + "sha256:d963ef25639d1417e8a247be36e6aedd8c7c6f0a08adcb5a89146980a96b577c" + ], + "index": "pypi", + "version": "==5.3.0" + } + }, + "develop": {} +} diff --git a/hunt/README.md b/hunt/README.md new file mode 100644 index 0000000..f805b09 --- /dev/null +++ b/hunt/README.md @@ -0,0 +1 @@ +# scavenger-hunt-2021 \ No newline at end of file diff --git a/hunt/apps/main/migrations/0012_alter_class_year.py b/hunt/apps/main/migrations/0012_alter_class_year.py new file mode 100644 index 0000000..ca2c2fe --- /dev/null +++ b/hunt/apps/main/migrations/0012_alter_class_year.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.6 on 2022-09-15 23:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0011_alter_challenge_flag'), + ] + + operations = [ + migrations.AlterField( + model_name='class', + name='year', + field=models.CharField(choices=[('2023', 'Seniors'), ('2024', 'Juniors'), ('2025', 'Sophomores'), ('2026', 'Freshmen')], max_length=20, unique=True), + ), + ] diff --git a/hunt/apps/main/models.py b/hunt/apps/main/models.py index 86a4222..391e5e6 100644 --- a/hunt/apps/main/models.py +++ b/hunt/apps/main/models.py @@ -26,7 +26,7 @@ class Challenge(models.Model): return "{} ({})".format(self.name, self.id) class Class(models.Model): - YEAR_CHOICES = (('2022', 'Seniors'), ('2023', 'Juniors'), ('2024', 'Sophomores'), ('2025', 'Freshmen')) + YEAR_CHOICES = (('2023', 'Seniors'), ('2024', 'Juniors'), ('2025', 'Sophomores'), ('2026', 'Freshmen')) id = models.AutoField(primary_key=True, null=False, blank=False) year = models.CharField(max_length=20, choices=YEAR_CHOICES, null=False, blank=False, unique=True) diff --git a/hunt/apps/main/urls.py b/hunt/apps/main/urls.py index 2d816ea..d9b55f6 100644 --- a/hunt/apps/main/urls.py +++ b/hunt/apps/main/urls.py @@ -9,5 +9,6 @@ urlpatterns = [ path("overview/", views.overview, name="overview"), path("validate/", views.validate_flag, name="validate_flag"), path("support/", views.support, name="support"), + path("toggledark/", views.dark_mode, name="toggledark"), path("challenge/", views.challenge_detail, name="challenge_detail") ] \ No newline at end of file diff --git a/hunt/apps/main/views.py b/hunt/apps/main/views.py index e1dda6a..1fced73 100644 --- a/hunt/apps/main/views.py +++ b/hunt/apps/main/views.py @@ -6,6 +6,10 @@ from django.urls import reverse from .models import Challenge, Class, Category +import logging + +logger = logging.getLogger(__file__) + @login_required def index(request): @@ -16,6 +20,7 @@ def index(request): - completed (completed by users's class) - locked (can only be completed by one class and has been completed) """ + data = sorted([(c.year, c.get_points()) for c in Class.objects.all()]) challenges_completed_by_class = set(Class.objects.get(year=str(request.user.graduation_year)).challenges_completed.all()) categories_dict = dict() for category in Category.objects.all(): @@ -28,10 +33,20 @@ def index(request): else: challenges_dict[c.id] = [c, "available"] categories_dict[category.id] = [category, challenges_dict] - return render(request, "main/index.html", context={"categories": categories_dict}) + + logger.debug(f"user is {request.user.username} with mode {request.user.dark_mode}") + + return render(request, "main/index.html", context={"categories": categories_dict,"data": data, dark_mode: request.user.dark_mode}) else: return redirect(reverse("main:overview")) +@login_required +def dark_mode(request): + user = request.user + user.dark_mode = not user.dark_mode + user.save() + return redirect(reverse("main:index")) + @login_required def overview(request): data = sorted([(c.year, c.get_points()) for c in Class.objects.all()]) diff --git a/hunt/apps/users/migrations/0004_alter_user_challenges_done.py b/hunt/apps/users/migrations/0004_alter_user_challenges_done.py new file mode 100644 index 0000000..d3fb984 --- /dev/null +++ b/hunt/apps/users/migrations/0004_alter_user_challenges_done.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.6 on 2022-09-16 00:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0012_alter_class_year'), + ('users', '0003_auto_20210814_2354'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='challenges_done', + field=models.ManyToManyField(blank=True, related_name='users_that_completed', to='main.Challenge'), + ), + ] diff --git a/hunt/apps/users/migrations/0005_user_dark_mode.py b/hunt/apps/users/migrations/0005_user_dark_mode.py new file mode 100644 index 0000000..2e120ce --- /dev/null +++ b/hunt/apps/users/migrations/0005_user_dark_mode.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.6 on 2022-09-21 00:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0004_alter_user_challenges_done'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='dark_mode', + field=models.BooleanField(default=False), + ), + ] diff --git a/hunt/apps/users/models.py b/hunt/apps/users/models.py index 0ed7214..49bdbdf 100644 --- a/hunt/apps/users/models.py +++ b/hunt/apps/users/models.py @@ -30,8 +30,9 @@ class User(AbstractBaseUser): email = models.EmailField(max_length=50, null=False, blank=False) is_superuser = models.BooleanField(default=False, null=False) _is_staff = models.BooleanField(default=False, null=False) + dark_mode = models.BooleanField(default=False, null=False) - challenges_done = models.ManyToManyField(Challenge, related_name="users_that_completed") + challenges_done = models.ManyToManyField(Challenge, related_name="users_that_completed", blank=True) date_joined = models.DateTimeField(auto_now_add=True) diff --git a/hunt/manage.py b/hunt/manage.py new file mode 100755 index 0000000..563e834 --- /dev/null +++ b/hunt/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hunt.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/hunt/settings/__init__.py b/hunt/settings/__init__.py index cc0d4e1..518dc1d 100644 --- a/hunt/settings/__init__.py +++ b/hunt/settings/__init__.py @@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-=6^bbhfem^#pl*@w29%mo$z#r5_#2d5-m@9q0&9egz@qtcfbah # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'hunt.sites.tjhsst.edu', 'hunt.tjhsst.edu'] +ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'hunt.sites.tjhsst.edu', 'hunt.tjhsst.edu', '*'] # Application definition diff --git a/hunt/static/css/overview.css b/hunt/static/css/overview.css index 6212c0a..b274671 100644 --- a/hunt/static/css/overview.css +++ b/hunt/static/css/overview.css @@ -9,7 +9,7 @@ top: 100px; } -.box { +#hoco-scores > .score-box { display: inline-block; position: relative; background-color: #545454; @@ -21,11 +21,11 @@ overflow: hidden; } -.class { +#hoco-scores > .score-box > .class { font-size: 1.5em; } -.score { +#hoco-scores > .score-box > .score { font-size: 2em; } @@ -40,7 +40,7 @@ } } -.corner-ribbon { +#hoco-scores > .score-box > .corner-ribbon { width: 95px; background: #e43; position: absolute; diff --git a/hunt/static/img/losing.mp3 b/hunt/static/img/losing.mp3 new file mode 100644 index 0000000..54938b6 Binary files /dev/null and b/hunt/static/img/losing.mp3 differ diff --git a/hunt/templates/auth/login.html b/hunt/templates/auth/login.html index 55df01f..ca9ccf4 100644 --- a/hunt/templates/auth/login.html +++ b/hunt/templates/auth/login.html @@ -8,10 +8,10 @@ {% block main %}
-

Hoco Hunt 2021

+

Hoco Hunt 2022

-

Login in with your Ion account to access the Hoco Hunt 2021.

+

Login in with your Ion account to access the Hoco Hunt 2022.

Log in with Ion
{% endblock %} \ No newline at end of file diff --git a/hunt/templates/base.html b/hunt/templates/base.html index a21826d..2b5cf5e 100644 --- a/hunt/templates/base.html +++ b/hunt/templates/base.html @@ -11,6 +11,10 @@ integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"> + Hoco Hunt 2022 diff --git a/hunt/templates/base_with_nav.html b/hunt/templates/base_with_nav.html index bd74d9a..36bc2eb 100644 --- a/hunt/templates/base_with_nav.html +++ b/hunt/templates/base_with_nav.html @@ -9,6 +9,12 @@