remote-party-finder/templates/listings.html

158 lines
7.3 KiB
HTML
Raw Normal View History

2021-10-04 03:17:09 +00:00
{% extends "_frame.html" %}
{% block title -%}
Remote Party Finder
{%- endblock %}
{% block head %}
2021-10-04 19:36:45 +00:00
<link rel="stylesheet" href="/assets/listings.css"/>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script defer src="/assets/listings.js"></script>
{% endblock %}
2021-10-04 03:17:09 +00:00
{% block body %}
2021-10-04 19:14:40 +00:00
<div id="container">
<div class="requires-js">
<input type="search" class="search" placeholder="Search"/>
<select id="data-centre-filter">
<option>All</option>
</select>
<details class="filter-controls">
<summary>Advanced</summary>
<div>
<div class="control">
<label>
Categories
<select multiple id="category-filter">
2021-10-05 18:36:24 +00:00
<option>None</option>
<option data-type="1">Duty Roulette</option>
<option data-type="2" data-content-kind="2">Dungeons</option>
<option data-type="2" data-content-kind="3">Guildhests</option>
<option data-type="2" data-content-kind="4">Trials</option>
<option data-type="2" data-content-kind="5">Raids</option>
<option data-type="2" data-high-end="true">High-end Duty</option>
<option data-type="2" data-content-kind="6">PvP</option>
<option data-category="1">Quest Battles</option>
<option data-category="2">FATEs</option>
<option data-category="4">Treasure Hunt</option>
<option data-category="8">The Hunt</option>
<option data-type="2" data-category="16">Gathering Forays</option>
<option data-type="2" data-category="32">Deep Dungeons</option>
<option data-type="2" data-category="64">Adventuring Forays</option>
</select>
</label>
</div>
</div>
</details>
</div>
2021-10-04 19:14:40 +00:00
<div id="listings" class="list">
{%- if containers.is_empty() %}
<em class="no-listings">No listings - download the plugin to help contribute!</em>
{%- endif %}
2021-10-04 19:36:45 +00:00
{%- for container in containers %}
{%- let listing = container.listing.borrow() %}
2021-10-04 19:14:40 +00:00
<div
2021-10-05 17:28:15 +00:00
class="listing"
data-id="{{ listing.id }}"
data-centre="{{ listing.data_centre_name().unwrap_or_default() }}"
data-type="{{ listing.duty_type.as_u8() }}"
data-category="{{ listing.category.as_u32() }}"
data-high-end="{{ listing.high_end() }}"
data-content-kind={{ listing.content_kind() }}>
2021-10-04 19:14:40 +00:00
<div class="left">
2021-10-04 19:36:45 +00:00
{%- let duty_class %}
{%- if listing.is_cross_world() %}
{%- let duty_class = " cross" %}
{%- else %}
{%- let duty_class = " local" %}
{%- endif %}
2021-10-04 19:14:40 +00:00
<div class="duty{{ duty_class }}">{{ listing.duty_name() }}</div>
<div class="description">
{%- let desc = listing.description.full_text() %}
{%- if desc.trim().is_empty() -%}
<em>None</em>
{%- else -%}
{%- let (colour_class, prepend_flags) = listing.prepend_flags() -%}
{%- if !prepend_flags.is_empty() -%}
2021-10-04 19:14:40 +00:00
<span class="{{ colour_class }}">{{ prepend_flags }} </span>
{%- endif -%}
2021-10-04 19:14:40 +00:00
{{- desc.trim() }}
{%- endif -%}
</div>
<div class="party">
2021-10-04 19:36:45 +00:00
{%- for slot in listing.slots() %}
{%- let filled %}
{%- let title %}
{%- let role_class %}
{%- match slot %}
{%- when Ok with (slot) %}
{%- let filled = " filled" %}
{%- match slot.role() %}
{%- when Some with (role) %}
{%- let role_class = " {}"|format(role.as_str().to_lowercase()) %}
{%- when None %}
{%- let role_class = "".to_string() %}
{%- endmatch %}
{%- let title = slot.code().to_string() %}
{%- when Err with (tuple) %}
{%- let filled = "" %}
{%- let title = tuple.1.clone() %}
{%- let role_class = " {}"|format(tuple.0) %}
{%- endmatch %}
2021-10-04 19:14:40 +00:00
<div class="slot{{ filled }}{{ role_class }}" title="{{ title }}">
2021-10-04 19:36:45 +00:00
{%- if !filled.is_empty() %}
2021-10-04 19:14:40 +00:00
<svg viewBox="0 0 32 32">
<use href="/assets/icons.svg#{{ title }}"></use>
</svg>
2021-10-04 19:36:45 +00:00
{%- endif %}
2021-10-04 19:14:40 +00:00
</div>
2021-10-04 19:36:45 +00:00
{%- endfor %}
2021-10-04 19:14:40 +00:00
<div class="total">{{ listing.slots_filled() }}/{{ listing.slots_available }}</div>
2021-10-04 03:17:09 +00:00
</div>
2021-10-04 19:14:40 +00:00
</div>
<div class="middle">
<div class="stat">
<div class="name">Min IL</div>
<div class="value">{{ listing.min_item_level }}</div>
</div>
</div>
<div class="right meta">
<div class="item creator">
<span class="text">{{ listing.name.full_text() }} @ {{ listing.home_world_string() }}</span>
<span title="Creator">
<svg class="icon" viewBox="0 0 32 32">
<use href="/assets/icons.svg#user"></use>
</svg>
</span>
</div>
<div class="item world">
<span class="text">{{ listing.created_world_string() }}</span>
<span title="Created on">
<svg class="icon" viewBox="0 0 32 32">
<use href="/assets/icons.svg#sphere"></use>
</svg>
</span>
</div>
<div class="item expires">
<span class="text">{{ container.human_time_left() }}</span>
<span title="Expires">
<svg class="icon" viewBox="0 0 32 32">
<use href="/assets/icons.svg#stopwatch"></use>
</svg>
</span>
</div>
<div class="item updated">
<span class="text">{{ container.human_since_updated() }}</span>
<span title="Updated">
<svg class="icon" viewBox="0 0 32 32">
<use href="/assets/icons.svg#clock"></use>
</svg>
</span>
</div>
</div>
2021-10-04 03:17:09 +00:00
</div>
2021-10-04 19:36:45 +00:00
{%- endfor %}
2021-10-04 03:17:09 +00:00
</div>
</div>
{% endblock %}