mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Make flash messages go away after 2 seconds.
This commit is contained in:
parent
065fe965a0
commit
402d756bf1
3 changed files with 44 additions and 30 deletions
|
@ -80,3 +80,10 @@ a {
|
|||
.negative{
|
||||
color: red;
|
||||
}
|
||||
|
||||
.flash{
|
||||
padding:8px;
|
||||
background-color: #ffc;
|
||||
font-weight: bold;
|
||||
font-size:15px;-moz-border-radius: 6px;-webkit-border-radius: 6px;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,17 @@
|
|||
<title>Account manager</title>
|
||||
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='main.css') }}">
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" charset="utf-8">{% block js %}{% endblock %}</script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
setTimeout(function(){
|
||||
$(".flash").fadeOut("slow", function () {
|
||||
$(".flash").remove();
|
||||
});
|
||||
}, 2000);
|
||||
|
||||
{% block js %}{% endblock %}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -17,7 +27,7 @@
|
|||
</div>
|
||||
<hr>
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div class=info>{{ message }}</div>
|
||||
<div class="flash">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,38 +1,35 @@
|
|||
{% extends "layout.html" %}
|
||||
|
||||
{% block js %}
|
||||
$(document).ready(function(){
|
||||
// display the form when clicking on the "add bill" button
|
||||
$('#add_bill_button').click(function(){
|
||||
$('#add_bill').show(200);
|
||||
$(this).hide();
|
||||
$('#hide_bill_form').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
// display the form when clicking on the "add bill" button
|
||||
$('#add_bill_button').click(function(){
|
||||
$('#add_bill').show(200);
|
||||
$(this).hide();
|
||||
$('#hide_bill_form').show();
|
||||
return false;
|
||||
});
|
||||
// and provide a mechanism to hide it back
|
||||
$('#hide_bill_form').click(function(){
|
||||
$('#add_bill').hide(200);
|
||||
$(this).hide();
|
||||
$('#add_bill_button').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
// and provide a mechanism to hide it back
|
||||
$('#hide_bill_form').click(function(){
|
||||
$('#add_bill').hide(200);
|
||||
$(this).hide();
|
||||
$('#add_bill_button').show();
|
||||
return false;
|
||||
// ask for confirmation before removing an user
|
||||
$('a.remove').each(function(){
|
||||
$(this).hide();
|
||||
$(this).click(function(){
|
||||
return confirm("are you sure?");
|
||||
});
|
||||
});
|
||||
|
||||
// ask for confirmation before removing an user
|
||||
$('a.remove').each(function(){
|
||||
$(this).hide();
|
||||
$(this).click(function(){
|
||||
return confirm("are you sure?");
|
||||
});
|
||||
});
|
||||
|
||||
// display the remove button on mouse over (and hide them per default)
|
||||
$('.members li').hover(function(){
|
||||
$(this).children('a.remove').show();
|
||||
}, function(){
|
||||
$(this).children('a.remove').hide();
|
||||
});
|
||||
// display the remove button on mouse over (and hide them per default)
|
||||
$('.members li').hover(function(){
|
||||
$(this).children('a.remove').show();
|
||||
}, function(){
|
||||
$(this).children('a.remove').hide();
|
||||
});
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue