Commit 5a69cfd8fbd60407dfcbff4597a7764150a20b01
Merge branch 'master' of http://service.routetopa.eu:7480/WebCompDev/COMPONENTS
Showing
4 changed files
with
174 additions
and
52 deletions
controllets/dataset-table-controllet/dataset-table-controllet.html
| @@ -239,7 +239,7 @@ | @@ -239,7 +239,7 @@ | ||
| 239 | <div id="header"> | 239 | <div id="header"> |
| 240 | <span id="selected_data"></span> | 240 | <span id="selected_data"></span> |
| 241 | <div style="float: right; right: 10px"> | 241 | <div style="float: right; right: 10px"> |
| 242 | - <paper-checkbox checked on-change="showAll"><span id="suggested_datasets">Last Version</span></paper-checkbox> | 242 | + <paper-checkbox checked on-change="showAll"><span id="suggested_datasets">{{_tr("last_version")}}</span></paper-checkbox> |
| 243 | </div> | 243 | </div> |
| 244 | </div> | 244 | </div> |
| 245 | 245 | ||
| @@ -248,12 +248,12 @@ | @@ -248,12 +248,12 @@ | ||
| 248 | <tr> | 248 | <tr> |
| 249 | <template is="dom-repeat" items="{{fields}}"> | 249 | <template is="dom-repeat" items="{{fields}}"> |
| 250 | <th id="id_{{index}}"> | 250 | <th id="id_{{index}}"> |
| 251 | - {{item.name}} | 251 | + {{_tr(item.name)}} |
| 252 | <paper-icon-button id="{{index}}" class="order" on-click="_order" icon="unfold-more"></paper-icon-button> | 252 | <paper-icon-button id="{{index}}" class="order" on-click="_order" icon="unfold-more"></paper-icon-button> |
| 253 | </th> | 253 | </th> |
| 254 | </template> | 254 | </template> |
| 255 | <th> | 255 | <th> |
| 256 | - TOOLS | 256 | + {{_tr("TOOLS")}} |
| 257 | </th> | 257 | </th> |
| 258 | </tr> | 258 | </tr> |
| 259 | <template is="dom-repeat" items="{{shownData}}"> | 259 | <template is="dom-repeat" items="{{shownData}}"> |
| @@ -275,10 +275,10 @@ | @@ -275,10 +275,10 @@ | ||
| 275 | </template> | 275 | </template> |
| 276 | </template> | 276 | </template> |
| 277 | <td> | 277 | <td> |
| 278 | - <paper-icon-button title="Open" room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="open-in-new" on-click="_onOpenDatasetClick"></paper-icon-button> | ||
| 279 | - <paper-icon-button title="Download as CSV" room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="file-download" on-click="_onDownloadDatasetClick"></paper-icon-button> | ||
| 280 | - <paper-icon-button title="Copy link" room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="content-copy" on-click="_onCopyDatasetClick"></paper-icon-button> | ||
| 281 | - <paper-icon-button title="Download docs" room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="description" on-click="_onDownloadInfoClick"></paper-icon-button> | 278 | + <paper-icon-button title='{{_tr("open")}}' room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="open-in-new" on-click="_onOpenDatasetClick"></paper-icon-button> |
| 279 | + <paper-icon-button title='{{_tr("download_csv")}}' room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="file-download" on-click="_onDownloadDatasetClick"></paper-icon-button> | ||
| 280 | + <paper-icon-button title='{{_tr("copy_link")}}' room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="content-copy" on-click="_onCopyDatasetClick"></paper-icon-button> | ||
| 281 | + <paper-icon-button title='{{_tr("download_docs")}}' room_id$="{{item.ID}}" version$="{{item.VER}}" class="tools" icon="description" on-click="_onDownloadInfoClick"></paper-icon-button> | ||
| 282 | </td> | 282 | </td> |
| 283 | </tr> | 283 | </tr> |
| 284 | </template> | 284 | </template> |
| @@ -341,12 +341,18 @@ | @@ -341,12 +341,18 @@ | ||
| 341 | type : String, | 341 | type : String, |
| 342 | value : undefined, | 342 | value : undefined, |
| 343 | observer : '_filter' | 343 | observer : '_filter' |
| 344 | + }, | ||
| 345 | + | ||
| 346 | + localization : { | ||
| 347 | + type : String, | ||
| 348 | + value : "en" | ||
| 344 | } | 349 | } |
| 345 | 350 | ||
| 346 | }, | 351 | }, |
| 347 | 352 | ||
| 348 | ready : function() { | 353 | ready : function() { |
| 349 | this.step = 10; | 354 | this.step = 10; |
| 355 | + ln["localization"] = this.attributes["localization"].value; | ||
| 350 | }, | 356 | }, |
| 351 | 357 | ||
| 352 | attached : function(){ | 358 | attached : function(){ |
| @@ -373,6 +379,10 @@ | @@ -373,6 +379,10 @@ | ||
| 373 | this.$.filter.setAttribute("label", ln["search_" + ln["localization"]]); | 379 | this.$.filter.setAttribute("label", ln["search_" + ln["localization"]]); |
| 374 | }, | 380 | }, |
| 375 | 381 | ||
| 382 | + _tr: function(key) { | ||
| 383 | + return ln[key +"_"+ this.attributes["localization"].value]; | ||
| 384 | + }, | ||
| 385 | + | ||
| 376 | _type : function() {return ln["type_" + ln["localization"]];}, | 386 | _type : function() {return ln["type_" + ln["localization"]];}, |
| 377 | _warning : function() {return ln["warning_" + ln["localization"]];}, | 387 | _warning : function() {return ln["warning_" + ln["localization"]];}, |
| 378 | 388 |
controllets/document-card-controllet/spreadsheet-card-controllet.html
datalets/base-datalet/base-datalet.html
| @@ -348,16 +348,75 @@ Example : | @@ -348,16 +348,75 @@ Example : | ||
| 348 | }, | 348 | }, |
| 349 | 349 | ||
| 350 | exportRTF: function () { | 350 | exportRTF: function () { |
| 351 | + | ||
| 352 | + var t = this; | ||
| 351 | var parent = this.parentElement; | 353 | var parent = this.parentElement; |
| 352 | while(!parent.hasAttribute("data-url")) | 354 | while(!parent.hasAttribute("data-url")) |
| 353 | parent = parent.parentElement; | 355 | parent = parent.parentElement; |
| 354 | 356 | ||
| 357 | + var post_id = parent.parentElement.id.match(/\d+/); post_id = post_id ? post_id[0] : ""; | ||
| 358 | + var datalet_id = $(parent).parents().eq(3).attr("datalet-id") ? $(parent).parents().eq(3).attr("datalet-id") : ""; | ||
| 359 | + var isPublicRoom = (typeof SPODPUBLICROOM != 'undefined') ? true : false; | ||
| 355 | 360 | ||
| 356 | var svg = $(parent).find(".highcharts-container"); | 361 | var svg = $(parent).find(".highcharts-container"); |
| 357 | svg = $(svg[0]).html(); | 362 | svg = $(svg[0]).html(); |
| 358 | 363 | ||
| 359 | var xhr = new XMLHttpRequest(); | 364 | var xhr = new XMLHttpRequest(); |
| 360 | 365 | ||
| 366 | + $.ajax({ | ||
| 367 | + url: ODE.get_datalet_info, | ||
| 368 | + data: {"post_id" : post_id, "datalet_id" : datalet_id, "is_public_room" : isPublicRoom}, | ||
| 369 | + dataType: "json", | ||
| 370 | + success: function(e){ | ||
| 371 | + xhr.open('POST', 'http://172.16.15.77/DEEalerProvider/DEEP/export/export-datalet-as-rtf', true); | ||
| 372 | + //xhr.open('POST', 'http://stage.routetopa.eu/deep/DEEP/export/export-datalet-as-rtf', true); | ||
| 373 | + //xhr.open('POST', 'http://deep.routetopa.eu/deep_1_5/DEEP/export/export-datalet-as-rtf', true); | ||
| 374 | + xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
| 375 | + | ||
| 376 | + var post = 'svg_data=' + window.encodeURIComponent(svg) + '&datalet=' + parent.is + '&dataset=' + t.$.base_datalet_link.getAttribute("href"); | ||
| 377 | + post += '&user=' + e.user + '×tamp=' + e.timestamp + '&comment=' + (e.comment ? e.comment : ""); | ||
| 378 | + | ||
| 379 | + xhr.responseType = 'blob'; | ||
| 380 | + | ||
| 381 | + //OpenDataSoft check | ||
| 382 | + if(t.dataUrl.indexOf("/records/") > -1) | ||
| 383 | + { | ||
| 384 | + var urlSource = t.dataUrl.split("/")[0] + "//" + t.dataUrl.split("/")[2]; | ||
| 385 | + | ||
| 386 | + var i; | ||
| 387 | + if(t.dataUrl.indexOf("&") > -1) | ||
| 388 | + i = t.dataUrl.indexOf("&"); | ||
| 389 | + else | ||
| 390 | + i = t.dataUrl.length; | ||
| 391 | + | ||
| 392 | + $.ajax({ | ||
| 393 | + url: urlSource + "/api/dataset/1.0/" + t.dataUrl.substring(t.dataUrl.indexOf("=")+1, i), | ||
| 394 | + dataType: "json", | ||
| 395 | + success: function(e){ | ||
| 396 | + post += '&name=' + e.metas.title + '&description=' + e.metas.description + '&created=' + e.metas.data_processed + '&lastModified=' + e.metas.modified; | ||
| 397 | + xhr.send(post); | ||
| 398 | + } | ||
| 399 | + }); | ||
| 400 | + } | ||
| 401 | + else if(t.dataUrl.indexOf("datastore_search?resource_id") > -1 ) | ||
| 402 | + { | ||
| 403 | + $.ajax({ | ||
| 404 | + url: t.dataUrl.replace("datastore_search?resource_id", "resource_show?id"), | ||
| 405 | + dataType: "json", | ||
| 406 | + success: function(e){ | ||
| 407 | + post += '&name=' + e.result.name + '&description=' + e.result.description + '&created=' + e.result.created + '&format=' + e.result.format + '&lastModified=' + e.result.last_modified; | ||
| 408 | + xhr.send(post); | ||
| 409 | + } | ||
| 410 | + }); | ||
| 411 | + } | ||
| 412 | + else | ||
| 413 | + { | ||
| 414 | + xhr.send(post); | ||
| 415 | + } | ||
| 416 | + | ||
| 417 | + } | ||
| 418 | + }); | ||
| 419 | + | ||
| 361 | xhr.onreadystatechange = function(){ | 420 | xhr.onreadystatechange = function(){ |
| 362 | if (this.readyState == 4 && this.status == 200){ | 421 | if (this.readyState == 4 && this.status == 200){ |
| 363 | var blob = new Blob([this.response], {type:'octet/stream'}); | 422 | var blob = new Blob([this.response], {type:'octet/stream'}); |
| @@ -370,51 +429,6 @@ Example : | @@ -370,51 +429,6 @@ Example : | ||
| 370 | //window.URL.revokeObjectURL(downloadUrl); | 429 | //window.URL.revokeObjectURL(downloadUrl); |
| 371 | } | 430 | } |
| 372 | }; | 431 | }; |
| 373 | - | ||
| 374 | - //xhr.open('POST', 'http://172.16.15.77/DEEalerProvider/DEEP/export/export-datalet-as-rtf', true); | ||
| 375 | - //xhr.open('POST', 'http://stage.routetopa.eu/deep/DEEP/export/export-datalet-as-rtf', true); | ||
| 376 | - xhr.open('POST', 'http://deep.routetopa.eu/deep_1_5/DEEP/export/export-datalet-as-rtf', true); | ||
| 377 | - xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
| 378 | - | ||
| 379 | - var post = 'svg_data=' + window.encodeURIComponent(svg) + '&datalet=' + parent.is + '&dataset=' + this.$.base_datalet_link.getAttribute("href"); | ||
| 380 | - xhr.responseType = 'blob'; | ||
| 381 | - | ||
| 382 | - //OpenDataSoft check | ||
| 383 | - if(this.dataUrl.indexOf("/records/") > -1 ) | ||
| 384 | - { | ||
| 385 | - var urlSource = this.dataUrl.split("/")[0] + "//" + this.dataUrl.split("/")[2]; | ||
| 386 | - | ||
| 387 | - var i; | ||
| 388 | - if(this.dataUrl.indexOf("&") > -1) | ||
| 389 | - i = this.dataUrl.indexOf("&"); | ||
| 390 | - else | ||
| 391 | - i = this.dataUrl.length; | ||
| 392 | - | ||
| 393 | - $.ajax({ | ||
| 394 | - url: urlSource + "/api/dataset/1.0/" + this.dataUrl.substring(this.dataUrl.indexOf("=")+1, i), | ||
| 395 | - dataType: "json", | ||
| 396 | - success: function(e){ | ||
| 397 | - post += '&name=' + e.metas.title + '&description=' + e.metas.description + '&created=' + e.metas.data_processed + '&lastModified=' + e.metas.modified; | ||
| 398 | - xhr.send(post); | ||
| 399 | - } | ||
| 400 | - }); | ||
| 401 | - } | ||
| 402 | - else if(this.dataUrl.indexOf("datastore_search?resource_id") > -1 ) | ||
| 403 | - { | ||
| 404 | - $.ajax({ | ||
| 405 | - url: this.dataUrl.replace("datastore_search?resource_id", "resource_show?id"), | ||
| 406 | - dataType: "json", | ||
| 407 | - success: function(e){ | ||
| 408 | - post += '&name=' + e.result.name + '&description=' + e.result.description + '&created=' + e.result.created + '&format=' + e.result.format + '&lastModified=' + e.result.last_modified; | ||
| 409 | - xhr.send(post); | ||
| 410 | - } | ||
| 411 | - }); | ||
| 412 | - } | ||
| 413 | - else | ||
| 414 | - { | ||
| 415 | - xhr.send(post); | ||
| 416 | - } | ||
| 417 | - | ||
| 418 | }, | 432 | }, |
| 419 | 433 | ||
| 420 | importToMySpace: function() { | 434 | importToMySpace: function() { |
locales/dataset_table_ln.js
0 โ 100644
| 1 | +var ln = []; | ||
| 2 | + | ||
| 3 | +ln["localization"] = "en"; | ||
| 4 | + | ||
| 5 | +/******** EN ********/ | ||
| 6 | + | ||
| 7 | +//data-table | ||
| 8 | +ln["selectedData_en"] = "DATASET"; | ||
| 9 | +ln["rows_en"] = "rows"; | ||
| 10 | +ln["type_en"] = "TYPE"; | ||
| 11 | +ln["warning_en"] = "WARNING"; | ||
| 12 | +ln["showing_en"] = "Showing"; | ||
| 13 | +ln["to_en"] = "to"; | ||
| 14 | +ln["of_en"] = "of"; | ||
| 15 | +ln["search_en"] = "Search"; | ||
| 16 | +ln["VER_en"] = "VER"; | ||
| 17 | +ln["USER_en"] = "USER"; | ||
| 18 | +ln["NAME_en"] = "NAME"; | ||
| 19 | +ln["DATA_en"] = "DATA"; | ||
| 20 | +ln["DESCRIPTION_en"] = "DESCRIPTION"; | ||
| 21 | +ln["TOOLS_en"] = "TOOLS"; | ||
| 22 | +ln["last_version_en"] = "Last version"; | ||
| 23 | +ln["open_en"] = "Open"; | ||
| 24 | +ln["download_csv_en"] = "Download as CSV"; | ||
| 25 | +ln["copy_link_en"] = "Copy link"; | ||
| 26 | +ln["download_docs_en"] = "Download docs"; | ||
| 27 | + | ||
| 28 | +/******** IT ********/ | ||
| 29 | + | ||
| 30 | +ln["selectedData_it"] = "DATASET"; | ||
| 31 | +ln["rows_it"] = "righe"; | ||
| 32 | +ln["type_it"] = "TIPO"; | ||
| 33 | +ln["warning_it"] = "ATTENZIONE"; | ||
| 34 | +ln["showing_it"] = "Visualizzati"; | ||
| 35 | +ln["to_it"] = "a"; | ||
| 36 | +ln["of_it"] = "di"; | ||
| 37 | +ln["search_it"] = "Cerca"; | ||
| 38 | +ln["VER_it"] = "VER"; | ||
| 39 | +ln["USER_it"] = "UTENTI"; | ||
| 40 | +ln["NAME_it"] = "NOME"; | ||
| 41 | +ln["DATA_it"] = "DATA"; | ||
| 42 | +ln["DESCRIPTION_it"] = "DESCRIZIONE"; | ||
| 43 | +ln["TOOLS_it"] = "STRUMENTI"; | ||
| 44 | +ln["last_version_it"] = "Ultima versione"; | ||
| 45 | +ln["open_it"] = "Apri"; | ||
| 46 | +ln["download_csv_it"] = "Scarica CSV"; | ||
| 47 | +ln["copy_link_it"] = "Copia link"; | ||
| 48 | +ln["download_docs_it"] = "Download documento"; | ||
| 49 | + | ||
| 50 | +/******** fr ********/ | ||
| 51 | + | ||
| 52 | +//data-table | ||
| 53 | +ln["selectedData_fr"] = "DATASET"; | ||
| 54 | +ln["rows_fr"] = "rows"; | ||
| 55 | +ln["type_fr"] = "TYPE"; | ||
| 56 | +ln["warning_fr"] = "WARNING"; | ||
| 57 | +ln["showing_fr"] = "Showing"; | ||
| 58 | +ln["to_fr"] = "to"; | ||
| 59 | +ln["of_fr"] = "of"; | ||
| 60 | +ln["search_fr"] = "Search"; | ||
| 61 | +ln["VER_fr"] = "VER"; | ||
| 62 | +ln["USER_fr"] = "USER"; | ||
| 63 | +ln["NAME_fr"] = "NAME"; | ||
| 64 | +ln["DATA_fr"] = "DATA"; | ||
| 65 | +ln["DESCRIPTION_fr"] = "DESCRIPTION"; | ||
| 66 | +ln["TOOLS_fr"] = "TOOLS"; | ||
| 67 | +ln["last_version_fr"] = "Last version"; | ||
| 68 | +ln["open_fr"] = "Open"; | ||
| 69 | +ln["download_csv_fr"] = "Download as CSV"; | ||
| 70 | +ln["copy_link_fr"] = "Copy link"; | ||
| 71 | +ln["download_docs_fr"] = "Download docs"; | ||
| 72 | + | ||
| 73 | +/******** nl ********/ | ||
| 74 | + | ||
| 75 | +//data-table | ||
| 76 | +ln["selectedData_nl"] = "DATASET"; | ||
| 77 | +ln["rows_nl"] = "rows"; | ||
| 78 | +ln["type_nl"] = "TYPE"; | ||
| 79 | +ln["warning_nl"] = "WARNING"; | ||
| 80 | +ln["showing_nl"] = "Showing"; | ||
| 81 | +ln["to_nl"] = "to"; | ||
| 82 | +ln["of_nl"] = "of"; | ||
| 83 | +ln["search_nl"] = "Search"; | ||
| 84 | +ln["VER_nl"] = "VER"; | ||
| 85 | +ln["USER_nl"] = "USER"; | ||
| 86 | +ln["NAME_nl"] = "NAME"; | ||
| 87 | +ln["DATA_nl"] = "DATA"; | ||
| 88 | +ln["DESCRIPTION_nl"] = "DESCRIPTION"; | ||
| 89 | +ln["TOOLS_nl"] = "TOOLS"; | ||
| 90 | +ln["last_version_nl"] = "Last version"; | ||
| 91 | +ln["open_nl"] = "Open"; | ||
| 92 | +ln["download_csv_nl"] = "Download as CSV"; | ||
| 93 | +ln["copy_link_nl"] = "Copy link"; | ||
| 94 | +ln["download_docs_nl"] = "Download docs"; | ||
| 0 | \ No newline at end of file | 95 | \ No newline at end of file |