Skip to content

Commit

Permalink
add display_header option
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Apr 18, 2024
1 parent 3377247 commit 8ac8084
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions app/models/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def type(self):
def link(self):
return self.widget.get('link', '')

@property
def display_header(self):
return self.widget.get('display_header', True)

@property
def display_limit(self):
return self.widget.get('display_limit', 10)
Expand Down
4 changes: 1 addition & 3 deletions app/static/css/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ ul li:last-child {

/* Content Boxes */
.box-content {
border-left: 0.063em solid #444; /* Rounded from 0.0625em */
border-right: 0.063em solid #444; /* Rounded from 0.0625em */
border-bottom: 0.063em solid #444; /* Rounded from 0.0625em */
border: 0.063em solid #444; /* Rounded from 0.0625em */
}

/* Scrollbar Styling */
Expand Down
7 changes: 4 additions & 3 deletions app/templates/widget.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% if not skip_htmx and widget.hasattr('hx_get') %}
<div class="box {{ widget.type }}-box" hx-get="{{ widget.hx_get }}" hx-trigger="load" hx-swap="outerHTML">
<div class="box {{ widget.type }}-box">
<div class="box-header {{ widget.type }}-header">
<a href="{{ widget.link }}" target="_blank" class="box-header-link {{ widget.type }}-header-link">{{ widget.name }}</a></div>
<div class="box-header {{ widget.type }}-header" {{ 'style=display:none' if not widget.display_header }} >
<a href="{{ widget.link }}" target="_blank" class="box-header-link {{ widget.type }}-header-link">{{ widget.name }}</a>
</div>
<div class="box-content {{ widget.type }}-content">
<ul>
{% set name = widget.name %}
Expand All @@ -13,7 +14,7 @@
</div>
{% else %}
<div class="box {{ widget.type }}-box">
<div class="box-header {{ widget.type }}-header">
<div class="box-header {{ widget.type }}-header" {{ 'style=display:none' if not widget.display_header }} >
<a href="{{ widget.link }}" target="_blank" class="box-header-link {{ widget.type }}-header-link">{{ widget.name }}</a></div>
<div class="box-content {{ widget.type }}-content">
<ul>
Expand Down

0 comments on commit 8ac8084

Please sign in to comment.