Commit cb1aab912b03e8839e3bf87045de7c9ef3daa0d2
1 parent
a619e8e4
Controllets update
Showing
2 changed files
with
142 additions
and
8 deletions
controllets/data-sevc-controllet/data-sevc-controllet.html
... | ... | @@ -9,6 +9,11 @@ |
9 | 9 | <link rel="import" href="../../bower_components/paper-input/paper-input.html"> |
10 | 10 | <link rel="import" href="../../bower_components/paper-input/paper-textarea.html"> |
11 | 11 | <link rel="import" href="../../bower_components/paper-button/paper-button.html"> |
12 | +<link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html"> | |
13 | +<link rel="import" href="../../bower_components/paper-tabs/paper-tab.html"> | |
14 | +<link rel="import" href="../../bower_components/iron-pages/iron-pages.html"> | |
15 | +<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html"> | |
16 | +<link rel="import" href="../../bower_components/paper-menu/paper-menu.html"> | |
12 | 17 | |
13 | 18 | <link rel="import" href="../../controllets/items-slider-controllet/items-slider-controllet.html"> |
14 | 19 | <link rel="import" href="../draggable-element-controllet/draggable-element-controllet.html"> |
... | ... | @@ -90,6 +95,17 @@ |
90 | 95 | width: 80%; |
91 | 96 | } |
92 | 97 | |
98 | + paper-dropdown-menu { | |
99 | + text-align: left; | |
100 | + margin: auto; | |
101 | + width: 100%; | |
102 | + } | |
103 | + | |
104 | + :host ::content paper-menu-button{ | |
105 | + display: block; | |
106 | + width: 100%; | |
107 | + } | |
108 | + | |
93 | 109 | #visualization_slider_area{ |
94 | 110 | position:relative; |
95 | 111 | float:left; |
... | ... | @@ -240,6 +256,25 @@ |
240 | 256 | overflow: auto; |
241 | 257 | } |
242 | 258 | |
259 | + paper-tabs, paper-toolbar { | |
260 | + background-color: var(--paper-blue-500); | |
261 | + color: #ffffff; | |
262 | + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); | |
263 | + } | |
264 | + | |
265 | + paper-toolbar paper-tabs { | |
266 | + box-shadow: none; | |
267 | + --paper-tabs-selection-bar-color : var(--google-gray-500); | |
268 | + } | |
269 | + | |
270 | + paper-tabs[noink][no-bar] paper-tab.iron-selected { | |
271 | + background-color: var(--google-gray-500); | |
272 | + } | |
273 | + | |
274 | + paper-tabs[align-bottom] { | |
275 | + box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.15); | |
276 | + } | |
277 | + | |
243 | 278 | </style> |
244 | 279 | |
245 | 280 | <iron-ajax |
... | ... | @@ -287,10 +322,32 @@ |
287 | 322 | |
288 | 323 | <neon-animatable> |
289 | 324 | |
290 | - <div class="fancy"> | |
291 | - <div class="card-content"> | |
292 | - <paper-textarea id="data_url" label="Dataset api data url" floatingLabel value="{{dataUrl}}" on-dragover="_handleDatasourceDragOver"></paper-textarea> | |
293 | - </div> | |
325 | + <div class="fancy area_container"> | |
326 | + <paper-tabs selected="{{DatasourceTabSelected}}"> | |
327 | + <paper-tab>Select data suorce</paper-tab> | |
328 | + <paper-tab>Most popular</paper-tab> | |
329 | + <paper-tab>Search</paper-tab> | |
330 | + </paper-tabs> | |
331 | + <iron-pages selected="{{DatasourceTabSelected}}"> | |
332 | + <div> | |
333 | + <div class="card-content"> | |
334 | + <paper-textarea id="data_url" label="Dataset api data url" floatingLabel value="{{dataUrl}}" on-dragover="_handleDatasourceDragOver"></paper-textarea> | |
335 | + </div> | |
336 | + | |
337 | + <div class="card-content"> | |
338 | + <paper-dropdown-menu id="datasets-sources" label="Available datasets"> | |
339 | + <paper-menu class="dropdown-content"> | |
340 | + <template is="dom-repeat" items="{{datasets}}" as="dataset" index-as="index"> | |
341 | + <paper-item id="{{index}}" on-tap="_datasourceSelected">{{dataset}}</paper-item> | |
342 | + </template> | |
343 | + </paper-menu> | |
344 | + </paper-dropdown-menu> | |
345 | + </div> | |
346 | + | |
347 | + </div> | |
348 | + <div>Under costruction</div> | |
349 | + <div>Under costruction</div> | |
350 | + </iron-pages> | |
294 | 351 | </div> |
295 | 352 | |
296 | 353 | </neon-animatable> |
... | ... | @@ -369,6 +426,60 @@ |
369 | 426 | |
370 | 427 | <script> |
371 | 428 | |
429 | + var datasetsPrato = { | |
430 | + names:[ | |
431 | + 'Consuntivo entrate 2009', | |
432 | + 'Consuntivo entrate 2010', | |
433 | + 'Consuntivo entrate 2011', | |
434 | + 'Consuntivo entrate 2012', | |
435 | + 'Consuntivo entrate 2014' | |
436 | + ], | |
437 | + urls: [ | |
438 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=07843fc3-07e1-4c66-9be4-fed43ca4a26f&limit=10000', | |
439 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=48a4db73-d3d4-4639-bbc2-9c797d0e6cda&limit=10000', | |
440 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=a14cc2fb-0c24-48d7-9370-834045797d89&limit=10000', | |
441 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fb32fcb6-5e44-4e52-b132-01c6540ddbee&limit=10000', | |
442 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=0cb600fc-19ad-4aaf-9794-1e6ea851840a&limit=10000' | |
443 | + ] | |
444 | + } | |
445 | + | |
446 | + var datasetsGroeningen = { | |
447 | + names:[ | |
448 | + 'Vestigingen register gemeente Groningen', | |
449 | + 'Woonruimte gemeente Groningen' | |
450 | + ], | |
451 | + urls: [ | |
452 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ba554c1f-02a7-4d76-b449-fb9daa1f8bfd&limit=10000', | |
453 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=af7b3916-4347-469a-8354-3c2d559bd92f&limit=10000' | |
454 | + ] | |
455 | + } | |
456 | + | |
457 | + var datasetsDublin = { | |
458 | + names:[ | |
459 | + 'SDCC Traffic Cameras', | |
460 | + 'Derelict Site Register', | |
461 | + 'Dublin City Council Commencement Notices', | |
462 | + 'Dublin City Council Planning Applications', | |
463 | + 'Dun Laoghaire-Rathdown County Council Planning Application 2008-2014', | |
464 | + 'Fingal Council Planning Applications for last 7 years', | |
465 | + 'Planning Register', | |
466 | + 'Fingal Development Plan 2011-2017 Record of Protected Structures' | |
467 | + ], | |
468 | + urls: [ | |
469 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=73e02092-85a1-434e-85fe-0c9a43aa9a52&limit=10000', | |
470 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=fcbee83e-3d3d-4303-a568-24dd33d02adc&limit=10000', | |
471 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=ee00de68-f2e4-482f-a003-3c0561351075&limit=10000', | |
472 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2f4a9d44-b52f-4c8b-a5db-d8f4a676d81e&limit=10000', | |
473 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=c479f061-9638-489d-ac55-0c68765548ff&limit=10000', | |
474 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=d29a477a-4734-43ef-8002-048c8640d441&limit=10000', | |
475 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=2b23f32d-e27e-4eef-af1e-27e05103df7d&limit=10000', | |
476 | + 'http://ckan.routetopa.eu/api/action/datastore_search?resource_id=5ea813bc-fdf9-4edb-b3b1-0142b593d5c6&limit=10000', | |
477 | + ] | |
478 | + } | |
479 | + | |
480 | + var AvailableDatasets = [datasetsPrato, datasetsGroeningen, datasetsDublin] | |
481 | + | |
482 | + | |
372 | 483 | Polymer({ |
373 | 484 | |
374 | 485 | is : 'data-sevc-controllet', |
... | ... | @@ -405,7 +516,7 @@ |
405 | 516 | */ |
406 | 517 | dataUrl : { |
407 | 518 | type : String, |
408 | - value : "http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&limit=50", | |
519 | + value : "",/*"http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&limit=50",*/ | |
409 | 520 | observer : '_dataUrlChanged' |
410 | 521 | }, |
411 | 522 | /** |
... | ... | @@ -417,7 +528,7 @@ |
417 | 528 | */ |
418 | 529 | deepUrl : { |
419 | 530 | type : String, |
420 | - value : "http://demo.ckan.org/api/action/datastore_search?resource_id=8324a4c9-66d6-47bf-a898-94237cc39b9f&limit=50" | |
531 | + value : "" | |
421 | 532 | }, |
422 | 533 | |
423 | 534 | datalet_query : { |
... | ... | @@ -438,6 +549,23 @@ |
438 | 549 | selected_fields : { |
439 | 550 | type : Array, |
440 | 551 | value : [] |
552 | + }, | |
553 | + | |
554 | + DatasourceTabSelected : { | |
555 | + type : Number, | |
556 | + value : 0 | |
557 | + }, | |
558 | + | |
559 | + datasets : | |
560 | + { | |
561 | + type : Array, | |
562 | + value : AvailableDatasets[2].names | |
563 | + }, | |
564 | + | |
565 | + datasets_urls : | |
566 | + { | |
567 | + type : Array, | |
568 | + value :AvailableDatasets[2].urls | |
441 | 569 | } |
442 | 570 | |
443 | 571 | }, |
... | ... | @@ -564,6 +692,11 @@ |
564 | 692 | this.assignToolbar(); |
565 | 693 | }, |
566 | 694 | |
695 | + _datasourceSelected : function(e){ | |
696 | + | |
697 | + this.$.data_url.value = this.datasets_urls[parseInt(e.srcElement.id)]; | |
698 | + }, | |
699 | + | |
567 | 700 | _dataUrlChanged : function(newValue, oldValue){ |
568 | 701 | this.$.data_request.generateRequest(); |
569 | 702 | }, |
... | ... |
controllets/treeview-controllet/treeview-controllet.html
... | ... | @@ -171,8 +171,9 @@ |
171 | 171 | '<div class="panel-title">' + heading + '</div>' + |
172 | 172 | '<input id="'+ heading +'" type="checkbox" class="checkbox select-all">' + |
173 | 173 | '</div>' + |
174 | - '<br>' + | |
175 | - '<div class="items-list"></div>'; | |
174 | + '<br>'; | |
175 | + /*'<div class="items-list"></div>';*/ | |
176 | + ul.innerHTML += (id.indexOf("records") != -1) ? '<div class="items-list" style="display:block;"></div>' : '<div class="items-list"></div>'; | |
176 | 177 | |
177 | 178 | return ul; |
178 | 179 | |
... | ... |