diff --git a/Makefile b/Makefile index 4dbde64bfe584eb70a83c33d63fe352f99d969a3..a21515d3b285261998d0945575c1d754a49cb8e3 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PYTHON = python VENV = .venv PORT = 8012 -SETTINGS = rybicka.settings.prod +SETTINGS = rybicka.settings.dev .PHONY: help venv install build run shell migrations migrate diff --git a/rv_voting_calc/templates/member_group_size_calc/index.html b/rv_voting_calc/templates/rv_voting_calc/index.html similarity index 100% rename from rv_voting_calc/templates/member_group_size_calc/index.html rename to rv_voting_calc/templates/rv_voting_calc/index.html diff --git a/rybicka/settings/base.py b/rybicka/settings/base.py index 8eb3f074efd718e15cae089d7e2d56c583680aa8..1b182f87f041bb007f550cda61d48026c22405c3 100644 --- a/rybicka/settings/base.py +++ b/rybicka/settings/base.py @@ -47,6 +47,7 @@ INSTALLED_APPS = [ "shared", "member_group_size_calc", + "rv_voting_calc", ] MIDDLEWARE = [ diff --git a/rybicka/urls.py b/rybicka/urls.py index fbfedf16485e96b0d616556486740e77b2148b92..d2110e6239e7777744927a270052f2f4afd9b2b5 100644 --- a/rybicka/urls.py +++ b/rybicka/urls.py @@ -17,5 +17,6 @@ from django.urls import include, path urlpatterns = [ path("vypocet-skupiny-clenu", include("member_group_size_calc.urls")), + path("hlasovani-rv", include("rv_voting_calc.urls")), path("", include("shared.urls")), ] diff --git a/shared/static/shared/voting.webp b/shared/static/shared/voting.webp new file mode 100644 index 0000000000000000000000000000000000000000..faf0b02ba0e4cbbd6bf479cfc9a4c78234132c12 Binary files /dev/null and b/shared/static/shared/voting.webp differ diff --git a/shared/templates/shared/base.html b/shared/templates/shared/base.html index b89cf70c4bbbc2a574284bf79d6a34dd28c21cfe..0c612109a4a97d224b81f3b88743661302fcb733 100644 --- a/shared/templates/shared/base.html +++ b/shared/templates/shared/base.html @@ -39,6 +39,7 @@ <link rel="shortcut icon" type="image/png" href="https://www.pirati.cz/static/shared/favicon/favicon-32.png" sizes="32x32"> <link rel="shortcut icon" type="image/png" href="https://www.pirati.cz/static/shared/favicon/favicon-16.png" sizes="16x16"> + {% render_bundle "shared" %} {% render_bundle "base" %} {% block head %}{% endblock %} diff --git a/shared/templates/shared/index.html b/shared/templates/shared/index.html index dc56a28ed734ad16d8306467d76cb3bdd5db0fb8..760351875888695140b3a69a4dc780248a01c464 100644 --- a/shared/templates/shared/index.html +++ b/shared/templates/shared/index.html @@ -34,6 +34,25 @@ </div> </div> </li> + <li class="card"> + <a href="{% url "rv_voting_calc:index" %}"> + <img + src="{% static "shared/voting.webp" %}" + alt="Kalkulačka velikosti skupiny členů" + class="w-full h-48 object-cover" + > + </a> + <div class="p-4"> + <h2 class="mb-2 text-xl font-bold"> + <a href="{% url "rv_voting_calc:index" %}"> + Kalkulačka hlasování RV + </a> + </h2> + <div class="font-light text-sm break-words"> + Výpočet velikosti skupiny členů podle jednacího řádu. + </div> + </div> + </li> <li class="card"> <a href="https://z.pirati.cz" target="_blank"> <img diff --git a/static_src/rv_voting_calc.js b/static_src/rv_voting_calc.js new file mode 100644 index 0000000000000000000000000000000000000000..8d1c8b69c3fce7bea45c73efd06983e3c419a92f --- /dev/null +++ b/static_src/rv_voting_calc.js @@ -0,0 +1 @@ + diff --git a/webpack.config.js b/webpack.config.js index bb38e048355512ab66e1552d8d8e44d2ab37c14e..d187e3f50a23b30b2bf9fc4e0ed3ff609aea096f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,8 +5,19 @@ module.exports = { mode: "production", context: __dirname, entry: { - base: path.resolve("static_src", "base.js"), - member_group_size_calc: path.resolve("static_src", "member_group_size_calc.js"), + base: { + import: path.resolve("static_src", "base.js"), + dependOn: "shared", + }, + member_group_size_calc: { + import: path.resolve("static_src", "member_group_size_calc.js"), + dependOn: "shared", + }, + rv_voting_calc: { + import: path.resolve("static_src", "rv_voting_calc.js"), + dependOn: "shared", + }, + shared: ["jquery"], }, output: { path: path.resolve(__dirname, "shared", "static", "shared"), @@ -20,6 +31,9 @@ module.exports = { }, ], }, + optimization: { + runtimeChunk: "single", + }, plugins: [ new BundleTracker({filename: './webpack-stats.json'}) ],