mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-21 06:13:34 +00:00
Fixed type radio buttons
This commit is contained in:
parent
5b51d7dfef
commit
c29501f597
@ -14,12 +14,24 @@
|
|||||||
<button class="btn btn-outline-success my-2 my-sm-0 ml-2" type="submit">Search</button>
|
<button class="btn btn-outline-success my-2 my-sm-0 ml-2" type="submit">Search</button>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<input id="all" name="type" type="radio" checked>
|
{% if type == "all" %}
|
||||||
<label for="all" style="margin-right: 1.5rem;">All</label>
|
<input id="all" name="type" type="radio" value="all" checked>
|
||||||
<input id="watched" name="type" type="radio" value="watched">
|
{% else %}
|
||||||
<label for="watched" style="margin-right: 1.5rem;">Watched</label>
|
<input id="all" name="type" type="radio" value="all">
|
||||||
<input id="unwatched" name="type" type="radio" value="unwatched">
|
{% endif %}
|
||||||
<label for="unwatched">Unwatched</label>
|
<label for="all" style="margin-right: 1.5rem;">All</label>
|
||||||
|
{% if type == "watched" %}
|
||||||
|
<input id="watched" name="type" type="radio" value="watched" checked>
|
||||||
|
{% else %}
|
||||||
|
<input id="watched" name="type" type="radio" value="watched">
|
||||||
|
{% endif %}
|
||||||
|
<label for="watched" style="margin-right: 1.5rem;">Watched</label>
|
||||||
|
{% if type == "unwatched" %}
|
||||||
|
<input id="unwatched" name="type" type="radio" value="unwatched" checked>
|
||||||
|
{% else %}
|
||||||
|
<input id="unwatched" name="type" type="radio" value="unwatched">
|
||||||
|
{% endif %}
|
||||||
|
<label for="unwatched">Unwatched</label>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
@ -16,7 +16,9 @@ def homepage_view(request):
|
|||||||
elif type_ == 'watched':
|
elif type_ == 'watched':
|
||||||
series = user.series.filter(new_episodes_count=0).order_by('-id')
|
series = user.series.filter(new_episodes_count=0).order_by('-id')
|
||||||
|
|
||||||
else: series = user.series.filter().order_by('-id')
|
else:
|
||||||
|
type_ = 'all'
|
||||||
|
series = user.series.filter().order_by('-id')
|
||||||
|
|
||||||
search = request.GET.get('search', 'None')
|
search = request.GET.get('search', 'None')
|
||||||
if search != 'None':
|
if search != 'None':
|
||||||
@ -33,4 +35,5 @@ def homepage_view(request):
|
|||||||
paginator = Paginator(series, 5)
|
paginator = Paginator(series, 5)
|
||||||
|
|
||||||
return render(request, 'homepage.html', context={'series': paginator.get_page(page),
|
return render(request, 'homepage.html', context={'series': paginator.get_page(page),
|
||||||
'kwargs': kwargs()})
|
'kwargs': kwargs(),
|
||||||
|
'type': type_})
|
Loading…
x
Reference in New Issue
Block a user