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,6 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<head>
<title>{{ title }}</title>
<!-- Meta -->
<meta charset="UTF-8"/>
@ -9,68 +9,62 @@
<!-- CSS & fonts -->
<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/cookieconsent.min.css" />
<link rel="stylesheet" href="{{ base_url() }}/css/cookieconsent.min.css"/>
<!-- Custom styles for this template -->
<style>
body {
padding-top: 54px;
}
@media (min-width: 992px) {
body {
padding-top: 56px;
}
}
<link rel="stylesheet" href="{{ base_url() }}/css/custom.css"/>
</head>
<body>
#container {
margin-top: 56px;
overflow-x: hidden;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<!-- 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>
<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"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a>
<a class="nav-link"
href="{{ base_url() }}{{ path_for('/') }}">{{ getenv('site_navbar_home_displayname') }}</a>
</li>
<!-- current user -->
{% if currentUser is not empty %}
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a>
<a class="nav-link"
href="{{ base_url() }}{{ path_for('password') }}">{{ getenv('site_navbar_password_displayname') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a>
<a class="nav-link"
href="{{ base_url() }}{{ path_for('delete') }}">{{ getenv('site_navbar_delete_displayname') }}</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a>
<a class="nav-link"
href="{{ base_url() }}{{ path_for('signup') }}">{{ getenv('site_navbar_signup_displayname') }}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('login') }}">{{ getenv('site_navbar_login_displayname') }}</a>
<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' %}
<li class="nav-item">
<a class="nav-link" href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a>
<a class="nav-link"
href="{{ getenv('site_navbar_backlink_uri') }}">{{ getenv('site_navbar_backlink_displayname') }}</a>
</li>
{% endif %}
{% if currentUser is not empty %}
<li class="nav-item">
<a class="nav-link" href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a>
<a class="nav-link"
href="{{ base_url() }}{{ path_for('logout') }}">{{ getenv('site_navbar_logout_displayname') }}</a>
</li>
<li class="nav-item disabled">
<a class="nav-link">{% trans with {'%username%': currentUser.identity, '%server%': getenv('site_xmpp_server_displayname') } %}logged.in.site{% endtrans %}</a>
@ -80,10 +74,10 @@
</ul>
</div>
</div>
</nav>
</nav>
<!-- Main content -->
<div id="container">
<!-- Main content -->
<div id="container">
<div class="row">
<div class="col-md-6 mx-auto">
{% if flash is not empty %}
@ -118,37 +112,15 @@
{% endblock %}
</div>
</div>
</div>
</div>
<!-- Script -->
<script src="{{ base_url() }}/js/jquery.min.js"></script>
<script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script>
<!-- Script -->
<script src="{{ base_url() }}/js/jquery.min.js"></script>
<script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script>
<script src="{{ base_url() }}/js/cookieconsent.min.js"></script>
<script>
$(".alert-danger" ).delay(30000).fadeOut(300);
$(".alert-success" ).delay(10000).fadeOut(300);
$(".alert-info" ).delay(10000).fadeOut(300);
</script>
<!-- Custom Script -->
<script src="{{ base_url() }}/js/custom.js"></script>
<script src="{{ base_url() }}/js/cookieconsent.min.js"></script>
<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>