Browse Source

Restoring annoucenement to be like it was before -refs BT#14739

Nicolas Ducoulombier 6 years ago
parent
commit
74847cc9c9

+ 44 - 0
main/template/rainbow/announcement/slider.tpl

@@ -0,0 +1,44 @@
+<!-- <div class="page-header">
+    <h4>{{ "SystemAnnouncements" | get_lang }}</h4>
+</div> -->
+<div id="carousel-announcement" class="carousel slide" data-ride="carousel">
+    <!-- Indicators -->
+    <ol class="carousel-indicators">
+      {% for announcement in announcements %}
+        <li data-target="#carousel-announcement" data-slide-to="{{ loop.index0 }}" {% if loop.index0 == 0 %} class="active" {% endif %}></li>
+      {% endfor %}
+    </ol>
+
+    <!-- Wrapper for slides -->
+    <div class="carousel-inner" role="listbox">
+    {% for announcement in announcements %}
+        <div class="item {% if loop.index0 == 0 %} active {% endif %}">
+<!--            <div class="carousel-caption">
+                {{ announcement.title }}
+            </div> -->
+            <div class="carousel-content">
+                {% if announcement.readMore %}
+                <div class="block-text">
+                    {{ announcement.content }}
+                    <a href="{{ _p.web }}news_list.php?id={{ announcement.id }}">{{ "More" | get_lang }}</a>
+                </div>
+                {% else %}
+                    <div class="block-image">
+                        {{ announcement.content }}
+                    </div>
+              {% endif %}
+            </div>
+        </div>
+    {% endfor %}
+    </div>
+
+    <!-- Controls -->
+    <a class="left carousel-control" href="#carousel-announcement" role="button" data-slide="prev">
+        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
+        <span class="sr-only">Previous</span>
+    </a>
+    <a class="right carousel-control" href="#carousel-announcement" role="button" data-slide="next">
+        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
+        <span class="sr-only">Next</span>
+    </a>
+</div>

+ 16 - 0
main/template/rainbow/announcement/view.tpl

@@ -0,0 +1,16 @@
+<div class="page-header">
+    <h4>{{ "SystemAnnouncements" | get_lang }}</h4>
+</div>
+
+{% if not announcement is empty %}
+    <article id="announcement-{{ announcement.id }}}">
+        <div class="page-header">
+            <h3>{{ announcement.title }}</h3>
+            {{ announcement.content }}
+        </div>
+    </article>
+{% else %}
+    <div class="alert alert-danger" role="alert">
+        {{ "NoResults" | get_lang }}
+    </div>
+{% endif %}