-
Notifications
You must be signed in to change notification settings - Fork 275
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
feat: Optional field 'external link' in bill form. #479
feat: Optional field 'external link' in bill form. #479
Conversation
ihatemoney/forms.py
Outdated
@@ -146,6 +146,8 @@ class BillForm(FlaskForm): | |||
what = StringField(_("What?"), validators=[DataRequired()]) | |||
payer = SelectField(_("Payer"), validators=[DataRequired()], coerce=int) | |||
amount = CalculatorStringField(_("Amount paid"), validators=[DataRequired()]) | |||
external_link = URLField(_("External link"), validators=[Optional( | |||
)], description="A link to an external document, related to this bill") |
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.
The description should probably be translatable too.
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 can easily add a _("A link to an external document, related to this bill")
but I don't know how to generate correctly the translation even after a make update-translation
with some changes in messages.po. Am I missing something ?
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.
make update-translations
will update the strings, and then the translation process is done via Weblate (http://hosted.weblate.org/). This is currently undocumented, so you didn't have any way to know, sorry.
Thanks! We're almost there :-) |
@@ -134,6 +134,9 @@ <h3 class="modal-title">{{ _('Add a bill') }}</h3> | |||
<td class="bill-actions"> | |||
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a> | |||
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a> | |||
{% if bill.external_link %} | |||
<a class="see" href="{{ bill.external_link }}" ref="noopener" target="_blank" title="{{ _("see") }}">{{ _('see') }} </a> |
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.
Should we replace "See" by "See attached document"?
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 have no preference tell me what's the best in your opinion :)
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 explicit is better than implicit :-)
An optional field has been added to the bill form to add a link to a real bill. A new action button allow user to see this bill. Breaking change with Bill model update for database, a migration is needed. See issue #429.
Hmm, actually, for the "see attached document", I believe it would be better to stay with "see". It's less explicit, but due to where this is placed, we probably want to keep it short. So… Let's merge! |
…-link-bill-form feat: Optional field 'external link' in bill form.
…-link-bill-form feat: Optional field 'external link' in bill form.
An optional field has been added to the bill form to add a link to a real bill. A new action button allow user to see this bill. Breaking change with Bill model update for database, a migration is needed.
See issue #429.