Explorar el Código

Show disabled campaigns with a flag; placeholder for invalid char IDs.

master
Ben Kurtovic hace 8 años
padre
commit
6ea69e5a08
Se han modificado 4 ficheros con 23 adiciones y 7 borrados
  1. +6
    -5
      calefaction/modules/campaigns.py
  2. +12
    -0
      static/main.css
  3. +1
    -1
      templates/_default.mako
  4. +4
    -1
      templates/campaigns/campaign.mako

+ 6
- 5
calefaction/modules/campaigns.py Ver fichero

@@ -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/<name>")
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():


+ 12
- 0
static/main.css Ver fichero

@@ -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 {


+ 1
- 1
templates/_default.mako Ver fichero

@@ -14,7 +14,7 @@
</%block>
<%block name="righthead">
<div id="character-portrait">
<img class="styled-border" alt="Portrait" src="${g.eve.image.character(g.auth.get_character_id(), 256)}"/>
<img class="styled-border" alt="Portrait" src="${g.eve.image.character(g.auth.get_character_id() or 1, 256)}"/>
<div id="character-options" class="styled-border">
<div id="style-options">
<% cur_style = g.auth.get_character_prop("style") or g.config.get("style.default") %>


+ 4
- 1
templates/campaigns/campaign.mako Ver fichero

@@ -2,5 +2,8 @@
<%block name="title">
${self.maketitle(campaign["title"], "Campaigns")}
</%block>
<h2><span class="understate">Campaign:</span> ${campaign["title"] | h}</h2>
<h2>
<span class="understate">Campaign:</span>
<span${"" if enabled else ' class="disabled"'}>${campaign["title"] | h}</span>
</h2>
<p>Hello! ...</p>

Cargando…
Cancelar
Guardar