Small fixes

This commit is contained in:
rubenwardy 2022-02-09 19:11:31 +00:00
parent f61112a8d7
commit 2bbb117eac
8 changed files with 19 additions and 4 deletions

@ -157,6 +157,9 @@ def delete_review(package, reviewer):
addNotification(package.maintainers, current_user, NotificationType.OTHER, notif_msg, url_for("threads.view", id=thread.id), package) addNotification(package.maintainers, current_user, NotificationType.OTHER, notif_msg, url_for("threads.view", id=thread.id), package)
db.session.delete(review) db.session.delete(review)
package.recalcScore()
db.session.commit() db.session.commit()
return redirect(thread.getViewURL()) return redirect(thread.getViewURL())

@ -1,3 +1,6 @@
// @author rubenwardy
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
$("textarea.markdown").each(function() { $("textarea.markdown").each(function() {
async function render(plainText, preview) { async function render(plainText, preview) {
const response = await fetch(new Request("/api/markdown/", { const response = await fetch(new Request("/api/markdown/", {

@ -1,3 +1,6 @@
// @author rubenwardy
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
const min = $("#min_rel"); const min = $("#min_rel");
const max = $("#max_rel"); const max = $("#max_rel");
const none = $("#min_rel option:first-child").attr("value"); const none = $("#min_rel option:first-child").attr("value");

@ -1,3 +1,6 @@
// @author rubenwardy
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
$(".topic-discard").click(function() { $(".topic-discard").click(function() {
const ele = $(this); const ele = $(this);
const tid = ele.attr("data-tid"); const tid = ele.attr("data-tid");

@ -1,3 +1,6 @@
// @author rubenwardy
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
document.querySelectorAll(".video-embed").forEach(ele => { document.querySelectorAll(".video-embed").forEach(ele => {
try { try {
const href = ele.getAttribute("href"); const href = ele.getAttribute("href");

@ -2,7 +2,7 @@
{% block content %} {% block content %}
{% for title, group in notifications | select("package") | groupby("package.title") %} {% for title, group in notifications | selectattr("package") | groupby("package.title") %}
<h2> <h2>
{{ title }} {{ title }}
</h2> </h2>
@ -17,7 +17,7 @@
</ul> </ul>
{% endfor %} {% endfor %}
{% for group in notifications | reject("package") %} {% for group in notifications | selectattr("package", "none") %}
<h2> <h2>
{{ _("Other Notifications") }} {{ _("Other Notifications") }}
</h2> </h2>

@ -3,7 +3,7 @@
{% for entry in log %} {% for entry in log %}
<a class="list-group-item list-group-item-action" <a class="list-group-item list-group-item-action"
{% if entry.description and current_user.rank.atLeast(current_user.rank.MODERATOR) %} {% if entry.description and current_user.rank.atLeast(current_user.rank.MODERATOR) %}
href="{{ url_for('admin.audit_view', id=entry.id) }}"> href="{{ url_for('admin.audit_view', id_=entry.id) }}">
{% else %} {% else %}
href="{{ entry.url }}"> href="{{ entry.url }}">
{% endif %} {% endif %}

@ -49,7 +49,7 @@ Generally, you want to start by finding the endpoint and then seeing the code it
Endpoints are sensibly organised in `app/blueprints`. Endpoints are sensibly organised in `app/blueprints`.
You can also use a file search. For example, to find the package edit endpoint, search for `.route("/packages/<author>/<name>/edit/")`. You can also use a file search. For example, to find the package edit endpoint, search for `"/packages/<author>/<name>/edit/"`.
## Users and Permissions ## Users and Permissions