mirror of
https://gitlab.com/OpenAlt/OpenAltRO/openalt_ro.git
synced 2026-11-23 15:19:15 +00:00
Cleanup of the code
This commit is contained in:
parent
6074b9c152
commit
4f65db4bce
13 changed files with 120 additions and 146 deletions
70
themes/openalt/layout/_partial/post_preview.ejs
Normal file
70
themes/openalt/layout/_partial/post_preview.ejs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<%
|
||||
isEvent = false
|
||||
post.tags.data.forEach(function(tag) {
|
||||
if ( (tag.name == "Events") && (!isEvent) ) {
|
||||
isEvent = true
|
||||
}
|
||||
});
|
||||
%>
|
||||
|
||||
<!-- This is the template for the post. It is used to display the posts in the feeds. -->
|
||||
<% if(isEvent && (source == "index") && (event == 2) ) { %>
|
||||
<div class="event-wrapper">
|
||||
<img src="/images/assets/OpenAltRomania.svg" alt="<%= post.title || "Untitled" %>" style="max-height: 250px" width="300px" />
|
||||
|
||||
<a href='<%= url_for(post.path) %>'><h1><%= post.title || "Untitled" %></h1></a>
|
||||
|
||||
<h2 class="event-spacer">
|
||||
<%- post.event.date %> at <%- post.event.time %>
|
||||
</h2>
|
||||
|
||||
<h3 class="event-spacer"Bashy.jpg>
|
||||
<a href='<%- post.event.place.link %>'><i class="fa fa-map-marker-alt"></i> <%- post.event.place.name %></a>
|
||||
</h3>
|
||||
|
||||
<div class="post-content">
|
||||
<%- post.content %>
|
||||
</div>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div class="post">
|
||||
<% if(post.photos && post.photos.length) { %>
|
||||
<% classTag = "post-with-image" %>
|
||||
<% } else { %>
|
||||
<% classTag = "post-without-image" %>
|
||||
<% } %>
|
||||
|
||||
<% if(source == "index") { %>
|
||||
<div class="post-home">
|
||||
<% } else if (isEvent) { %>
|
||||
<div class="post-event">
|
||||
<% } else { %>
|
||||
<div class="post-feed">
|
||||
<% } %>
|
||||
<div class="<%= classTag %>">
|
||||
<% if(post.photos && post.photos.length) { %>
|
||||
<div class="post-cover">
|
||||
<a href='<%= url_for(post.path) %>'>
|
||||
<img class="gallery" src="<%- config.root %><%- post.photos[0] %>" alt="<%- post.title || 'Untitled' %>">
|
||||
</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="post-blerp">
|
||||
<a href='<%= url_for(post.path) %>'><h2><%= post.title || "Untitled" %></h2>
|
||||
<div class="date smoll">
|
||||
<%- include('date', { date: post.date.toISOString() }) %></a>
|
||||
</div>
|
||||
<p class="post_description"><%= post.description %></p>
|
||||
|
||||
<a href='<%= url_for(post.path) %>'><p>Read More...</p></a>
|
||||
|
||||
<div class="tags smoll">
|
||||
<% post.tags.data.forEach(function(tag) { %>
|
||||
<a href="<%= url_for('/tags/' + tag.slug || tag.name.replace(/\s+/g, '-')) %>">#<%= tag.name %></a>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue