Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Errata field if ERRATA_URL_PREFIX not set. Fix #186 #188

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tcms/templates/run/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ <h2>Edit Test Run</h2>
{{ form.build }}
<a href="{{ ADMIN_PREFIX }}/management/testbuild/add/" class="addlink" id="add_id_build">Add Build</a></td>
</tr>
{% if errata_url_prefix %}
<tr>
<td><label>Errata </label></td>
<td>{{ form.errata_id }}</td>
</tr>
{% endif %}
<tr>
<td><label>Manager</label></td>
{% ifequal test_run.manager user %}
Expand Down
4 changes: 2 additions & 2 deletions tcms/templates/run/get.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ <h2 id="display_title">{{ test_run.summary }}</h2>
<a href="{% url "tcms.testruns.views.all" %}?build={{ test_run.build_id }}" title="Search test runs of {{ test_run.build_id }}">{{ test_run.build }}</a>
</div>
</div>
{% if errata_url_prefix and test_run.errata_id %}
<div class="listinfo">
<div class="title grey">Errata&nbsp;:</div>
<div class="name">
{% if test_run.errata_id %}
<a href="{{ errata_url_prefix }}/{{ test_run.errata_id }}" target="_blank">{{ test_run.errata_id }}</a>
{% endif %}
</div>
</div>
{% endif %}
<div class="listinfo">
<div class="title grey">Default Tester&nbsp;:</div>
<div class="name">
Expand Down
2 changes: 2 additions & 0 deletions tcms/templates/run/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ <h2>Create New Test Run</h2>
<a href="{{ ADMIN_PREFIX }}/management/testbuild/add/" class="addlink" id="add_id_build">Add Build</a>
</td>
</tr>
{% if errata_url_prefix %}
<tr>
<td valign="top"><label for="id_errata_id">Errata</label></td>
<td>{{ form.errata_id }}<div class="errors">{{ form.errata_id.errors }}</div></td>
</tr>
{% endif %}
<tr>
<td valign="top" valign="top"><label for="id_manager">Run Manager </label></td>
<td valign="top">{{ form.manager }}<div class="errors">{{ form.manager.errors }}</div></td>
Expand Down
2 changes: 2 additions & 0 deletions tcms/testruns/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def new(request, template_name='run/new.html'):
'form': form,
'num_unconfirmed_cases': num_unconfirmed_cases,
'run_estimated_time': estimated_time,
'errata_url_prefix': settings.ERRATA_URL_PREFIX,
}
return render_to_response(template_name, context_data,
context_instance=RequestContext(request))
Expand Down Expand Up @@ -852,6 +853,7 @@ def edit(request, run_id, template_name='run/edit.html'):
'sub_module': SUB_MODULE_NAME,
'test_run': tr,
'form': form,
'errata_url_prefix': settings.ERRATA_URL_PREFIX,
}
return render_to_response(template_name, context_data,
context_instance=RequestContext(request))
Expand Down