-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #156 from abe-101/use-htm-modal-forms
use htmx modal to update calendar
- Loading branch information
Showing
13 changed files
with
143 additions
and
3,355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
https://github.com/encode/django-rest-framework/discussions/9503#discussioncomment-10487612 | ||
""" | ||
|
||
import re | ||
|
||
from django.conf import settings | ||
from django.contrib.auth.middleware import LoginRequiredMiddleware | ||
|
||
|
||
class CustomLoginRequiredMiddleware(LoginRequiredMiddleware): | ||
def __init__(self, get_response=None): | ||
self.get_response = get_response | ||
self.open_urls = [re.compile(url) for url in settings.OPEN_URLS] | ||
super().__init__(get_response) | ||
|
||
def process_view(self, request, view_func, view_args, view_kwargs): | ||
for url in self.open_urls: | ||
if url.match(request.path): | ||
return None # Pass through, no login required | ||
return super().process_view(request, view_func, view_args, view_kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div id="calendar-{{ calendar.id }}" class="mb-4"> | ||
<div class="d-flex align-items-center gap-3"> | ||
<div> | ||
<h1 class="mb-1">{{ calendar.name }}</h1> | ||
<small class="text-muted">Timezone: {{ calendar.timezone }}</small> | ||
</div> | ||
<button hx-get="{% url 'hebcal:update_calendar' pk=calendar.pk %}" | ||
hx-target="body" | ||
hx-swap="beforeend" | ||
data-bs-toggle="tooltip" | ||
class="btn btn-primary align-self-start mt-2" | ||
title="Edit Calendar"> | ||
<i class="bi bi-pencil-square me-1"></i> | ||
Edit | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters