Fix inconsistent naming of reviews vs approvals

Fixes #354
This commit is contained in:
rubenwardy
2022-01-20 01:18:10 +00:00
parent d7152485bb
commit 3ad003140f
18 changed files with 995 additions and 640 deletions

View File

@@ -391,7 +391,7 @@ def move_to_state(package):
db.session.commit()
if package.state == PackageState.CHANGES_NEEDED:
flash(gettext("Please comment what changes are needed in the review thread"), "warning")
flash(gettext("Please comment what changes are needed in the approval thread"), "warning")
if package.review_thread:
return redirect(package.review_thread.getViewURL())
else:

View File

@@ -303,7 +303,7 @@ def new():
# Only allow creating one thread when not approved
elif is_review_thread and package.review_thread is not None:
flash(gettext("A review thread already exists!"), "danger")
flash(gettext("An approval thread already exists!"), "danger")
return redirect(package.review_thread.getViewURL())
elif not current_user.canOpenThreadRL():

View File

@@ -163,11 +163,11 @@ class PackageState(enum.Enum):
def verb(self):
if self == self.READY_FOR_REVIEW:
return "Submit for Review"
return lazy_gettext("Submit for Approval")
elif self == self.APPROVED:
return "Approve"
return lazy_gettext("Approve")
elif self == self.DELETED:
return "Delete"
return lazy_gettext("Delete")
else:
return self.value

View File

@@ -14,11 +14,53 @@ $("textarea.markdown").each(function() {
let timeout_id = null;
function urlInserter(url) {
return (editor) => {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.table, `[](${url})`);
};
}
this.easy_mde = new EasyMDE({
element: this,
hideIcons: ["image"],
showIcons: ["code", "table"],
forceSync: true,
toolbar: [
"bold",
"italic",
"heading",
"|",
"code",
"quote",
"unordered-list",
"ordered-list",
"|",
"link",
"table",
"|",
"preview",
"side-by-side",
"fullscreen",
"|",
"guide",
{
name: "rules",
className: "fa fa-book",
title: "others buttons",
children: [
{
name: "rules",
action: urlInserter("/policy_and_guidance/#2-accepted-content"),
className: "fa fa-star",
title: "2. Accepted content",
text: "2. Accepted content",
},
]
},
],
previewRender: (plainText, preview) => {
if (timeout_id) {
clearTimeout(timeout_id);

View File

@@ -107,8 +107,8 @@
{{ _("Open Thread") }}
</a>
{{ _("Package review thread") }}:
{{ _("You can open a thread if you have a question for the reviewer or package author.") }}
{{ _("Package approval thread") }}:
{{ _("You can open a thread if you have a question for the approver or package author.") }}
<div style="clear:both;"></div>
</div>
{% endif %}

View File

@@ -33,7 +33,7 @@
{{ ss.title }}
{% if not ss.approved %}
<div class="text-muted">
{{ _("Awaiting review") }}
{{ _("Awaiting approval") }}
</div>
{% endif %}
</div>

View File

@@ -30,7 +30,7 @@
</div>
</a></li>
{% else %}
<li><i>{{ _("No screenshots need reviewing.") }}</i></li>
<li><i>{{ _("No screenshots need approval.") }}</i></li>
{% endfor %}
{% for i in range(4) %}
<li class="packagetile flex-fill"></li>
@@ -62,7 +62,7 @@
{{ p.title }} by {{ p.author.display_name }}
</a>
{% else %}
<li class="list-group-item"><i>{{ _("No packages need reviewing.") }}</i></li>
<li class="list-group-item"><i>{{ _("No packages need approval.") }}</i></li>
{% endfor %}
</div>
</div>
@@ -87,7 +87,7 @@
</a>
</li>
{% else %}
<li class="list-group-item"><i>{{ _("No releases need reviewing.") }}</i></li>
<li class="list-group-item"><i>{{ _("No releases need approval.") }}</i></li>
{% endfor %}
</ul>
</div>
@@ -180,7 +180,7 @@
{{ p.title }} by {{ p.author.display_name }}
</a>
{% else %}
<li class="list-group-item"><i>{{ _("No packages need reviewing.") }}</i></li>
<li class="list-group-item"><i>{{ _("No packages need approval.") }}</i></li>
{% endfor %}
</div>
</div>