Changeset e50254d in osmose-frontend


Ignore:
Timestamp:
Mar 18, 2014 10:08:59 PM (6 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
a03ade7
Parents:
a2374c8
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (09/03/2014 22:45:46)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (18/03/2014 22:08:59)
Message:

Change fixable from checkbox to select

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • map.py

    r4734d02 re50254d  
    9696        tags_selected[t] = "" 
    9797 
    98     if params["fixable"] and params["fixable"] == "true": 
    99       fixable_checked = " checked=\"checked\"" 
    100     else: 
    101       fixable_checked = "" 
     98    fixable_selected = {} 
     99    fixable_selected['online'] = " selected=\"selected\"" if params["fixable"] and params["fixable"] == "online" else "" 
     100    fixable_selected['josm'] = " selected=\"selected\"" if params["fixable"] and params["fixable"] == "josm" else "" 
    102101 
    103102    all_items = [] 
     
    184183    return template('map/index', categories=categories, lat=params["lat"], lon=params["lon"], zoom=params["zoom"], 
    185184        source=params["source"], username=params["username"], classs=params["class"], country=params["country"], 
    186         item_tags=item_tags, tags_selected=tags_selected, tags=tags, fixable_checked=fixable_checked, 
     185        item_tags=item_tags, tags_selected=tags_selected, tags=tags, fixable_selected=fixable_selected, 
    187186        item_levels=item_levels, level_selected=level_selected, 
    188187        active_items=active_items, useDevItem=params["useDevItem"], 
     
    284283    response.set_cookie('last_item', str(params.item), expires=expires, path=path) 
    285284    response.set_cookie('last_tags', str(','.join(params.tags)) if params.tags else '', expires=expires, path=path) 
    286     response.set_cookie('last_fixable', str('true' if params.fixable else 'false'), expires=expires, path=path) 
     285    response.set_cookie('last_fixable', str(params.fixable) if params.fixable else '', expires=expires, path=path) 
    287286 
    288287    return errors._errors_geo(db, lang, params) 
  • static/map/Osmose.Menu.js

    raf8e500 re50254d  
    135135    var new_level = document.myform.level.value, 
    136136      new_tag = document.myform.tags.value, 
    137       fixable = document.myform.fixable.checked; 
     137      fixable = document.myform.fixable.value; 
    138138    this._change_item_display(new_level || "1,2,3", new_tag, fixable); 
    139139 
     
    176176      level: document.myform.level.value, 
    177177      tags: document.myform.tags.value, 
    178       fixable: document.myform.fixable.checked, 
     178      fixable: document.myform.fixable.value, 
    179179    }; 
    180180  }, 
     
    200200    } 
    201201 
    202     if (fixable) { 
    203       document.myform.fixable.checked = fixable == 'true'; 
     202    if (fixable != undefined) { 
     203      document.myform.fixable.value = fixable; 
    204204    } 
    205205 
  • static/map/Permalink.Item.js

    raf8e500 re50254d  
    1919  _set_items: function (e) { 
    2020    var p = e.params; 
    21     if (this.options.menu && (p.item || p.level || p.tags != undefined || p.fixable)) { 
     21    if (this.options.menu && (p.item || p.level || p.tags != undefined || p.fixable != undefined)) { 
    2222      this.options.menu.setItems(p.item, p.level, p.tags, p.fixable); 
    2323    } 
  • tools/query.py

    ra2374c8 re50254d  
    157157        where.append("dynpoi_class.tags::text[] && ARRAY['%s']" % "','".join(map(utils.pg_escape, tags))) 
    158158 
    159     if fixable: 
     159    if fixable == 'online': 
     160        where.append("EXISTS (SELECT 1 FROM marker_fix WHERE marker_fix.marker_id = marker.id AND elem_id != 0)") 
     161    elif fixable == 'josm': 
    160162        where.append("EXISTS (SELECT 1 FROM marker_fix WHERE marker_fix.marker_id = marker.id)") 
    161163 
     
    216218    if params.tags: 
    217219        params.tags = params.tags.split(",") 
    218     if params.fixable == "true": 
    219         params.fixable = True 
    220     else: 
    221         params.fixable = False 
    222220 
    223221    return params 
  • views/map/index.tpl

    r97c1a17 re50254d  
    5757      <span id="fixable-span"> 
    5858        <label for='fixable'>{{_("Fixable")}}</label> 
    59         <input type="checkbox" name="fixable" id="fixable" value="true"{{fixable_checked}} title="{{_("Show only markers with correction suggestions")}}"/> 
     59        <select id="fixable" title="{{_("Show only markers with correction suggestions")}}"> 
     60          <option value=""></option> 
     61          <option value="online"{{!fixable_selected['online']}}>{{_("Online")}}</option> 
     62          <option value="josm"{{!fixable_selected['josm']}}>JOSM</option> 
     63        </select> 
    6064      </span> 
    6165      <span id="tags-span"> 
Note: See TracChangeset for help on using the changeset viewer.