diff options
41 files changed, 304 insertions, 268 deletions
diff --git a/sources/db/pre.sql b/sources/db/pre.sql index bc51db0..9d349a3 100644 --- a/sources/db/pre.sql +++ b/sources/db/pre.sql @@ -28,6 +28,7 @@ CREATE TABLE keys ( cells_ways INTEGER DEFAULT 0, in_wiki INTEGER DEFAULT 0, in_wiki_en INTEGER DEFAULT 0, + in_projects INTEGER DEFAULT 0, in_josm INTEGER DEFAULT 0, in_potlatch INTEGER DEFAULT 0, characters VARCHAR @@ -73,6 +74,7 @@ CREATE TABLE tags ( object_id INTEGER, in_wiki INTEGER DEFAULT 0, in_wiki_en INTEGER DEFAULT 0, + in_projects INTEGER DEFAULT 0, in_josm INTEGER DEFAULT 0, in_potlatch INTEGER DEFAULT 0 ); diff --git a/sources/languages/update.sh b/sources/languages/update.sh index adcd965..33f8cab 100755 --- a/sources/languages/update.sh +++ b/sources/languages/update.sh @@ -20,6 +20,23 @@ PROPERTY_ALIASES_FILE="$DIR/PropertyValueAliases.txt" DATECMD='date +%Y-%m-%dT%H:%M:%S' +update_file() { + file=$1 + url=$2 + + if curl --silent --fail --location --time-cond $file --output $file $url; then + return 0 + else + error=$? + if [ "$error" = "22" ]; then + echo "WARNING: Getting ${url} failed. Using old version." + else + echo "ERROR: Could not get ${url}: curl error: $error" + exit 1 + fi + fi +} + if [ "x" = "x$DIR" ]; then echo "Usage: update.sh DIR" exit 1 @@ -44,13 +61,13 @@ echo "`$DATECMD` Running pre.sql..." sqlite3 $DATABASE <pre.sql echo "`$DATECMD` Getting subtag registry..." -curl --silent --time-cond $REGISTRY_FILE --output $REGISTRY_FILE $REGISTRY_URL +update_file $REGISTRY_FILE $REGISTRY_URL echo "`$DATECMD` Running subtag import..." $EXEC_RUBY ./import_subtag_registry.rb $DIR echo "`$DATECMD` Getting CLDR..." -curl --silent --location --time-cond $CLDR_FILE --output $CLDR_FILE $CLDR_URL +update_file $CLDR_FILE $CLDR_URL echo "`$DATECMD` Unpacking CLDR..." rm -fr $CLDR_DIR @@ -58,8 +75,8 @@ mkdir $CLDR_DIR unzip -q -d $CLDR_DIR $CLDR_FILE echo "`$DATECMD` Getting unicode scripts..." -curl --silent --location --time-cond $UNICODE_SCRIPTS_FILE --output $UNICODE_SCRIPTS_FILE $UNICODE_SCRIPTS_URL -curl --silent --location --time-cond $PROPERTY_ALIASES_FILE --output $PROPERTY_ALIASES_FILE $PROPERTY_ALIASES_URL +update_file $UNICODE_SCRIPTS_FILE $UNICODE_SCRIPTS_URL +update_file $PROPERTY_ALIASES_FILE $PROPERTY_ALIASES_URL echo "`$DATECMD` Running unicode scripts import..." $EXEC_RUBY ./import_unicode_scripts.rb $DIR diff --git a/sources/master/master.sql b/sources/master/master.sql index ebd8202..5397a4c 100644 --- a/sources/master/master.sql +++ b/sources/master/master.sql @@ -49,12 +49,10 @@ INSERT INTO master_stats SELECT * FROM db.stats -- ============================================================================ -INSERT INTO db.keys (key) SELECT DISTINCT key FROM wiki.wikipages WHERE key NOT IN (SELECT key FROM db.keys); -INSERT INTO db.keys (key) SELECT DISTINCT k FROM josm.josm_style_rules WHERE k NOT IN (SELECT key FROM db.keys); +INSERT INTO db.keys (key) SELECT DISTINCT key FROM wiki.wikipages WHERE key NOT IN (SELECT key FROM db.keys); UPDATE db.keys SET in_wiki=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages WHERE value IS NULL); UPDATE db.keys SET in_wiki_en=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages WHERE value IS NULL AND lang='en'); -UPDATE db.keys SET in_josm=1 WHERE key IN (SELECT distinct k FROM josm.josm_style_rules); -- ============================================================================ @@ -69,6 +67,41 @@ UPDATE db.selected_tags SET in_wiki_en=1 WHERE skey || '=' || svalue IN (SELECT -- ============================================================================ +-- currently unused future replacement for db.selected_tags + +DROP TABLE IF EXISTS top_tags; +CREATE TABLE top_tags ( + skey VARCHAR, + svalue VARCHAR, + count_all INTEGER DEFAULT 0, + count_nodes INTEGER DEFAULT 0, + count_ways INTEGER DEFAULT 0, + count_relations INTEGER DEFAULT 0, + in_wiki INTEGER DEFAULT 0, + in_wiki_en INTEGER DEFAULT 0, + in_projects INTEGER DEFAULT 0 +); + +INSERT INTO top_tags (skey, svalue) + SELECT key1, value1 FROM db.tag_combinations WHERE value1 != '' + UNION + SELECT key2, value2 FROM db.tag_combinations WHERE value2 != ''; + +UPDATE top_tags SET + count_all = (SELECT t.count_all FROM db.tags t WHERE t.key=skey AND t.value=svalue), + count_nodes = (SELECT t.count_nodes FROM db.tags t WHERE t.key=skey AND t.value=svalue), + count_ways = (SELECT t.count_ways FROM db.tags t WHERE t.key=skey AND t.value=svalue), + count_relations = (SELECT t.count_relations FROM db.tags t WHERE t.key=skey AND t.value=svalue); + +UPDATE top_tags SET in_wiki=1 WHERE skey || '=' || svalue IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*'); +UPDATE top_tags SET in_wiki_en=1 WHERE skey || '=' || svalue IN (SELECT distinct tag FROM wiki.wikipages WHERE value IS NOT NULL AND value != '*' AND lang='en'); + +UPDATE top_tags SET in_projects=(SELECT num FROM projects.project_counts p WHERE p.key=skey AND p.value=svalue); + +CREATE UNIQUE INDEX top_tags_key_value_idx ON top_tags (skey, svalue); + +-- ============================================================================ + DROP TABLE IF EXISTS popular_keys; CREATE TABLE popular_keys ( key VARCHAR, @@ -77,12 +110,10 @@ CREATE TABLE popular_keys ( wikipages INTEGER DEFAULT 0, in_wiki INTEGER DEFAULT 0, in_wiki_en INTEGER DEFAULT 0, - in_josm INTEGER DEFAULT 0, in_potlatch INTEGER DEFAULT 0, scale_count REAL, scale_users REAL, scale_wiki REAL, - scale_josm REAL, scale_name REAL, scale1 REAL, scale2 REAL @@ -96,7 +127,6 @@ UPDATE popular_keys SET wikipages = (SELECT count(*) FROM wiki.wikipages w WHERE UPDATE popular_keys SET in_wiki=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages); UPDATE popular_keys SET in_wiki_en=1 WHERE key IN (SELECT distinct key FROM wiki.wikipages WHERE lang='en'); -UPDATE popular_keys SET in_josm=1 WHERE key IN (SELECT distinct k FROM josm.josm_style_rules); -- ============================================================================ @@ -117,11 +147,10 @@ INSERT INTO popular_metadata (keys, count_min, count_max, count_delta, users_min UPDATE popular_keys SET scale_count = CAST (count - (SELECT count_min FROM popular_metadata) AS REAL) / (SELECT count_delta FROM popular_metadata); UPDATE popular_keys SET scale_users = CAST (users - (SELECT users_min FROM popular_metadata) AS REAL) / (SELECT users_delta FROM popular_metadata); UPDATE popular_keys SET scale_wiki = CAST (wikipages AS REAL) / (SELECT max(wikipages) FROM popular_keys); -UPDATE popular_keys SET scale_josm = in_josm; UPDATE popular_keys SET scale_name = 1; UPDATE popular_keys SET scale_name = 0 WHERE key LIKE '%:%'; -UPDATE popular_keys SET scale1 = 10 * scale_count + 8 * scale_users + 2 * scale_wiki + 1 * scale_josm + 2 * scale_name; +UPDATE popular_keys SET scale1 = 10 * scale_count + 8 * scale_users + 2 * scale_wiki + 2 * scale_name; -- ============================================================================ @@ -151,16 +180,5 @@ UPDATE suggestions SET score = count * (1+in_wiki); -- ============================================================================ --- temporary hack to pull over JOSM data from old JOSM format into new projects format - -INSERT INTO projects.projects (id, json_url, status, name, description) VALUES ('josm', '', 'OK', 'JOSM Editor', 'JOSM offline OSM Editor'); - -INSERT INTO projects.project_tags (project_id, key, value, on_node, on_way, on_relation, on_area, icon_url) SELECT 'josm', k, v, 1, 0, 0, 0, '/api/4/josm/style/image?style=standard&image=' || icon_source FROM josm.josm_style_rules WHERE icon_source IS NOT NULL; --- INSERT INTO projects.project_tags (project_id, key, value, on_node, on_way, on_relation, on_area, icon_url) SELECT 'josm', k, v, 0, 1, 0, 0, 'https://chart.googleapis.com/chart?cht=bhs&chs=16x16&chf=bg,s,' || substr(line_color, 1+instr(line_color, '#')) FROM josm.josm_style_rules WHERE line_color IS NOT NULL; --- INSERT INTO projects.project_tags (project_id, key, value, on_node, on_way, on_relation, on_area, icon_url) SELECT 'josm', k, v, 0, 0, 0, 1, 'https://chart.googleapis.com/chart?cht=bhs&chs=16x16&chf=bg,s,' || substr(area_color, 1+instr(area_color, '#')) FROM josm.josm_style_rules WHERE area_color IS NOT NULL; - - --- ============================================================================ - ANALYZE; diff --git a/sources/master/selection.sql b/sources/master/selection.sql index 053faad..a93e676 100644 --- a/sources/master/selection.sql +++ b/sources/master/selection.sql @@ -17,7 +17,6 @@ ATTACH DATABASE '__DIR__/db/taginfo-db.db' AS db; ATTACH DATABASE '__DIR__/wiki/taginfo-wiki.db' AS wiki; -ATTACH DATABASE '__DIR__/josm/taginfo-josm.db' AS josm; -- ============================================================================ diff --git a/sources/master/update.sh b/sources/master/update.sh index 85c3ee7..12c3ad4 100755 --- a/sources/master/update.sh +++ b/sources/master/update.sh @@ -58,9 +58,5 @@ fi m4 --prefix-builtins -D __DIR__=$DIR history_update.sql | sqlite3 $HISTORY_DB -# Remove old *.lst files. This is only temporary and can be removed once -# everybody has the new version which doesn't create these files any more -rm -f frequent_tags.lst interesting_relation_types.lst interesting_tags.lst - echo "`$DATECMD` Done master." diff --git a/sources/projects/parse.rb b/sources/projects/parse.rb index 7a0c270..40bd288 100755 --- a/sources/projects/parse.rb +++ b/sources/projects/parse.rb @@ -36,101 +36,183 @@ db = SQLite3::Database.new(dir + '/taginfo-projects.db') #------------------------------------------------------------------------------ -projects = db.execute("SELECT id, fetch_json FROM projects WHERE status='OK' ORDER BY id") +class Log -projects.each do |id, json| - puts " #{id}..." - error_log = '' - begin - data = JSON.parse(json, { :symbolize_names => true, :create_additions => false }) + def initialize + @messages = [] + @state = 0 + end - db.transaction do |db| - db.execute("UPDATE projects SET data_format=?, data_url=? WHERE id=?", data[:data_format], data[:data_url], id) + def fatal(message) + @messages << "FATAL: #{message}" + if @state < 3 + @state = 3 + end + end - if data[:data_updated] - db.execute("UPDATE projects SET data_updated=? WHERE id=?", data[:data_updated], id) - end + def error(message) + @messages << "ERROR: #{message}" + if @state < 2 + @state = 2 + end + end - if data[:project] - p = data[:project].clone + def warning(message) + @messages << "WARNING: #{message}" + if @state < 1 + @state = 1 + end + end - if ! p[:name] - error_log += "ERROR: MISSING project.name\n" - end + def get_log + return @messages.join("\n") + end - if ! p[:description] - error_log += "ERROR: MISSING project.description\n" - end + def get_state + if @state < 3 + return 'OK' + else + return 'PARSE_ERROR' + end + end - if ! p[:project_url] - error_log += "ERROR: MISSING project.project_url\n" - end +end - if ! p[:contact_name] - error_log += "ERROR: MISSING project.contact_name\n" - end +#------------------------------------------------------------------------------ - if ! p[:contact_email] - error_log += "ERROR: MISSING project.contact_email\n" - end +def parse_and_check(id, data, log, db) + if data[:data_format] != 1 + log.fatal "UNKNOWN OR MISSING data_format (KNOWN FORMATS: 1)." + return + end - db.execute("UPDATE projects SET name=?, description=?, project_url=?, doc_url=?, icon_url=?, contact_name=?, contact_email=? WHERE id=?", - p[:name], - p[:description], - p[:project_url], - p[:doc_url], - p[:icon_url], - p[:contact_name], - p[:contact_email], - id - ) - - p.delete(:name) - p.delete(:description) - p.delete(:project_url) - p.delete(:doc_url) - p.delete(:icon_url) - p.delete(:contact_name) - p.delete(:contact_email) - - p.each_key do |key| - error_log += "WARNING: project HAS UNKNOWN KEY '#{key}'\n" - end - else - error_log += "ERROR: MISSING project\n" - end + db.execute("UPDATE projects SET data_format=?, data_url=? WHERE id=?", data[:data_format], data[:data_url], id) + + if data[:data_updated] + if data[:data_updated].match(/^[0-9]{8}T[0-9]{6}Z$/) + db.execute("UPDATE projects SET data_updated=? WHERE id=?", data[:data_updated], id) + else + log.error "project.data_updated MUST USE FORMAT 'yyyymmddThhmmssZ'. CURRENT VALUE IGNORED." + end + end + + data.each_key do |property| + unless property.match(/^(data_format|data_updated|data_url|project|tags)$/) + log.warning "UNKNOWN PROPERTY: '#{property}'." + end + end - if data[:tags] - data[:tags].each do |d| - on = { 'node' => 0, 'way' => 0, 'relation' => 0, 'area' => 0 } - if d[:object_types] && d[:object_types].class == Array + unless data[:project] + log.fatal "MISSING project." + return + end + + p = data[:project].clone + + if ! p[:name] + log.fatal "MISSING project.name." + end + + if ! p[:description] + log.fatal "MISSING project.description." + end + + if ! p[:project_url] + log.fatal "MISSING project.project_url." + end + + if ! p[:contact_name] + log.error "MISSING project.contact_name." + end + + if ! p[:contact_email] + log.error "MISSING project.contact_email." + end + + db.execute("UPDATE projects SET name=?, description=?, project_url=?, doc_url=?, icon_url=?, contact_name=?, contact_email=? WHERE id=?", + p[:name], + p[:description], + p[:project_url], + p[:doc_url], + p[:icon_url], + p[:contact_name], + p[:contact_email], + id + ) + + p.delete(:name) + p.delete(:description) + p.delete(:project_url) + p.delete(:doc_url) + p.delete(:icon_url) + p.delete(:contact_name) + p.delete(:contact_email) + p.delete(:keywords) # ignored for future extensions + + p.each_key do |property| + log.warning "project HAS UNKNOWN PROPERTY: '#{property}'." + end + + unless data[:tags] + log.fatal "MISSING tags." + return + end + + data[:tags].each_with_index do |d, n| + if d[:key].nil? + log.error "MISSING tags.#{n}.key.\n" + else + on = { 'node' => 0, 'way' => 0, 'relation' => 0, 'area' => 0 } + if d[:object_types] + if d[:object_types].class == Array + if d[:object_types] == [] + log.warning "EMPTY tags.#{n}.object_types IS INTERPRETED AS 'ALL TYPES'. PLEASE REMOVE object_types OR ADD SOME TYPES." + on = { 'node' => 1, 'way' => 1, 'relation' => 1, 'area' => 1 } + else d[:object_types].each do |type| - on[type] = 1 + if type.match(/^(node|way|relation|area)$/) + on[type] = 1 + else + log.error "UNKNOWN OBJECT TYPE FOR #{d[:key]}: '#{type}' (ALLOWED ARE: node, way, relation, area)." + end end - else - on = { 'node' => 1, 'way' => 1, 'relation' => 1, 'area' => 1 } end - db.execute("INSERT INTO project_tags (project_id, key, value, description, doc_url, icon_url, on_node, on_way, on_relation, on_area) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", - id, - d[:key], - d[:value], - d[:description], - d[:doc_url], - d[:icon_url], - on['node'], - on['way'], - on['relation'], - on['area'], - ); + else + log.error "tags.#{n}.object_types (FOR KEY '#{d[:key]}') MUST BE AN ARRAY." end else - error_log += "ERROR: MISSING tags\n" + on = { 'node' => 1, 'way' => 1, 'relation' => 1, 'area' => 1 } end + db.execute("INSERT INTO project_tags (project_id, key, value, description, doc_url, icon_url, on_node, on_way, on_relation, on_area) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + id, + d[:key], + d[:value], + d[:description], + d[:doc_url], + d[:icon_url], + on['node'], + on['way'], + on['relation'], + on['area'], + ); + end + end +end - db.execute("UPDATE projects SET error_log=? WHERE id=?", error_log, id) +#------------------------------------------------------------------------------ + +db.execute("SELECT id, fetch_json FROM projects WHERE status='OK' ORDER BY id").each do |id, json| + puts " #{id}..." + begin + data = JSON.parse(json, { :symbolize_names => true, :create_additions => false }) + + db.transaction do |db| + log = Log.new + parse_and_check(id, data, log, db) + db.execute("UPDATE projects SET error_log=?, status=? WHERE id=?", log.get_log(), log.get_state(), id) end rescue JSON::ParserError - db.execute("UPDATE projects SET status='PARSE_ERROR' WHERE id=?", id) + db.execute("UPDATE projects SET status='JSON_ERROR' WHERE id=?", id) end end diff --git a/sources/projects/post.sql b/sources/projects/post.sql index 5fa2b5a..5a6f73c 100644 --- a/sources/projects/post.sql +++ b/sources/projects/post.sql @@ -11,6 +11,15 @@ INSERT INTO stats (key, value) SELECT 'projects_ok', count(*) FROM projects WHER INSERT INTO stats (key, value) SELECT 'project_keys', count(*) FROM project_tags WHERE value IS NULL; INSERT INTO stats (key, value) SELECT 'project_tags', count(*) FROM project_tags WHERE value IS NOT NULL; +CREATE TABLE project_counts ( + key TEXT NOT NULL, + value TEXT, + num INTEGER +); + +INSERT INTO project_counts (key, value, num) SELECT key, NULL, count(*) FROM (SELECT DISTINCT project_id, key FROM project_tags) GROUP BY key; +INSERT INTO project_counts (key, value, num) SELECT key, value, count(*) FROM (SELECT DISTINCT project_id, key, value FROM project_tags WHERE value IS NOT NULL) GROUP BY key, value; + ANALYZE; UPDATE source SET update_end=datetime('now'); diff --git a/sources/projects/project_list.txt b/sources/projects/project_list.txt index c70ab40..0085691 100644 --- a/sources/projects/project_list.txt +++ b/sources/projects/project_list.txt @@ -1,9 +1,12 @@ +bano http://bano.openstreetmap.fr/bano_taginfo.json id_editor https://raw.githubusercontent.com/openstreetmap/iD/master/data/taginfo.json +josm_main_mappaint_style http://josm.openstreetmap.de/download/taginfo/taginfo_style.json nominatim http://nominatim.openstreetmap.org/taginfo.json +osm24eu http://osm24.eu/taginfo.json +osm_inspector_public_transport_railways http://tools.geofabrik.de/osmi/osmi_pubtrans_railways.json +osm_inspector_public_transport_stops http://tools.geofabrik.de/osmi/osmi_pubtrans_stops.json osm_mug https://raw.githubusercontent.com/joto/taginfo/master/projects/osm-mug.json osmcoastline https://raw.githubusercontent.com/joto/osmcoastline/master/taginfo.json osrm https://raw.githubusercontent.com/Project-OSRM/osrm-backend/develop/taginfo.json vespucci https://osmeditor4android.googlecode.com/svn/trunk/taginfo.json waymarkedtrails http://mapstatic.waymarkedtrails.org/taginfo.json -osm_inspector_public_transport_railways http://tools.geofabrik.de/osmi/osmi_pubtrans_railways.json -osm_inspector_public_transport_stops http://tools.geofabrik.de/osmi/osmi_pubtrans_stops.json diff --git a/sources/update_all.sh b/sources/update_all.sh index 2b01dcc..dfe31c6 100755 --- a/sources/update_all.sh +++ b/sources/update_all.sh @@ -50,7 +50,7 @@ for source in $SOURCES_DOWNLOAD; do echo "=====================================" echo "Downloading $source..." mkdir -p $DIR/$source - curl --silent --output $DIR/download/taginfo-$source.db.bz2 http://taginfo.openstreetmap.org/download/taginfo-$source.db.bz2 + curl --silent --fail --output $DIR/download/taginfo-$source.db.bz2 http://taginfo.openstreetmap.org/download/taginfo-$source.db.bz2 bzcat $DIR/download/taginfo-$source.db.bz2 >$DIR/$source/taginfo-$source.db echo "Done." done diff --git a/taginfo-config-example.json b/taginfo-config-example.json index 50fa178..c2c0264 100644 --- a/taginfo-config-example.json +++ b/taginfo-config-example.json @@ -67,7 +67,7 @@ // Note that this will NOT work for the "db" source! Well, you can download it, // but it will fail later, because the database is changed by the master.sql // scripts. - "download": "languages josm wiki", + "download": "languages josm projects wiki", // These sources will be created from the actual sources. "create": "db", "db": { diff --git a/web/i18n/de.yml b/web/i18n/de.yml index 33ec493..4e6bfc8 100644 --- a/web/i18n/de.yml +++ b/web/i18n/de.yml @@ -49,8 +49,6 @@ taginfo: comparison: Key/Tag-Vergleich overview: Übersicht data_from: Daten vom - uses_data_from: | - Nutzt Daten von: data_from_description: Letzte Aktualisierung der taginfo-Datenbank instance: title: Über dieses Taginfo @@ -189,7 +187,7 @@ pages: <a class="extlink" href="http://www.bzip.org/">bzip2</a> gepackt.</p> <p>Wenn Du die Datenbanken nicht herunterladen willst, aber trotzdem - automatisiert auf die Daten zugreifen willst, kannst Du auch die + automatisiert auf die Daten zugreifen willst, kannst Du auch die <a href="/about">API</a> verwenden.</p> file: Datei packed: Gepackt diff --git a/web/i18n/en.yml b/web/i18n/en.yml index 5562e5e..f366fdd 100644 --- a/web/i18n/en.yml +++ b/web/i18n/en.yml @@ -50,8 +50,6 @@ taginfo: comparison: Key/Tag Comparison overview: Overview data_from: Data from - uses_data_from: | - Uses data from: data_from_description: Last update of taginfo database instance: title: About this taginfo site diff --git a/web/i18n/es.yml b/web/i18n/es.yml index 4052ccb..0aaec97 100644 --- a/web/i18n/es.yml +++ b/web/i18n/es.yml @@ -48,8 +48,6 @@ taginfo: comparison: Comparación de Clave/Etiqueta overview: Descripción general data_from: Datos de - uses_data_from: | - Utiliza datos de: data_from_description: Última actualización de la base de datos de taginfo instance: title: Acerca de este sitio de taginfo diff --git a/web/i18n/fr.yml b/web/i18n/fr.yml index 56de49e..21ac8f3 100644 --- a/web/i18n/fr.yml +++ b/web/i18n/fr.yml @@ -47,9 +47,7 @@ taginfo: key_combinations: Combinaisons comparison: Comparaison clé/tag overview: Vue d'ensemble - data_from: Données datant du - uses_data_from: | - Utilise des données provenant de : + data_from: Données datant du data_from_description: Dernière mise à jour de la base de données de Taginfo instance: title: À propos de ce site Taginfo @@ -367,7 +365,7 @@ reports: title: Clés contenant des espaces intro: | <p>Les tags dont la clé contient des symboles d'espacement comme l'espace, tabulation, nouvelle ligne, retour chariot, ou autre selon les alphabets. - <br/>Les espaces dans les clés des tags sont sources d'erreur, surtout s'ils sont placés au début ou la fin de la clé ; + <br/>Les espaces dans les clés des tags sont sources d'erreur, surtout s'ils sont placés au début ou la fin de la clé ; il est donc préférable d'utiliser le caractère de soulignement (<span class="char">_</span>) à la place. </p> problematic: diff --git a/web/i18n/hu.yml b/web/i18n/hu.yml index 102ea36..6d602e2 100644 --- a/web/i18n/hu.yml +++ b/web/i18n/hu.yml @@ -48,8 +48,6 @@ taginfo: comparison: Kulcs/Címke összehasonlítás overview: Áttekintés data_from: Adatok frissítve - uses_data_from: | - Felhasznált adatok dátuma: data_from_description: A taginfo adatbázis utolsó frissítése instance: title: Ezen taginfo webhely névjegye @@ -155,7 +153,7 @@ pages: intro: | <p>A taginfo az OSM címkéket különböző forrásokból gyűjti be, majd egyesíti őket a könnyű kereshetőség és felfedezés érdekében.</p> - <p> Megjegyzendő, hogy a taginfo csak megjeleníti ezeket az adatokat. + <p> Megjegyzendő, hogy a taginfo csak megjeleníti ezeket az adatokat. Ha módosítani szeretnéd, vissza kell menned a forráshoz.</p> list: title: Források listája diff --git a/web/i18n/it.yml b/web/i18n/it.yml index 4c7de31..0581d19 100644 --- a/web/i18n/it.yml +++ b/web/i18n/it.yml @@ -26,7 +26,6 @@ osm: user: Utente users: Utenti - taginfo: source: Fonte sources: Fonti @@ -45,13 +44,11 @@ taginfo: key_combinations: Combinazioni delle Chiavi overview: Panoramica data_from: Fonte Dati - uses_data_from: | - Fonte dati usati: data_from_description: Ultimo aggiornamento al database taginfo instance: title: Informazioni sul sito taginfo other: Vedere <a href="http://wiki.openstreetmap.org/wiki/Taginfo/Sites">OSM wiki</a> per gli altri siti. - + misc: values_less_than_one_percent: Nessuno dei valori con più dell' 1% empty_string: stringa vuota diff --git a/web/i18n/pl.yml b/web/i18n/pl.yml index f38c9c9..95d1426 100644 --- a/web/i18n/pl.yml +++ b/web/i18n/pl.yml @@ -47,8 +47,6 @@ taginfo: comparison: Porównanie kluczy/tagów overview: Omówienie data_from: Dane z - uses_data_from: | - Uses data from: data_from_description: Ostatnia aktualizacja bazy taginfo instance: title: O tej stronie taginfo @@ -461,7 +459,7 @@ reports: intro: | <p><a href="http://www.ietf.org/">IETF</a> definiuje <i>znaczniki języków</i> in its standard <a href="http://tools.ietf.org/html/bcp47">Znaczniki dla Identyfikacji Języków - (BCP47)</a>. Znaczniki języka zawierają jeden lub więcej <i>znaczników podrzędnych</i> opisujących język, skrypt, warianty itp. Poniższa lista pokazuje obecnie zarejestrowane podrzędne znaczniki istotne dla OSM. Więcej informacji znajdziesz w artukule + (BCP47)</a>. Znaczniki języka zawierają jeden lub więcej <i>znaczników podrzędnych</i> opisujących język, skrypt, warianty itp. Poniższa lista pokazuje obecnie zarejestrowane podrzędne znaczniki istotne dla OSM. Więcej informacji znajdziesz w artukule <a href="http://en.wikipedia.org/wiki/IETF_language_tag">Wikipedii o znacznikach językowych IETF</a> oraz na stronie <a href="http://www.langtag.net/">langtag.net</a>.</p> <p>Zwróć uwagę, że dane w tej tabeli <b>nie pochodzą</b> z bazy OpenStreetMap, diff --git a/web/i18n/pt.yml b/web/i18n/pt.yml index a0618db..317c692 100644 --- a/web/i18n/pt.yml +++ b/web/i18n/pt.yml @@ -47,8 +47,6 @@ taginfo: key_combinations: Combinações overview: Visão geral data_from: Dados de - uses_data_from: | - Usa dados de: data_from_description: Última atualização do banco de dados do taginfo instance: title: Sobre o site taginfo @@ -432,7 +430,7 @@ reports: languages: name: Linguagens intro: | - <p>OpenStreetMap é um projeto internacional. As etiquetas e as suas descrições + <p>OpenStreetMap é um projeto internacional. As etiquetas e as suas descrições podem estar em qualquer linguagem. Esta tabela lista as linguagens que o taginfo conhece e quantas páginas da wiki existem nessas linguagens documentando chaves e etiquetas, respectivamente.</p> diff --git a/web/i18n/ru.yml b/web/i18n/ru.yml index 1fc32fd..e5fba3e 100644 --- a/web/i18n/ru.yml +++ b/web/i18n/ru.yml @@ -43,11 +43,9 @@ taginfo: maps: Карты relations: Отношения combinations: Сочетания - key_combinations: Сочетания + key_combinations: Сочетания overview: Обзор data_from: Данные от - uses_data_from: | - Использует данные от: data_from_description: Дата последнего обновления базы Taginfo instance: title: Об этом сайте Taginfo @@ -90,7 +88,7 @@ help: complete_tags: Вы можете искать теги целиком values_only: Вы также можете искать только значения suggestions: | - Пока вы набираете запрос, соответствующие популярные ключи и теги предлагаются в меню быстрого поиска. Выберите нужный при помощи курсора и нажмите + Пока вы набираете запрос, соответствующие популярные ключи и теги предлагаются в меню быстрого поиска. Выберите нужный при помощи курсора и нажмите <span class="key">Enter</span>. Сразу откроется страница искомого ключа или тега. keyboard: @@ -278,7 +276,7 @@ pages: tab: Обзор title: Обзор member_type: Тип участника - member_count: Количество участников + member_count: Количество участников see_also: См. также страницу тегов roles: tab: Роли @@ -422,8 +420,8 @@ reports: tab: Обзор title: Обзор bcp47: - tab: Субтеги BCP47 - title: Субтеги BCP47 + tab: Субтеги BCP47 + title: Субтеги BCP47 filter: label: Показывает только субтеги этого типа all: Все diff --git a/web/i18n/uk.yml b/web/i18n/uk.yml index e88d47f..056cf47 100644 --- a/web/i18n/uk.yml +++ b/web/i18n/uk.yml @@ -43,11 +43,9 @@ taginfo: maps: Мапи relations: Зв’язки combinations: Сполучення - key_combinations: Сполучення + key_combinations: Сполучення overview: Огляд data_from: Дані від - uses_data_from: | - Використовує дані від: data_from_description: Дата останнього оновлення бази Taginfo instance: title: Про цей сайтTaginfo @@ -90,7 +88,7 @@ help: complete_tags: Ви можете шукати теґи цілком values_only: Ви також можете шукати лише значення suggestions: | - Поки Ви набираєте запит, відповідні популярні ключі й теґи пропонуються в меню швидкого пошуку. Виберіть потрібний за допомогою курсору та натисніть + Поки Ви набираєте запит, відповідні популярні ключі й теґи пропонуються в меню швидкого пошуку. Виберіть потрібний за допомогою курсору та натисніть <span class="key">Enter</span>. Відразу відкриється сторінка шуканого ключа або теґа. keyboard: @@ -278,7 +276,7 @@ pages: tab: Огляд title: Огляд member_type: Тип учасника - member_count: Кількість учасників + member_count: Кількість учасників see_also: Див. також сторінку теґів roles: tab: Ролі @@ -422,8 +420,8 @@ reports: tab: Огляд title: Огляд bcp47: - tab: Підтеґи BCP47 - title: Підтеґи BCP47 + tab: Підтеґи BCP47 + title: Підтеґи BCP47 filter: label: Показує лише підтеґи цього типу all: Усі diff --git a/web/i18n/vi.yml b/web/i18n/vi.yml index 62f4f0f..707eb4b 100644 --- a/web/i18n/vi.yml +++ b/web/i18n/vi.yml @@ -48,8 +48,6 @@ taginfo: comparison: So sánh chìa khóa/thẻ overview: Tóm lược data_from: Dữ liệu từ - uses_data_from: | - Lấy dữ liệu từ: data_from_description: Cơ sở dữ liệu taginfo được cập nhật lần cuối vào instance: title: Giới thiệu về trang taginfo này diff --git a/web/lib/api/v4/josm.rb b/web/lib/api/v4/josm.rb index c3b2c7e..e72e484 100644 --- a/web/lib/api/v4/josm.rb +++ b/web/lib/api/v4/josm.rb @@ -2,7 +2,8 @@ class Taginfo < Sinatra::Base api(4, 'josm/style/image', { - :description => 'Access images for map features used in JOSM.', + :superseded_by => '', + :description => 'DEPRECATED. Access images for map features used in JOSM.', :parameters => { :style => 'JOSM style (required).', :image => 'Image path (required).' @@ -21,6 +22,7 @@ class Taginfo < Sinatra::Base end api(4, 'josm/style/rules', { + :superseded_by => '', :description => 'List rules and symbols in JOSM styles.', :parameters => { :style => 'JOSM style (required).', diff --git a/web/lib/api/v4/key.rb b/web/lib/api/v4/key.rb index 83d09fd..c88092a 100644 --- a/web/lib/api/v4/key.rb +++ b/web/lib/api/v4/key.rb @@ -106,6 +106,7 @@ class Taginfo < Sinatra::Base end api(4, 'key/josm/style/rules', { + :superseded_by => '', :description => 'List rules and symbols for the given key in JOSM styles.', :parameters => { :style => 'JOSM style (required).', diff --git a/web/lib/api/v4/keys.rb b/web/lib/api/v4/keys.rb index b0072ff..723efe0 100644 --- a/web/lib/api/v4/keys.rb +++ b/web/lib/api/v4/keys.rb @@ -27,7 +27,7 @@ class Taginfo < Sinatra::Base [:values_all, :INT, 'Number of different values for this key.'], [:users_all, :INT, 'Number of users owning objects with this key.'], [:in_wiki, :BOOL, 'Has this key at least one wiki page?'], - [:in_josm, :BOOL, 'Is this key referenced in at least one JOSM style rule?'] + [:in_josm, :BOOL, 'DEPRECATED. Now always false.'] ]), :example => { :page => 1, :rp => 10, :filter => 'in_wiki', :sortname => 'key', :sortorder => 'asc' }, :ui => '/keys' @@ -135,8 +135,8 @@ class Taginfo < Sinatra::Base :count_relations_fraction => (row['count_relations'].to_f / @db.stats('relations')).round_to(4), :values_all => row['values_all'].to_i, :users_all => row['users_all'].to_i, - :in_wiki => row['in_wiki'].to_i == 1 ? true : false, - :in_josm => row['in_josm'].to_i == 1 ? true : false + :in_wiki => row['in_wiki'].to_i == 1 ? true : false, + :in_josm => false } h[:wikipages] = row['wikipages'] if row['wikipages'] h[:prevalent_values] = row['prevalent_values'][0,10] if row['prevalent_values'] diff --git a/web/lib/api/v4/tag.rb b/web/lib/api/v4/tag.rb index b6fdbbe..80bdc61 100644 --- a/web/lib/api/v4/tag.rb +++ b/web/lib/api/v4/tag.rb @@ -126,6 +126,7 @@ class Taginfo < Sinatra::Base end api(4, 'tag/josm/style/rules', { + :superseded_by => '', :description => 'List rules and symbols for the given tag in JOSM styles.', :parameters => { :style => 'JOSM style (required).', diff --git a/web/lib/reports.rb b/web/lib/reports.rb index 398e7da..0611744 100644 --- a/web/lib/reports.rb +++ b/web/lib/reports.rb @@ -52,7 +52,7 @@ class Report end Report.new 'Database statistics', :db -Report.new 'JOSM styles', :josm +Report.new 'JOSM styles' # disabled Report.new 'Characters in keys', :db Report.new 'Frequently used keys without wiki page', :db, :wiki Report.new 'Key lengths', :db diff --git a/web/lib/ui/taginfo.rb b/web/lib/ui/taginfo.rb index 702f6e7..de7b07e 100644 --- a/web/lib/ui/taginfo.rb +++ b/web/lib/ui/taginfo.rb @@ -34,15 +34,26 @@ class Taginfo < Sinatra::Base out end - get '/taginfo' do + def get_commit begin @commit = `git rev-parse HEAD`.chop + @commit_date = Time.parse(`git show -s --format=%ci HEAD`.chop).utc.iso8601 rescue @commit = 'unknown' + @commit_date = 'unknown' end + end + + get '/taginfo' do + get_commit erb :'taginfo/index' end + get '/taginfo/version' do + get_commit + "#{@commit} #{@commit_date}\n" + end + get '/taginfo/status' do content_type 'text/plain' age_in_days = DateTime.now() - DateTime.parse(@data_until) @@ -111,7 +122,7 @@ class Taginfo < Sinatra::Base @section = 'taginfo' @section_title = t.taginfo.meta - @projects = @db.select("SELECT * FROM projects.projects ORDER BY name").execute() + @projects = @db.select("SELECT * FROM projects.projects ORDER BY lower(name)").execute() erb :'taginfo/projects' end diff --git a/web/views/key.erb b/web/views/key.erb index 7b809e6..b13aaf5 100644 --- a/web/views/key.erb +++ b/web/views/key.erb @@ -40,7 +40,6 @@ <li><a href="#combinations"><%= h(t.taginfo.key_combinations) %></a></li> <li><a href="#map"><%= h(t.taginfo.map) %></a></li> <li><a href="#wiki"><%= h(t.sources.wiki.name) %></a></li> - <li><a href="#josm"><%= h(t.sources.josm.name) %></a></li> <li><a href="#projects"><%= h(t.taginfo.projects) %></a></li> </ul> <div id="overview"> @@ -102,15 +101,6 @@ <p><a class="extlink" target="_blank" rel="nofollow" href="//wiki.openstreetmap.org/w/index.php?action=edit&title=Key:<%= @key_uri %>"><%= h(t.pages.key.wiki_pages.create) %></a></p> <% end %> </div> - <div id="josm"> - <h2><%= h(t.pages.key.josm.title) %></h2> -<% if @josm_count > 0 %> - <table id="grid-josm"> - </table> -<% else %> - <p class="empty"><%= h(t.pages.key.josm.no_styles) %></p> -<% end %> - </div> <div id="projects"> <h2><%= h(t.pages.key.projects.title) %></h2> <table id="grid-projects"> @@ -120,6 +110,17 @@ <iframe id="josmiframe" name="josmiframe"></iframe> <% javascript do JS.raw(<<"JAVASCRIPT") +function redraw_chart() { + jQuery('#canvas-values').html(''); + var max_height = jQuery(window).height() - 300; + create_chart({ + key: #{ @key.to_json }, + width: 160, + height: Math.min(440, max_height), + max: #{ @count_all_values }, + data: #{ @prevalent_values.to_json() } + }); +} function page_init2() { var filter = #{ @filter_type.to_json }, key = #{ @key.to_json }; @@ -139,13 +140,9 @@ function page_init2() { }); init_tabs([key, filter, #{ r18n.locale.code.to_json }]); - create_chart({ - key: key, - width: 160, - height: 440, - max: #{ @count_all_values }, - data: #{ @prevalent_values.to_json() } - }); + + redraw_chart(); + jQuery(window).resize(redraw_chart); } JAVASCRIPT end diff --git a/web/views/reports/index.erb b/web/views/reports/index.erb index 1acd99e..d37f8ae 100644 --- a/web/views/reports/index.erb +++ b/web/views/reports/index.erb @@ -4,15 +4,9 @@ </div> <div class="box resize"> <h2><%= h(t.pages.reports.list) %></h2> - <table class="list"> - <tr><th class="tc" colspan="<%= Source.visible.size %>"/><%= t.pages.reports.data_sources %></th><th class="tl"><%= t.taginfo.report %></th></tr> - <% Report.each_visible_with_index do |report, n| c = (n%2!=0) ? ' even' : '' %> - <tr> - <% Source.visible.each do |source| %> - <td class="tc<%= c %>" width="40"><%= source.img(16, t.taginfo.uses_data_from) if report.uses_source?(source.id) %></td> - <% end %> - <td class="tl<%= c %>"><a href="<%= report.url %>"><%= t.reports[report.name].name %></a></td> - </tr> - <% end %> - </table> + <ul> +<% Report.each_visible_with_index do |report, n| c = (n%2!=0) ? ' even' : '' %> + <li><a href="<%= report.url %>"><%= t.reports[report.name].name %></a></li> +<% end %> + </ul> </div> diff --git a/web/views/tag.erb b/web/views/tag.erb index 28e7a2a..dda4594 100644 --- a/web/views/tag.erb +++ b/web/views/tag.erb @@ -39,7 +39,6 @@ <li><a href="#combinations"><%= h(t.taginfo.combinations) %></a></li> <li><a href="#map"><%= h(t.taginfo.map) %></a></li> <li><a href="#wiki"><%= h(t.sources.wiki.name) %></a></li> - <li><a href="#josm"><%= h(t.sources.josm.name) %></a></li> <li><a href="#projects"><%= h(t.taginfo.projects) %></a></li> </ul> <div id="overview"> @@ -99,15 +98,6 @@ <p><a class="extlink" target="_blank" rel="nofollow" href="//wiki.openstreetmap.org/w/index.php?action=edit&title=Tag:<%= escape(@tag) %>"><%= h(t.pages.tag.wiki_pages.create) %></a></p> <% end %> </div> - <div id="josm"> - <h2><%= h(t.pages.tag.josm.title) %></h2> -<% if @josm_count > 0 %> - <table id="grid-josm"> - </table> -<% else %> - <p class="empty"><%= h(t.pages.key.josm.no_styles) %></p> -<% end %> - </div> <div id="projects"> <h2><%= h(t.pages.tag.projects.title) %></h2> <table id="grid-projects"> diff --git a/web/views/taginfo/apidoc.erb b/web/views/taginfo/apidoc.erb index 79b71d1..a6bf9d6 100644 --- a/web/views/taginfo/apidoc.erb +++ b/web/views/taginfo/apidoc.erb @@ -8,11 +8,9 @@ <% API.paths.keys.sort.each do |version| if version > 0 API.paths[version].keys.sort.each do |path| - doc = API.paths[version][path] - if !doc.deprecated? || params[:show_deprecated] %> - <li><a href="#<%= doc.complete_path.tr('/', '_')[1,1000] %>"><%= doc.complete_path %></a><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></li> -<% end - end + doc = API.paths[version][path] %> + <li><a href="#<%= doc.complete_path.tr('/', '_')[1,1000] %>"><%= doc.complete_path %></a><%= doc.deprecated? ? " <span class='bad'>Deprecated</span>" : '' %></li> +<% end end end %> </ul> @@ -21,10 +19,9 @@ if version > 0 API.paths[version].keys.sort.each do |path| doc = API.paths[version][path] - if !doc.deprecated? || params[:show_deprecated] - hashpath = doc.complete_path.tr('/', '_')[1,1000] %> + hashpath = doc.complete_path.tr('/', '_')[1,1000] %> <a name="<%= hashpath %>"></a> -<h2><%= doc.complete_path %><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></h2> +<h2><%= doc.complete_path %><%= doc.deprecated? ? " <span class='bad'>Deprecated</span>" : '' %></h2> <table class="desc"> <tr> <th>Path:</th> @@ -69,7 +66,6 @@ </tr> <% end %> </table> -<% end - end +<% end end end %> diff --git a/web/views/taginfo/index.erb b/web/views/taginfo/index.erb index 3139642..62099f6 100644 --- a/web/views/taginfo/index.erb +++ b/web/views/taginfo/index.erb @@ -12,7 +12,7 @@ <li><a href="/taginfo/projects">Projects</a></li> </ul> <h2>Software Version</h2> - <p><%= @commit %></p> + <p><%= @commit_date %> (<a href="https://github.com/joto/taginfo/commit/<%= @commit %>"><%= @commit[0, 10] %></a>)</p> <h2>Config Settings</h2> <table class="list"> <tr><th class="tl">Variable</th><th class="tl">Setting</th></tr> diff --git a/web/views/taginfo/project_error_log.erb b/web/views/taginfo/project_error_log.erb index 420f0cd..99a9025 100644 --- a/web/views/taginfo/project_error_log.erb +++ b/web/views/taginfo/project_error_log.erb @@ -2,6 +2,7 @@ <h1 class="section">Error log for project file</h1> </div> <div class="box"> + <p><a href="/taginfo/projects">Project list</a></p> <h2><%= h(@data['name']) %></h2> <pre> <%= h(@data['error_log']) %> diff --git a/web/viewsjs/index.js.erb b/web/viewsjs/index.js.erb index 29bd4fb..28ab272 100644 --- a/web/viewsjs/index.js.erb +++ b/web/viewsjs/index.js.erb @@ -1,9 +1,9 @@ <% # This is the maximum number of tags in the tag cloud. Javascript code will only show # as many of them as will fit in the window. -tagcloud_number_of_keys = 200 -tagcloud_number_of_tags = 40 -tagcloud_number_of_relations = 40 +tagcloud_number_of_keys = 300 +tagcloud_number_of_tags = 30 +tagcloud_number_of_relations = 30 keys = @db.select("SELECT key, scale1 FROM popular_keys ORDER BY scale1 DESC LIMIT #{ tagcloud_number_of_keys }"). execute(). each_with_index{ |tag, idx| tag['pos'] = (tagcloud_number_of_keys - idx) / tagcloud_number_of_keys.to_f } diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb index 9b8698f..a8b99fa 100644 --- a/web/viewsjs/key.js.erb +++ b/web/viewsjs/key.js.erb @@ -121,30 +121,6 @@ var create_flexigrid_for = { } }); }, - josm: function(key, filter_type) { - create_flexigrid('grid-josm', { - url: '/api/4/key/josm/style/rules?style=standard&key=' + encodeURIComponent(key), - colModel: [ - { display: '<%= h(osm.value) %>', name: 'value', width: 400, sortable: true }, - { display: '<%= h(misc.icon) %>', name: 'icon', width: 40, sortable: false, align: 'center' }, - { display: '<%= h(misc.line) %>', name: 'line', width: 40, sortable: false, align: 'center' }, - { display: '<%= h(misc.area) %>', name: 'area', width: 40, sortable: false, align: 'center' } - ], - sortname: 'value', - sortorder: 'asc', - preProcess: function(data) { - data.rows = jQuery.map(data.data, function(row, i) { - return { 'cell': [ - fmt_josm_value(row.key, row.value, row.value_bool), - fmt_josm_icon('standard', row.icon), - fmt_josm_line(row.line_width, row.line_color), - fmt_josm_area(row.area_color) - ] }; - }); - return data; - } - }); - }, projects: function(key, filter_type) { create_flexigrid('grid-projects', { url: '/api/4/key/projects?key=' + encodeURIComponent(key) + '&filter=' + encodeURIComponent(filter_type), diff --git a/web/viewsjs/keys.js.erb b/web/viewsjs/keys.js.erb index 13652f2..4e4f6b1 100644 --- a/web/viewsjs/keys.js.erb +++ b/web/viewsjs/keys.js.erb @@ -13,7 +13,6 @@ function page_init() { { display: '<span title="<%= h(misc.relations_tooltip) %>"><img src="/img/types/relation.16.png" width="16" height="16" alt=""/> <%= h(osm.relations) %></span>', name: 'count_relations', width: 250, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.users_tooltip) %>"><%= h(osm.users) %></span>', name: 'users_all', width: 44, sortable: true, align: 'right' }, { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16" title="<%= h(misc.in_wiki_tooltip) %>"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, - { display: '<img src="/img/sources/josm.16.png" alt="JOSM" width="16" height="16" title="<%= h(misc.in_josm_tooltip) %>"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.values_tooltip) %>"><%= h(osm.values) %></span>', name: 'values_all', width: 70, sortable: true, align: 'right' }, { display: '<span title="<%= h(misc.prevalent_values_tooltip) %>"><%= h(misc.prevalent_values) %></span>', name: 'prevalent_values', width: 500, sortable: true } ], @@ -32,7 +31,6 @@ function page_init() { fmt_value_with_percent(row.count_relations, row.count_relations_fraction), fmt_with_ts(row.users_all), fmt_checkmark(row.in_wiki), - fmt_checkmark(row.in_josm), fmt_with_ts(row.values_all), fmt_prevalent_value_list(row.key, row.prevalent_values) ] }; diff --git a/web/viewsjs/projects.js.erb b/web/viewsjs/projects.js.erb index ac4eabf..d740aab 100644 --- a/web/viewsjs/projects.js.erb +++ b/web/viewsjs/projects.js.erb @@ -2,8 +2,8 @@ function page_init() { create_flexigrid('grid-projects', { url: '/api/4/projects/all', colModel: [ - { display: '<%= h(@trans.t.taginfo.project) %>', name: 'name', width: 300, sortable: true }, - { display: '<%= h(@trans.t.misc.description) %>', name: 'description', width: 600, sortable: false } + { display: '<%= h(@trans.t.taginfo.project) %>', name: 'name', width: 400, sortable: true }, + { display: '<%= h(@trans.t.misc.description) %>', name: 'description', width: 800, sortable: false } ], searchitems: [ { display: '<%= h(@trans.t.taginfo.project) %>/<%= h(@trans.t.misc.description) %>', name: 'name' } diff --git a/web/viewsjs/reports/characters_in_keys.js.erb b/web/viewsjs/reports/characters_in_keys.js.erb index 2ef2ccb..72061d8 100644 --- a/web/viewsjs/reports/characters_in_keys.js.erb +++ b/web/viewsjs/reports/characters_in_keys.js.erb @@ -11,7 +11,6 @@ var create_flexigrid_for = { { display: '<span title="<%= h(misc.objects_tooltip) %>"><img src="/img/types/all.16.png" width="16" height="16" alt=""/> <%= h(osm.objects) %></span>', name: 'count_all', width: 150, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.users_tooltip) %>"><%= h(osm.users) %></span>', name: 'users_all', width: 44, sortable: true, align: 'right' }, { display: '<img src="/img/sources/wiki.16.png" width="16" height="16" alt="Wiki" title="<%= h(misc.in_wiki_tooltip) %>"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, - { display: '<img src="/img/sources/josm.16.png" width="16" height="16" alt="JOSM" title="<%= h(misc.in_josm_tooltip) %>"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.values_tooltip) %>"><%= h(osm.values) %></span>', name: 'values_all', width: 70, sortable: true, align: 'right' }, { display: '<span title="<%= h(misc.prevalent_values_tooltip) %>"><%= h(misc.prevalent_values) %></span>', name: 'prevalent_values', width: 600, sortable: true } ], @@ -27,7 +26,6 @@ var create_flexigrid_for = { fmt_value_with_percent(row.count_all, row.count_all_fraction), fmt_with_ts(row.users_all), fmt_checkmark(row.in_wiki), - fmt_checkmark(row.in_josm), fmt_with_ts(row.values_all), fmt_prevalent_value_list(row.key, row.prevalent_values) ] }; @@ -44,7 +42,6 @@ var create_flexigrid_for = { { display: '<span title="<%= h(misc.objects_tooltip) %>"><img src="/img/types/all.16.png" width="16" height="16" alt=""/> <%= h(osm.objects) %></span>', name: 'count_all', width: 150, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.users_tooltip) %>"><%= h(osm.users) %></span>', name: 'users_all', width: 44, sortable: true, align: 'right' }, { display: '<img src="/img/sources/wiki.16.png" width="16" height="16" alt="Wiki" title="<%= h(misc.in_wiki_tooltip) %>"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, - { display: '<img src="/img/sources/josm.16.png" width="16" height="16" alt="JOSM" title="<%= h(misc.in_josm_tooltip) %>"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.values_tooltip) %>"><%= h(osm.values) %></span>', name: 'values_all', width: 70, sortable: true, align: 'right' }, { display: '<span title="<%= h(misc.prevalent_values_tooltip) %>"><%= h(misc.prevalent_values) %></span>', name: 'prevalent_values', width: 600, sortable: true } ], @@ -60,7 +57,6 @@ var create_flexigrid_for = { fmt_value_with_percent(row.count_all, row.count_all_fraction), fmt_with_ts(row.users_all), fmt_checkmark(row.in_wiki), - fmt_checkmark(row.in_josm), fmt_with_ts(row.values_all), fmt_prevalent_value_list(row.key, row.prevalent_values) ] }; diff --git a/web/viewsjs/reports/key_lengths.js.erb b/web/viewsjs/reports/key_lengths.js.erb index d0d691d..2c80540 100644 --- a/web/viewsjs/reports/key_lengths.js.erb +++ b/web/viewsjs/reports/key_lengths.js.erb @@ -12,7 +12,6 @@ var create_flexigrid_for = { { display: '<%= h(osm.key) %>', name: 'key', width: 180, sortable: true }, { display: '<span title="<%= h(misc.objects_tooltip) %>"><img src="/img/types/all.16.png" width="16" height="16" alt=""/> <%= h(osm.objects) %></span>', name: 'count_all', width: 200, sortable: true, align: 'center' }, { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16" title="<%= h(misc.in_wiki_tooltip) %>"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, - { display: '<img src="/img/sources/josm.16.png" alt="JOSM" width="16" height="16" title="<%= h(misc.in_josm_tooltip) %>"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, { display: '<span title="<%= h(misc.values_tooltip) %>"><%= h(osm.values) %></span>', name: 'values_all', width: 70, sortable: true, align: 'right' }, { display: '<span title="<%= h(misc.prevalent_values_tooltip) %>"><%= h(misc.prevalent_values) %></span>', name: 'prevalent_values', width: 550, sortable: true } ], @@ -28,7 +27,6 @@ var create_flexigrid_for = { link_to_key(row.key), fmt_value_with_percent(row.count_all, row.count_all_fraction), fmt_checkmark(row.in_wiki), - fmt_checkmark(row.in_josm), fmt_with_ts(row.values_all), fmt_prevalent_value_list(row.key, row.prevalent_values) ] }; diff --git a/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb b/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb index 71c102d..ba42016 100644 --- a/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb +++ b/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb @@ -7,8 +7,6 @@ function page_init() { create_flexigrid('grid-keys', { url: '/api/4/keys/all?filter=in_wiki,not_in_db&include=wikipages', colModel: [ - { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16" title="Wiki"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, - { display: '<img src="/img/sources/josm.16.png" alt="JOSM" width="16" height="16" title="JOSM"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, { display: '<%= h(osm.key) %>', name: 'key', width: 250, sortable: true, align: 'left' }, { display: '<%= h(page.wiki_pages) %>', name: 'wikipages', width: 600, sortable: false, align: 'left' } ], @@ -28,8 +26,6 @@ function page_init() { wikilinks.push(w); }); return { 'cell': [ - fmt_checkmark(row.in_wiki), - fmt_checkmark(row.in_josm), link_to_key(row.key), wikilinks.join(' • ') ] }; diff --git a/web/viewsjs/tag.js.erb b/web/viewsjs/tag.js.erb index 4616acc..3626aa3 100644 --- a/web/viewsjs/tag.js.erb +++ b/web/viewsjs/tag.js.erb @@ -101,30 +101,6 @@ var create_flexigrid_for = { } }); }, - josm: function(key, value) { - create_flexigrid('grid-josm', { - url: '/api/4/tag/josm/style/rules?style=standard&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value), - colModel: [ - { display: '<%= h(osm.value) %>', name: 'value', width: 400, sortable: false }, - { display: '<%= h(misc.icon) %>', name: 'icon', width: 40, sortable: false, align: 'center' }, - { display: '<%= h(misc.line) %>', name: 'line', width: 40, sortable: false, align: 'center' }, - { display: '<%= h(misc.area) %>', name: 'area', width: 40, sortable: false, align: 'center' } - ], - sortname: 'value', - sortorder: 'asc', - preProcess: function(data) { - data.rows = jQuery.map(data.data, function(row, i) { - return { 'cell': [ - fmt_josm_value(row.key, row.value, row.value_bool), - fmt_josm_icon('standard', row.icon), - fmt_josm_line(row.line_width, row.line_color), - fmt_josm_area(row.area_color) - ] }; - }); - return data; - } - }); - }, projects: function(key, value, filter_type) { create_flexigrid('grid-projects', { url: '/api/4/tag/projects?key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value) + '&filter=' + encodeURIComponent(filter_type), |