allow progress bar to be larger
This commit is contained in:
parent
6d73b99636
commit
99056282bc
3 changed files with 21 additions and 2 deletions
|
|
@ -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),
|
||||
),
|
||||
]
|
||||
|
|
@ -459,6 +459,7 @@ if CMSPlugin:
|
|||
choices=PLUGIN_TEMPLATES,
|
||||
help_text=_("template used to display the plugin"),
|
||||
)
|
||||
extra_classes = models.CharField(max_length=255, blank=True)
|
||||
|
||||
@property
|
||||
def render_template(self):
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
{% get_plan_progress object_list as progress %}
|
||||
|
||||
<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="progress">
|
||||
<div class="progress" {% if "progress-lg" in instance.extra_classes %}style="height: 1.5rem;"{% endif %}>
|
||||
{% 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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue