fd
This commit is contained in:
parent
9d46066c09
commit
d28d2cc318
11 changed files with 25 additions and 14 deletions
|
@ -311,7 +311,7 @@ function post(url, callback, errortext) {
|
|||
xhr.send(form);
|
||||
};
|
||||
|
||||
function post_toast(url, callback, data) {
|
||||
function post_toast(url, reload, data) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
var form = new FormData()
|
||||
|
@ -335,8 +335,8 @@ function post_toast(url, callback, data) {
|
|||
} catch(e) {
|
||||
document.getElementById('toast-post-success-text').innerText = "Action successful!";
|
||||
}
|
||||
try {callback(xhr)}
|
||||
catch(e) {}
|
||||
|
||||
if (reload == 1) {window.location.reload(true)}
|
||||
return true
|
||||
|
||||
} else if (xhr.status >= 300 && xhr.status < 400) {
|
|
@ -842,4 +842,14 @@ def settings_title_change(v):
|
|||
v.customtitle = filter_title(new_name)
|
||||
|
||||
g.db.add(v)
|
||||
return redirect("/settings/profile")
|
||||
return redirect("/settings/profile")
|
||||
|
||||
|
||||
@app.post("/settings/badges")
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def settings_badge_recheck(v):
|
||||
|
||||
v.refresh_selfset_badges()
|
||||
|
||||
return {"message":"Badges Refreshed"}
|
|
@ -1251,7 +1251,7 @@
|
|||
|
||||
{% include "expanded_image_modal.html" %}
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
<!-- ClipboardJS -->
|
||||
|
||||
|
|
|
@ -144,6 +144,6 @@ We also have some custom hooks for mentioning users and subreddits. Note that th
|
|||
|
||||
{% include "expanded_image_modal.html" %}
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
{% include "bootstrap.html" %}
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
{% block onload %}{% endblock %}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
|
||||
<!-- {{'SITE_NAME' | app_config}} JS -->
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
|
||||
<!-- {{'SITE_NAME' | app_config}} JS -->
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@
|
|||
|
||||
<!-- {{'SITE_NAME' | app_config}} JS -->
|
||||
|
||||
<script src="/assets/js/general15.js"></script>
|
||||
<script src="/assets/js/general16.js"></script>
|
||||
|
||||
<!-- ClipboardJS -->
|
||||
|
||||
|
|
|
@ -244,6 +244,7 @@
|
|||
{% elif v and v.id == u.id %}
|
||||
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
|
||||
<a href="/views" class="btn btn-secondary">Profile views</a>
|
||||
<a href="javascript:void(0)" onclick="post_toast('/settings/badges','1')" class="btn btn-secondary">Refresh Badges</a>
|
||||
{% endif %}
|
||||
{% if v and v.id != u.id and v.admin_level > 1 %}
|
||||
<br><br>
|
||||
|
@ -445,8 +446,8 @@
|
|||
</div>
|
||||
{% if v and v.id == u.id %}
|
||||
<a href="/settings/profile" class="btn btn-secondary btn-sm">Edit profile</a>
|
||||
<a href="/views" class="btn btn-secondary btn-sm">Profile views</a>
|
||||
{% endif %}
|
||||
<a href="javascript:void(0)" onclick="post_toast('/settings/badges','1')" class="btn btn-secondary">Refresh Badges</a>
|
||||
{% endif %}
|
||||
{% if v and v.id != u.id %}
|
||||
<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub2').classList.toggle('d-none');document.getElementById('button-sub2').classList.toggle('d-none');})">Unfollow</a>
|
||||
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/follow/{{u.username}}', callback=function(){document.getElementById('button-sub2').classList.toggle('d-none');document.getElementById('button-unsub2').classList.toggle('d-none');})">Follow</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue