From 6ea69e5a085adee850ceefb998e3a790c659e270 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 27 Dec 2016 00:20:05 -0500 Subject: [PATCH] Show disabled campaigns with a flag; placeholder for invalid char IDs. --- calefaction/modules/campaigns.py | 11 ++++++----- static/main.css | 12 ++++++++++++ templates/_default.mako | 2 +- templates/campaigns/campaign.mako | 5 ++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/calefaction/modules/campaigns.py b/calefaction/modules/campaigns.py index 4c6e656..da12e5a 100644 --- a/calefaction/modules/campaigns.py +++ b/calefaction/modules/campaigns.py @@ -19,8 +19,8 @@ def home(): current = get_current() if current: campaign = config["campaigns"][current] - return render_template( - "campaigns/campaign.mako", name=current, campaign=campaign) + return render_template("campaigns/campaign.mako", + name=current, campaign=campaign, enabled=True) return render_template("campaigns/empty.mako") def navitem(): @@ -41,11 +41,12 @@ def current_campaign(): @blueprint.rroute("/campaigns/") def campaign(name): """Render and return a campaign page.""" - if name not in config["enabled"]: + if name not in config["campaigns"]: abort(404) campaign = config["campaigns"][name] - return render_template( - "campaigns/campaign.mako", name=name, campaign=campaign) + enabled = name in config["enabled"] + return render_template("campaigns/campaign.mako", + name=name, campaign=campaign, enabled=enabled) @blueprint.rroute("/settings/campaign", methods=["POST"]) def set_campaign(): diff --git a/static/main.css b/static/main.css index 1769fd3..a8628ee 100644 --- a/static/main.css +++ b/static/main.css @@ -348,6 +348,18 @@ footer ul li:not(:last-child)::after { -moz-appearance: none; } +h2 .disabled { + color: #989898; + text-decoration: line-through; +} + +h2 .disabled::after { + display: inline-block; + padding-left: 0.75em; + font-size: 75%; + content: "✘"; +} + /* -------------------------------- Members -------------------------------- */ #members-list { diff --git a/templates/_default.mako b/templates/_default.mako index f60c0fd..3b1a79b 100644 --- a/templates/_default.mako +++ b/templates/_default.mako @@ -14,7 +14,7 @@ <%block name="righthead">
- Portrait + Portrait
<% cur_style = g.auth.get_character_prop("style") or g.config.get("style.default") %> diff --git a/templates/campaigns/campaign.mako b/templates/campaigns/campaign.mako index 5688655..cfc1ee0 100644 --- a/templates/campaigns/campaign.mako +++ b/templates/campaigns/campaign.mako @@ -2,5 +2,8 @@ <%block name="title"> ${self.maketitle(campaign["title"], "Campaigns")} -

Campaign: ${campaign["title"] | h}

+

+ Campaign: + ${campaign["title"] | h} +

Hello! ...