Rennes rebranding
This commit is contained in:
parent
687445e414
commit
3d985e473d
8 changed files with 52 additions and 54 deletions
|
|
@ -13,6 +13,7 @@ class lgAdmin {
|
|||
this.isStaff = document.querySelector('[name=is_staff]').value === "true";
|
||||
this.userId = document.querySelector('[name=user_id]').value;
|
||||
this.canResolveCensorship = document.querySelector('[name=can_resolve_censorship]').value === "true";
|
||||
this.guestMode = document.querySelector('[name=guest_mode]').value === "true";
|
||||
this.csrfToken = document.querySelector('[name=csrfmiddlewaretoken]').value;
|
||||
this.photoId = 0;
|
||||
return this;
|
||||
|
|
@ -33,7 +34,8 @@ class lgAdmin {
|
|||
document.getElementById("lg-delete").addEventListener('click', this.onDelete.bind(this));
|
||||
|
||||
// Add button to report photo
|
||||
this.core.$toolbar.append(`<a href="#" id="lg-report" title="Notify abuse" class="lg-icon lg-bi-icon">${reportIcon}</a>`);
|
||||
this.core.$toolbar.append(`<a href="#" id="lg-report" title="Request removal" class="lg-icon lg-bi-icon">${deleteIcon}</a>`);
|
||||
document.getElementById("lg-report").style.display = 'none';
|
||||
document.getElementById("lg-report").addEventListener('click', this.onReport.bind(this));
|
||||
|
||||
// Add button to restore a censored photo
|
||||
|
|
@ -53,6 +55,7 @@ class lgAdmin {
|
|||
const ownerId = el ? el.dataset.ownerId : null;
|
||||
const canDelete = this.isStaff || (ownerId && ownerId === this.userId);
|
||||
document.getElementById("lg-delete").style.display = canDelete ? 'block' : 'none';
|
||||
document.getElementById("lg-report").style.display = canDelete ? 'none' : 'block';
|
||||
const isCensored = el ? el.dataset.isPublic === 'false' : false;
|
||||
document.getElementById("lg-restore").style.display = (this.canResolveCensorship && isCensored) ? 'block' : 'none';
|
||||
}
|
||||
|
|
@ -135,7 +138,7 @@ class lgAdmin {
|
|||
// Event called when user click on report button
|
||||
onReport(event) {
|
||||
event.preventDefault();
|
||||
if(confirm("Are you sure to report this photo?")) {
|
||||
if(confirm("Are you sure to ask removal for this photo?")) {
|
||||
// Build form request
|
||||
const photoId = this.photoId;
|
||||
const currentIndex = this.core.index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue