forked from rDrama/rDrama
Fix merge of #59 with data-click2 attributes.
PR #59 was started prior to 59e0beebb2
and data-click2 -> data-click was not automerged for obvious reasons.
Resolve this to fix the delete banner buttons.
master
parent
6a8e36caef
commit
3459c4c9da
|
@ -1,4 +1,4 @@
|
|||
from random import Random
|
||||
import random
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
|
@ -50,9 +50,8 @@ class Sub(Base):
|
|||
return []
|
||||
|
||||
@lazy
|
||||
def random_banner(self, random:Optional[Random]=None):
|
||||
def random_banner(self):
|
||||
if not self.banner_urls: return None
|
||||
if not random: random = Random()
|
||||
return random.choice(self.banner_urls)
|
||||
|
||||
@property
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</div>
|
||||
<div class="body w-lg-100 my-auto">
|
||||
<div class="d-flex">
|
||||
<button class="btn btn-danger sub-banner-delete-button" id="sub-banner-delete-{{loop.index}}" onclick="areyousure(this)" data-click2="postToastReload(this, '/h/{{sub.name}}/settings/banners/{{loop.index - 1}}', 'DELETE');">Delete</button>
|
||||
<button class="btn btn-danger sub-banner-delete-button" id="sub-banner-delete-{{loop.index}}" onclick="areyousure(this)" data-click="postToastReload(this, '/h/{{sub.name}}/settings/banners/{{loop.index - 1}}', 'DELETE');">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -88,7 +88,7 @@
|
|||
<label class="btn btn-secondary text-capitalize mr-2 mb-0">
|
||||
Upload New Banner<input autocomplete="off" type="file" accept="image/*" hidden name="banner" onchange="form.submit()">
|
||||
</label>
|
||||
<button type="button" class="btn btn-danger sub-banner-delete-button" id="sub-banner-delete-all" onclick="areyousure(this)" data-click2="postToastReload(this, '/h/{{sub.name}}/settings/banners/', 'DELETE');">Delete All Banners</button>
|
||||
<button type="button" class="btn btn-danger sub-banner-delete-button" id="sub-banner-delete-all" onclick="areyousure(this)" data-click="postToastReload(this, '/h/{{sub.name}}/settings/banners/', 'DELETE');">Delete All Banners</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue