Browse Source

Small fixes

master
rubenwardy 8 months ago
parent
commit
2bbb117eac
  1. 3
      app/blueprints/packages/reviews.py
  2. 3
      app/public/static/markdowntextarea.js
  3. 3
      app/public/static/release_minmax.js
  4. 3
      app/public/static/topic_discard.js
  5. 3
      app/public/static/video_embed.js
  6. 4
      app/templates/emails/notification_digest.html
  7. 2
      app/templates/macros/audit_log.html
  8. 2
      docs/dev_intro.md

3
app/blueprints/packages/reviews.py

@ -157,6 +157,9 @@ def delete_review(package, reviewer): @@ -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)
db.session.delete(review)
package.recalcScore()
db.session.commit()
return redirect(thread.getViewURL())

3
app/public/static/markdowntextarea.js

@ -1,3 +1,6 @@ @@ -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() {
async function render(plainText, preview) {
const response = await fetch(new Request("/api/markdown/", {

3
app/public/static/release_minmax.js

@ -1,3 +1,6 @@ @@ -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 max = $("#max_rel");
const none = $("#min_rel option:first-child").attr("value");

3
app/public/static/topic_discard.js

@ -1,3 +1,6 @@ @@ -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() {
const ele = $(this);
const tid = ele.attr("data-tid");

3
app/public/static/video_embed.js

@ -1,3 +1,6 @@ @@ -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 => {
try {
const href = ele.getAttribute("href");

4
app/templates/emails/notification_digest.html

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

2
app/templates/macros/audit_log.html

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
{% for entry in log %}
<a class="list-group-item list-group-item-action"
{% 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 %}
href="{{ entry.url }}">
{% endif %}

2
docs/dev_intro.md

@ -49,7 +49,7 @@ Generally, you want to start by finding the endpoint and then seeing the code it @@ -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`.
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

Loading…
Cancel
Save