-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add first approach to component with a map * fix in component routes and add map js logic * make rubocop happy * add query to graphql api to show meetings and proposals, still without templates as popup * fix use of templates in awesome map * update bundle && erblint * rearrange map into a single component * update gemfiles and appraisal * fix gemfile * fix gemfile * fix gemfile * fix dummy app bndle * revert automatic gemfile version finder * normalize yml * add seeds to awesome * refactor javascript * add geolocation to proposals in assemblys when seeding * add customizable height * ask only if elements are geolocated * fix dropdown zindex * custom icon for meetings * custom icons * add pagination to api queries (#11) * add colors based on categories to markers (#12) * add colors based on categories to markers * set fillColor to --primary in case the category has no color assigned * use a Category class * add category layers * add category colors * add amendments layer * search for category names * automatic choose best language * intelligent label placement * refactor category assignation * style fixes * add specs * fix unpublished components * fix empy nodes * try to fix not found image from leaflet * Add readme info * remove custom asset * override assets * fix finall call on paginate * erblint * New Crowdin updates (#18) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * fix asset definition * fix category filter management * New Crowdin updates (#19) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * New translations en.yml (Catalan) Co-authored-by: Ivan Vergés <[email protected]> * do not hide parent categories * add menu collapse option * fix test * disable codeclimate reporter * New Crowdin updates (#21) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * New translations en.yml (Catalan) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * New translations en.yml (Catalan) Co-authored-by: Ivan Vergés <[email protected]> * New Crowdin updates (#23) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * New translations en.yml (Catalan) * New translations en.yml (French) * New translations en.yml (Spanish) * New translations en.yml (Catalan) * New translations en.yml (Catalan) * New translations en.yml (Spanish) * New translations en.yml (Spanish) Co-authored-by: Ivan Vergés <[email protected]> Co-authored-by: David Igón <[email protected]> Co-authored-by: Platoniq Bot <[email protected]>
- Loading branch information
1 parent
6498360
commit 78dd8cf
Showing
53 changed files
with
1,783 additions
and
109 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--exclude-exts=.min.css | ||
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* | ||
*= link decidim/decidim_awesome/application.css | ||
*= link decidim/decidim_awesome/awesome_map/map.css | ||
*/ |
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/decidim_awesome/application.js | ||
// = link decidim/decidim_awesome/awesome_map/map.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// = require decidim/decidim_awesome/proposals/images | ||
// = require decidim/decidim_awesome/editors/quill_editor | ||
// = require decidim/decidim_awesome/editors/markdown_view | ||
// = require decidim/decidim_awesome/forms/autosave | ||
// = require decidim/decidim_awesome/forms/autosave |
40 changes: 40 additions & 0 deletions
40
app/assets/javascripts/decidim/decidim_awesome/awesome_map/api_fetcher.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,40 @@ | ||
/* eslint-disable no-unused-vars */ | ||
|
||
class ApiFetcher { | ||
|
||
constructor(query, variables) { | ||
this.query = query; | ||
this.variables = variables; | ||
} | ||
|
||
fetch(callback) { | ||
$.ajax({ | ||
method: "POST", | ||
url: "/api", | ||
contentType: "application/json", | ||
data: JSON.stringify({ | ||
query: this.query, | ||
variables: this.variables | ||
}) | ||
}).done(function(data) { | ||
callback(data.data); | ||
}); | ||
} | ||
|
||
fetchAll (callback) { | ||
this.fetch(callback); | ||
} | ||
|
||
static findTranslation(translations) { | ||
let text, lang = document.querySelector('html').getAttribute('lang'); | ||
|
||
translations.forEach((t) => { | ||
if(t.text) { | ||
if(!text || t.locale == lang) { | ||
text = t.text | ||
} | ||
} | ||
}); | ||
return text; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
app/assets/javascripts/decidim/decidim_awesome/awesome_map/categories.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,25 @@ | ||
((exports) => { | ||
|
||
const getCategory = (category) => { | ||
let defaultCat = { | ||
color: getComputedStyle(document.documentElement).getPropertyValue('--primary'), | ||
children: () => {}, | ||
parent: null, | ||
name: null | ||
}; | ||
if(category) { | ||
let id = category.id ? parseInt(category.id, 10) : parseInt(category, 10); | ||
let cat = exports.AwesomeMap.categories.find((c) => c.id == id); | ||
if(cat) { | ||
cat.children = () => { | ||
return exports.AwesomeMap.categories.filter((c) => c.parent === cat.id ); | ||
} | ||
return cat; | ||
} | ||
} | ||
return defaultCat; | ||
}; | ||
|
||
exports.AwesomeMap = exports.AwesomeMap || {}; | ||
exports.AwesomeMap.getCategory = getCategory; | ||
})(window); |
Oops, something went wrong.