-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
froide-govplan: init at 0-unstable-2024-09-19
- Loading branch information
Showing
3 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
pkgs/by-name/fr/froide-govplan/disable_missing_template.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/froide_govplan/templates/froide_govplan/detail.html b/froide_govplan/templates/froide_govplan/detail.html | ||
index 25b780b..3620852 100644 | ||
--- a/froide_govplan/templates/froide_govplan/detail.html | ||
+++ b/froide_govplan/templates/froide_govplan/detail.html | ||
@@ -5,7 +5,6 @@ | ||
{% load cms_tags %} | ||
{% load follow_tags %} | ||
{% load govplan %} | ||
-{% load form_helper %} | ||
{% load content_helper %} | ||
{% load thumbnail %} | ||
|
||
@@ -41,7 +40,6 @@ | ||
</ul> | ||
|
||
<div class="ms-auto mt-2 mt-md-0"> | ||
- {% show_follow "govplan" object %} | ||
</div> | ||
</div> | ||
|
||
@@ -177,7 +175,6 @@ | ||
<div class="modal-body"> | ||
<form method="post" action="{% url 'govplan:propose_planupdate' gov=object.government.slug plan=object.slug %}"> | ||
{% csrf_token %} | ||
- {% render_form update_proposal_form %} | ||
<button type="submit" class="btn btn-primary"> | ||
Neue Entwicklung melden | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/project/settings.py b/project/settings.py | ||
index dd282ac..64ff265 100644 | ||
--- a/project/settings.py | ||
+++ b/project/settings.py | ||
@@ -202,3 +202,10 @@ CMS_CONFIRM_VERSION4 = True | ||
|
||
GOVPLAN_NAME = "GovPlan" | ||
GOVPLAN_ENABLE_FOIREQUEST = False | ||
+ | ||
+EXTRA_SETTINGS_PATH = os.path.join(PROJECT_DIR, 'extra_settings.py') | ||
+ | ||
+if os.path.exists(EXTRA_SETTINGS_PATH): | ||
+ with open(EXTRA_SETTINGS_PATH) as f: | ||
+ code = compile(f.read(), EXTRA_SETTINGS_PATH, 'exec') | ||
+ exec(code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
lib, | ||
python3, | ||
fetchFromGitHub, | ||
makeWrapper, | ||
froide, | ||
gdal, | ||
geos, | ||
nixosTests, | ||
fetchpatch, | ||
froide-govplan, | ||
gettext, | ||
}: | ||
|
||
let | ||
|
||
python = python3.override { | ||
packageOverrides = self: super: { | ||
django = super.django.override { withGdal = true; }; | ||
}; | ||
}; | ||
|
||
in | ||
python.pkgs.buildPythonApplication rec { | ||
pname = "froide-govplan"; | ||
version = "0-unstable-2024-11-05"; | ||
pyproject = true; | ||
|
||
src = fetchFromGitHub { | ||
owner = "okfde"; | ||
repo = "froide-govplan"; | ||
# No tagged release yet | ||
# https://github.com/okfde/froide-govplan/issues/15 | ||
rev = "5d2f5e6c0bc883c75a00e45893f3e32761d3159f"; | ||
hash = "sha256-hVZL8WMY0xorZv8k0qQ2Q7etJnwrl/CTKXkcQiLN+RQ="; | ||
}; | ||
|
||
patches = [ | ||
# Add missing oauth2_provider app | ||
# https://github.com/okfde/froide-govplan/pull/17 | ||
(fetchpatch { | ||
url = "https://github.com/okfde/froide-govplan/commit/bc388b693ebc7656fc7917511048a47b68e119fe.patch"; | ||
hash = "sha256-StIyN3gFKd/fld14s03fsV6fmWinSRWINUyRRBzqVco="; | ||
name = "add_oauth2_provider_app.patch"; | ||
}) | ||
# Enable automatic image cropping for filer | ||
# https://github.com/okfde/froide-govplan/pull/19 | ||
(fetchpatch { | ||
url = "https://github.com/okfde/froide-govplan/commit/d5db02f3bbc501929a901e964147a0ed2f974f41.patch"; | ||
hash = "sha256-jf6e84fd2kQIPER2HGmZNkbtl067311xdNJRU+iFVXM="; | ||
name = "filer_enable_automatic_cropping.patch"; | ||
}) | ||
# Add support for reading SECRET_KEY_FILE | ||
# https://github.com/okfde/froide-govplan/pull/21 | ||
(fetchpatch { | ||
url = "https://github.com/okfde/froide-govplan/commit/39dc381ed6c4afcbbaea616f0e8f44d5eeb96ec2.patch"; | ||
hash = "sha256-PxBtB6VupK4QJiWKKlTmub+7tfi6nAHWe29lxpNgoVk="; | ||
name = "add_secret_key_file_support.patch"; | ||
}) | ||
|
||
# Patch settings.py to source additional settings from the NixOS module | ||
./load_extra_settings.patch | ||
|
||
# Disable rendering of missing template | ||
# https://github.com/okfde/froide-govplan/issues/22 | ||
./disable_missing_template.patch | ||
]; | ||
|
||
build-system = [ python.pkgs.setuptools ]; | ||
|
||
nativeBuildInputs = [ | ||
gettext | ||
makeWrapper | ||
]; | ||
|
||
build-inputs = [ gdal ]; | ||
|
||
dependencies = with python.pkgs; [ | ||
bleach | ||
django-admin-sortable2 | ||
django-cms | ||
django-filer | ||
django-mfa3 | ||
django-mptt | ||
django-oauth-toolkit | ||
django-sekizai | ||
django-tinymce | ||
django-treebeard | ||
djangocms-alias | ||
(toPythonModule (froide.override { python3Packages = python.pkgs; })) | ||
psycopg | ||
]; | ||
|
||
preBuild = "${python.interpreter} -m django compilemessages"; | ||
|
||
postInstall = '' | ||
cp manage.py $out/${python.sitePackages}/froide_govplan/ | ||
cp -r project $out/${python.sitePackages}/froide_govplan/ | ||
cp -r froide_govplan/locale $out/${python.sitePackages}/froide_govplan/ | ||
makeWrapper $out/${python.sitePackages}/froide_govplan/manage.py $out/bin/froide-govplan \ | ||
--prefix PYTHONPATH : "$PYTHONPATH" \ | ||
--set GDAL_LIBRARY_PATH "${gdal}/lib/libgdal.so" \ | ||
--set GEOS_LIBRARY_PATH "${geos}/lib/libgeos_c.so" | ||
''; | ||
|
||
passthru = { | ||
tests = { | ||
inherit (nixosTests) froide-govplan; | ||
}; | ||
python = python; | ||
pythonPath = "${python.pkgs.makePythonPath dependencies}:${froide-govplan}/${python.sitePackages}"; | ||
}; | ||
|
||
meta = { | ||
description = "Government planner and basis of FragDenStaat.de Koalitionstracker"; | ||
homepage = "https://github.com/okfde/froide-govplan"; | ||
license = lib.licenses.mit; | ||
maintainers = [ lib.maintainers.onny ]; | ||
mainProgram = "froide-govplan"; | ||
}; | ||
|
||
} |