Changeset 6e7d36d in osmose-frontend


Ignore:
Timestamp:
Oct 31, 2012 6:57:10 PM (5 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
395974d
Parents:
e5466bd
Message:

Use css sprite and display error number in menu

Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • static/map/style.css

    re11ae9d r6e7d36d  
    2020  background: white; 
    2121  position: absolute; 
    22   width: 330px; 
     22  width: 270px; 
    2323  left: 50px; 
    2424  top: 30px; 
     
    2626  padding: 5px; 
    2727  padding-top: 8px; 
     28  padding-right: 0px; 
    2829  opacity: 0.9; 
    2930} 
     
    272273  height: 16px; 
    273274} 
    274 div.level-123 { 
    275   background: url('../images/level-123.png'); 
    276 } 
    277 div.level-12_ { 
    278   background: url('../images/level-12_.png'); 
    279 } 
    280 div.level-1_3 { 
    281   background: url('../images/level-1_3.png'); 
    282 } 
    283 div.level-_23 { 
    284   background: url('../images/level-_23.png'); 
    285 } 
    286 div.level-1__ { 
    287   background: url('../images/level-1__.png'); 
    288 } 
    289 div.level-_2_ { 
    290   background: url('../images/level-_2_.png'); 
    291 } 
    292 div.level-__3 { 
    293   background: url('../images/level-__3.png'); 
     275div.test_group div.level div { 
     276  width: 16px; 
     277  height: 16px; 
     278  display: inline-block; 
     279  direction: rtl; 
     280} 
     281div.test_group div.level div span { 
     282  display: none; 
     283} 
     284div.test_group div.level div:hover span { 
     285  display: block; 
     286  padding: 5px; 
     287  z-index: 20; 
     288  overflow: visible; 
     289} 
     290div.level-1 { 
     291  background: url('../images/level-123.png') no-repeat; 
     292  background-position:0px 0px; 
     293} 
     294div.level-2 { 
     295  background: url('../images/level-123.png') no-repeat; 
     296  background-position:-16px 0px; 
     297} 
     298div.level-3 { 
     299  background: url('../images/level-123.png') no-repeat; 
     300  background-position:-32px 0px; 
    294301} 
    295302 
  • tools/utils.py

    r95a622e r6e7d36d  
    5555                res["menu"] = res1[1][l] 
    5656                break 
    57         curs2.execute("SELECT item, menu, marker_color, marker_flag, levels FROM dynpoi_item WHERE categ = %d ORDER BY item"%res1[0]) 
     57        curs2.execute("SELECT item, menu, marker_color, marker_flag, levels, number FROM dynpoi_item WHERE categ = %d ORDER BY item"%res1[0]) 
    5858        for res2 in curs2.fetchall(): 
    59             res["item"].append({"item":res2[0], "menu":"no translation", "marker_color":res2[2], "marker_flag":res2[3], "levels": res2["levels"]}) 
     59            res["item"].append({"item":res2[0], "menu":"no translation", "marker_color":res2[2], "marker_flag":res2[3], "levels":res2["levels"], "number":res2["number"]}) 
    6060            for l in lang: 
    6161                if res2[1] and l in res2[1]: 
  • views/map/index.tpl

    r3aad5cc r6e7d36d  
    7171    <ul> 
    7272%    for err in categ["item"]: 
    73 %        s_l = ["_"] * 3 
    74 %        for l in err["levels"]: 
    75 %            s_l[l-1] = str(l) 
     73        <li style='background-image: url(../images/markers/marker-l-{{err["item"]}}.png)' id='item_desc{{err["item"]}}'> 
     74            <div class="level">\\ 
     75%        p = 0 
     76%        for i in [1,2,3]: 
     77%            if i in err["levels"]: 
     78<div class="level-{{i}}"><span>{{err["number"][p] if err["number"] and len(err["number"]) > p else 0}}</span></div>\\ 
     79%                p += 1 
     80%            else: 
     81<div></div>\\ 
     82%            end 
    7683%        end 
    77         <li style='background-image: url(../images/markers/marker-l-{{err["item"]}}.png)' id='item_desc{{err["item"]}}'> 
     84            </div> 
    7885            <input type='checkbox' id='item{{err["item"]}}' name='item{{err["item"]}}' onclick='checkbox_click(this)' {{ {True:" checked=\"checked\"", False:""}[err["item"] in active_items]}}> 
    7986            <a target="_blank" href="../errors/?item={{err["item"]}}">{{err["menu"]}}</a> 
    80             <div class="level level-{{"".join(s_l)}}">&nbsp;</div> 
    8187        </li> 
    8288%    end 
Note: See TracChangeset for help on using the changeset viewer.