diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..62ce41f2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "umap/static/darline"] + path = umap/static/darline + url = git://github.com/yohanboniface/Darline.git diff --git a/fabfile.py b/fabfile.py index ce3085e0..8959a3e1 100644 --- a/fabfile.py +++ b/fabfile.py @@ -251,12 +251,13 @@ def collect_remote_statics(): remote_static_dir = '{project_dir}/{project_name}/remote_static'.format(**env) run('mkdir -p {0}'.format(remote_static_dir)) remote_repositories = { - 'leaflet': "git://github.com/Leaflet/Leaflet.git@master", + 'leaflet': "git://github.com/Leaflet/Leaflet.git@stable", 'draw': "git://github.com/Leaflet/Leaflet.draw.git@master", 'hash': "git://github.com/mlevans/leaflet-hash.git@master", 'storage': 'git://github.com/yohanboniface/Leaflet.Storage.git@master', 'edit_in_osm': 'git://github.com/yohanboniface/Leaflet.EditInOSM.git@master', 'minimap': 'git://github.com/Norkart/Leaflet-MiniMap.git@master', + 'darline': 'git://github.com/yohanboniface/Darline.git@master', } with cd(remote_static_dir): for subdir, path in remote_repositories.iteritems(): diff --git a/requirements.pip b/requirements.pip index 764af674..a18581e3 100644 --- a/requirements.pip +++ b/requirements.pip @@ -8,9 +8,7 @@ Django>=1.4 South django-leaflet-storage django_compressor -django-foundation django-social-auth GDAL git+git://github.com/yohanboniface/vectorformats.git@leafletstorage -git+git://github.com/frankban/django-endless-pagination.git hg+https://bitbucket.org/liberation/sesql \ No newline at end of file diff --git a/umap/static/darline b/umap/static/darline new file mode 160000 index 00000000..9e55949b --- /dev/null +++ b/umap/static/darline @@ -0,0 +1 @@ +Subproject commit 9e55949bb9bd818236fba1fabb591c44e0f9d1b2 diff --git a/umap/static/umap/umap.css b/umap/static/umap/umap.css index fffb5639..afe6bdbb 100644 --- a/umap/static/umap/umap.css +++ b/umap/static/umap/umap.css @@ -12,8 +12,17 @@ body.map_detail { .map_fragment { width: 100%; } -.map_list .map_fragment { - height: 200px; +.map_list .map_fragment, +.demo_map .map_fragment { + height: 210px; +} +.umap-features-list img { + width: 14px; + vertical-align: middle; + padding-right: 14px; +} +.umap-features-list li { + line-height: 21px; } /* Modals */ @@ -40,31 +49,6 @@ input:-moz-placeholder, :-moz-placeholder { color: #a5a5a5; } -/* Forms */ - -.help-text small, small.help-text { - display: block; - padding: 6px 4px; - margin-top: -13px; - margin-bottom: 12px; - background: #a5a5a5; - color: #fff; - font-size: 12px; - font-weight: bold; - -moz-border-radius-bottomleft: 2px; - -webkit-border-bottom-left-radius: 2px; - border-bottom-left-radius: 2px; - -moz-border-radius-bottomright: 2px; - -webkit-border-bottom-right-radius: 2px; - border-bottom-right-radius: 2px; -} -.formbox { - border: 1px #a5a5a5 solid; - min-height: 32px; - line-height: 32px; - padding-left: 10px; - margin-bottom: 10px; -} #storage-ui-container textarea { height: 100px; } @@ -80,29 +64,29 @@ input:-moz-placeholder, :-moz-placeholder { background-color: #970b0e; } -#style_options > * { +fieldset.toggle > * { display: none; } -#style_options .more_style_options, -#style_options legend { +fieldset.toggle .more_style_options, +fieldset.toggle legend { display: block; cursor: pointer; } -#style_options .more_style_options:before { +fieldset.toggle .more_style_options:before { content: "…"; } -#style_options legend:before { +fieldset.toggle legend:before { content: "▶"; padding-right: 5px; } -#style_options.on legend:before { +fieldset.toggle.on legend:before { content: "▼"; } -#style_options.on > * { +fieldset.toggle.on > * { display: block; } -#style_options.on .more_style_options { +fieldset.toggle.on .more_style_options { display: none; } @@ -118,9 +102,11 @@ input:-moz-placeholder, :-moz-placeholder { /* **************** */ /* Login icons */ /* **************** */ -/*.login-grid li { +.login-grid li, +.login-grid a { + display: inline-block; } -*/ + .login-grid a { border: 1px solid #e5e5e5; padding: 5px; @@ -130,7 +116,6 @@ input:-moz-placeholder, :-moz-placeholder { background-size: 92px 92px; height: 92px; width: 92px; - display: inline-block; margin-right: 10px; } .login-grid .login-github { @@ -144,4 +129,74 @@ input:-moz-placeholder, :-moz-placeholder { } .login-grid .login-openstreetmap { background-image: url("./openstreetmap.png"); +} + +/* +* Navigation +*/ +nav { + min-height: 70px; + font-family: sans-serif; + font-size: 0; + border-bottom: solid 1px #ddd; +} + +nav section, nav h1, nav ul, nav li, nav a { + display: inline-block; + font-size: 14px; + letter-spacing: -1px; + margin-bottom: 0; + font-weight: normal; +} + +nav ul li { + height: 100%; +} + +nav a { + display: inline-block; + height: 100%; + line-height: 70px; + padding: 0 14px; + margin: 0 7px 0 0; + color: #000; + text-align: center; +} + +nav a:hover, nav h1 a { + background-color: SeaGreen; +} + +nav h1 a { + font-weight: bold; +} + +nav a.logout { + font-style: italic; +} + +nav li.has-button { + padding-top: 7px; +} + +nav .branding ul, nav .branding li, +nav .branding a, nav .branding h1 { + width: 100%; +} + +nav .branding { + margin-bottom: 7px; +} + +/* **************************** */ +/* Override Leaflet.Storage */ +/* **************************** */ +body.content #storage-ui-container { +/* width: 100%; + top: 0; + right: 0; + left: 0; + bottom: inherit; + height: 30%; +*/ background-color: #fff; } \ No newline at end of file diff --git a/umap/templates/auth/user_detail.html b/umap/templates/auth/user_detail.html index d4915d56..37cf7ad6 100644 --- a/umap/templates/auth/user_detail.html +++ b/umap/templates/auth/user_detail.html @@ -1,33 +1,18 @@ -{% extends "umap/home.html" %} +{% extends "umap/content.html" %} + +{% load i18n %} {% block content %} -
-
- - - - {% include 'umap/navigation.html' %} - - -
-
- -
-
-

Browse {{ current_user }}'s maps

-
-
-
-
-
- {% if maps %} - {% include "leaflet_storage/map_list.html" %} - {% else %} -
+
+

{% blocktrans %}Browse {{ current_user }}'s maps{% endblocktrans %}

+
+
+ {% if maps %} + {% include "leaflet_storage/map_list.html" %} + {% else %} +
{{ current_user }} has not map yet. -
- {% endif %} -
-
+ {% endif %} +
{% endblock content %} diff --git a/umap/templates/base.html b/umap/templates/base.html index d3414565..6ec450e1 100644 --- a/umap/templates/base.html +++ b/umap/templates/base.html @@ -6,10 +6,15 @@ {% compress css %} - + + + + + + + + - - {% endcompress css %} - - - - - - - - - - {% endcompress js %} + {% block bottom_js %} {% endblock %}
diff --git a/umap/templates/leaflet_storage/map_detail.html b/umap/templates/leaflet_storage/map_detail.html index 2eedada4..c2be96e3 100644 --- a/umap/templates/leaflet_storage/map_detail.html +++ b/umap/templates/leaflet_storage/map_detail.html @@ -6,7 +6,6 @@ {% block extra_head %} {% compress css %} {% leaflet_storage_css %} - {% endcompress %} {% compress js %} {% leaflet_storage_js %} diff --git a/umap/templates/leaflet_storage/map_list.html b/umap/templates/leaflet_storage/map_list.html index b20a9b7a..58d3bed8 100644 --- a/umap/templates/leaflet_storage/map_list.html +++ b/umap/templates/leaflet_storage/map_list.html @@ -1,12 +1,11 @@ -{% load leaflet_storage_tags endless i18n %} - -{% paginate 5 maps %} +{% load leaflet_storage_tags umap_tags i18n %} {% for map_inst in maps %} -
+
{% map_fragment map_inst %} -
{{ map_inst.name }} — «{{ map_inst.description }}» {% trans "Cured by" %} {{ map_inst.owner }}{% trans "See this map!" %}
+
{{ map_inst.name }} — {% if map_inst.description %}«{{ map_inst.description }}» {% endif %}{% trans "Cured by" %} {{ map_inst.owner }}{% trans "See this map!" %}
{% endfor %} - -{% show_more %} \ No newline at end of file +{% if maps.has_next %} + +{% endif %} \ No newline at end of file diff --git a/umap/templates/leaflet_storage/map_update_tilelayers.html b/umap/templates/leaflet_storage/map_update_tilelayers.html index a1a6c776..c96689c7 100644 --- a/umap/templates/leaflet_storage/map_update_tilelayers.html +++ b/umap/templates/leaflet_storage/map_update_tilelayers.html @@ -2,18 +2,16 @@

{% trans "Choose your tilelayer" %}

{% csrf_token %} -
    {% for tilelayer in tilelayers %} -
  • +
  • +
{% endfor %} -
- -
+
+ \ No newline at end of file diff --git a/umap/templates/leaflet_storage/upload_form.html b/umap/templates/leaflet_storage/upload_form.html index 61b89160..0b45295e 100644 --- a/umap/templates/leaflet_storage/upload_form.html +++ b/umap/templates/leaflet_storage/upload_form.html @@ -7,30 +7,26 @@ {% endfor %} -
{% trans "Details on formats" %}
- +
+ diff --git a/umap/templates/umap/about.html b/umap/templates/umap/about.html new file mode 100644 index 00000000..56d8035f --- /dev/null +++ b/umap/templates/umap/about.html @@ -0,0 +1,5 @@ +{% extends "umap/content.html" %} + +{% block content %} + {% include "umap/about_summary.html" %} +{% endblock content %} diff --git a/umap/templates/umap/about_summary.html b/umap/templates/umap/about_summary.html new file mode 100644 index 00000000..2886b898 --- /dev/null +++ b/umap/templates/umap/about_summary.html @@ -0,0 +1,26 @@ +{% load leaflet_storage_tags i18n %} +
+
+
{% trans "What is u{Map}" %}
+

{% blocktrans %}u{Map} let you create maps with OpenStreetMap layers in a minute and embed them in your site.
This is a demo instance, you can host your own, it's open source!{% endblocktrans %} +

+
+
+
{% trans "What can you do?" %}
+ +
+ {% if demo_map %} +
+ {% map_fragment demo_map %} + Play with the demo +
+ {% endif %} +
diff --git a/umap/templates/umap/content.html b/umap/templates/umap/content.html new file mode 100644 index 00000000..8168c5f6 --- /dev/null +++ b/umap/templates/umap/content.html @@ -0,0 +1,63 @@ +{% extends "base.html" %} + +{% load leaflet_storage_tags compress i18n %} + +{% block body_class %}content{% endblock %} + +{% block extra_head %} + {% compress css %} + {% leaflet_storage_css %} + {% endcompress css %} + {% compress js %} + {% leaflet_storage_js %} + {% endcompress js %} +{% endblock %} + +{% block header %} +
+ {% include 'umap/navigation.html' %} +
+{% endblock %} + +{% block content %} +
+
+
+ +
+
+ +
+
+
+
+
+

{% trans "Last maps" %}

+ {% include "leaflet_storage/map_list.html" %} +
+ + +{% endblock content %} + +{% block bottom_js %} + {{ block.super }} + +{% endblock bottom_js %} \ No newline at end of file diff --git a/umap/templates/umap/home.html b/umap/templates/umap/home.html index 5b51a6d8..13554388 100644 --- a/umap/templates/umap/home.html +++ b/umap/templates/umap/home.html @@ -1,109 +1,16 @@ -{% extends "base.html" %} +{% extends "umap/content.html" %} {% load leaflet_storage_tags compress i18n %} -{% block extra_head %} - {% compress css %} - {% leaflet_storage_css %} - {% endcompress css %} - {% compress js %} - {% leaflet_storage_js %} - {% endcompress js %} -{% endblock %} - {% block content %} -
-
+{% if not user.is_authenticated %} + {% include "umap/about_summary.html" %} +
+{% endif %} +{% include "umap/search_bar.html" %} +
+

{% trans "Get inspired, browse maps" %}

+ {% include "leaflet_storage/map_list.html" %} +
- - - {% include 'umap/navigation.html' %} - - -
-
- - -
-
-
- - - -
-
- -
-
-

u{Map} alpha


-
{% blocktrans %}u{Map} let you create maps with OpenStreetMap layers in a minute and embed them in your site.
This is a demo instance, you can host your own, it's open source!{% endblocktrans %} -
-
-
-
{% trans "What you can do?" %}
-
    -
  1. {% trans "Choose the layers of your map" %}
  2. -
  3. {% trans "Add POIs: markers, lines, polygons..." %}
  4. -
  5. {% trans "Manage POIs colours and icons" %}
  6. -
  7. {% trans "Batch import geostructured data (GEOJson...)" %}
  8. -
  9. {% trans "Choose the licence for your data" %}
  10. -
  11. {% trans "Embed and share your map" %}
  12. -
-
- -
-
-
- - - - - -
-
-
-
-
-
-

{% trans "Browse maps" %}

-
-
-
-
-
- {% include "leaflet_storage/map_list.html" %} -
-
-
- - {% endblock content %} - -{% block bottom_js %} - - -{% endblock bottom_js %} \ No newline at end of file diff --git a/umap/templates/umap/navigation.html b/umap/templates/umap/navigation.html index 22062bcc..c9748f8b 100644 --- a/umap/templates/umap/navigation.html +++ b/umap/templates/umap/navigation.html @@ -1,25 +1,32 @@ {% load i18n %} -