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

View File

@ -1,25 +1,15 @@
<html> {% extends "base.html" %}
<head> {% block 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>
<script type="text/javascript"> <script type="text/javascript">
var hidden_categories = "{{ user.hidden_categories }}"; var hidden_categories = "{{ user.hidden_categories }}";
hidden_categories = hidden_categories.split(","); hidden_categories = hidden_categories.split(",");
function get_csrf_token() { return '{{ csrf_token }}';} function get_csrf_token() { return '{{ csrf_token }}';}
</script> </script>
</head> {% endblock %}
<body onload="startup();"> {% block left %}
<!-- Header --> {% if authenticated %}
<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/>
<a href="/note/add">Add a note</a> <a href="/note/add">Add a note</a>
{% endif %}
<div id="categories"> <div id="categories">
{% for meta_note in notes_by_category %} {% for meta_note in notes_by_category %}
<div class="category" category_id="{{ meta_note.category_id }}"> <div class="category" category_id="{{ meta_note.category_id }}">
@ -63,14 +53,4 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
</div> {% endblock %}
<!-- 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>