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

Do not duplicate project search form #877

Merged
merged 2 commits into from
Jan 6, 2020
Merged
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
11 changes: 4 additions & 7 deletions anitya/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@ <h1>Search projects{% if distroname %} in {{ distroname }}{% endif %}</h1>

<div class="col-sm-6">
{% if distroname %}
<form action="{{ url_for('anitya_ui.distro_projects_search', distroname=distroname)
}}" role="form">
{% else %}
<form action="{{ url_for('anitya_ui.projects_search') }}" role="form" class="form-inline">
{% endif %}
<form action="{{ url_for('anitya_ui.distro_projects_search', distroname=distroname) }}">
<div class="form-group">
<input type="text" name="pattern" placeholder="Project name"
class="form-control input-sm" value="{{ pattern }}"/>
<button type="submit" class="btn btn-sm btn-default">Search</button>
</div>
</form>
{% endif %}
</div>
</div>

Expand All @@ -58,7 +55,7 @@ <h1>Search projects{% if distroname %} in {{ distroname }}{% endif %}</h1>
<p>{{ projects_count }} projects found</p>
<div class="list-group">
{% if projects %}
<span class="list-group-item">
<div class="list-group-item">
<p class="list-group-item-text">
<dl class="dl-horizontal">
<table class="table table-condensed">
Expand Down Expand Up @@ -88,7 +85,7 @@ <h1>Search projects{% if distroname %} in {{ distroname }}{% endif %}</h1>
</dl>
</p>
<div class="clearfix"></div>
</span>
</div>
{% else %}
<blockquote>
Oups this is embarrassing, it seems that no projects are being
Expand Down
8 changes: 3 additions & 5 deletions anitya/tests/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,9 @@ def test_distro_projects_search(self):
monitored currently.
<p><a href="/project/new?name=gua">Click Here</a> to add this project instead. </p>
</blockquote>"""
self.assertTrue(expected in output.data)
self.assertTrue(
b'form action="/distro/Fedora/search/" role="form">' in output.data
)
self.assertTrue(b"<h1>Search projects in Fedora</h1>" in output.data)
self.assertIn(expected, output.data)
self.assertIn(b'form action="/distro/Fedora/search/">', output.data)
self.assertIn(b"<h1>Search projects in Fedora</h1>", output.data)

def test_distro_projects_search_pattern(self):
"""
Expand Down
1 change: 1 addition & 0 deletions news/PR877.bug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed duplicate search form from project search result page