-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cell for comparative stats map and add new query in api_queries
- Loading branch information
Showing
23 changed files
with
269 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
//= link decidim/comparative_stats/graphs.js | ||
//= link decidim/comparative_stats/upcoming_events.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* | ||
*= link decidim/comparative_stats/upcoming_events.css | ||
*/ |
16 changes: 16 additions & 0 deletions
16
app/assets/javascripts/decidim/comparative_stats/upcoming_events.js.es6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//= require leaflet | ||
//= require_self | ||
|
||
$(function() { | ||
|
||
var map_object = document.getElementById('upcoming_events'); | ||
var map = L.map(map_object, { | ||
center: [41,2], | ||
zoom: 4 | ||
}); | ||
|
||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | ||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | ||
}).addTo(map); | ||
|
||
}); |
6 changes: 6 additions & 0 deletions
6
app/assets/stylesheets/decidim/comparative_stats/upcoming_events.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//= require leaflet | ||
//= require_self | ||
|
||
#upcoming_events { | ||
height: 360px; | ||
} |
12 changes: 12 additions & 0 deletions
12
...s/decidim/comparative_stats/content_blocks/participatory_processes_geocod_events/show.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<section class="extended home-section"> | ||
<div class="wrapper-home"> | ||
<div class="row column text-center"> | ||
<div class="navigation_maps"> | ||
<%= content_tag(:div, "", id: "upcoming_events", class: "map", data: { endpoints: upcoming_events }) %> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<%= javascript_include_tag "decidim/comparative_stats/upcoming_events" %> | ||
<%= stylesheet_link_tag "decidim/comparative_stats/upcoming_events" %> |
35 changes: 35 additions & 0 deletions
35
...ls/decidim/comparative_stats/content_blocks/participatory_processes_geocod_events_cell.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module ComparativeStats | ||
# This cell renders a map with participatory processes | ||
# the `model` is spected to be a collection of API endpoints | ||
# | ||
module ContentBlocks | ||
class ParticipatoryProcessesGeocodEventsCell < Decidim::ViewModel | ||
|
||
view_paths << "#{Decidim::ComparativeStats::Engine.root}/app/cells/decidim/comparative_stats/content_blocks/partipatory_processes_geocod_events" | ||
|
||
def show | ||
render :show | ||
end | ||
|
||
def endpoints | ||
Decidim::ComparativeStats::Endpoint.first | ||
end | ||
|
||
def upcoming_events | ||
events = {} | ||
data = endpoints.api.fetch_global_events.data | ||
byebug | ||
# endpoints.each do |endpoint| | ||
# endpoint.api.fetch_global_events.data.each do |item| | ||
# events[item.name] ||= {} | ||
# end | ||
# end | ||
events | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.