updates - ui
This commit is contained in:
@@ -44,7 +44,7 @@ class ContentItem:
|
||||
self.title = self.data.get("title", self.slug)
|
||||
self.omit_second_title = self.data.get("omit_second_title", False)
|
||||
self.date = self.data.get("date", "2000-01-01T00:00:00+03:00")
|
||||
self.categories = self.data.get("categories", str([]))
|
||||
self.categories = [c for c in self.data.get("categories", str([])) if c != 'default']
|
||||
self.hidden = self.data.get("hidden", str(False))
|
||||
self.data.content = self.data.content.replace('\n', ' \n')
|
||||
self.html = markdown.markdown(self.data.content)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<a href="{{ parent_path }}static/about.html">About</a>
|
||||
</div>
|
||||
<div id="categories_container" class="container">
|
||||
<div id="categories_menu" class="row justify-content-around mx-auto" style="visibility: hidden">
|
||||
<div id="categories_menu" class="row justify-content-around mx-auto" style="display: none">
|
||||
{% for category in categories %}
|
||||
<a href="{{ parent_path }}categories/{{ category }}.html" class="mx-2">{{ category }}</a>
|
||||
{% endfor %}
|
||||
@@ -102,12 +102,11 @@
|
||||
<script defer>
|
||||
document.getElementById("categories_toggle").onclick = function() {
|
||||
categories_menu_item = document.getElementById("categories_menu")
|
||||
console.log(categories_menu_item.style.visibility)
|
||||
if (categories_menu_item.style.visibility == "hidden") {
|
||||
categories_menu_item.style.visibility = "visible"
|
||||
if (categories_menu_item.style.display == "none") {
|
||||
categories_menu_item.style.display = "block"
|
||||
}
|
||||
else {
|
||||
categories_menu_item.style.visibility = "hidden"
|
||||
categories_menu_item.style.display = "none"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
<h5 class="card-title"><a class="text-decoration-none text-body" href="{{ parent_path }}content/{{ content_item.slug}}.html">{{ content_item.title }}</a></h5>
|
||||
<p class="card-text mb-3">{{ content_item.preview | safe}}<a href="{{ parent_path }}content/{{ content_item.slug}}.html">... read more</a> </p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{% for item_category in content_item.categories %}
|
||||
<small><a href="{{ parent_path }}categories/{{ item_category }}.html" class="text-muted mx-1">{{ item_category }}</a></small>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user