Skip to content

Commit

Permalink
Hide Errata field if ERRATA_URL_PREFIX not set. Fix Nitrate#186
Browse files Browse the repository at this point in the history
Signed-off-by: Mr. Senko <atodorov@mrsenko.com>
  • Loading branch information
atodorov committed May 24, 2017
1 parent 82eeff3 commit d02b1f7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tcms/templates/run/edit.html
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
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
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
Expand Up @@ -228,6 +228,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 @@ -851,6 +852,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

0 comments on commit d02b1f7

Please sign in to comment.