-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regularize template structure for forms
Create a standard inheritance for form templates: - Each type of model has its own base template that inherits from cv/forms/_base.html - Create formgroups directory that contains reusable code for form groups used in multiple types of models (e.g., title, abstract) - Create template for each model that inherits from appropriate type
- Loading branch information
Showing
25 changed files
with
207 additions
and
355 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 @@ | ||
{% extends 'cv/forms/_base.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,13 @@ | ||
{% extends 'cv/forms/_base.html' %} | ||
|
||
{% load widget_tweaks %} | ||
|
||
{% block formcontent %} | ||
<!-- NAME --> | ||
{% include 'cv/forms/formgroups/name.html' %} | ||
|
||
{% block other_information %}{% endblock other_information %} | ||
|
||
|
||
{% endblock %} | ||
|
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 @@ | ||
{% extends 'cv/forms/_base.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 @@ | ||
{% extends 'cv/forms/_base.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,25 @@ | ||
{% extends 'cv/forms/_base.html' %} | ||
|
||
{% block formcontent %} | ||
<div class="form-group row align-items-start "> | ||
{% include 'cv/forms/formgroups/title.html' %} | ||
|
||
{% block work_details %}{% endblock work_details%} | ||
</div> | ||
<div class="form-group row align-items-start "> | ||
{% include 'cv/forms/formgroups/abstract.html' %} | ||
|
||
{% block work_description %}{% endblock work_description %} | ||
</div> | ||
|
||
{% block formset %}{% endblock formset %} | ||
|
||
{% block discipline %} | ||
{% include 'cv/forms/formgroups/discipline.html' %} | ||
{% endblock discipline %} | ||
|
||
{% block grant %} | ||
{% include 'cv/forms/formgroups/grant.html' %} | ||
{% endblock grant %} | ||
|
||
{% endblock formcontent %} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% extends 'cv/forms/_base.html' %} | ||
{% extends 'cv/forms/_base_achievement.html' %} | ||
|
||
{% load widget_tweaks %} | ||
|
||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
{% load widget_tweaks %} | ||
|
||
<div class="col-12 col-lg-6 mt-3 form-row"> | ||
<h5 class="col-12 form-title">Abstract</h5> | ||
<span class="col-12"> | ||
{% with form.abstract as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
<span class="form-text text-muted">Use <a href="https://daringfireball.net/projects/markdown/syntax" alt="Markdown syntax">Markdown syntax</a>: e.g., **<b>bold</b>**, *<i>italics</i>*, `<code>code</code>`, [link text]<url></span> | ||
</span> | ||
</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,19 @@ | ||
{% load widget_tweaks %} | ||
|
||
<div class="form-group row"> | ||
<h5 class="col-12 form-title">Disciplinary information</h5> | ||
<div class="col-12 col-lg-6 form-row"> | ||
<span class="col-12"> | ||
{% with form.primary_discipline as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
</div> | ||
<div class="col-12 col-lg-6 form-row"> | ||
<span class="col-12"> | ||
{% with form.other_disciplines as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
</div> | ||
</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,31 @@ | ||
{% load widget_tweaks %} | ||
|
||
<div class="form-group row"> | ||
<h5 class="col-12 form-title">Grant information</h5> | ||
<div class="col-12 col-lg-6 form-row"> | ||
<span class="col-12"> | ||
{% with form.grants as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
</div> | ||
<div class="col-12 col-lg-6 form-row"> | ||
<span class="col-12"> | ||
{% with form.pmcid as field %}{% with noprinthelp=True %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %}{% endwith %} | ||
</span> | ||
<span class="col-12"> | ||
{% with form.pmid as field %}{% with noprinthelp=True %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %}{% endwith %} | ||
</span> | ||
{% if form.pmid or form.pmcid %} | ||
<span class="col-12"> | ||
<span class="form-text text-muted"> | ||
For information on the above see <a href="https://publicaccess.nih.gov/include-pmcid-citations.htm#Difference" title="The Difference Between a PMCID and a PMID">explanation from NIH</a> | ||
</span> | ||
</span> | ||
{% endif %} | ||
</div> | ||
</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,32 @@ | ||
{% load widget_tweaks %} | ||
|
||
<div class="form-group row"> | ||
<h5 class="col-12">Name</h5> | ||
<span class="col-8 col-lg-4"> | ||
{% with form.first_name as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
<span class="col-4 col-lg-2"> | ||
{% if form.middle_initial %} | ||
{% with form.middle_initial as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
{% else %} | ||
{% with form.middle_name as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
{% endif %} | ||
</span> | ||
<span class="col-8 col-lg-5"> | ||
{% with form.last_name as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
<span class="col-4 col-lg-1"> | ||
{% with form.suffix as field %} | ||
{% include "cv/forms/_form_field.html" %} | ||
{% endwith %} | ||
</span> | ||
</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
Oops, something went wrong.