-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add a tool, first pass (#37) * feat: add a tool, second pass (#37) * fix: enable another rule * fix: add another ignore path * feat: move labels to forms * fix: restore labels to model * fix: restore labels to model * feat: niche handling, first pass * feat: niche selection * feat: finish tool flow * fix: localize some tool choice strings, set defaults to empty * feat: set Tool.submitted_by_email on creation
- Loading branch information
1 parent
f031b21
commit 4eb969e
Showing
14 changed files
with
387 additions
and
13 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
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,66 @@ | ||
{% extends "maps/base.html" %} | ||
{% load i18n %} | ||
{% load maps_extras %} | ||
{% block bodyclass %}form-wizard{% endblock %} | ||
{% block title %}{{ 'Basic information'|titlify }}{% endblock %}} | ||
|
||
{% block content %} | ||
<form class="form" action="" method="post" novalidate> | ||
<div class="page-header"> | ||
{% include 'maps/profiles/back.html' %} | ||
<h1>{% trans 'Add a tool' %}</h1> | ||
{% include 'maps/profiles/steps.html' %} | ||
</div> | ||
<div class="form__content"> | ||
{% if form.errors %} | ||
{% include 'maps/profiles/errors.html' %} | ||
{% endif %} | ||
<h2>{% trans 'Basic information' %}</h2> | ||
{{ wizard.management_form }} | ||
{% csrf_token %} | ||
{% if wizard.form.forms %} | ||
{{ wizard.form.management_form }} | ||
{% for form in wizard.form.forms %} | ||
{{ form }} | ||
{% endfor %} | ||
{% else %} | ||
{{ wizard.form.name.label_tag }} | ||
{{ wizard.form.name }} | ||
{{ wizard.form.niches.label_tag }} | ||
<ul id="niches" class="input-group input-group__parent checkbox niches"> | ||
{% for parent, value in niche_dict.items %} | ||
<li> | ||
{% if value.children|length > 0%} | ||
<label for="niche-{{ parent|slugify }}"> | ||
<input class="input--parent" id="niche-{{ parent|slugify }}" type="checkbox" name="basic_info-niche-parents" value="niche-{{ parent|slugify }}" />{{ parent }} | ||
</label> | ||
<span class="filter-disclosure-label" hidden>{% blocktrans with parent=parent count=value.children|length %}show {{ count }} subtypes for "{{ parent }}"{% endblocktrans %}</span> | ||
<span class="supplementary-label" hidden>{% blocktrans with count=value.children|length %} (and {{ count }} subtopics){% endblocktrans %}</span> | ||
<ul class="input-group checkbox input-group__descendant"> | ||
{% for child in value.children %} | ||
<li> | ||
<label for="niche-{{ child.id }}"> | ||
<input id="niche-{{ child.id }}" type="checkbox" name="basic_info-niches" value="{{ child.id }}" />{{ child.name|capfirst }} | ||
</label> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<label for="niche-{{ value.id }}"> | ||
<input class="input--parent" id="niche-{{ value.id }}" type="checkbox" name="basic_info-niches" value="{{ value.id }}" />{{ parent }} | ||
</label> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{{ wizard.form.description.label_tag }} | ||
{{ wizard.form.description }} | ||
<span class="helptext">{{ wizard.form.description.help_text | safe }}</span> | ||
{{ wizard.form.url.label_tag }} | ||
{{ wizard.form.url }} | ||
{% endif %} | ||
{% include 'maps/profiles/footer.html' %} | ||
</div> | ||
</form> | ||
{% include 'maps/profiles/cancel.html' %} | ||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% extends "maps/base.html" %} | ||
{% load i18n %} | ||
{% load maps_extras %} | ||
{% block bodyclass %}form-wizard{% endblock %} | ||
{% block title %}{{ 'Detailed information'|titlify }}{% endblock %}} | ||
|
||
{% block content %} | ||
<form class="form" action="" method="post" novalidate> | ||
<div class="page-header"> | ||
{% include 'maps/profiles/back.html' %} | ||
<h1>{% trans 'Add a tool' %}</h1> | ||
{% include 'maps/profiles/steps.html' %} | ||
</div> | ||
<div class="form__content"> | ||
{% if form.errors %} | ||
{% include 'maps/profiles/errors.html' %} | ||
{% endif %} | ||
<h2>{% trans 'Detailed information' %}</h2> | ||
{{ wizard.management_form }} | ||
{% csrf_token %} | ||
{% if wizard.form.forms %} | ||
{{ wizard.form.management_form }} | ||
{% for form in wizard.form.forms %} | ||
{{ form }} | ||
{% endfor %} | ||
{% else %} | ||
{{ wizard.form }} | ||
{% endif %} | ||
{% include 'maps/profiles/footer.html' %} | ||
</div> | ||
</form> | ||
{% include 'maps/profiles/cancel.html' %} | ||
{% 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
Oops, something went wrong.