Skip to content
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

frontend: use common enum constants for sharing descriptions #3030

Closed
wants to merge 2 commits into from

Conversation

nikromen
Copy link
Member

@nikromen nikromen commented Nov 27, 2023

(this is follow-up from #2807 containing its commit to prevent the PR to become huge; not done yet, I just began the transition and I'll finish it once #2807 is merged)

TODO:

Fixes #3029

@nikromen nikromen marked this pull request as draft November 27, 2023 13:30
@praiskup
Copy link
Member

I must be honest and admit that, while C&P always hurts, I'm not in favor of doing this change "on our own". Isn't there some flask plugin that would help us to do this a standard way?

"are full-featured <strong>pyp2rpm</strong> with cross "
"distribution support, and <strong>pyp2spec</strong> that is "
"being actively developed and considered to be the future."
info="{{ common_descriptions.SPEC_GENERATOR.description }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are losing formatting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note there are some form field metdata arguments we could perhaps use:

label="Create repositories manually",
description="""Repository meta data is normally refreshed
after each build. If you want to do this manually, turn
this option on.""",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are losing formatting.

that's true... perhaps this one is worth not unifying

<div class="form-group">
<label class="col-sm-2 control-label" for="textInput-markup">
Auto-rebuild
</label>
<div class="col-sm-10">
<input type="checkbox" name="webhook_rebuild" {% if form.webhook_rebuild.data == True %}checked="checked"{% endif %}/>
Auto-rebuild the package? (i.e. every commit or new tag)
{{ common_descriptions.SPEC_GENERATOR.description }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only part of the message is moved here.

@praiskup
Copy link
Member

I think we should do some research first. Would gettext/babel help us?

@praiskup
Copy link
Member

Also note that we c&p the messages into copr-cli --help output, and then to manual pages.

@nikromen
Copy link
Member Author

nikromen commented Dec 3, 2023

I think we should do some research first.

I agree, that's why the PR is not complete - as I continued converting the descriptions the more I disliked that solution

Would gettext/babel help us?

I am going to look at it - sounds promising in some ways

Also note that we c&p the messages into copr-cli --help output, and then to manual pages.

That would be also very nice to unify somehow... but I guess this would mean to create the descriptions in copr-common

@nikromen nikromen closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use some common descriptions between Fask-restx fields and WTForms
2 participants