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
Add search endpoint #135
Add search endpoint #135
Conversation
Starting demo at: http://snapcraft.io-pr-135.run.demo.haus/ |
@nottrobin I discussed with @bartaz I will add a commit to filter and normalize the informations I send to the template. |
I have 2 bugs on the snap search API:
Here is an example of what is returned:
Here is what I would expect:
The |
I got a JSON decode error. I'll keep looking tomorrow. |
This are the informations that are given to the template:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small suggestions. Basically it works fine for me.
templates/snap-search.html
Outdated
|
||
{% block title %}{{ snap_title }} — Linux software in the Snap Store{% endblock %} | ||
|
||
{% block content %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we give the frontends slightly more to work with, with a template something like this?
{% block content %}
<ul>
{% for snap in snaps %}
<li>
<h3>{{ snap.title }}</h1>
<table>
{% for key, value in snap.items() %}
<tr>
<th>{{ key }}</th>
<td>{{ value }}</td>
</tr>
{% endfor %}
</table>
</li>
{% endfor %}
<nav>
{% if links.first %}<a href="{{ links.first }}">First</a>{% endif %}
{% if links.prev %}<a href="{{ links.prev }}">Previous</a>{% endif %}
{% if links.next %}<a href="{{ links.next }}">Next</a>{% endif %}
{% if links.last %}<a href="{{ links.last }}">Last</a>{% endif %}
</nav>
{% endblock %}
templates/snap-search.html
Outdated
@@ -0,0 +1,7 @@ | |||
{% extends "_layout.html" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind if we call this file simply "search.html"?
Basic template added #113 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, works a charm. Good work 👍 🥘 🧀
Summary
Added the search endpoint on the server. It renders a temporary page that diplays a JSON of the searched result. For the moment the search response isn't modified from what I receive from the snapcraft search API.
QA
./run