tg-prepare 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tg-prepare might be problematic. Click here for more details.

Files changed (46) hide show
  1. tg_prepare-1.0.0.dist-info/METADATA +19 -0
  2. tg_prepare-1.0.0.dist-info/RECORD +46 -0
  3. tg_prepare-1.0.0.dist-info/WHEEL +5 -0
  4. tg_prepare-1.0.0.dist-info/entry_points.txt +3 -0
  5. tg_prepare-1.0.0.dist-info/licenses/LICENSE +202 -0
  6. tg_prepare-1.0.0.dist-info/top_level.txt +2 -0
  7. tgp_backend/__init__.py +18 -0
  8. tgp_backend/auth.py +71 -0
  9. tgp_backend/cli.py +22 -0
  10. tgp_backend/directories.py +85 -0
  11. tgp_backend/interfaces.py +3 -0
  12. tgp_backend/nextcloud.py +125 -0
  13. tgp_backend/project.py +267 -0
  14. tgp_backend/tgclient.py +92 -0
  15. tgp_backend/util.py +83 -0
  16. tgp_ui/__init__.py +0 -0
  17. tgp_ui/app.py +424 -0
  18. tgp_ui/static/css/bootstrap-icons.min.css +5 -0
  19. tgp_ui/static/css/bootstrap.min.css +7 -0
  20. tgp_ui/static/css/main.css +146 -0
  21. tgp_ui/static/css/simpleXML.css +67 -0
  22. tgp_ui/static/js/bootstrap.bundle.min.js +7 -0
  23. tgp_ui/static/js/jquery.min.js +2 -0
  24. tgp_ui/static/js/jstree.min.js +3 -0
  25. tgp_ui/static/js/main.js +454 -0
  26. tgp_ui/static/js/simpleXML.js +193 -0
  27. tgp_ui/templates/collection.html +194 -0
  28. tgp_ui/templates/empty.html +4 -0
  29. tgp_ui/templates/file_tree.html +39 -0
  30. tgp_ui/templates/file_upload.html +24 -0
  31. tgp_ui/templates/jsfiler.html +6 -0
  32. tgp_ui/templates/layout.html +59 -0
  33. tgp_ui/templates/layout2.html +99 -0
  34. tgp_ui/templates/macros.html +91 -0
  35. tgp_ui/templates/main.html +5 -0
  36. tgp_ui/templates/nxc_file_tree.html +33 -0
  37. tgp_ui/templates/nxc_login.html +25 -0
  38. tgp_ui/templates/nxc_tab.html +15 -0
  39. tgp_ui/templates/project.html +25 -0
  40. tgp_ui/templates/project_nxc.html +37 -0
  41. tgp_ui/templates/projects.html +73 -0
  42. tgp_ui/templates/publish.html +120 -0
  43. tgp_ui/templates/storage.html +49 -0
  44. tgp_ui/templates/tei_browser.html +14 -0
  45. tgp_ui/templates/tei_explorer.html +48 -0
  46. tgp_ui/templates/xpath_parser_modal_content.html +37 -0
@@ -0,0 +1,194 @@
1
+ {% from "macros.html" import multi_input, xpath_or_value_input with context %}
2
+ <div class="row mb-4 text-center">
3
+ <h5>{{ collection.long_title }}</h5>
4
+ </div>
5
+ <form method="POST" class="row collection-form"
6
+ action="{{ url_for('save_collection', projectname=project.name, title=collection_title) }}" method="POST">
7
+ <div class="row mb-1">
8
+ <ul class="nav nav-tabs w-100 align-items-stretch" id="collectionTab{{ collection.short_title }}"
9
+ role="tablist">
10
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
11
+ <button class="nav-link text-dark active w-100 text-primary"
12
+ id="fixedAttributesTab_{{ collection_title }}" data-bs-toggle="tab"
13
+ data-bs-target="#fixedAttributesContent_{{ collection_title }}" type="button" role="tab"
14
+ aria-controls="fixedAttributesContent_{{ collection_title }}" aria-selected="true">
15
+ Project
16
+ </button>
17
+ </li>
18
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
19
+ <button class="nav-link text-dark w-100" id="classificationAttributesTab_{{ collection_title }}"
20
+ data-bs-toggle="tab" data-bs-target="#classificationAttributesContent_{{ collection_title }}"
21
+ type="button" role="tab" aria-controls="classificationAttributesContent_{{ collection_title }}"
22
+ aria-selected="false">
23
+ Classifications
24
+ </button>
25
+ </li>
26
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
27
+ <button class="nav-link text-dark w-100" id="workAttributesTab_{{ collection_title }}"
28
+ data-bs-toggle="tab" data-bs-target="#workAttributesContent_{{ collection_title }}" type="button"
29
+ role="tab" aria-controls="workAttributesContent_{{ collection_title }}" aria-selected="false">
30
+ Work
31
+ </button>
32
+ </li>
33
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
34
+ <button class="nav-link text-dark w-100" id="editionAttributesTab_{{ collection_title }}"
35
+ data-bs-toggle="tab" data-bs-target="#editionAttributesContent_{{ collection_title }}" type="button"
36
+ role="tab" aria-controls="editionAttributesContent_{{ collection_title }}" aria-selected="false">
37
+ Edition
38
+ </button>
39
+ </li>
40
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
41
+ <button class="nav-link text-dark w-100" id="eltecAttributesTab_{{ collection_title }}"
42
+ data-bs-toggle="tab" data-bs-target="#eltecAttributesContent_{{ collection_title }}" type="button"
43
+ role="tab" aria-controls="eltecAttributesContent_{{ collection_title }}" aria-selected="false">
44
+ ELTEC specifications
45
+ </button>
46
+ </li>
47
+ <li class="nav-item col-12 col-lg-2 mb-2 mb-md-0" role="presentation">
48
+ <button class="nav-link text-dark w-100 tei_explorer" id="teiExplorer_{{ collection_title }}"
49
+ data-bs-toggle="tab" data-bs-target="#teiExplorerContent_{{ collection_title }}" type="button"
50
+ role="tab" aria-controls="teiExplorerContent_{{ collection_title }}" aria-selected="false"
51
+ data-url="{{url_for('tei_explorer', projectname=project.name, title=collection_title)}}">
52
+ TEI explorer
53
+ </button>
54
+ </li>
55
+ </ul>
56
+ </div>
57
+ <div class="row my-2">
58
+ <li class="nav-item col-12 col-lg-2 mt-2 mt-md-0" role="presentation">
59
+ <button type="submit" class="btn btn-success w-100">
60
+ <span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
61
+ <span>Save</span>
62
+ </button>
63
+ </li>
64
+ </div>
65
+ <div class="row tab-content" id="collectionTabContent{{ collection.short_title }}">
66
+ <div class="tab-pane fade show active" id="fixedAttributesContent_{{ collection_title }}" role="tabpanel"
67
+ aria-labelledby="fixedAttributesTab_{{ collection_title }}">
68
+ <div class="col-12">
69
+ <div class="mb-3 row">
70
+ <label class="col-sm-2 col-form-label">Long title</label>
71
+ <div class="col-sm-10">
72
+ <input type="text" class="form-control" name="long_title" value="{{ collection.long_title }}">
73
+ </div>
74
+ </div>
75
+ <div class="mb-3 row">
76
+ <label class="col-sm-2 col-form-label">Short title</label>
77
+ <div class="col-sm-10">
78
+ <input type="text" class="form-control" name="short_title" value="{{ collection.short_title }}">
79
+ </div>
80
+ </div>
81
+ {{ multi_input('rights_holder', 'Rights Holder', collection.rights_holder, version=2) }}
82
+ {{ multi_input('collector', 'Collector', collection.collector, version=2) }}
83
+ </div>
84
+ </div>
85
+ {% set collection_parser = project.get_collection_parser(collection) %}
86
+ <div class="tab-pane fade" id="workAttributesContent_{{ collection_title }}" role="tabpanel"
87
+ aria-labelledby="workAttributesTab_{{ collection_title }}">
88
+ <div class="col-12">
89
+ <div class="mb-3 row">
90
+ <label class="col-sm-12 col-form-label"><b>General</b>
91
+ </label>
92
+ </div>
93
+ {{ xpath_or_value_input('ID', 'work_id',
94
+ collection.work_id, collection_parser) }}
95
+ {{ xpath_or_value_input('Title', 'work_title', collection.work_title, collection_parser) }}
96
+ {{ xpath_or_value_input('Genre', 'genre', collection.genre, collection_parser) }}
97
+ {{ xpath_or_value_input('Place of publication', 'work_publication_place',
98
+ collection.work_publication_place, collection_parser) }}
99
+
100
+ <div class="mb-3 row">
101
+ <label class="col-sm-12 col-form-label"><b>Author</b>
102
+ </label>
103
+ </div>
104
+ {{ xpath_or_value_input('ID', 'author_id', collection.author_id, collection_parser)
105
+ }}
106
+ {{ xpath_or_value_input('Firstname', 'author_firstname', collection.author_firstname, collection_parser)
107
+ }}
108
+ {{ xpath_or_value_input('Lastname', 'author_lastname', collection.author_lastname, collection_parser) }}
109
+ {{ xpath_or_value_input('Fullname', 'author_fullname', collection.author_fullname, collection_parser) }}
110
+ <div class="mb-3 row">
111
+ <label class="col-sm-12 col-form-label"><b>Date of Creation</b>
112
+ </label>
113
+ </div>
114
+ {{ xpath_or_value_input('Date', 'work_publication_date',
115
+ collection.work_publication_date,
116
+ collection_parser) }}
117
+ {{ xpath_or_value_input('notBefore', 'work_publication_notBefore',
118
+ collection.work_publication_notBefore,
119
+ collection_parser) }}
120
+ {{ xpath_or_value_input('notAfter', 'work_publication_notAfter',
121
+ collection.work_publication_notAfter,
122
+ collection_parser) }}
123
+ </div>
124
+ </div>
125
+ <div class="tab-pane fade" id="classificationAttributesContent_{{ collection_title }}" role="tabpanel"
126
+ aria-labelledby="classificationAttributesTab_{{ collection_title }}">
127
+ <div class="col-12">
128
+ {{ multi_input('basic_classifications', 'Basic classification', collection.basic_classifications,
129
+ version=1)
130
+ }}
131
+ {{ multi_input('gnd_subjects', 'GND Subject Areas', collection.gnd_subjects, version=1) }}
132
+
133
+ </div>
134
+ </div>
135
+ <div class="tab-pane fade" id="editionAttributesContent_{{ collection_title }}" role="tabpanel"
136
+ aria-labelledby="editionAttributesTab_{{ collection_title }}">
137
+ <div class="col-12">
138
+ <div class="mb-3 row">
139
+ <label class="col-sm-12 col-form-label"><b>General</b>
140
+ </label>
141
+ </div>
142
+ {{ xpath_or_value_input('Title', 'edition_title', collection.edition_title,
143
+ collection_parser) }}
144
+ {{ xpath_or_value_input('Author ID', 'edition_author', collection.edition_author,
145
+ collection_parser) }}
146
+ {{ xpath_or_value_input('Language', 'language', collection.language, collection_parser) }}
147
+ {{ xpath_or_value_input('Wordcount', 'wordcount', collection.wordcount, collection_parser) }}
148
+
149
+ <div class="mb-3 row">
150
+ <label class="col-sm-12 col-form-label"><i>Publication</i>
151
+ </label>
152
+ </div>
153
+ {{ xpath_or_value_input('Date', 'edition_publication_date',
154
+ collection.edition_publication_date, collection_parser) }}
155
+ {{ xpath_or_value_input('Place', 'edition_publication_place',
156
+ collection.edition_publication_place, collection_parser) }}
157
+ <div class="mb-3 row">
158
+ <label class="col-sm-12 col-form-label"><i>License</i>
159
+ </label>
160
+ </div>
161
+ {{ xpath_or_value_input('Title', 'edition_license_title',
162
+ collection.edition_license_title, collection_parser) }}
163
+ {{ xpath_or_value_input('URL', 'edition_license_url',
164
+ collection.edition_license_url, collection_parser) }}
165
+
166
+ </div>
167
+ </div>
168
+ <div class="tab-pane fade" id="eltecAttributesContent_{{ collection_title }}" role="tabpanel"
169
+ aria-labelledby="eltecAttributesTab_{{ collection_title }}">
170
+ <div class="col-12">
171
+ <div class="mb-3 row">
172
+ <label class="col-sm-12 col-form-label"><b>General</b>
173
+ </label>
174
+ </div>
175
+ {{ xpath_or_value_input('Author gender', 'eltec_author_gender', collection.eltec_author_gender,
176
+ collection_parser) }}
177
+ {{ xpath_or_value_input('Reprint count', 'eltec_reprintCount', collection.eltec_reprintCount,
178
+ collection_parser) }}
179
+ {{ xpath_or_value_input('Author gender', 'eltec_author_gender', collection.eltec_author_gender,
180
+ collection_parser) }}
181
+ {{ xpath_or_value_input('Timeslot', 'eltec_time_slot', collection.eltec_time_slot,
182
+ collection_parser) }}
183
+ {{ xpath_or_value_input('Corpus collection', 'eltec_corpus', collection.eltec_corpus,
184
+ collection_parser) }}
185
+ {{ xpath_or_value_input('Size', 'eltec_size', collection.eltec_size,
186
+ collection_parser) }}
187
+ </div>
188
+ </div>
189
+
190
+ <div class="tab-pane fade tei-explorer-content" id="teiExplorerContent_{{ collection_title }}" role="tabpanel"
191
+ aria-labelledby="teiExplorer_{{ collection_title }}">TEI
192
+ explorer</div>
193
+ </form>
194
+ </div>
@@ -0,0 +1,4 @@
1
+ {% extends 'layout.html' %}
2
+ {% block content %}
3
+
4
+ {% endblock %}
@@ -0,0 +1,39 @@
1
+ {% set active_class = 'bg-warning' if project.main_config.get_subproject(inpath=item.path) else '' %}
2
+ {% if item.type == 'folder' %}
3
+ <li class="list-group-item {{ active_class }} folder">
4
+ <div class="d-flex justify-content-between align-items-center">
5
+ <span>
6
+ <a href="#" class="badge text-dark show-files" title="Show files">
7
+ <span class="bi bi-eye-slash-fill"></span>
8
+ </a>
9
+ <span class="bi-folder-fill"></span>
10
+ {{ item.name }}
11
+ <a href="#" class="badge text-dark select-folder" title="Select folder"
12
+ data-url="{{ url_for('set_configs', projectname=project.name) }}">
13
+ {% if project.main_config.get_subproject(inpath=item.path) %}
14
+ <span class="bi bi-circle-fill" data-path="{{ item.path }}"></span>
15
+ {% else %}
16
+ <span class="bi bi-circle" data-path="{{ item.path }}"></span>
17
+ {% endif %}
18
+ </a>
19
+ <span class="spinner-border spinner-border-sm" style="display:none;"></span>
20
+ </span>
21
+ <span>
22
+ <span class="badge bg-primary rounded-pill">{{ item.children.count }}</span>
23
+ </span>
24
+ </div>
25
+ {% for child in item.children.list %}
26
+ {% with item=child %}
27
+ <ul class="list-group list-group-flush">
28
+ {% include 'file_tree.html' %}
29
+ </ul>
30
+ {% endwith %}
31
+ {% endfor %}
32
+ </li>
33
+ {% else %}
34
+ <li class="list-group-item p-0 ps-3 m-0 small text-muted {{ active_class }} file" style="display: none;">
35
+ <span class="bi-file-earmark-text-fill"></span>
36
+ {{ item.name }}
37
+ </span>
38
+ </li>
39
+ {% endif %}
@@ -0,0 +1,24 @@
1
+ <form class="row mb-3" action="{{ url_for('upload_files', projectname=project.name) }}" method="POST"
2
+ enctype="multipart/form-data">
3
+ <h5>Upload Files or Folders</h5>
4
+ <div class="col-6">
5
+ <input type="file" class="form-control" name="files" multiple webkitdirectory onchange="this.form.submit()">
6
+ </div>
7
+ </form>
8
+ <form class="row" method="POST" data-url="{{ url_for('clone_git_project', projectname=project.name) }}" method="POST"
9
+ id="cloneFromGit">
10
+ <h5>Upload from git project</h5>
11
+ <i>Please be aware, that this can a take while (depending on the size of the git project)!</i>
12
+ <div class="col-6">
13
+ <input type="text" class="form-control" name="github_repo">
14
+ </div>
15
+ <div class="col-6">
16
+ <button type="submit" class="btn btn-primary">
17
+ <span class="spinner-border spinner-border-sm" style="display:none;" role="status"
18
+ aria-hidden="true"></span>
19
+ <span>Clone</span>
20
+ </button>
21
+ </div>
22
+ </form>
23
+
24
+ <br>
@@ -0,0 +1,6 @@
1
+ {% extends 'layout.html' %}
2
+ {% block content %}
3
+
4
+ <div id="filer-demo" data-url="{{ url_for('filer_content') }}"></div>
5
+
6
+ {% endblock %}
@@ -0,0 +1,59 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7
+ <meta name="description" content="" />
8
+ <meta name="author" content="" />
9
+ <title>{{ title }}</title>
10
+ <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" />
11
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" />
12
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
13
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/simpleXML.css') }}" />
14
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/main.css') }}" />
15
+
16
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/jstree.min.css') }}" />
17
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/jsfiler.min.css') }}" />
18
+ </head>
19
+
20
+ <body>
21
+ <nav class="navbar navbar-expand-md navbar-dark bg-secondary">
22
+ <div class="container-fluid">
23
+ <a class="navbar-brand" href="/">{{ title }}</a>
24
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
25
+ data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
26
+ aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
27
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
28
+ <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
29
+ <li class="nav-item">
30
+ <a class="nav-link" href="{{ url_for('projects') }}">Projects</a>
31
+ </li>
32
+ </ul>
33
+ </div>
34
+ </div>
35
+ </nav>
36
+ <div class="container mt-3">
37
+ <h1>
38
+ <span>
39
+ {{ sub_title }}
40
+ </span>
41
+ </h1>
42
+ <p> {{sub_description}} </p>
43
+ {% if error_msg %}
44
+ <div class="alert alert-danger text-center">
45
+ {{ error_msg }}
46
+ </div>
47
+ {% endif %}
48
+ {% block content %}{% endblock content %}
49
+ </div>
50
+ <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
51
+ <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
52
+ <script src="{{ url_for('static', filename='js/simpleXML.js') }}"></script>
53
+ <script src="{{ url_for('static', filename='js/jstree.min.js') }}"></script>
54
+ <script src="{{ url_for('static', filename='js/jsfiler.min.js') }}"></script>
55
+ <script src="{{ url_for('static', filename='js/main.js') }}"></script>
56
+ </script>
57
+ </body>
58
+
59
+ </html>
@@ -0,0 +1,99 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
7
+ <meta name="description" content="" />
8
+ <meta name="author" content="" />
9
+ <title>{{ title }}</title>
10
+ <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='img/favicon.ico') }}" />
11
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" />
12
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
13
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/simpleXML.css') }}" />
14
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/main.css') }}" />
15
+ </head>
16
+
17
+ <body>
18
+ <div class="wrapper">
19
+ <aside id="sidebar" class="expand">
20
+ <div class="d-flex">
21
+ <button class="toggle-btn" type="button">
22
+ <i class="bi bi-grid"></i>
23
+ </button>
24
+ <div class="sidebar-logo">
25
+ <a href="#">{{ title }}</a>
26
+ </div>
27
+ </div>
28
+ <ul class="sidebar-nav">
29
+ <li class="sidebar-item">
30
+ <a href={{ url_for("projects") }} class="sidebar-link" title="Projects">
31
+ <i class="bi bi-view-list"></i>
32
+ <span>Overview</span>
33
+ </a>
34
+ </li>
35
+ {% for project in get_projects() %}
36
+ <li class="sidebar-item">
37
+ <a href="{{ url_for('project', projectname=project.name) }}" class="sidebar-link"
38
+ data-bs-target="#project_{{ loop.index }}" aria-expanded="false"
39
+ aria-controls="project_{{ loop.index }}">
40
+ {% if current_project == project.name %}
41
+ <i class="bi bi-circle-fill"></i>
42
+ {% else %}
43
+ <i class="bi bi-circle"></i>
44
+ {% endif %}
45
+ <span>{{ project.name }}</span>
46
+ </a>
47
+ <ul id="project_{{ loop.index }}"
48
+ class="sidebar-dropdown nav list-unstyled ps-3 {{ 'collapse' if current_project != project.name }}"
49
+ data-bs-parent="#sidebar">
50
+ <li class="sidebar-item">
51
+ <a class="sidebar-link nav-link" data-bs-toggle="tab" href="#tab_storage" role="tab"
52
+ aria-controls="tab_storage" aria-selected="false">
53
+ <i class="bi bi-folder2-open"></i>
54
+ Storage
55
+ </a>
56
+ </li>
57
+ {% for c in project.collections %}
58
+ {% set collection_config = project.collections[c]['config'] %}
59
+ <li class="sidebar-item">
60
+ <a class="sidebar-link nav-link collection-tab" data-bs-toggle="tab" href="#tab_{{ c }}"
61
+ role="tab" aria-controls="tab_{{ c }} aria-selected=" false"
62
+ data-url="{{ url_for('collection', projectname=project.name, name=c) }}"
63
+ data-name="{{ c }}">
64
+ <i class="spinner-border spinner-border-sm" role="status" style="display:none;"></i>
65
+ <i class="bi bi-{{ loop.index }}-circle"></i>
66
+ {{collection_config.short_title}}
67
+ </a>
68
+ </li>
69
+ {% endfor %}
70
+ <li class="sidebar-item">
71
+ <a class="sidebar-link nav-link" data-bs-toggle="tab" href="#tab_publish" role="tab"
72
+ aria-controls="tab_publish" aria-selected="false">
73
+ <i class="bi bi-cloud-upload"></i>
74
+ Publish
75
+ </a>
76
+ </li>
77
+ </ul>
78
+ </li>
79
+ {% endfor %}
80
+ </aside>
81
+ <div class="main p-3">
82
+ <div class="text-center">
83
+ <h1>
84
+ <span>
85
+ {{ sub_title }}
86
+ </span>
87
+ </h1>
88
+ </div>
89
+ {% block content %}{% endblock content %}
90
+ </div>
91
+ </div>
92
+ <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
93
+ <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
94
+ <script src="{{ url_for('static', filename='js/simpleXML.js') }}"></script>
95
+ <script src="{{ url_for('static', filename='js/main.js') }}"></script>
96
+ </script>
97
+ </body>
98
+
99
+ </html>
@@ -0,0 +1,91 @@
1
+ {% macro multi_input(type, heading, elements, version=1) %}
2
+ <div class="border-top mb-3 row">
3
+ <label class="col-sm-12 col-form-label">
4
+ <div class="d-flex justify-content-between align-items-center">
5
+ <b>{{ heading }}</b>
6
+ <a href="#" class="add-multi-input btn btn-md" title="Add {{ heading }}">
7
+ <span class="bi bi-plus-circle"></span>
8
+ </a>
9
+ </div>
10
+ </label>
11
+ </div>
12
+ {% for item in elements or [None] %}
13
+ <div class="multi-input" data-name="{{ type }}">
14
+ {% if version == 1 %}
15
+ <div class="mb-3 row">
16
+ <label class="col-lg-2 col-form-label">ID
17
+ <a href="#" class="badge text-dark remove-multi-field">
18
+ <span class="bi bi-trash"></span>
19
+ </a>
20
+ </label>
21
+ <div class="col-lg-4">
22
+ <input type="text" class="form-control" data-key="id" value="{{ item['id'] if item['id'] }}">
23
+ </div>
24
+ <label class="col-lg-2 col-form-label">URL</label>
25
+ <div class="col-lg-4">
26
+ <input type="text" class="form-control" data-key="url" value="{{ item['url'] if item['url'] }}">
27
+ </div>
28
+ </div>
29
+ <div class="mb-3 row">
30
+ <label class="col-lg-2 col-form-label">Value</label>
31
+ <div class="col-lg-10 {{'pb-2 border-bottom' if loop.nextitem }}">
32
+ <input type="text" class="form-control" data-key="value" value="{{ item['value'] if item['value'] }}">
33
+ </div>
34
+ </div>
35
+ {% elif version == 2 %}
36
+ <div class="mb-3 row {{'pb-2 border-bottom' if loop.nextitem }}">
37
+ <label class="col-lg-2 col-form-label">
38
+ Fullname
39
+ </label>
40
+ <div class="col-lg-4">
41
+ <input type="text" class="form-control" data-key="fullname"
42
+ value="{{ item['fullname'] if item['fullname'] }}">
43
+ </div>
44
+ <label class="col-lg-1 col-form-label">URL</label>
45
+ <div class="col-lg-4 ">
46
+ <input type="text" class="form-control" data-key="url" value="{{ item['url'] if item['url'] }}">
47
+ </div>
48
+ <div class="col-lg-1 mt-lg-0 mt-2">
49
+ <a href="#" class="btn btn-md remove-multi-field">
50
+ <span class="bi bi-trash"></span>
51
+ </a>
52
+ </div>
53
+ </div>
54
+ {% endif %}
55
+ </div>
56
+ {% endfor %}
57
+ {% endmacro %}
58
+
59
+ {% macro xpath_or_value_input(heading, input_name, item, collection_parser, is_subsection=True) %}
60
+ <div class="mb-1 row gap-1 align-items-center xpath-or-value-input">
61
+ <label class="col-lg-2 col-form-label">
62
+ {% if is_subsection %}
63
+ {{ heading }}
64
+ {% else %}
65
+ <b>{{ heading }}</b>
66
+ {% endif %}
67
+ </label>
68
+ <div class="col-lg-5">
69
+ <div class="form-floating">
70
+ <input type="text" class="form-control" id="valueInput_{{ input_name }}" data-name="{{ input_name }}"
71
+ data-type="value" value="{{ item['value'] if item['value'] }}" placeholder="Value">
72
+ <label for="valueInput_{{ input_name }}">Value</label>
73
+ </div>
74
+ </div>
75
+ <div class="col-lg-4 position-relative">
76
+ <div class="form-floating">
77
+ <input type="text" class="form-control" id="xpathInput_{{ input_name }}" data-name="{{ input_name }}"
78
+ data-type="xpath" value="{{ item['xpath'] if item['xpath'] }}" placeholder="XPath">
79
+ <label for="xpathInput_{{ input_name }}">XPath</label>
80
+ </div>
81
+ <a href="#" class="show-xpath-in-tei-explorer" title="Hitrate of xpath (in %) - CLICK to see results"
82
+ data-url="{{ url_for('xpath_parser_modal', projectname=project.name, title=collection_title) }}"
83
+ data-xpath="{{ item['xpath'] }}">
84
+ <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-success"
85
+ data-bs-toggle="tooltip" data-bs-placement="top" title="Hitrate of XPath in percentage">
86
+ {{ collection_parser.test_xpath(item['xpath'])['count']['percentage'] if item['xpath'] else '-' }}
87
+ </span>
88
+ </a>
89
+ </div>
90
+ </div>
91
+ {% endmacro %}
@@ -0,0 +1,5 @@
1
+ {% extends "layout.html" %}
2
+ {% block content %}
3
+ <h1>A bare starting point for a flask project</h1>
4
+ <p class="lead">So far....completely bare bone!</p>
5
+ {% endblock %}
@@ -0,0 +1,33 @@
1
+ {% if item.type == 'folder' %}
2
+ <li class="list-group-item {{ active_class }} folder">
3
+ <div class="d-flex justify-content-between align-items-center">
4
+ <span>
5
+ <a href="#" class="badge text-dark show-files" title="Show files">
6
+ <span class="bi bi-eye-slash-fill"></span>
7
+ </a>
8
+ <span class="bi-folder-fill"></span>
9
+ {{ item.name }}
10
+ <a href="#" class="badge text-dark nxc_select-folder" title="Select folder" data-path="{{ item.path }}">
11
+ <span class="bi bi-circle" data-path="{{ item.path }}"></span>
12
+ </a>
13
+ <span class="spinner-border spinner-border-sm" style="display:none;"></span>
14
+ </span>
15
+ <span>
16
+ <span class="badge bg-primary rounded-pill">{{ item.children.count }}</span>
17
+ </span>
18
+ </div>
19
+ {% for child in item.children.list %}
20
+ {% with item=child %}
21
+ <ul class="list-group list-group-flush">
22
+ {% include 'nxc_file_tree.html' %}
23
+ </ul>
24
+ {% endwith %}
25
+ {% endfor %}
26
+ </li>
27
+ {% else %}
28
+ <li class="list-group-item p-0 ps-3 m-0 small text-muted {{ active_class }} file" style="display: none;">
29
+ <span class="bi-file-earmark-text-fill"></span>
30
+ {{ item.name }}
31
+ </span>
32
+ </li>
33
+ {% endif %}
@@ -0,0 +1,25 @@
1
+ <div class="h2">Nextcloud Login</div>
2
+ <form class="form-group login" method="POST" action="" id="nextcloud_login">
3
+ <div class="col-6">
4
+ <small class="form-text text-muted">Url</small>
5
+ <input required type="text" class="form-control" name="nextcloud_url" placeholder="Enter Nextcloud URL">
6
+ </div>
7
+ <div class="form-group col-3">
8
+ <small class="form-text text-muted">Username</small>
9
+ <input required type="text" class="form-control" name="username" id="username" placeholder="Enter Username">
10
+ </div>
11
+ <div class="form-group col-3">
12
+ <small class="form-text text-muted">Password</small>
13
+ <input required type="password" class="form-control" name="password" id="password" placeholder="Password">
14
+ </div>
15
+ <div class="form-group col-3">
16
+ <small class="form-text text-muted">Directory</small>
17
+ <input type="text" class="form-control" name="root_dir" id="root_dir" placeholder="(e.g.) TextGrid">
18
+ </div>
19
+ <br>
20
+ <button type="submit" class="btn btn-primary p-2 m-3 submit-login">
21
+ Submit
22
+ <span class="spinner-border spinner-border-sm spinner-login" hidden></span>
23
+ </button>
24
+ <span class="alert alert-danger" id="login-error" hidden>Wrong credentials</span>
25
+ </form>
@@ -0,0 +1,15 @@
1
+ {% if nextcloud %}
2
+ <div class="h2">{{user}}'s Folders</div>
3
+ {% for item in nextcloud.nxc_list_files_and_folders() %}
4
+ {% include 'nxc_file_tree.html' %}
5
+ {% endfor %}
6
+ <button type="submit" class="btn btn-primary p-2 m-3 submit-selection">
7
+ Submit
8
+ <span class="spinner-border spinner-border-sm spinner-submit" hidden></span>
9
+ </button>
10
+ <button type="button" class="btn btn-secondary p-2 m-3" id="nextcloud_logout" onclick="handleLogout()">
11
+ Logout
12
+ </button>
13
+ {% else %}
14
+ {% include 'nxc_login.html' %}
15
+ {% endif %}
@@ -0,0 +1,25 @@
1
+ {% extends 'layout2.html' %}
2
+ {% block content %}
3
+ <div class="row">
4
+ <div class="tab-content pt-2" id="tab-content">
5
+ <div class="tab-pane {{'active' if tab=='storage' }}" id="tab_storage" role="tabpanel">
6
+ {% include 'storage.html' %}
7
+ </div>
8
+ {% for c in project.collections %}
9
+ {% set collection_config = project.collections[c]['config'] %}
10
+ <div class="tab-pane {{ 'active' if tab==collection_config.short_title }}" id="tab_{{ c }}" role="tabpanel">
11
+ </div>
12
+ {% endfor %}
13
+ <div class="tab-pane {{'active' if tab=='publish' }}" id="tab_publish" role="tabpanel">
14
+ {% include 'publish.html' %}
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <div class=" modal fade" id="xpathParserModal" tabindex="-1" aria-labelledby="xpathParserModalLabel" aria-hidden="true">
20
+ </div>
21
+
22
+ <div class="modal fade" id="teiExplorer" tabindex="-1" aria-labelledby="teiExplorerLabel" aria-hidden="true">
23
+ </div>
24
+
25
+ {% endblock %}