Project

General

Profile

Download (4.29 KB) Statistics
| Branch: | Tag: | Revision:

haketilo / html / repo_query.html @ 72553a2d

1
#IF !REPO_QUERY_LOADED
2
#DEFINE REPO_QUERY_LOADED
3
<!--
4
    SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
5

    
6
    Show available repositories and allow querying them for resources.
7

    
8
    This file is part of Haketilo.
9

    
10
    Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
11

    
12
    File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
13

    
14
    This program is free software: you can redistribute it and/or modify
15
    it under the terms of the GNU General Public License as published by
16
    the Free Software Foundation, either version 3 of the License, or
17
    (at your option) any later version.
18

    
19
    This program is distributed in the hope that it will be useful,
20
    but WITHOUT ANY WARRANTY; without even the implied warranty of
21
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
    GNU General Public License for more details.
23

    
24
    You should have received a copy of the GNU General Public License
25
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
26

    
27
    I, Wojtek Kosior, thereby promise not to sue for violation of this file's
28
    licenses. Although I request that you do not make use of this code in a
29
    proprietary program, I am not going to enforce this in court.
30
  -->
31

    
32
<!--
33
    This is not a standalone page. This file is meant to be imported into other
34
    HTML code.
35
  -->
36

    
37
#INCLUDE html/install.html
38

    
39
#LOADCSS html/reset.css
40
#LOADCSS html/base.css
41
<style>
42
  .repo_query_top_text {
43
      text-align: center;
44
      padding: 0.4em;
45
      text-overflow: ellipsis;
46
      overflow: hidden;
47
  }
48
  .repo_queried_url {
49
      text-decoration: underline;
50
      white-space: nowrap;
51
  }
52

    
53
  .repo_query_repo_li {
54
      margin: 0;
55
      background-color:#dadada;
56
  }
57
  .repo_query_repo_li > .repo_query_entry {
58
      padding: 0.2em;
59
  }
60
  .repo_query_repo_li > .repo_query_results_list {
61
      background-color: #f0f0f0;
62
  }
63

    
64
  .repo_query_info_div {
65
      margin: 0.5em;
66
  }
67

    
68
  .repo_query_result_li {
69
      margin: 0;
70
      padding: 0.2em;
71
  }
72
  .repo_query_result_li:nth-child(2n) {
73
      background-color:#dadada;
74
  }
75

    
76
  .repo_query_entry {
77
      display: flex;
78
      align-items: center;
79
  }
80
  .repo_query_entry_info {
81
      display: grid;
82
      grid-template-columns: auto;
83
      flex: 1 1 auto;
84
      min-width: 0;
85
  }
86

    
87
  .repo_query_entry_info > * {
88
      white-space: nowrap;
89
      overflow: hidden;
90
      text-overflow: ellipsis;
91
      padding-bottom: 0.1em;
92
  }
93
  .repo_query_entry button {
94
      white-space: nowrap;
95
  }
96

    
97
  .repo_query_mapping_id {
98
      font-size: 80%;
99
      font-style: italic;
100
  }
101

    
102
  .repo_query_bottom_buttons {
103
      margin: 1em;
104
      text-align: center;
105
  }
106
</style>
107
<template>
108
  <div id="repo_query" data-template="main_div" class="repo_query_main_div">
109
    <div data-template="repos_list_container">
110
      <div class="repo_query_top_text">
111
	Browsing custom resources for:
112
	<span data-template="url_span" class="repo_queried_url"></span>
113
      </div>
114
      <ul data-template="repos_list"></ul>
115
      <div class="repo_query_bottom_buttons">
116
	<button data-template="cancel_but">Cancel</button>
117
      </div>
118
    </div>
119
    <div data-template="install_view_container" class="hide">
120
      <!-- Install view will be dynamically inserted here. -->
121
    </div>
122
  </div>
123

    
124
  <li id="repo_query_single_repo" data-template="main_li"
125
      class="repo_query_repo_li">
126
    <div class="top_line"></div>
127
    <div class="repo_query_entry">
128
      <div class="repo_query_entry_info">
129
	<label data-template="repo_url_label"></label>
130
      </div>
131
      <span class="repo_query_buttons">
132
	<button data-template="show_results_but">
133
	  Show results
134
	</button>
135
	<button data-template="hide_results_but" class="hide">
136
	  Hide results
137
	</button>
138
      </span>
139
    </div>
140
    <div data-template="list_container" class="hide repo_query_results_list">
141
      <div data-template="info_div" class="repo_query_info_div">
142
	Querying repository...
143
      </div>
144
      <ul data-template="results_list" class="hide"></ul>
145
    </div>
146
  </li>
147

    
148
  <li id="repo_query_single_result" data-template="main_li"
149
      class="repo_query_entry repo_query_result_li">
150
    <div class="repo_query_entry_info">
151
      <span data-template="mapping_name"></span>
152
      <span data-template="mapping_id" class="repo_query_mapping_id"></span>
153
    </div>
154
    <span><button data-template="install_but">Install preview</button></span>
155
  </li>
156
</template>
157
#ENDIF
(20-20/27)