-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the Package details view into a generic tabset system #164
Signed-off-by: Thomas Druez <[email protected]>
- Loading branch information
Showing
7 changed files
with
136 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
scanpipe/templates/scanpipe/tabset/tab_content_default.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<dl> | ||
{% for field_name, value in tab_data.fields.items %} | ||
<dt class="has-text-weight-semibold"> | ||
{{ field_name }} | ||
</dt> | ||
<dd class="mb-4"> | ||
<pre class="is-small">{{ value|default_if_none:''|urlize }}</pre> | ||
</dd> | ||
{% endfor %} | ||
</dl> |
9 changes: 9 additions & 0 deletions
9
scanpipe/templates/scanpipe/tabset/tab_content_resources.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="content"> | ||
<ul> | ||
{% for resource in tab_data.fields.codebase_resources.all %} | ||
<li> | ||
<a href="{{ resource.get_absolute_url }}">{{ resource }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="tabs is-boxed mx-5"> | ||
<ul> | ||
{% for label, tab_data in tabset_data.items %} | ||
<li{% if forloop.first %} class="is-active"{% endif %}> | ||
<a data-target="tab-{{ label }}"> | ||
{% if tab_data.icon_class %} | ||
<span class="icon is-small"><i class="{{ tab_data.icon_class }}"></i></span> | ||
{% endif %} | ||
<span>{{ label|capfirst }}</span> | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
|
||
{% for label, tab_data in tabset_data.items %} | ||
<section id="tab-{{ label }}" class="tab-content mx-5 px-1 mb-3{% if forloop.first %} is-active{% endif %}"> | ||
{% if tab_data.template %} | ||
{% include tab_data.template with tab_data=tab_data only %} | ||
{% else %} | ||
{% include 'scanpipe/tabset/tab_content_default.html' with tab_data=tab_data only %} | ||
{% endif %} | ||
</section> | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters