65f1a2afb2
Browsing with a long joined subreddit list will cause the label to look a bit weird. Example: https://libredd.it/r/Android+AnimalsBeingBros+AnimalsBeingDerps+AnimalsBeingJerks+AppleWatch+CatSlaps+CatSmiles+CatsBeingAdorable+FreeTube+Games+Ijustwatched+IllegallySmol+IllegallySmolCats+IpodClassic+LearnRubyonRails+Megadrive+MovieDetails+Music+NetflixBestOf+NintendoSwitch+Possums+Teefers+UKPersonalFinance+airplaneears+apple+aww+brushybrushy+cats+catswhotrill+curledfeetsies+cyberpunkgame+dataisbeautiful+dechonkers+digital_ocean+dogs+dogsareliquid+dogswithjobs+emulation+greebles+happycowgifs+hardware+iOSDevelopment+iOSProgramming+iosdev+kittykankles+learnruby+likeus+mac+mashups+microsoft+movies+netflix+netsec+pihole+playstation+programming+rarepuppers+raspberry_pi+redditsync+rubyonrails+satelliteears+shittymoviedetails+spookyteefies+technology+teefies+vampirecats+velvethippos That will cause the label to be excessively long
28 lines
1.1 KiB
HTML
28 lines
1.1 KiB
HTML
{% macro options(current, values, default) -%}
|
|
{% for value in values %}
|
|
<option value="{{ value }}" {% if current == value || (current == "" && value == default) %}selected{% endif %}>
|
|
{{ format!("{}{}", value.get(0..1).unwrap().to_uppercase(), value.get(1..).unwrap()) }}
|
|
</option>
|
|
{% endfor %}
|
|
{%- endmacro %}
|
|
|
|
{% macro sort(root, methods, selected) -%}
|
|
{% for method in methods %}
|
|
<a {% if method == selected %}class="selected"{% endif %} href="{{ root }}/{{ method }}">
|
|
{{ format!("{}{}", method.get(0..1).unwrap().to_uppercase(), method.get(1..).unwrap()) }}
|
|
</a>
|
|
{% endfor %}
|
|
{%- endmacro %}
|
|
|
|
{% macro search(root, search) -%}
|
|
<form action="{% if root != "/r/" && !root.is_empty() %}{{ root }}{% endif %}/search/" id="searchbox">
|
|
<input id="search" type="text" name="q" placeholder="Search" value="{{ search }}">
|
|
{% if root != "/r/" && !root.is_empty() %}
|
|
<div id="inside">
|
|
<input type="checkbox" name="restrict_sr" id="restrict_sr">
|
|
<label for="restrict_sr" class="search_label">in {{ root }}</label>
|
|
</div>
|
|
{% endif %}
|
|
<input type="submit" value="→">
|
|
</form>
|
|
{%- endmacro %} |