feat: ux improvements
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<div class="feed-controls">
|
||||
<select name="sort_by" onchange="this.form.submit()">
|
||||
<option value="date"{% if sort_by == "date" %} selected{% endif %}>Date: newest first</option>
|
||||
<option value="date_asc"{% if sort_by == "date_asc" %} selected{% endif %}>Date: oldest first</option>
|
||||
<option value="rating"{% if sort_by == "rating" %} selected{% endif %}>Rating: highest first</option>
|
||||
<option value="rating_asc"{% if sort_by == "rating_asc" %} selected{% endif %}>Rating: lowest first</option>
|
||||
</select>
|
||||
<input type="text" name="search" value="{{ search }}" placeholder="Search movies...">
|
||||
<button type="submit" class="btn-search">Search</button>
|
||||
</div>
|
||||
@@ -15,19 +15,10 @@
|
||||
Following
|
||||
</label>
|
||||
{% endif %}
|
||||
<div class="feed-controls">
|
||||
<select name="sort_by" onchange="this.form.submit()">
|
||||
<option value="date"{% if sort_by == "date" %} selected{% endif %}>Date: newest first</option>
|
||||
<option value="date_asc"{% if sort_by == "date_asc" %} selected{% endif %}>Date: oldest first</option>
|
||||
<option value="rating"{% if sort_by == "rating" %} selected{% endif %}>Rating: highest first</option>
|
||||
<option value="rating_asc"{% if sort_by == "rating_asc" %} selected{% endif %}>Rating: lowest first</option>
|
||||
</select>
|
||||
<input type="text" name="search" value="{{ search }}" placeholder="Search movies...">
|
||||
<button type="submit" class="btn-search">Search</button>
|
||||
{% if filter != "all" || sort_by != "date" || !search.is_empty() %}
|
||||
<a href="/" class="clear-filters">Clear</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include "_filter_controls.html" %}
|
||||
{% if filter != "all" || sort_by != "date" || !search.is_empty() %}
|
||||
<a href="/" class="clear-filters">Clear</a>
|
||||
{% endif %}
|
||||
<input type="hidden" name="limit" value="{{ limit }}">
|
||||
</form>
|
||||
<div class="diary">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{% if let Some(name) = actor.display_name %}
|
||||
({{ name }})
|
||||
{% endif %}
|
||||
<a href="{{ actor.url }}" target="_blank" rel="noopener noreferrer">{{ actor.url }}</a>
|
||||
<a href="{{ actor.url }}" target="_blank" rel="noopener noreferrer">View profile ↗</a>
|
||||
<form method="POST" action="/users/{{ user_id }}/followers/remove" style="display:inline">
|
||||
<input type="hidden" name="actor_url" value="{{ actor.url }}">
|
||||
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{% if let Some(name) = actor.display_name %}
|
||||
({{ name }})
|
||||
{% endif %}
|
||||
<a href="{{ actor.url }}" target="_blank" rel="noopener noreferrer">{{ actor.url }}</a>
|
||||
<a href="{{ actor.url }}" target="_blank" rel="noopener noreferrer">View profile ↗</a>
|
||||
<form method="POST" action="/users/{{ user_id }}/unfollow" style="display:inline">
|
||||
<input type="hidden" name="actor_url" value="{{ actor.url }}">
|
||||
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
|
||||
|
||||
@@ -75,6 +75,17 @@
|
||||
<a href="?view=trends" class="view-tab {% if view == "trends" %}active{% endif %}">Trends</a>
|
||||
</div>
|
||||
|
||||
{% if view == "recent" || view == "ratings" %}
|
||||
<form method="get" class="feed-filters" action="/users/{{ profile_user_id }}">
|
||||
<input type="hidden" name="view" value="{{ view }}">
|
||||
<input type="hidden" name="limit" value="{{ limit }}">
|
||||
{% include "_filter_controls.html" %}
|
||||
{% if sort_by != "date" || !search.is_empty() %}
|
||||
<a href="/users/{{ profile_user_id }}?view={{ view }}" class="clear-filters">Clear</a>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if view == "history" %}
|
||||
{% if let Some(hist) = history %}
|
||||
<div class="heatmap-section">
|
||||
@@ -185,7 +196,7 @@
|
||||
<div class="watched-at">{{ entry.review().watched_at().format("%Y-%m-%d") }}</div>
|
||||
{% if ctx.is_current_user(entry.review().user_id().value()) %}
|
||||
<form method="post" action="/reviews/{{ entry.review().id().value() }}/delete" class="delete-form">
|
||||
<input type="hidden" name="redirect_after" value="/users/{{ profile_user_id }}?view={{ view }}&offset={{ current_offset }}">
|
||||
<input type="hidden" name="redirect_after" value="/users/{{ profile_user_id }}?offset={{ current_offset }}{{ self.filter_qs() }}">
|
||||
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
@@ -198,7 +209,7 @@
|
||||
</div>
|
||||
<nav class="pagination">
|
||||
{% if current_offset >= limit %}
|
||||
<a href="?view={{ view }}&offset={{ current_offset - limit }}" class="page-nav">← Prev</a>
|
||||
<a href="/users/{{ profile_user_id }}?offset={{ current_offset - limit }}{{ self.filter_qs() }}" class="page-nav">← Prev</a>
|
||||
{% endif %}
|
||||
{% for item in page_items %}
|
||||
{% if item.is_ellipsis %}
|
||||
@@ -206,11 +217,11 @@
|
||||
{% elif item.is_current %}
|
||||
<span class="page-num current">{{ item.number + 1 }}</span>
|
||||
{% else %}
|
||||
<a href="?view={{ view }}&offset={{ item.number * limit }}" class="page-num">{{ item.number + 1 }}</a>
|
||||
<a href="/users/{{ profile_user_id }}?offset={{ item.number * limit }}{{ self.filter_qs() }}" class="page-num">{{ item.number + 1 }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if has_more %}
|
||||
<a href="?view={{ view }}&offset={{ current_offset + limit }}" class="page-nav">Next →</a>
|
||||
<a href="/users/{{ profile_user_id }}?offset={{ current_offset + limit }}{{ self.filter_qs() }}" class="page-nav">Next →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user