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

@ -12,21 +12,7 @@
<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;
}
}
#container {
margin-top: 56px;
overflow-x: hidden;
}
</style>
<link rel="stylesheet" href="{{ base_url() }}/css/custom.css"/>
</head>
<body>
@ -34,43 +20,51 @@
<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>
@ -123,32 +117,10 @@
<!-- Script -->
<script src="{{ base_url() }}/js/jquery.min.js"></script>
<script src="{{ base_url() }}/js/bootstrap.bundle.min.js"></script>
<script>
$(".alert-danger" ).delay(30000).fadeOut(300);
$(".alert-success" ).delay(10000).fadeOut(300);
$(".alert-info" ).delay(10000).fadeOut(300);
</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>
<!-- Custom Script -->
<script src="{{ base_url() }}/js/custom.js"></script>
</body>
</html>