-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split example into two models, better default styles
- Loading branch information
Showing
31 changed files
with
601 additions
and
197 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.error { | ||
color: red; | ||
clear: both; | ||
} | ||
|
||
.footer { | ||
text-align: center; | ||
font-size: 0.8em; | ||
} | ||
.footer, .footer a, .footer a:visited { | ||
color: #999; | ||
} | ||
|
||
.map { | ||
border: 1px solid #999; | ||
} | ||
.map.list-map { | ||
height: 500px; | ||
} | ||
.map.detail-map { | ||
height: 300px; | ||
} | ||
.map.edit-map { | ||
height: 400px; | ||
} |
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,11 @@ | ||
@media screen and (min-width: 60em) { | ||
.ui-mobile [data-role="page"], .ui-page { | ||
width: 80%; | ||
max-width: 60em; | ||
margin-left: auto; | ||
margin-right: auto; | ||
position: relative; | ||
border-left: 1px solid #999; | ||
border-right: 1px solid #999; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 +1,30 @@ | ||
define(['wq/app', 'wq/map', './config'], | ||
function(app, map, config) { | ||
define(['wq/app', 'wq/map', 'wq/photos', | ||
'./config', | ||
'leaflet.draw'], | ||
function(app, map, photos, config) { | ||
|
||
app.use(map); | ||
app.use(photos); | ||
|
||
config.presync = presync; | ||
config.postsync = postsync; | ||
app.init(config).then(function() { | ||
map.init(config.map); | ||
app.jqmInit(); | ||
app.prefetchAll(); | ||
}); | ||
|
||
// Sync UI | ||
function presync() { | ||
$('button.sync').html("Syncing..."); | ||
$('li a.ui-icon-minus, li a.ui-icon-alert') | ||
.removeClass('ui-icon-minus') | ||
.removeClass('ui-icon-alert') | ||
.addClass('ui-icon-refresh'); | ||
} | ||
|
||
function postsync(items) { | ||
$('button.sync').html("Sync Now"); | ||
app.syncRefresh(items); | ||
} | ||
|
||
}); |
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 @@ | ||
{ | ||
"name": "{{ project_name }} Project", | ||
"start_url": "index.html", | ||
"display": "fullscreen" | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
place_map = { | ||
'list': {'autoLayers': True}, | ||
'detail': {'autoLayers': True}, | ||
'edit': { | ||
'layers': [{ | ||
'name': 'Place Location(s)', | ||
'type': 'geojson', | ||
'url': 'places/{% templatetag openvariable %}id{% templatetag closevariable %}/edit.geojson', | ||
'geometryField': 'locations', | ||
|
||
# Leaflet.draw options | ||
'draw': { | ||
'circle': False, | ||
'marker': {}, | ||
'polygon': {}, | ||
'polyline': False, | ||
'rectangle': {}, | ||
} | ||
}] | ||
} | ||
} | ||
|
||
index_map = { | ||
'defaults': { | ||
'layers': [{ | ||
'name': 'Places', | ||
'type': 'geojson', | ||
'url': 'places.geojson', | ||
'popup': 'place', | ||
}] | ||
} | ||
} |
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,10 +1,17 @@ | ||
from wq.db import rest | ||
from wq.db.patterns import rest as patterns | ||
from .models import Example | ||
from .models import Place, Observation | ||
from .maps import place_map, index_map | ||
|
||
rest.router.register_model(Observation) | ||
|
||
rest.router.register_model( | ||
Example, | ||
serializer=patterns.IdentifiedModelSerializer | ||
Place, | ||
serializer=patterns.IdentifiedLocatedModelSerializer, | ||
map=place_map | ||
) | ||
rest.router.add_page('index', {'url': '', 'map': True}) | ||
|
||
rest.router.add_page('index', { | ||
'url': '', | ||
'map': index_map | ||
}) |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.