summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-03-29 21:02:13 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-03-29 21:02:40 +0200
commitefa6b41339623028c8ef7a5534946f4617d6d977 (patch)
tree1b0afb0e49e5bf668293ebdcc3aee65cfb6a9f11
parenta71fd5ac929770a536c5ac8ed44a7da95ce1bc93 (diff)
downloadChimère - projet de référence-efa6b41339623028c8ef7a5534946f4617d6d977.tar.bz2
Chimère - projet de référence-efa6b41339623028c8ef7a5534946f4617d6d977.zip
Replace welcome window by news window
-rw-r--r--chimere_example_static/chimere/css/extra-styles.css4
-rw-r--r--templates/chimere/blocks/actions.html2
-rw-r--r--templates/chimere/blocks/news.html62
-rw-r--r--templates/chimere/main_map.html2
4 files changed, 66 insertions, 4 deletions
diff --git a/chimere_example_static/chimere/css/extra-styles.css b/chimere_example_static/chimere/css/extra-styles.css
index a099929..5a4df27 100644
--- a/chimere_example_static/chimere/css/extra-styles.css
+++ b/chimere_example_static/chimere/css/extra-styles.css
@@ -56,7 +56,7 @@ a:hover, a:focus {
color:#327E04;
}
-#welcome{
+#news{
background-color:transparent;
}
@@ -245,7 +245,7 @@ li.main_category > span.category_name:hover{
top: 125px;
}
-a#welcome_button{
+a#news_button{
padding:0 10px;
margin:0;
}
diff --git a/templates/chimere/blocks/actions.html b/templates/chimere/blocks/actions.html
index 5af5cbc..97db138 100644
--- a/templates/chimere/blocks/actions.html
+++ b/templates/chimere/blocks/actions.html
@@ -30,7 +30,7 @@
<li id='permalink-lnk'><span class='fa fa-chimere-action fa-bookmark'></span><span id='permalink'></span></li>
<li>{% routing %}</li>
<li id='news-lnk'>
- <a data-toggle='modal' data-target="#welcome" href='#' id='welcome_button'><span class='fa fa-chimere-action fa-newspaper-o'></span><span class='lbl'>{% trans "News"%}</span></a>
+ <a data-toggle='modal' data-target="#news" href='#' id='news_button'><span class='fa fa-chimere-action fa-newspaper-o'></span><span class='lbl'>{% trans "News"%}</span></a>
</li>
<li id="simple_button-lnk"><a id='simple_button' href='{% url chimere:simple_index area_name_slash %}'><span class='fa fa-chimere-action fa-simplybuilt'></span><span class='lbl'> {% trans "Simple map" %}</span></a></li>
{% endif %}
diff --git a/templates/chimere/blocks/news.html b/templates/chimere/blocks/news.html
new file mode 100644
index 0000000..68b0836
--- /dev/null
+++ b/templates/chimere/blocks/news.html
@@ -0,0 +1,62 @@
+{% load i18n sanitize chimere_tags %}
+{% if news_lst %}
+<script type='text/javascript'>
+$(function(){
+ $('#news div.media-player').jmeEmbedControls();
+ $('#news video').each(function(index){$(this).pause()});
+ $('#news audio').each(function(index){$(this).pause()});
+ {% if display %}$('#news').modal('show');{%endif%}
+});
+</script>
+
+<div class="modal fade" id="news" tabindex="-1" role="dialog" aria-labelledby="news-label" aria-hidden="true">
+ <div class="modal-dialog modal-lg">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title" id="news-label">{% trans "Upcoming events" %}</h4>
+ </div>
+ <div class="modal-body">
+ <div id='news_content'>
+ {% if welcome_message %}
+ <div id='welcome_message'>
+ {{welcome_message|safe}}
+ </div>
+ {% endif %}
+ <div class='news'>
+ {% if news_lst %}
+ {% for news in news_lst %}
+ <div class='info'>
+ {% if news.title %}
+ <h3>{{news.title}} &ndash; {{ news.date }}</h3>
+ <p>{{news.content|safe}}</p>
+ {% else %}
+ <h3>{{news.name}} &ndash; {{ news.start_date }}{% if news.end_date %} - {{ news.end_date }}{% endif %}</h3>
+ {% if news.default_pictures or news.default_pictures or news.default_multimedia_items%}
+ <div class='small-gallery'>
+ {% for picture in news.default_pictures %}
+ {% multimedia_render picture %}
+ {%endfor%}
+ {% for multimedia_item in news.default_multimedia_items %}
+ {% multimedia_render multimedia_item %}
+ {%endfor%}
+ </div>
+ {%endif%}
+ {% if news.description %}
+ <p class='description'>{{news.description|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td th tr"|safe}}</p>
+ {% endif %}
+ {% for property in news.getProperties %}
+ <p class='{{news.propertymodel.getNamedId}}'>{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td th tr"|safe }}</p>
+ {% endfor %}
+ <p class='marker_link'><a href='{% get_tinyfied_url news area_name %}'>{% trans "See it on the map"%}</a></p>
+ {% endif %}
+ </div>
+ {%endfor%}
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endif %}
diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html
index 5a9189d..4f9b1c1 100644
--- a/templates/chimere/main_map.html
+++ b/templates/chimere/main_map.html
@@ -12,7 +12,7 @@
{% endblock %}
{% block message_edit %}{% endblock %}
{% block sidebar %}
-{% display_welcome %}
+{% display_news %}
<div class='show-hide-panel' id='hide-panel'><span class='fa fa-arrow-circle-left'></span></div>
<div class='show-hide-panel' id='show-panel'><span class='fa fa-arrow-circle-right'></span></div>
<div id='panel' class='navbar-default'>