remote-party-finder/templates/listings.html

126 lines
5.5 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">
<input type="search" class="search" placeholder="Search"/>
<select id="data-centre-filter">
<option>All</option>
</select>
{%- if containers.is_empty() %}
<br/>
<em>No listings - download the plugin to help contribute!</em>
{%- endif %}
2021-10-04 19:14:40 +00:00
<div id="listings" class="list">
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
class="listing"
data-id="{{ listing.id }}"
data-centre="{{ listing.data_centre_name().unwrap_or_default() }}">
<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 %}