diasporadiaries

a platform for writing stories with personal accounts and messages
git clone https://git.parazyd.org/diasporadiaries
Log | Files | Refs | Submodules | README | LICENSE

gallery.html (3152B)


      1   <div class="album py-5 bg-light">
      2     <div class="container">
      3       {% if filtered_stories %}
      4         {% set stor = filtered_stories %}
      5       {% else %}
      6         {% set stor = stories %}
      7       {% endif %}
      8 
      9       {% if not stor %}
     10       <p>No stories to list.</p>
     11       {% endif %}
     12 
     13       {% for i in stor %}
     14         {% if loop.index % 3 == 1 %}
     15         <div class="row">
     16         {% endif %}
     17 
     18           <div class="col-md-4">
     19             <div class="card">
     20               <div class="card-body">
     21 
     22                 <p class="card-text small">{{ i['abstract'] }}</p>
     23 
     24                 <div class="card-body">
     25                   {% if request.endpoint == 'dashboard' %}
     26                   <a href="/edit?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Edit</a>
     27                   {% if i['visible'] == 0 %}
     28                   <a href="/dashboard?approveid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Add</a>
     29                   {% else %}
     30                   <a href="/dashboard?hideid={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Hide</a>
     31                   {% endif %}
     32                   {% else %}
     33                   <a href="/view?id={{ i['id'] }}" class="btn btn-sm btn-outline-secondary">Read</a>
     34                   {% endif %}
     35 
     36                   <img style="height: 1em;" src="/static/img/flags/{{ i['embark'] }}.png" alt="{{ i['embarkname'] }}" title="{{ i['embarkname'] }}">
     37                   <span class="fa fa-anchor"></span>
     38                   <img style="height: 1em;" src="/static/img/flags/{{ i['disembark'] }}.png" alt="{{ i['disembarkname'] }}" title="{{ i['disembarkname'] }}">
     39                 </div>
     40 
     41                 <p class="text-muted text-right">
     42                   {% if i['email'] and profiles[i['email']] %}
     43                   by <a href="/profile?id={{ profiles[i['email']] }}">{{ i['name'] }}</a><br>
     44                   {% else %}
     45                   by {{ i['name'] }}<br>
     46                   {% endif %}
     47                   {{ parsetime(i['time']) }}
     48                 </p>
     49               </div>
     50             </div>
     51           </div>
     52 
     53         {% if loop.index % 3 == 0 or loop.last %}
     54         </div>
     55         {% if not loop.last %}
     56         <hr>
     57         {% endif %}
     58         {% endif %}
     59       {% endfor %}
     60     </div>
     61   </div>
     62 
     63   {% if cc %}
     64   <div class="container">
     65     <div class="countrylist-bottom">
     66       {% if request.endpoint == 'dashboard' %}
     67       <p class="lead">List by country of disembarkment:</p>
     68       <a href="/dashboard?list={{ listtype }}">
     69       {% else %}
     70       <p class="lead">List by country of embarkment:</p>
     71       <a href="/country?id={{ cc }}">
     72       {% endif %}
     73         <img style="height: 2em;" src="/static/img/flags/globe.png" alt="All around the globe" title="All around the globe">
     74       </a>
     75       {% for j in clist %}
     76       {% if request.endpoint == 'dashboard' %}
     77       <a href="/dashboard?list={{ listtype }}&to={{ j[0] }}">
     78       {% else %}
     79       <a href="/country?id={{ cc }}&from={{ j[0] }}">
     80       {% endif %}
     81         <img style="height: 2em;" src="/static/img/flags/{{ j[0] }}.png" alt="{{ j[1] }}" title="{{ j[1] }}">
     82       </a>
     83       {% endfor %}
     84     </div>
     85   </div>
     86   {% endif %}