Use files for custom JS/CSS

This commit is contained in:
Varakh 2018-05-23 18:45:25 +02:00
parent ee1d4d4786
commit b32adde2bd
3 changed files with 134 additions and 128 deletions

13
public/css/custom.css Normal file
View file

@ -0,0 +1,13 @@
body {
padding-top: 54px;
}
@media (min-width: 992px) {
body {
padding-top: 56px;
}
}
#container {
margin-top: 56px;
overflow-x: hidden;
}

21
public/js/custom.js Normal file
View file

@ -0,0 +1,21 @@
$(".alert-danger").delay(30000).fadeOut(300);
$(".alert-success").delay(10000).fadeOut(300);
$(".alert-info").delay(10000).fadeOut(300);
window.addEventListener("load", function () {
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#252e39"
},
"button": {
"background": "#14a7d0"
}
},
"content": {
"message": "{{ 'cookiemodal.message'|trans }}",
"dismiss": "{{ 'cookiemodal.dismiss'|trans }}",
"href": "/signup"
}
})
});

View file

@ -1,154 +1,126 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>{{ title }}</title> <title>{{ title }}</title>
<!-- Meta --> <!-- Meta -->
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<!-- CSS & fonts --> <!-- CSS & fonts -->
<link rel="stylesheet" href="{{ base_url() }}/css/bootstrap.min.css"> <link rel="stylesheet" href="{{ base_url() }}/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ base_url() }}/css/font-awesome.css"> <link rel="stylesheet" href="{{ base_url() }}/css/font-awesome.css">
<link rel="stylesheet" href="{{ base_url() }}/css/cookieconsent.min.css" /> <link rel="stylesheet" href="{{ base_url() }}/css/cookieconsent.min.css"/>
<!-- Custom styles for this template --> <!-- Custom styles for this template -->
<style> <link rel="stylesheet" href="{{ base_url() }}/css/custom.css"/>
body { </head>
padding-top: 54px; <body>
}
@media (min-width: 992px) {
body {
padding-top: 56px;
}
}
#container { <!-- Navigation -->
margin-top: 56px; <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
overflow-x: hidden; <div class="container">
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_title') }}</a> <a class="navbar-brand" href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_title') }}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
<span class="navbar-toggler-icon"></span> aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarResponsive"> <div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto"> <ul class="navbar-nav ml-auto">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a> <a class="nav-link"
</li> href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a>
</li>
<!-- current user --> <!-- current user -->
{% if currentUser is not empty %} {% if currentUser is not empty %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a> <a class="nav-link"
</li> href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a>
<li class="nav-item"> </li>
<a class="nav-link" href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a> <li class="nav-item">
</li> <a class="nav-link"
{% else %} href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a>
<li class="nav-item"> </li>
<a class="nav-link" href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a> {% else %}
</li> <li class="nav-item">
<li class="nav-item"> <a class="nav-link"
<a class="nav-link" href="{{ base_url() }}{{ path_for('login') }}">{{ getenv('site_navbar_login_displayname') }}</a> href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a>
</li> </li>
{% endif %} <li class="nav-item">
<a class="nav-link"
href="{{ base_url() }}{{ path_for('login') }}">{{ getenv('site_navbar_login_displayname') }}</a>
</li>
{% endif %}
{% if getenv('site_navbar_backlink_enabled') == 'true' %} {% if getenv('site_navbar_backlink_enabled') == 'true' %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a> <a class="nav-link"
</li> href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a>
{% endif %} </li>
{% endif %}
{% if currentUser is not empty %} {% if currentUser is not empty %}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a> <a class="nav-link"
</li> href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a>
<li class="nav-item disabled"> </li>
<a class="nav-link">{% trans with {'%username%': currentUser.identity, '%server%': getenv('site_xmpp_server_displayname') } %}logged.in.site{% endtrans %}</a> <li class="nav-item disabled">
</li> <a class="nav-link">{% trans with {'%username%': currentUser.identity, '%server%': getenv('site_xmpp_server_displayname') } %}logged.in.site{% endtrans %}</a>
{% endif %} </li>
{% endif %}
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
<!-- Main content --> <!-- Main content -->
<div id="container"> <div id="container">
<div class="row"> <div class="row">
<div class="col-md-6 mx-auto"> <div class="col-md-6 mx-auto">
{% if flash is not empty %} {% if flash is not empty %}
<div id="flashMessage"> <div id="flashMessage">
{% if flash.getMessage('info').0 %} {% if flash.getMessage('info').0 %}
<div class="alert alert-info"> <div class="alert alert-info">
{{ flash.getMessage('info').0 }} {{ flash.getMessage('info').0 }}
</div>
{% endif %}
{% if flash.getMessage('success').0 %}
<div class="alert alert-success">
{{ flash.getMessage('success').0 }}
</div>
{% endif %}
{% if flash.getMessage('error') %}
{% for error in flash.getMessage('error') %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endfor %}
{% endif %}
</div> </div>
{% endif %} {% endif %}
</div>
</div>
<div class="row"> {% if flash.getMessage('success').0 %}
<div class="col-md-6 mx-auto"> <div class="alert alert-success">
{% block content %} {{ flash.getMessage('success').0 }}
{% endblock %} </div>
{% endif %}
{% if flash.getMessage('error') %}
{% for error in flash.getMessage('error') %}
<div class="alert alert-danger">
{{ error }}
</div>
{% endfor %}
{% endif %}
</div> </div>
</div> {% endif %}
</div> </div>
</div>
<!-- Script --> <div class="row">
<script src="{{ base_url() }}/js/jquery.min.js"></script> <div class="col-md-6 mx-auto">
<script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script> {% block content %}
{% endblock %}
</div>
</div>
</div>
<script> <!-- Script -->
$(".alert-danger" ).delay(30000).fadeOut(300); <script src="{{ base_url() }}/js/jquery.min.js"></script>
$(".alert-success" ).delay(10000).fadeOut(300); <script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script>
$(".alert-info" ).delay(10000).fadeOut(300); <script src="{{ base_url() }}/js/cookieconsent.min.js"></script>
</script>
<script src="{{ base_url() }}/js/cookieconsent.min.js"></script> <!-- Custom Script -->
<script> <script src="{{ base_url() }}/js/custom.js"></script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#252e39"
},
"button": {
"background": "#14a7d0"
}
},
"content": {
"message": "{{ 'cookiemodal.message'|trans }}",
"dismiss": "{{ 'cookiemodal.dismiss'|trans }}",
"href": "/signup"
}
})});
</script>
</body> </body>
</html> </html>