From d9cf29c510ecdb288ca99aee538ecb53aa9de198 Mon Sep 17 00:00:00 2001 From: Arnaud Bos Date: Wed, 2 Nov 2011 00:46:05 +0100 Subject: [PATCH] First draft of fixing sidebar ugly hovering effect pointed in #51. --- budget/static/delete.png | Bin 0 -> 4355 bytes budget/static/main.css | 14 +++++ budget/static/refresh.png | Bin 0 -> 3846 bytes budget/templates/list_bills.html | 96 +++++++++++++++++++++++++------ 4 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 budget/static/delete.png create mode 100644 budget/static/refresh.png diff --git a/budget/static/delete.png b/budget/static/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..a910d5a20ef238dcdd4a2aa86637aafcfed0adb9 GIT binary patch literal 4355 zcmV+e5&Z6nP)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3 zJ#qp$hg?Rwkvqr$GJ^buyhkyVfwECO)C{#lxu`c9ghrwZ&}4KmnvWKso6vH!8a<3Q zq36)6Xb;+tK10Vaz~~qUGsJ8#F2=(`u{bOVlVi)VBCHIn#u~6ztOL7=^<&SmcLWlF zMZgI*1b0F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=y z1gl^~DQ*4&_E2|}6UNMHqKdbC1$y@`!b!wB)M*r}stSf0SRwFkIb&@Jf_Khf8XF_6 zg9PEeU!%JpKqdeZ2N1*_ap zC4p6%D`gh~tFA@VRcUHGkHlBEV;*`0TL$ZaT*#5za5Kf8?s;;;z>;gqWr40XPe*c$-EkYm!#$WFsAkU?!hgPtlX$H%aH#~R zY($MZ1JiFFiJDA|zQ)3k%QMK1E+uFSy5J)WK#2QNW%*kJQ(b{zT`+a-79*j^vt;W3tWU zyAR@~OQ?Vy7^Zmg1QUOF8apshxnY5qS4{JG4Fms3&Z9uSdQNH>zF!rblxks zoD&Pbv4f^PKVfD`mxsjIp0SQ&v$kV^Z+g4~To;=n2qnk(z9%4+BGul3NvCILz(nT> zmbG!=r56d$4VI5s9!Po-?z%4I?7S1v36CuB9I&RcStBazZ(T>jmMzrZ`e}k}wrXGg zjU(iqf1dH*Jw@^KzYwn~xCJ)0TMm4nnec5xBk&Burz+F1BC25O()igd{^C}G)>gui zQNq4n?ARD~co?->*1Q59xVgh|@Uq78<3bX69N0D^UusA5YA=_5c@Ox^^~$L$ewe%o zT?W2o;3ER{GoJ*PI*R{03uhGmG7Jyh0=dh5n0P=Es3Qs}%VBXBtotzBxCpLofNTcp zf>_*XuoEym1gCr9*m3CoJsgQ~=3^_w%XK~g0t7@ap(daaXaLecDhYKhu%I3?DF}S< x9B2tjlQ1<5xe=I%15Od0ei#@b`d*v~;NL!4+rPXTtxf;{002ovPDHLkV1np<9KZko literal 0 HcmV?d00001 diff --git a/budget/static/main.css b/budget/static/main.css index f156fa8..3d3236f 100644 --- a/budget/static/main.css +++ b/budget/static/main.css @@ -139,3 +139,17 @@ div.topbar ul.secondary-nav { padding-right: 75px; } .delete img { height: 24px; } + +#overlay { + position:absolute; + background-color:#000000; + opacity:0.7; + display:none; + text-align: center; +} + +#overlay-delete, #overlay-reactivate { + position:absolute; + cursor:pointer; + display:none; +} diff --git a/budget/static/refresh.png b/budget/static/refresh.png new file mode 100644 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Ty000JJOGiWi{{a60 z|De66lK=n!32;bRa{vGf6951U69E94oEQKA00(qQO+^RW3jq%#Dq2o|bpQYaI7vi7 zR9M5^mwjlJWf;bP*E!q#*x9CKq-5C_Gg50P1sXKj_1q!Ya1B|0){nh>{xPde{6LnjyJR~sW9^&LQDc~7AiNhbBGfd z2c+niPgbstzt{fUpMvv-)jn0Z{!qaLntpobS~J!m)kqWr(O|9s3m)GLAG1wJPfJA1 zI0j6cKeqAIRS|gW=o3RCiY@}Jl0p&g1y-Ls(f$9RbN;l2cW#JZ5rOqb=iLfwl=NV3 zVC!+w1)K#cz^)5iW|I8DcYgiiahre6#3{-JzV^u6QJ#6Nl5P)hES8#(>5H`3bB!{BYEB-abVb69NxMYK@4zBy@4*IcYpD1K8Mb{Ei3N&Y-N8-`%-9MIq<+>L?hzy%uE(~svxZrP6Ewg0#zuhFSU2qd11qMUIWscjL*l+xzHA^p#(fj#d7#g zA?y+X-;yO{wG}SBGx?WP!312gQrXc>0vAFN@U{XYL;Dm3zAqH~vAs7Idw64I;oLTW zc+->ER@YWKR_INPS%GDbv-t+QgvCJ~P-14+NUAimrIMyyMmwIytiE~b`CWM> zSvQ_Wn%U%_fmq3dhZ5VD%}OoAHb64 z>cq~1FDCVSVhtD@fxU`SYd%wfnP%Jp43!vUki<9#b_DqRqp9ax3%!~Nh?G`Xm-s43aib6!kZHmIU}bfheC(k1q<`X?T&UO=%TVD8e^80l)u08<{Z zQUnYEV#P7auAdmasq3)oxOm3mq3fCDcxM8-(AxzEo&)@U0V?{07*qo IM6N<$f=SCW00000 literal 0 HcmV?d00001 diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index b1d1c68..18b3637 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -33,24 +33,70 @@ $('#hide-bill-form').click(hide_form); $('#cancel-form').click(hide_form); - // 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; - }); - }); + var tr_id; + var id; // 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(); + $('.balance tr').hover(function() + { + tr_id = $(this).attr('id'); + + var index = tr_id.indexOf("-"); + var action = tr_id.substring(0, index); + id = tr_id.substring(index+1); + + 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("{{_("you sure?")}}"); + } + }); + + // 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("{{_("you sure?")}}"); + $(this).hide(); + }); + + // 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(); }); $.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'}); @@ -70,12 +116,11 @@ {% set balance = g.project.balance %} {% for member in g.project.members %} {% if member.activated or balance[member.id] != 0 %} - + {{ member.name }} {% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }} - {% if member.activated %}{{ _("delete") }}{% else %}{{ _("reactivate") }}{% endif %} {% endif %} {% endfor %} @@ -83,6 +128,9 @@ +
+ + {% endblock %} {% block content %} @@ -121,6 +169,18 @@ {% else %}

{{ _("Nothing to list yet. You probably want to") }} {{ _("add a bill") }} ?

{% endif %} + + + + + + + + + + + +