Show prices for logged in users
Trip prices are visible on trip list, accommodation list, conference list and travel list. Prices are hidden if not logged in, except conference prices. Still need to show prices on individual trip page.
This commit is contained in:
parent
dbffd60937
commit
e2afe0ffa4
7 changed files with 53 additions and 7 deletions
|
|
@ -2,7 +2,7 @@
|
|||
{% from "macros.html" import trip_link, accommodation_row with context %}
|
||||
{% block title %}Accommodation - Edward Betts{% endblock %}
|
||||
{% block style %}
|
||||
{% set column_count = 8 %}
|
||||
{% set column_count = 9 %}
|
||||
<style>
|
||||
.grid-container {
|
||||
display: grid;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{% block title %}Conferences - Edward Betts{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
{% set column_count = 8 %}
|
||||
{% set column_count = 9 %}
|
||||
<style>
|
||||
.grid-container {
|
||||
display: grid;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@
|
|||
<span class="badge text-bg-success">transport</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item text-end">
|
||||
{% if item.price and item.currency %}
|
||||
<span class="badge bg-info text-nowrap">{{ "{:,d}".format(item.price | int) }} {{ item.currency }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item">{{ item.topic }}</div>
|
||||
<div class="grid-item">{{ item.location }}</div>
|
||||
<div class="grid-item text-end">{{ display_date(item.cfp_end) if item.cfp_end else "" }}</div>
|
||||
|
|
@ -70,6 +75,11 @@
|
|||
{{ item.name }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item text-end">
|
||||
{% if g.user.is_authenticated and item.price and item.currency %}
|
||||
<span class="badge bg-info text-nowrap">{{ "{:,f}".format(item.price) }} {{ item.currency }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro flight_row(item) %}
|
||||
|
|
@ -103,6 +113,11 @@
|
|||
{{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item text-end">
|
||||
{% if g.user.is_authenticated and item.price and item.currency %}
|
||||
<span class="badge bg-info text-nowrap">{{ "{:,f}".format(item.price) }} {{ item.currency }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro train_row(item) %}
|
||||
|
|
@ -141,4 +156,9 @@
|
|||
{{ "{:,.0f} km / {:,.0f} miles".format(item.distance, item.distance / 1.60934) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid-item text-end">
|
||||
{% if g.user.is_authenticated and item.price and item.currency %}
|
||||
<span class="badge bg-info text-nowrap">{{ "{:,f}".format(item.price) }} {{ item.currency }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -3,18 +3,20 @@
|
|||
|
||||
{% block title %}Travel - Edward Betts{% endblock %}
|
||||
|
||||
{% set column_count = 10 %}
|
||||
|
||||
{% block style %}
|
||||
<style>
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(9, auto);
|
||||
grid-template-columns: repeat({{ column_count }}, auto);
|
||||
gap: 10px;
|
||||
justify-content: start;
|
||||
}
|
||||
|
||||
.train-grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(9, auto);
|
||||
grid-template-columns: repeat({{ column_count }}, auto);
|
||||
gap: 10px;
|
||||
justify-content: start;
|
||||
}
|
||||
|
|
@ -43,6 +45,7 @@
|
|||
<div class="grid-item">reference</div>
|
||||
<div class="grid-item">tracking</div>
|
||||
<div class="grid-item"></div>
|
||||
<div class="grid-item"></div>
|
||||
|
||||
{% for item in flights | sort(attribute="depart") %}
|
||||
{{ flight_row(item) }}
|
||||
|
|
@ -61,6 +64,7 @@
|
|||
<div class="grid-item">reference</div>
|
||||
<div class="grid-item"></div>
|
||||
<div class="grid-item"></div>
|
||||
<div class="grid-item"></div>
|
||||
|
||||
{% for item in trains | sort(attribute="depart") %}
|
||||
{{ train_row(item) }}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
<link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}">
|
||||
|
||||
{% set conference_column_count = 7 %}
|
||||
{% set accommodation_column_count = 7 %}
|
||||
{% set travel_column_count = 9 %}
|
||||
{% set conference_column_count = 8 %}
|
||||
{% set accommodation_column_count = 8 %}
|
||||
{% set travel_column_count = 10 %}
|
||||
<style>
|
||||
.conferences {
|
||||
display: grid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue