aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-11-24 00:27:51 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2011-11-24 00:27:51 +0100
commit672f2a1ca16a7e34acf8fadbf0d7113921d2573c (patch)
tree2167842bf595fc87e7c8261eae6d3ad848aefdc7 /budget
parent2a6ccaa0cff1dddc5982df6c2cd22f717912d1cd (diff)
downloadihatemoney-mirror-672f2a1ca16a7e34acf8fadbf0d7113921d2573c.zip
ihatemoney-mirror-672f2a1ca16a7e34acf8fadbf0d7113921d2573c.tar.gz
ihatemoney-mirror-672f2a1ca16a7e34acf8fadbf0d7113921d2573c.tar.bz2
revert arnaud's commit about delete links
Diffstat (limited to 'budget')
-rw-r--r--budget/static/delete.pngbin4355 -> 0 bytes
-rw-r--r--budget/static/main.css20
-rw-r--r--budget/static/refresh.pngbin3846 -> 0 bytes
-rw-r--r--budget/templates/list_bills.html84
4 files changed, 18 insertions, 86 deletions
diff --git a/budget/static/delete.png b/budget/static/delete.png
deleted file mode 100644
index a910d5a..0000000
--- a/budget/static/delete.png
+++ /dev/null
Binary files differ
diff --git a/budget/static/main.css b/budget/static/main.css
index c14e0b7..9505e88 100644
--- a/budget/static/main.css
+++ b/budget/static/main.css
@@ -1,4 +1,4 @@
- @import "bootstrap-1.0.0.min.css";
+@import "bootstrap-1.0.0.min.css";
@import url(http://fonts.googleapis.com/css?family=Lobster|Comfortaa);
@import "jquery/jquery-ui.css";
@@ -140,23 +140,6 @@ div.topbar ul.secondary-nav { padding-right: 75px; }
height: 24px;
}
-#overlay {
- position:absolute;
- background-color:#000000;
- opacity:0.7;
- display:none;
- text-align: center;
-}
-
-#overlay-delete, #overlay-reactivate {
- width: 28px;
- height: 28px;
- margin-top: 2px;
- position:absolute;
- cursor:pointer;
- display:none;
-}
-
.balance-value{
text-align:right;
}
@@ -176,4 +159,3 @@ tr.payer_line .balance-name{
color:green;
text-indent:5px;
}
-
diff --git a/budget/static/refresh.png b/budget/static/refresh.png
deleted file mode 100644
index 3b815bf..0000000
--- a/budget/static/refresh.png
+++ /dev/null
Binary files differ
diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html
index 192e200..0cbf583 100644
--- a/budget/templates/list_bills.html
+++ b/budget/templates/list_bills.html
@@ -39,70 +39,24 @@
$('#hide-bill-form').click(hide_form);
$('#cancel-form').click(hide_form);
-
- var tr_id;
- var id;
-
- // display the remove button on mouse over (and hide them per default)
- $('.balance tr').hover(function()
- {
- tr_id = $(this).attr('id');
- var index = tr_id.lastIndexOf("-");
- id = tr_id.substring(index+1);
- var action = $(this).attr('action');
-
- var x = $(this).offset().left;
- var y = $(this).offset().top;
- var width = $(this).width();
- var height = $(this).height();
-
- $('#overlay').css({ "left":x+"px", "top":y+"px", "width":width+"px", "height":height+"px", "line-height":height+"px" }).show();
-
- if(!$(this).hasClass("confirm"))
- {
- $('#overlay').html("");
- if (action == 'delete')
- {
- $('#overlay-delete').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
- }
- else if (action == 'reactivate')
- {
- $('#overlay-reactivate').css({ "left":(x+width/2-16)+"px", "top":(y+height/2-16)+"px" }).show();
- }
- }
- else
- {
- var url = "{{ url_for('.remove_member', member_id=id) }}";
- url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
- $('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
- }
- });
-
- // show confirm message before actually removing the member
- $('#overlay-delete').click(function ()
- {
- $('#'+tr_id).addClass("confirm");
- var url = "{{ url_for('.remove_member', member_id=id) }}";
- url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
- $('#overlay').html("<a href='"+url+"' >{{_("you sure?")}}</a>");
+ // ask for confirmation before removing an user
+ $('a.remove').each(function(){
$(this).hide();
+ $(this).click(function(){
+ if ($(this).hasClass("confirm")){
+ return true;
+ }
+ $(this).html("{{_("you sure?")}}");
+ $(this).addClass("confirm");
+ return false;
+ });
});
- // re-create reactivation url from hover-ed item and call it
- $('#overlay-reactivate').click(function ()
- {
- var url = "{{ url_for('.reactivate', member_id=id) }}";
- url = url.substring(0, url.lastIndexOf('/'))+id+url.substring(url.lastIndexOf('/'));
- $(location).attr('href', url);
- });
-
- $('#overlay').hover(function()
- {
- }, function()
- {
- $('#overlay').hide();
- $('#overlay-delete').hide();
- $('#overlay-reactivate').hide();
+ // display the remove button on mouse over (and hide them per default)
+ $('.balance tr').hover(function(){
+ $(this).find('.remove').show();
+ }, function(){
+ $(this).find('.remove').hide();
});
$.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
@@ -139,11 +93,12 @@
{% set balance = g.project.balance %}
{% for member in g.project.members %}
{% if member.activated or balance[member.id] != 0 %}
- <tr id="bal-member-{{ member.id }}" action={% if member.activated %}delete{% else %}reactivate{% endif %}>
+<tr id="bal-member-{{ member.id }}">
<td class="balance-name">{{ member.name }}</td>
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
</td>
+ <td> {% if member.activated %}<a class="remove" href="{{ url_for(".remove_member", member_id=member.id) }}">{{ _("delete") }}</a>{% else %}<a href="{{ url_for(".reactivate", member_id=member.id) }}">{{ _("reactivate") }}</a>{% endif %}</td>
</tr>
{% endif %}
{% endfor %}
@@ -151,9 +106,6 @@
</div>
</div>
- <div id="overlay"></div>
- <img id="overlay-delete" title="{{ _("delete") }}" src="{{ url_for("static", filename="delete.png") }}">
- <img id="overlay-reactivate" title="{{ _("reactivate") }}" src="{{ url_for("static", filename="refresh.png") }}">
{% endblock %}
{% block content %}
@@ -192,8 +144,6 @@
{% else %}
<p>{{ _("Nothing to list yet. You probably want to") }} <a id="empty-new-bill" href="{{ url_for(".add_bill") }}">{{ _("add a bill") }}</a> ?</p>
{% endif %}
-
-
</div>
<script>
$("#sidebar").height( window.innerHeight-40 );