Moved navbars to base.html and js to bottom of templates
This commit is contained in:
parent
0a105ea7ea
commit
88c1095e51
@ -1,4 +1,5 @@
|
||||
{% extends "base/navbar.html" %}
|
||||
{% extends "base/base.html" %}
|
||||
|
||||
{% block 'navbar-right' %}
|
||||
{% if user.is_authenticated %}
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
@ -17,24 +18,33 @@
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="modal" id="registerLink" href="#"><span class="fa fa-user"></span> Register</a>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#registerLink").modalForm({
|
||||
formURL: "{% url 'signup' %}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="modal" id="loginLink" href="#"><span class="fa fa-sign-in-alt"></span> Login</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock 'navbar-right' %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% endblock main %}
|
||||
|
||||
<!-- Boostrap login and register modals -->
|
||||
{% include "store/modal.html" %}
|
||||
{% endblock body %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
$("#registerLink").modalForm({
|
||||
formURL: "{% url 'signup' %}"
|
||||
});
|
||||
$("#loginLink").modalForm({
|
||||
formURL: "{% url 'login' %}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock 'navbar-right' %}
|
||||
{% endblock extra_js %}
|
@ -1,11 +1,6 @@
|
||||
{% extends "base/base.html" %}
|
||||
|
||||
{% block navbar %}
|
||||
{% include "store/store-navbar.html" %}
|
||||
{% endblock navbar %}
|
||||
|
||||
{% block body %}
|
||||
{% extends "store/base.html" %}
|
||||
|
||||
{% block main %}
|
||||
<main role="main">
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
@ -80,9 +75,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Boostrap login and register modals -->
|
||||
|
||||
{% include "store/modal.html" %}
|
||||
|
||||
{% endblock body %}
|
||||
{% endblock main %}
|
||||
|
@ -1,13 +1,10 @@
|
||||
{% extends "base/base.html" %}
|
||||
{% extends "store/base.html" %}
|
||||
{% load static %}
|
||||
{% block extra_static %}
|
||||
<script type="text/javascript" src="{% static 'dropzone-5.7.0/dist/dropzone.js' %}"></script>
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" href="{% static 'dropzone-5.7.0/dist/dropzone.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'store/dropzone-style.css' %}">
|
||||
{% endblock extra_static %}
|
||||
{% block navbar %}
|
||||
{% include "store/store-navbar.html" %}
|
||||
{% endblock navbar %}
|
||||
{% endblock extra_css %}
|
||||
|
||||
{% block body %}
|
||||
<main>
|
||||
<div class="container pt-5">
|
||||
@ -26,8 +23,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function getCookie(name) {
|
||||
</main>
|
||||
{% endblock body %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script type="text/javascript" src="{% static 'dropzone-5.7.0/dist/dropzone.js' %}"></script>
|
||||
<script type="text/javascript">
|
||||
function getCookie(name) {
|
||||
let cookieValue = null;
|
||||
if (document.cookie && document.cookie != '') {
|
||||
let cookies = document.cookie.split(';');
|
||||
@ -40,10 +42,10 @@
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
let csrftoken = getCookie('csrftoken');
|
||||
Dropzone.autoDiscover = false;
|
||||
$('#multiFileUpload').dropzone({
|
||||
}
|
||||
let csrftoken = getCookie('csrftoken');
|
||||
Dropzone.autoDiscover = false;
|
||||
$('#multiFileUpload').dropzone({
|
||||
url: "{% url 'upload' %}",
|
||||
crossDomain: false,
|
||||
paramName: "file",
|
||||
@ -76,8 +78,7 @@
|
||||
myDropzone.removeAllFiles();
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</main>
|
||||
{% endblock body %}
|
||||
</script>
|
||||
{% endblock extra_js %}
|
||||
|
@ -1,6 +1,7 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<title>{% block title %}PDMI - Python Discord Module Index{% endblock %}</title>
|
||||
<meta charset="UTF-8">
|
||||
@ -11,22 +12,43 @@
|
||||
<!-- Favicon.ico -->
|
||||
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
|
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.4/css/all.css" rel="stylesheet">
|
||||
{% block extra_css %}{% endblock extra_css %}
|
||||
</head>
|
||||
|
||||
<body class="pt-5">
|
||||
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||
<a class="navbar-brand" href="{% url 'front_page' %}">P.D.M.I</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item {% if request.path == '/' %}active{% endif %}">
|
||||
<a class="nav-link" href="{% url 'front_page' %}">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/store/' %}active{% endif %}">
|
||||
<a class="nav-link" href="{% url 'store_front_page' %}">Store</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/doc/' %}active{% endif %}">
|
||||
<a class="nav-link" href="#">Documentation</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% block 'navbar-right' %}
|
||||
{% endblock 'navbar-right' %}
|
||||
</div>
|
||||
</nav>
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
{% include "base/legal.html" %}
|
||||
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
|
||||
<script src="{% static 'js/jquery.bootstrap.modal.forms.min.js' %}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
{% block extra_static %}{% endblock extra_static %}
|
||||
</head>
|
||||
<body class="pt-5">
|
||||
{% block navbar %}
|
||||
{% include "base/navbar.html" %}
|
||||
{% endblock navbar %}
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
{% include "base/legal.html" %}
|
||||
{% block extra_js %}{% endblock extra_js %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,22 +0,0 @@
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||
<a class="navbar-brand" href="{% url 'front_page' %}">P.D.M.I</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item {% if request.path == '/' %}active{% endif %}">
|
||||
<a class="nav-link" href="{% url 'front_page' %}">Home <span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/store/' %}active{% endif %}">
|
||||
<a class="nav-link" href="{% url 'store_front_page' %}">Store</a>
|
||||
</li>
|
||||
<li class="nav-item {% if request.path == '/doc/' %}active{% endif %}">
|
||||
<a class="nav-link" href="#">Documentation</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% block 'navbar-right' %}
|
||||
{% endblock 'navbar-right' %}
|
||||
</div>
|
||||
</nav>
|
Loading…
Reference in New Issue
Block a user