summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/repos.html
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/templates/repos.html')
-rw-r--r--ogcp/templates/repos.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/ogcp/templates/repos.html b/ogcp/templates/repos.html
new file mode 100644
index 0000000..881057b
--- /dev/null
+++ b/ogcp/templates/repos.html
@@ -0,0 +1,59 @@
+{% extends 'base.html' %}
+
+{% block nav_repos %}active{% endblock %}
+
+{% block container %}
+ <form id="reposForm">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
+ </form>
+ {{ super() }}
+</form>
+{% endblock %}
+
+{% block sidebar %}
+ <ul id="repos-list" class="nav ogcp-nav flex-column nav-pills">
+ {% for repos in repos_resp %}
+ {% set server_name = repos["server"].name %}
+ {% set server_ip_port = repos["server"].ip ~ ":" ~ repos["server"].port %}
+ {% set repos_list = repos["json"]["repositories"] %}
+ <li class="nav-item">
+ <input class="form-check-input" type="checkbox" form="reposForm"
+ value="{{ server_ip_port }}" name="selected-server" />
+ <a class="nav-link {% if not repos_list %}disabled{% endif %}" href="#server{{loop.index}}"
+ {% if repos_list %}data-toggle="collapse"{% endif %}>
+ {{ server_name }}
+ </a>
+ <ul class="nav flex-column collapse" id="server{{loop.index}}">
+ {% for r in repos_list %}
+ <li class="nav-item">
+ <input class="form-check-input" type="checkbox" form="reposForm"
+ value="{{ r["id"] }}"
+ name="selected-repo" />
+ {{ r["name"] }}
+ </li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endfor %}
+ </ul>
+ <script>
+ // Launch the javascript on document ready, so all the global functions exists
+ // in the scope
+ document.addEventListener('readystatechange', () => {
+ if (document.readyState === 'complete') {
+ keepReposTreeState()
+ }
+ });
+ </script>
+{% endblock %}
+
+{% block commands %}
+ <input class="btn btn-light {% block nav_repo_add %}{% endblock %}" type="submit" value="{{ _('Add repo') }}"
+ form="reposForm" formaction="{{ url_for('repo_add_get') }}" formmethod="get">
+
+ {% if btn_back %}
+ <button class="btn btn-danger ml-3" type="button" id="backButton" onclick="history.back()">
+ {{ _("Back") }}
+ </button>
+ {% endif %}
+{% endblock %}