Skip to content

Commit

Permalink
fix: remove proprietary brick attributes and allow customized columns…
Browse files Browse the repository at this point in the history
…/attributes
  • Loading branch information
mike4git committed Aug 10, 2024
1 parent 5455b18 commit 5280814
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Bricks/Model/BrickView.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class BrickView
public string $name;
public string $id;

/** @var array<string> */
public array $tags;

/** @var array<mixed> */
public array $pageFullPaths;

/** @var array<string, mixed> */
public array $additionalCols;
}
19 changes: 7 additions & 12 deletions templates/bricks/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,32 @@
}
</style>


<div id="site">
<table id="logo">
<thead>
<th>Name</th>
<th>ID</th>
<th>Tags</th>
<th><strike>Unpublished</strike> Pages (using Brick)</th>
{% for columnHeader in brick.additionalCols %}
<th>{{ columnHeader }}</th>
{% endfor %}
</thead>
{% for brick in bricks %}
<tbody>
<td>{{ brick.name }}</td>
<td>{{ brick.id }}</td>
<td>
{% for tag in brick.tags %}
{% if tag in brick.tags %}
{{ tag }},
{% else %}
<strikethrough>{{ tag }}</strikethrough>,
{% endif %}
{% endfor %}
</td>
<td>
{% for fullPath in brick.pageFullPaths %}
{% if fullPath[0] %}
<a href="{{ fullPath[1] }}">{{ fullPath[1] }}</a>,
<a href="{{ fullPath[1] }}">{{ fullPath[1] }}</a>,
{% else %}
<strike>{{ fullPath[1] }}</strike>
{% endif %}
{% endfor %}
</td>
{% for columnHeader, columnValue in brick.additionalCols %}
<td>{{ columnValue }}</td>
{% endfor %}
</tbody>
{% endfor %}
</table>
Expand Down

0 comments on commit 5280814

Please sign in to comment.