-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#454 Add ProgressField #483
Conversation
src/Field/ProgressField.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" => '
I think the field should be ProgressBarField, ProgressField is not very precise (same for the Twig file).
doc/progress_field.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" => '
Be careful of the spaces around =>
</div> | ||
<div class="d-flex position-absolute justify-content-center align-items-center w-100"> | ||
<span | ||
class="{% if options.progressLabelCssClass is not null %} {{ options.progressLabelCssClass }} {% else %} lh-sm fa-sm {% endif %}"> {% if options.progressLabel is not null %} {{ options.progressLabel }} {% else %} {{ percentage }} % {% endif %} </span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PSR-12 max 120 characters
</div> | ||
{% if options.bottomLabel %} | ||
<div> | ||
<span>{{ value }} / {{ options.max }}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like we can modify this text
<div class="progress w-100" role="progressbar" aria-valuenow="{{ value }}" aria-valuemin="{{ options.min }}" | ||
aria-valuemax="{{ options.max }}"> | ||
<div | ||
class="progress-bar {% if options.theme is not null %} {{ options.theme }} {% else %} bg-primary {% endif %} progress-bar-animated" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PSR-12 max 120 characters
You can make it shorter by making "if options.theme ... else ..."
- 'progressLabel' => Change the label displayed on the progress bar, | ||
- 'progressLabelCssClass' => Defines the Bootstrap class for the label to customize it, | ||
- 'min' => Integer who defines the minimum value, | ||
- 'max' => integer who defines the maximum value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'aimerais bien qu'on puisse avoir ça à partir d'une propriété/méthode dans l'entité.
si l'entité définit son propre maximum, on peut pas avoir une valeur fixe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ce qui est prévu c'est que l'entité calcule le pourcentage, donc le dev peut le faire avec n'importe quelle valeur de maximum. Par défaut, c'est 100 et 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
si c'est un pourcentage le min max ce sera toujours 0 à 100 si jamais
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
donc pas très utile d'avoir ces 2 options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
effectivement ca n'a que peux d'interet.
Adding ProgressField in order to generate progress bar in crudit