Explorar el Código

Add jQuery; make logout link auto-POST.

master
Ben Kurtovic hace 8 años
padre
commit
3b59e3b4dc
Se han modificado 3 ficheros con 13 adiciones y 2 borrados
  1. +10
    -0
      static/main.js
  2. +2
    -0
      templates/_base.mako
  3. +1
    -2
      templates/_default.mako

+ 10
- 0
static/main.js Ver fichero

@@ -0,0 +1,10 @@
$(function() {
// Install logout auto-POST form:
$("#logout").click(function() {
$("<form>", {
"action": this.href,
"method": "post"
}).appendTo($("body")).submit();
return false;
});
});

+ 2
- 0
templates/_base.mako Ver fichero

@@ -19,6 +19,8 @@
% for size in g.eve.image.corp_widths:
<link rel="icon" type="image/png" sizes="${size}x${size}" href="${g.eve.image.corp(g.config.get('corp.id'), size)}"/>
% endfor
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="${url_for('staticv', filename='main.js')}"></script>
</head>
<body>
<%block name="header">


+ 1
- 2
templates/_default.mako Ver fichero

@@ -9,8 +9,7 @@
<img id="character-portrait" class="aligned" title="${g.auth.get_character_prop('name')}" alt="" src="${g.eve.image.character(g.auth.get_character_id(), 256)}"/>
<span id="character-summary" class="aligned">
${g.auth.get_character_prop("name")}
<span class="sep">[</span><a title="Log out" href="${url_for('logout')}">logout</a><span class="sep">]</span>
<!-- ... JS switch to a POST form -->
<span class="sep">[</span><a id="logout" title="Log out" href="${url_for('logout')}">log out</a><span class="sep">]</span>
</span>
</%block>
${next.body()}

Cargando…
Cancelar
Guardar