summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/locale/fr/LC_MESSAGES/django.po98
-rw-r--r--chimere/main/views.py16
-rw-r--r--chimere/settings.py10
-rw-r--r--chimere/static/icons/facebook.pngbin0 -> 731 bytes
-rw-r--r--chimere/static/icons/identica.pngbin0 -> 1373 bytes
-rw-r--r--chimere/static/icons/twitter.pngbin0 -> 924 bytes
-rw-r--r--chimere/static/main_map.js15
-rw-r--r--chimere/static/styles.css22
-rw-r--r--chimere/templates/detail.html9
9 files changed, 123 insertions, 47 deletions
diff --git a/chimere/locale/fr/LC_MESSAGES/django.po b/chimere/locale/fr/LC_MESSAGES/django.po
index c629c12..b6eace0 100644
--- a/chimere/locale/fr/LC_MESSAGES/django.po
+++ b/chimere/locale/fr/LC_MESSAGES/django.po
@@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 0.2\n"
-"Report-Msgid-Bugs-To: etienne@peacefrogs.net\n"
-"POT-Creation-Date: 2010-03-20 19:56+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-04-06 01:19+0200\n"
"PO-Revision-Date: 2010-03-20 20:00+0100\n"
"Last-Translator: Étienne Loks <etienne.loks@peacefrogs.net>\n"
"MIME-Version: 1.0\n"
@@ -55,18 +55,18 @@ msgstr "Courriel (optionnel) "
msgid "Object"
msgstr "Objet"
-#: main/forms.py:226 main/models.py:368
+#: main/forms.py:226 main/models.py:407
msgid "Area"
msgstr "Zone"
-#: main/models.py:36 main/models.py:49 main/models.py:70 main/models.py:83
-#: main/models.py:95 main/models.py:143 main/models.py:211 main/models.py:349
-#: main/models.py:394
+#: main/models.py:36 main/models.py:88 main/models.py:109 main/models.py:122
+#: main/models.py:134 main/models.py:182 main/models.py:250 main/models.py:388
+#: main/models.py:433
msgid "Name"
msgstr "Nom"
-#: main/models.py:37 main/models.py:71 main/models.py:96 main/models.py:149
-#: main/models.py:217 main/models.py:356 main/models.py:396
+#: main/models.py:37 main/models.py:110 main/models.py:135 main/models.py:188
+#: main/models.py:256 main/models.py:395 main/models.py:435
msgid "Available"
msgstr "Disponible"
@@ -78,123 +78,131 @@ msgstr "Date"
msgid "News"
msgstr "Nouvelle"
-#: main/models.py:53 main/models.py:60 main/models.py:100
+#: main/models.py:49
+msgid "Parameters"
+msgstr ""
+
+#: main/models.py:53
+msgid "TinyUrl"
+msgstr ""
+
+#: main/models.py:92 main/models.py:99 main/models.py:139
msgid "Color theme"
msgstr "Thème de couleur"
-#: main/models.py:58
+#: main/models.py:97
msgid "Code"
msgstr "Code"
-#: main/models.py:59 main/models.py:72 main/models.py:102 main/models.py:355
-#: main/models.py:395
+#: main/models.py:98 main/models.py:111 main/models.py:141 main/models.py:394
+#: main/models.py:434
msgid "Order"
msgstr "Ordre"
-#: main/models.py:65
+#: main/models.py:104
msgid "Color"
msgstr "Couleur"
-#: main/models.py:78 main/models.py:94 templates/edit.html:18
+#: main/models.py:117 main/models.py:133 templates/edit.html:18
#: templates/edit_route.html:17
msgid "Category"
msgstr "Catégorie"
-#: main/models.py:84 main/models.py:146 main/models.py:214
+#: main/models.py:123 main/models.py:185 main/models.py:253
#: templates/edit.html:37 templates/edit_route.html:37
msgid "Image"
msgstr "Image"
-#: main/models.py:89 main/models.py:99
+#: main/models.py:128 main/models.py:138
msgid "Icon"
msgstr "Icône"
-#: main/models.py:103
+#: main/models.py:142
msgid "Marker"
msgstr "Point d'intérêt"
-#: main/models.py:104 main/models.py:213 main/models.py:230
+#: main/models.py:143 main/models.py:252 main/models.py:269
#: templates/edit_route.html:31
msgid "Route"
msgstr "Trajet"
-#: main/models.py:105
+#: main/models.py:144
msgid "Both"
msgstr "Mixte"
-#: main/models.py:106
+#: main/models.py:145
msgid "Item type"
msgstr "Type d'élément"
-#: main/models.py:111 main/models.py:144 main/models.py:212
+#: main/models.py:150 main/models.py:183 main/models.py:251
msgid "Subcategory"
msgstr "Sous-catégorie"
-#: main/models.py:145
+#: main/models.py:184
msgid "Localisation"
msgstr "Localisation"
-#: main/models.py:148 main/models.py:216
+#: main/models.py:187 main/models.py:255
msgid "Submited"
msgstr "Soumis"
-#: main/models.py:150 main/models.py:218
+#: main/models.py:189 main/models.py:257
msgid "Disabled"
msgstr "Désactivé"
-#: main/models.py:154 main/models.py:222
+#: main/models.py:193 main/models.py:261
msgid "Status"
msgstr "État"
-#: main/models.py:162 main/models.py:418
+#: main/models.py:201 main/models.py:457
msgid "Point of interest"
msgstr "Point d'intérêt"
-#: main/models.py:350
+#: main/models.py:389
msgid "Area urn"
msgstr "Urn de la zone"
-#: main/models.py:357
+#: main/models.py:396
msgid "Upper left corner"
msgstr "Coin en haut à gauche"
-#: main/models.py:359
+#: main/models.py:398
msgid "Lower right corner"
msgstr "Coin en bas à droite"
-#: main/models.py:397
+#: main/models.py:436
msgid "Text"
msgstr "Texte"
-#: main/models.py:398
+#: main/models.py:437
msgid "Long text"
msgstr "Texte long"
-#: main/models.py:399
+#: main/models.py:438
msgid "Password"
msgstr "Mot de passe"
-#: main/models.py:403
+#: main/models.py:442
msgid "Type"
msgstr "Type"
-#: main/models.py:408 main/models.py:420
+#: main/models.py:447 main/models.py:459
msgid "Property model"
msgstr "Modèle de propriété"
-#: main/models.py:421
+#: main/models.py:460
msgid "Value"
msgstr "Valeur"
-#: main/models.py:425
+#: main/models.py:464
msgid "Property"
msgstr "Propriété"
-#: main/views.py:214
+#: main/views.py:217
msgid "Comments/request on the map"
msgstr "Commentaires/requètes sur la carte"
-#: main/views.py:217
+#: main/views.py:220
msgid ""
"Thank you for your contribution. It will be taken into account. If you have "
"left your email you may be contacted soon for more details."
@@ -203,11 +211,11 @@ msgstr ""
"laissé votre courriel vous serez peut-être contacté bientôt pour plus de "
"détails."
-#: main/views.py:221
+#: main/views.py:224
msgid "Temporary error. Renew your message later."
msgstr "Erreur temporaire. Réenvoyez votre message plus tard."
-#: main/views.py:300
+#: main/views.py:307
msgid "No category available in this area."
msgstr "Pas de catégorie disponible sur cette zone."
@@ -324,6 +332,14 @@ msgstr ""
msgid "Submit"
msgstr "Proposer"
+#: templates/detail.html:8
+msgid "Share on"
+msgstr "Partager sur"
+
+#: templates/detail.html:11
+msgid "Share"
+msgstr "Partager"
+
#: templates/edit.html:9
msgid "Add a new site"
msgstr "Ajouter un nouveau site"
@@ -348,7 +364,7 @@ msgstr "Choisissez une localisation pour ce nouveau site"
msgid "Propose"
msgstr "Proposez"
-#: templates/main_map.html:6
+#: templates/main_map.html:6 templates/main_map_simple.html:8
msgid "Topics"
msgstr "Thèmes"
diff --git a/chimere/main/views.py b/chimere/main/views.py
index f065f2c..f8c93dc 100644
--- a/chimere/main/views.py
+++ b/chimere/main/views.py
@@ -29,6 +29,7 @@ from django.shortcuts import render_to_response
from django.template import loader
from django.http import HttpResponseRedirect, HttpResponse
from django.core import serializers
+from django.utils.http import urlquote
from chimere import settings
from chimere.main.actions import actions
@@ -239,6 +240,10 @@ def getDetail(request, marker_id):
return HttpResponse('no results')
response_dct = get_base_response()
response_dct['marker'] = marker
+ response_dct['share_networks'] = settings.SHARE_NETWORKS
+ if request.method == 'GET':
+ if 'simple' in request.GET and request.GET['simple']:
+ response_dct['simple'] = True
return render_to_response('detail.html', response_dct)
def getDescriptionDetail(request, category_id):
@@ -336,7 +341,16 @@ def getTinyfiedUrl(request, area_name='', parameters=''):
if url[-1] == '/':
url = url[:-1]
url += response_dct['extra_url'] + 'ty/' + urn
- data = '{"urn": "%s", "url":"%s"}' % (urn, url)
+ text = settings.PROJECT_NAME
+ if 'current_feature' in parameters:
+ for item in parameters.split('&'):
+ if 'current_feature' in item:
+ try:
+ text = unicode(Marker.objects.get(id=item.split('=')[1]))
+ except (IndexError, Marker.DoesNotExist):
+ pass
+ data = '{"urn": "%s", "url":"%s", "text":"%s"}' % (urlquote(urn),
+ urlquote(url), urlquote(text))
return HttpResponse(data)
def redirectFromTinyURN(request, area_name='', tiny_urn=''):
diff --git a/chimere/settings.py b/chimere/settings.py
index 3281277..6afb2af 100644
--- a/chimere/settings.py
+++ b/chimere/settings.py
@@ -81,6 +81,16 @@ MEDIA_ROOT = ROOT_PATH + 'static/'
# Example: "http://media.lawrence.com"
MEDIA_URL = '/' + EXTRA_URL + 'static/'
+# share with
+SHARE_NETWORKS = (
+("Facebook", 'http://www.facebook.com/sharer.php?t=TEXT&u=URL',
+ MEDIA_URL + 'icons/facebook.png'),
+("Twitter", 'http://twitter.com/home?status=TEXT URL',
+ MEDIA_URL + 'icons/twitter.png'),
+("Identi.ca", 'http://identi.ca/index.php?action=newnotice&status_textarea=TEXT URL',
+ MEDIA_URL + 'icons/identica.png'),
+)
+
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
diff --git a/chimere/static/icons/facebook.png b/chimere/static/icons/facebook.png
new file mode 100644
index 0000000..8036b19
--- /dev/null
+++ b/chimere/static/icons/facebook.png
Binary files differ
diff --git a/chimere/static/icons/identica.png b/chimere/static/icons/identica.png
new file mode 100644
index 0000000..a9625d1
--- /dev/null
+++ b/chimere/static/icons/identica.png
Binary files differ
diff --git a/chimere/static/icons/twitter.png b/chimere/static/icons/twitter.png
new file mode 100644
index 0000000..295767a
--- /dev/null
+++ b/chimere/static/icons/twitter.png
Binary files differ
diff --git a/chimere/static/main_map.js b/chimere/static/main_map.js
index 5964aea..66ed27f 100644
--- a/chimere/static/main_map.js
+++ b/chimere/static/main_map.js
@@ -390,6 +390,7 @@ var refreshMapItems = function (evt) {
/* update current detail panel with an AJAX request */
function updateDetail(pk){
var uri = extra_url + "getDetail/" + pk;
+ if (simple){uri += "/?simple=True"}
OpenLayers.loadURL(uri, '', this, setDetail);
}
@@ -470,10 +471,14 @@ function createParams(center, zoom, layers) {
var tiny_url = '';
var redirect_url = '';
-function processTinyUrl(url){
- var params = OpenLayers.Util.getParameterString(this.createParams());
+function processTinyUrl(url, current_feature_id){
redirect_url = url;
- var uri = extra_url + "getTinyUrl/" + params;
+ var uri = extra_url + "getTinyUrl/";
+ var params = OpenLayers.Util.getParameterString(this.createParams());
+ if (current_feature_id && params.indexOf('current_feature') < 0){
+ uri += 'current_feature=' + current_feature_id + '&';
+ }
+ uri += params;
OpenLayers.loadURL(uri, '', this, getTinyfiedUrl);
}
@@ -485,7 +490,9 @@ function getTinyfiedUrl(response){
var result = json.read(response.responseText);
tiny_url = result.url;
if (!redirect_url || !tiny_url) return;
- window.open(redirect_url+tiny_url);
+ redirect_url = redirect_url.replace('URL', tiny_url);
+ redirect_url = redirect_url.replace('TEXT', result.text);
+ window.open(redirect_url);
}
}
diff --git a/chimere/static/styles.css b/chimere/static/styles.css
index 8094bba..e6618b8 100644
--- a/chimere/static/styles.css
+++ b/chimere/static/styles.css
@@ -232,6 +232,28 @@ height:90%;
width:280px;
}
+ul#share{
+list-style-type:none;
+margin:0;
+padding:0;
+}
+
+ul#share li{
+display:inline;
+line-height:22px;
+vertical-align: bottom;
+}
+
+#share a{
+text-decoration:None;
+}
+
+#share img{
+border:None;
+width:22px;
+height:22px;
+}
+
#welcome h2{
padding:10px 0;
}
diff --git a/chimere/templates/detail.html b/chimere/templates/detail.html
index 351ab4e..e387dcc 100644
--- a/chimere/templates/detail.html
+++ b/chimere/templates/detail.html
@@ -4,5 +4,12 @@
{% if marker.picture %}<img src='{{media_path}}{{marker.picture}}' alt='{{marker.name}}'/>{%endif%}
<div>{% for property in marker.getProperties %}
<p id='{{property.propertymodel.getNamedId}}'>{{ property.value|safe }}</p>
-{% endfor %}</div>
+{% endfor %}</div>{% if share_networks %}
+{% if simple %}{% trans "Share on"%}{% for share_network in share_networks %}
+<a href='{{share_network.1}}' onclick='processTinyUrl("{{share_network.1}}", {{marker.id}}); return false;'>{{share_network.0}}</a>
+{% endfor %}{%else%}
+<ul id='share'><li>{% trans "Share"%}</li>{% for share_network in share_networks %}
+<li><a href='{{share_network.1}}' onclick='processTinyUrl("{{share_network.1}}, {{marker.id}}"); return false;'><img src="{{share_network.2}}" alt="{{share_network.0}}"/></a></li>
+{% endfor %}</ul>{% endif %}
+{% endif %}
</div>