Changeset View
Standalone View
swh/web/templates/browse/branches.html
{% extends "./browse.html" %} | {% extends "./browse.html" %} | ||||||||
{% comment %} | {% comment %} | ||||||||
Copyright (C) 2017-2019 The Software Heritage developers | Copyright (C) 2017-2019 The Software Heritage developers | ||||||||
See the AUTHORS file at the top-level directory of this distribution | See the AUTHORS file at the top-level directory of this distribution | ||||||||
License: GNU Affero General Public License version 3, or any later version | License: GNU Affero General Public License version 3, or any later version | ||||||||
See top-level LICENSE file for more information | See top-level LICENSE file for more information | ||||||||
{% endcomment %} | {% endcomment %} | ||||||||
{% load swh_templatetags %} | {% load swh_templatetags %} | ||||||||
{% block swh-browse-content %} | {% block swh-browse-content %} | ||||||||
{% if displayed_branches|length > 0 %} | |||||||||
<div class="table-responsive mt-3 mb-3"> | <div class="table-responsive mt-3 mb-3"> | ||||||||
<div class="form-group row float-right"> | |||||||||
<div> | |||||||||
<input class="form-control" | |||||||||
ardumont: indentation is a bit off. | |||||||||
placeholder="Search in branch names" | |||||||||
value="{{search_string}}" | |||||||||
type="text" | |||||||||
id="swh-branch-name-search" /> | |||||||||
</div> | |||||||||
anlambertUnsubmitted Not Done Inline ActionsCould you turn this to a real form DOM element with a search button on the right ? You can inspire from the origins search form at the top right of the main HTML layout. It will simplify JS code as you will simply need to bind the submit event instead of listening for key up event. anlambert: Could you turn this to a real form DOM element with a search button on the right ?
You can… | |||||||||
</div> | |||||||||
<table class="table swh-table swh-table-striped"> | <table class="table swh-table swh-table-striped"> | ||||||||
<thead> | <thead> | ||||||||
Not Done Inline ActionsIndentation is not right here, sibling elements should be at the same level. anlambert: Indentation is not right here, sibling elements should be at the same level. | |||||||||
Done Inline ActionsIsn't <i> the child element of <button>? I'm using jinja2 mode in emacs and that formats like this. What is the mode/plugin you are in?. Maybe we can use the same one for consistency. jayeshv: Isn't <i> the child element of <button>? I'm using jinja2 mode in emacs and that formats like… | |||||||||
Not Done Inline ActionsThis should be indented as follow: <div class="form-group row float-right"> <form class="form-horizontal d-none d-md-flex input-group" id="swh-branch-search-form"> <input class="form-control" placeholder="Search in branch names" id="swh-branch-search-string" value="{{search_string}}" type="text" /> <div class="input-group-append"> <button class="btn btn-primary" type="submit" id="swh-branch-serach-button"> <i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i> </button> </div> </form> </div> I am not using any HTML formatting plugin as I could not find one that plays well with django template language. anlambert: This should be indented as follow:
```lang=html
<div class="form-group row float-right">… | |||||||||
<tr> | <tr> | ||||||||
<th><i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i>Name</th> | <th><i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i>Name</th> | ||||||||
<th>Revision</th> | <th>Revision</th> | ||||||||
<th>Message</th> | <th>Message</th> | ||||||||
<th>Date</th> | <th>Date</th> | ||||||||
</tr> | </tr> | ||||||||
</thead> | </thead> | ||||||||
<tbody> | <tbody> | ||||||||
{% if displayed_branches|length > 0 %} | |||||||||
{% for branch in displayed_branches %} | {% for branch in displayed_branches %} | ||||||||
<tr class="swh-branch-entry swh-tr-hover-highlight"> | <tr class="swh-branch-entry swh-tr-hover-highlight"> | ||||||||
<td class="swh-branch-name"> | <td class="swh-branch-name"> | ||||||||
<a href="{{ branch.directory_url }}"> | <a href="{{ branch.directory_url }}"> | ||||||||
{% if branch.alias %} | {% if branch.alias %} | ||||||||
<i class="{{ swh_object_icons.alias }} mdi-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.alias }} mdi-fw" aria-hidden="true"></i> | ||||||||
{% else %} | {% else %} | ||||||||
<i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i> | <i class="{{ swh_object_icons.branch }} mdi-fw" aria-hidden="true"></i> | ||||||||
{% endif %} | {% endif %} | ||||||||
{{ branch.name }} | {{ branch.name }} | ||||||||
</a> | </a> | ||||||||
</td> | </td> | ||||||||
<td> | <td> | ||||||||
<a href="{{ branch.revision_url }}"> | <a href="{{ branch.revision_url }}"> | ||||||||
{{ branch.revision|slice:":7" }} | {{ branch.revision|slice:":7" }} | ||||||||
</a> | </a> | ||||||||
</td> | </td> | ||||||||
<td class="swh-branch-message swh-table-cell-text-overflow" title="{{ branch.message }}"> | <td class="swh-branch-message swh-table-cell-text-overflow" title="{{ branch.message }}"> | ||||||||
{{ branch.message }} | {{ branch.message }} | ||||||||
</td> | </td> | ||||||||
<td class="swh-branch-date"> | <td class="swh-branch-date"> | ||||||||
{{ branch.date }} | {{ branch.date }} | ||||||||
</td> | </td> | ||||||||
</tr> | </tr> | ||||||||
{% endfor %} | {% endfor %} | ||||||||
{% else %} | |||||||||
<tr> | |||||||||
<td> | |||||||||
The list of branches is empty ! | |||||||||
ardumontUnsubmitted Not Done Inline Actions
ardumont: | |||||||||
</td> | |||||||||
</tr> | |||||||||
{% endif %} | |||||||||
anlambertUnsubmitted Not Done Inline ActionsIt will be great to display a message like No branch names containing {search_string} have been found ! instead when search returns no results. You can check for the branch_name_include query parameter in the template code and display such message. {% elif "branch_name_include" in request.GET %} anlambert: It will be great to display a message like `No branch names containing {search_string} have… | |||||||||
</tbody> | </tbody> | ||||||||
</table> | </table> | ||||||||
</div> | </div> | ||||||||
{% else %} | |||||||||
<i>The list of branches is empty !</i> | |||||||||
{% endif %} | |||||||||
{% endblock %} | {% endblock %} | ||||||||
{% block swh-browse-after-content %} | {% block swh-browse-after-content %} | ||||||||
{% if prev_branches_url or next_branches_url %} | {% if prev_branches_url or next_branches_url %} | ||||||||
<ul class="pagination justify-content-center"> | <ul class="pagination justify-content-center"> | ||||||||
{% if prev_branches_url %} | {% if prev_branches_url %} | ||||||||
<li class="page-item"><a class="page-link" href="{{ prev_branches_url }}">Previous</a></li> | <li class="page-item"><a class="page-link" href="{{ prev_branches_url }}">Previous</a></li> | ||||||||
{% else %} | {% else %} | ||||||||
<li class="page-item disabled"><a class="page-link">Previous</a></li> | <li class="page-item disabled"><a class="page-link">Previous</a></li> | ||||||||
{% endif %} | {% endif %} | ||||||||
Show All 9 Lines |
indentation is a bit off.