fix progress view on category site

This commit is contained in:
Jonas Heinrich 2025-05-07 08:46:58 +02:00
parent 3165e50b9f
commit aa8d467b1a
3 changed files with 90 additions and 5 deletions

85
flake.nix Normal file
View file

@ -0,0 +1,85 @@
{
description = "Invoiceplane invoice template development shell";
inputs.nixpkgs.url = "nixpkgs/master";
outputs = { self, nixpkgs, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
start =
pkgs.writeShellScriptBin "start" ''
set -e
export NIXPKGS_ALLOW_INSECURE=1
export QEMU_NET_OPTS="hostfwd=tcp::8080-:80"
${pkgs.nixos-shell}/bin/nixos-shell --flake .
'';
in {
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs.inputs = inputs;
pkgs = import nixpkgs {
overlays = [
(self: super: {
froide-govplan = super.froide-govplan.overridePythonAttrs (oldAttrs: rec {
src = ./.;
#pkgs.fetchFromGitHub {
# owner = "onny";
# repo = "froide-govplan";
# rev = "81697ce37cfdee7b5d0f667c50b13062ed9786c3";
# hash = "sha256-ooHGlCKgZL+TMh6OtopKtbkV0MhT4udLCOIC+C3Ytdw=";
#};
dependencies = oldAttrs.dependencies ++ [ oldAttrs.passthru.python.pkgs.mastodon-py ];
postInstall = oldAttrs.postInstall + ''
rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates
ln -sf /var/lib/froide-govplan/templates $out/${pkgs.python3.sitePackages}/froide_govplan/templates
cp -r froide_govplan/static $out/${pkgs.python3.sitePackages}/froide_govplan/
'';
});
})
];
};
modules = [
({ lib, config, pkgs, ... }: {
virtualisation = {
memorySize = 8000;
diskSize = 4096;
cores = 4;
};
disabledModules = [ "services/web-apps/froide-govplan.nix" ];
imports = [ ./froide-govplan.nix ];
services.froide-govplan = {
enable = true;
package = pkgs.froide-govplan;
settings = {
DEBUG = lib.mkForce true;
CSRF_TRUSTED_ORIGINS = [ "http://localhost:8080" ];
MASTODON_ACCESS_TOKEN = "WvUND5mp_tPQ9dgMrKWVXpUbP2gKpxRD3ejg10z74pg";
MASTODON_API_BASE_URL = "https://social.project-insanity.org";
};
};
nixos-shell.mounts.extraMounts = {
"/var/lib/froide-govplan/templates" = {
target = /home/onny/projects/froide-govplan/froide_govplan/templates;
cache = "none";
};
};
system.stateVersion = "25.05";
services.getty.autologinUser = "root";
})
];
};
packages = { inherit start; };
defaultPackage.x86_64-linux = start;
};
}

View file

@ -2,11 +2,11 @@
{% get_plan_progress object_list as progress %} {% get_plan_progress object_list as progress %}
<div class="row"> <div class="row" style="align-items: center;">
<div class="col-sm-3"> <div class="col-sm">
<span class="text-body-secondary{% if not instance.extra_classes or "progress-lg" not in instance.extra_classes %} small{% endif %}">{{ progress.count }} Vorhaben</span> <span class="text-body-secondary{% if not instance.extra_classes or "progress-lg" not in instance.extra_classes %}{% endif %}">{{ progress.count }} Vorhaben</span>
</div> </div>
<div class="col-sm-9"> <div class="col-sm-10">
<div class="progress" {% if "progress-lg" in instance.extra_classes %}style="height: 1.5rem;"{% endif %}> <div class="progress" {% if "progress-lg" in instance.extra_classes %}style="height: 1.5rem;"{% endif %}>
{% for section in progress.sections %} {% for section in progress.sections %}
<div class="progress-bar bg-{{ section.css_class }}" role="progressbar" style="width: {{ section.css_percentage }}%;" aria-valuenow="{{ section.css_percentage }}" aria-valuemin="0" aria-valuemax="100" aria-label="{{ section.percentage }}% {{ section.label }}" title="{{ section.percentage }}% {{ section.label }}" data-bs-toggle="tooltip" data-placement="top"> <div class="progress-bar bg-{{ section.css_class }}" role="progressbar" style="width: {{ section.css_percentage }}%;" aria-valuenow="{{ section.css_percentage }}" aria-valuemin="0" aria-valuemax="100" aria-label="{{ section.percentage }}% {{ section.label }}" title="{{ section.percentage }}% {{ section.label }}" data-bs-toggle="tooltip" data-placement="top">

View file

@ -27,7 +27,7 @@
<div class="row justify-content-center mb-5"> <div class="row justify-content-center mb-5">
<div class="col col-lg-12"> <div class="col col-lg-12">
<div class="box-card border-yellow md:shadow-yellow bg-body p-3 p-md-4 p-lg-5 tight-margin"> <div class="box-card border-yellow md:shadow-yellow bg-body mw-100 col-md-8">
<div class="mt-5"> <div class="mt-5">
{% include "froide_govplan/plugins/progress_row.html" with object_list=plans %} {% include "froide_govplan/plugins/progress_row.html" with object_list=plans %}
<p class="small text-body-secondary mt-3 no-hyphens"> <p class="small text-body-secondary mt-3 no-hyphens">