Make a more generic base template

This commit is contained in:
Gregory Soutade 2016-06-14 09:44:44 +02:00
parent 9a41eb2f49
commit abcde9da12
2 changed files with 10 additions and 28 deletions

View File

@ -4,15 +4,17 @@
<link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png" />
{% block head %} {% endblock %}
<link href="{{ STATIC_URL }}css/denote.css" rel="stylesheet" type="text/css"/>
<link href="{{ STATIC_URL }}css/pygments.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="{{ STATIC_URL }}js/denote.js"> </script>
</head>
<body>
<body onload="startup();">
<!-- Header -->
<div class="settings"><a href="/user/edit">Settings</a> <a href="/disconnect">Disconnect</a><br/>
<form action="/search">{% csrf_token %}<input name="text"/><input type="button" value="Search"/></form></div>
<!-- Left panel -->
<div id="left_panel">
<a id="home_icon" href="/" alt="Home"><img src="{{ STATIC_URL }}images/home.png"/></a><br/><br/>
{% block left %} {% endblock %}
</div>
<div id="main_panel">
<div id="content">

View File

@ -1,25 +1,15 @@
<html>
<head>
<title>Dénote{% if user.get_full_name|length != 0 %} - {{ user.get_full_name }}{% endif %}</title>
<link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png" />
{% block head %} {% endblock %}
<link href="{{ STATIC_URL }}css/denote.css" rel="stylesheet" type="text/css"/>
<link href="{{ STATIC_URL }}css/pygments.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="{{ STATIC_URL }}js/denote.js"> </script>
{% extends "base.html" %}
{% block head %}
<script type="text/javascript">
var hidden_categories = "{{ user.hidden_categories }}";
hidden_categories = hidden_categories.split(",");
function get_csrf_token() { return '{{ csrf_token }}';}
</script>
</head>
<body onload="startup();">
<!-- Header -->
<div class="settings"><a href="/user/edit">Settings</a> <a href="/disconnect">Disconnect</a><br/><br/>
<form method="post" action="/search">{% csrf_token %}<input name="text"/><input type="submit" value="Search"/></form></div>
<!-- Left panel -->
<div id="left_panel">
<a id="home_icon" href="/" alt="Home"><img src="{{ STATIC_URL }}images/home.png"/></a><br/><br/>
{% endblock %}
{% block left %}
{% if authenticated %}
<a href="/note/add">Add a note</a>
{% endif %}
<div id="categories">
{% for meta_note in notes_by_category %}
<div class="category" category_id="{{ meta_note.category_id }}">
@ -63,14 +53,4 @@
{% endif %}
{% endif %}
</div>
</div>
<!-- Main panel -->
<div id="main_panel">
<div id="content">
{% block content %} {% endblock %}
</div>
</div>
<br/><br/><br/>
<center><a href="http://indefero.soutade.fr/p/denote">Dénote</a> 0.2</center>
</body>
</html>
{% endblock %}