Giter Site home page Giter Site logo

opentreemap / otm-core Goto Github PK

View Code? Open in Web Editor NEW
185.0 31.0 88.0 16.88 MB

OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.

Home Page: www.opentreemap.org

License: Other

JavaScript 19.84% Python 63.33% HTML 12.35% CSS 0.12% Shell 0.03% SCSS 4.28% Jinja 0.04%

otm-core's Introduction

OTM2 open source logo

Code Health Build Status Coverage Status

OpenTreeMap 2

Questions?

Join the user mailing list and let us know: http://groups.google.com/group/opentreemap-user

Or, try our Gitter channel: Join the chat at https://gitter.im/OpenTreeMap/otm-core

Installation

For full installation instructions, see the Github wiki.

Alternatively, you can also use the otm-vagrant project to get started. While not recommended for production, otm-vagrant greatly simplifies getting a development environment for testing and contributing to OTM locally.

Environment variables

This project requires several environment variables, to provide API keys for several services.

ROLLBAR_SERVER_SIDE_ACCESS_TOKEN=....
GOOGLE_MAPS_KEY=...

ROLLBAR_SERVER_SIDE_ACCESS_TOKEN is a token for Rollbar. GOOGLE_MAPS_KEY is a browser key for the Google Maps Javascript API, which can be obtained here.

Other Repositories

This repository (ie, otm-core) is but one of a few separate repositories that together compose the OpenTreeMap project. Others include:

Additional Documentation

The REST API that provides data for the native mobile apps is documented in api.md

Deprecated Repositories

OpenTreeMap has a long history. These repositories still exist, but are deprecated and no development is happening here moving forward.

  • OpenTreeMap - Otherwise known as "OTM1", this is previous generation codebase of OpenTreeMap. It has been entirely superceded by this repository and the others listed above. However, there are some live tree map sites still running on the old OTM1 code, and so we have left it up for archival purposes.

Developer documentation

Acknowledgements

This application includes code based on django-url-tools, Copyright (c) 2013 Monwara LLC.

USDA Grant

Portions of OpenTreeMap are based upon work supported by the National Institute of Food and Agriculture, U.S. Department of Agriculture, under Agreement No. 2010-33610-20937, 2011-33610-30511, 2011-33610-30862 and 2012-33610-19997 of the Small Business Innovation Research Grants Program. Any opinions, findings, and conclusions, or recommendations expressed on the OpenTreeMap website are those of Azavea and do not necessarily reflect the view of the U.S. Department of Agriculture.

otm-core's People

Contributors

ahinz avatar andrewbt avatar balexandrowicz avatar bryant100000 avatar cgarrard avatar designmatty avatar emstellato avatar george-mcintyre avatar hectcastro avatar jwalgran avatar kdeloach avatar larrylutw avatar lederer avatar lepittenger avatar lliss avatar mauriciopasquier avatar maurizi avatar mmcfarland avatar nicoali avatar requires avatar rickmohr avatar riromu avatar robinisthebird avatar tnation14 avatar ultradiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

otm-core's Issues

Can't create new objects if a user only has pending privs

If a user can only create normal pends, then none of them will be applied! That means that if a user with only pending creates a new plot with a plot width of 5 you get:

Audit(1, CREATE NEW PLOT)
Audit(2, UPDATE PLOT #???? SET WIDTH=5)

Since the second one has no id, it can't be applied and, in fact, is tightly coupled to audit 1.

Also, if a user with sufficient WRITE DIRECT privileges approves Audit #2 but without sufficient privileges to CREATE and object how would we mark that?

URL should reference plot and tree numbers

In OTM1, http://phillytreemap.org/trees/467254/ and http://phillytreemap.org/plots/1200/ go to the same page - which is just confusing.

We need to keep the concept that a tree is linked to a planting site in order to track the history of that site over time. Maybe, users should be able to see all trees that were at a site so http://opentremap.com/philadelphia/plots/1200/trees/467254 would go to the specific tree but http://opentremap.com/philadelphia/plots/1200/ would go to a page for the plot with links to all trees that were ever at that plot.

Designers are working this into the design prototypes.

Importer doesn't update postgres id sequences

Since the objects are inserted with an id set, the primary key sequences aren't queried. For now run the following to update:

select setval('treemap_user_id_seq', (select max(id) from treemap_user));
select setval('treemap_plot_id_seq', (select max(id) from treemap_plot));
select setval('treemap_tree_id_seq', (select max(id) from treemap_tree));

treemap.js bundle is 8.3MB

vagrant@precise64:/usr/local/otm/static/js$ ls -lah treemap.js 
-rw-r--r-- 1 root root 8.3M Jul 26 21:10 treemap.js

The Chrome dev tools freeze for 5-10 seconds when you try to open treemap.js.

Storing only currency symbol does not allow for aggregating benefits over multiple instances

In PR #162 we are storing only the displayed currency symbol to identify which currency the ecobenefits-to-money conversion is happening in, which seems OK for right now.

If in the future we want to show aggregate benefits for multiple instances together, e.g. how much money do all trees in every OpenTreeMap instance save, we should save the currency used in an unambiguous way. currency symbol alone does not suffice, as multiple countries use '$' to represent their different currencies.

Instance is nullable on ReputationMetric

Do we actually want this? The comment says:
# instance is nullable because some auditables don't have instances
instance = models.ForeignKey('Instance', null=True, blank=True)

but will users ever be editing and receiving reputation points for models that aren't instance-specific?

Rename BoundaryZones model to BoundaryZoneGroup or BoundaryZoneSet

I think it's unconventional to pluralize the name of a model. If I understand correctly, this is a multipolygon and so it is a group of boundaries, we should consider putting that into the name and removing the pluralization.

From a developer perspective, if I were to get all BoundaryZones objects, would I call them BoundaryZoneses? I think if we use some of the builtin django niceties, we'll be going against the grain. We can always set the model meta option verbose_name_plural, but maybe we don't want to bother.

Can't delete a user

u.delete_with_user(u)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/otm/app/opentreemap/treemap/audit.py", line 371, in delete_with_user
    instance=self.instance,
AttributeError: 'User' object has no attribute 'instance'

URLs are not consistent

We should settle on a consistent URL pattern.

Some of the URLs end in trailing slashes: "/users/vagrant/"
Some do not: "/1/benefit/search"

If possible, I think ommitting the trailing slash looks better, as it prevents URLs with query params after the trailing slash like "/users/vagrant/?instance_id=1"

Show loading feedback when fetching eco benefits

For a large number of trees, calculating eco benefits can take seconds. When a search is triggered, the subhead and the accordion on the map page should show loading indicators which should be cleared and replaced with either content or a friendly error message.

Password reset fails

Password reset is failing to save the User model because we need to call save_with_user() rather than save(). We will be adding the concept of a 'system user' so this issue should be addressed after that is in place.

Remove ambiguous strict equal filter syntax

Currently there are two ways to encode an exact match filter

{"field": "value")

{"field": {"IS": "value")}

To keep things simple, remove the shorthand syntax so that all strict equal matches use the "IS" marcher.

Use a hash for instance id in the url conf

Should we change the url for instances so that instead of having an ID in the path, we have a string of some kind?

This can be useful because:
  1. It prevents people from poking around other instances. You can imagine people trying to test the water by looping over instance ids and hitting urls to see what kind of privileges they have. Hashstrings are harder to iterate over.
  2. It can further separate premium instances from regular instances. If you are a high paying customer, you can get www.opentreemap.org/winnipeg-trees/ but if you have a free acount you have to deal with www.opentreemap.org/sliding-snails-91x231/
    3) Heroku does this.

Prototype cleanup

Please do the following for the prototypes/markup:

General Styling Edits

  • Strip out Glyphicons from Bootstrap, replace with Fontello library. Be sure to keep a copy of the icons.html file so we have a reference of the icons available.
  • If you use SVGs anywhere (which I'd like to keep minimal and only for custom things, like the logo), either convert them to images (.pngs) or be sure to have cross-platform fallbacks.

Layout/UI

  • Do we need the full header on the login and signup pages (do they need to extend the full layout of base.html)? I think we can remove the search options from this page.
  • Let's make the signup form simpler -- check with Deb if it's necessary for us to have all of these items.
  • The static page and tree detail pages feel overloaded and crowded as 100% width. Consider adjusting these to use the responsive width container or add additional padding. The navigation on the left on the static page is problematic on smaller desktop screens.

Mobile

  • Although we're not supporting a mobile-specific version of the site, we likely want to have the mobile view look decent (or remove > 767px media queries). At this point, the site is completely unusable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.