-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base): create detail view templates
- Loading branch information
Showing
10 changed files
with
422 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function openContentNavigationTab(evt, TabName) { | ||
var i, tabcontent, tablinks; | ||
|
||
tabcontent = document.getElementsByClassName("content-tab"); | ||
for (i = 0; i < tabcontent.length; i++) { | ||
tabcontent[i].style.display = "none"; | ||
} | ||
|
||
tablinks = document.getElementsByClassName("content-navigation-tabs-link"); | ||
for (i = 0; i < tablinks.length; i++) { | ||
tablinks[i].className = tablinks[i].className.replace(" active", ""); | ||
} | ||
|
||
document.getElementById(TabName).style.display = "block"; | ||
evt.currentTarget.className += " active"; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{% load json %} | ||
{% load markdown %} | ||
|
||
{% if field.widget_type == 'textarea' or field.label == 'Notes' %} | ||
|
||
{% if field.name in section.json and field.value %} | ||
|
||
<pre style="width: 80%; text-align: left; display:inline; border: 1px solid #ccc; padding: 22px;">{{ field.value.strip | json_pretty | safe }}</pre> | ||
|
||
{% elif field.name in section.markdown or field.label == 'Notes' %} | ||
|
||
{% if field.label == 'Notes' %} | ||
|
||
<div> | ||
<label style="font-weight: bold; width: 100%; border-bottom: 1px solid #ccc; display: block; text-align: inherit;"> | ||
{{ field.label }} | ||
</label> | ||
|
||
<div style="display: inline-block; text-align: left;"> | ||
{% if field.value %} | ||
{{ field.value | markdown | safe }} | ||
{% else %} | ||
| ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
{% else %} | ||
|
||
{% if field.value %} | ||
|
||
{{ field.value | markdown | safe }} | ||
|
||
{% else %} | ||
|
||
| ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% elif not field.value %} | ||
|
||
| ||
|
||
{% endif %} | ||
|
||
|
||
{% else %} | ||
|
||
|
||
<div class="detail-view-field"> | ||
<label>{{ field.label }}</label> | ||
<span> | ||
{% if field.field.choices %} {# Display the selected choice text value #} | ||
{% for id, value in field.field.choices %} | ||
|
||
{% if field.value == id %} | ||
|
||
{{ value }} | ||
|
||
{% endif %} | ||
|
||
{%endfor%} | ||
|
||
{% else %} | ||
{{ field.value }} | ||
{% endif %} | ||
</span> | ||
</div> | ||
|
||
{% endif %} |
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,93 @@ | ||
{% load json %} | ||
{% load markdown %} | ||
|
||
{% for section in tab.sections %} | ||
|
||
|
||
{% if forloop.first %} | ||
|
||
<h3>{{ tab.name }}</h3> | ||
|
||
{% else %} | ||
|
||
<hr /> | ||
<h3>{{ section.name }}</h3> | ||
|
||
{% endif %} | ||
|
||
<div style="align-items:flex-start; align-content: center; display: flexbox; width: 100%"> | ||
|
||
{% if section.layout == 'single' %} | ||
|
||
{% for section_field in section.fields %} | ||
{% for field in form %} | ||
|
||
{% if field.name in section_field %} | ||
|
||
{% include 'content/field.html.j2' %} | ||
|
||
{% endif %} | ||
|
||
{% endfor %} | ||
{% endfor %} | ||
|
||
{% elif section.layout == 'double' %} | ||
|
||
{% if section.left %} | ||
|
||
<div style="display: inline; width: 40%; margin: 30px;"> | ||
|
||
{% for section_field in section.left %} | ||
{% for field in form %} | ||
|
||
{% if field.name in section_field %} | ||
|
||
{% include 'content/field.html.j2' %} | ||
|
||
{% endif %} | ||
|
||
{% endfor %} | ||
{% endfor %} | ||
|
||
</div> | ||
|
||
{% endif %} | ||
|
||
|
||
{% if section.right %} | ||
|
||
<div style="display: inline; width: 40%; margin: 30px; text-align: left;"> | ||
|
||
{% for section_field in section.right %} | ||
{% for field in form %} | ||
|
||
{% if field.name in section_field %} | ||
|
||
{% include 'content/field.html.j2' %} | ||
|
||
{% endif %} | ||
|
||
{% endfor %} | ||
{% endfor %} | ||
|
||
</div> | ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% if forloop.first %} | ||
|
||
{% if tab.edit_url %} | ||
|
||
<div style="display:block;"> | ||
<input type="button" value="Edit" onclick="window.location='{{ tab.edit_url }}';"> | ||
</div> | ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
</div> | ||
|
||
{% endfor %} |
Oops, something went wrong.