allow progress bar to be larger

This commit is contained in:
krmax44 2022-03-17 18:27:40 +01:00
parent 6d73b99636
commit 99056282bc
No known key found for this signature in database
GPG key ID: 5C499A4F4EC4EE03
3 changed files with 21 additions and 2 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2022-03-17 17:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('froide_govplan', '0009_governmentplanupdatescmsplugin'),
]
operations = [
migrations.AddField(
model_name='governmentplanscmsplugin',
name='extra_classes',
field=models.CharField(blank=True, max_length=255),
),
]

View file

@ -459,6 +459,7 @@ if CMSPlugin:
choices=PLUGIN_TEMPLATES, choices=PLUGIN_TEMPLATES,
help_text=_("template used to display the plugin"), help_text=_("template used to display the plugin"),
) )
extra_classes = models.CharField(max_length=255, blank=True)
@property @property
def render_template(self): def render_template(self):

View file

@ -3,9 +3,9 @@
{% get_plan_progress object_list as progress %} {% get_plan_progress object_list as progress %}
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<small class="text-gray-700">{{ progress.count }} Vorhaben</small> <span class="text-gray-700{% if not instance.extra_classes or "progress-lg" not in instance.extra_classes %} small{% endif %}">{{ progress.count }} Vorhaben</span>
<div class="flex-grow-1 ml-2"> <div class="flex-grow-1 ml-2">
<div class="progress"> <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" title="{{ section.percentage }}% {{ section.label }}" data-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" title="{{ section.percentage }}% {{ section.label }}" data-toggle="tooltip" data-placement="top">
</div> </div>