Static pages
This commit is contained in:
parent
35669526cf
commit
7ca4f5d008
4
static/css/style.css
Normal file
4
static/css/style.css
Normal file
@ -0,0 +1,4 @@
|
||||
body {
|
||||
background-color: #2D2D2D;
|
||||
padding-top: 54px;
|
||||
}
|
22
static/lib/bootstrap/LICENSE
Normal file
22
static/lib/bootstrap/LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2020 Twitter, Inc.
|
||||
Copyright (c) 2011-2020 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
8975
static/lib/bootstrap/css/bootstrap.css
vendored
Normal file
8975
static/lib/bootstrap/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
static/lib/bootstrap/css/bootstrap.css.map
Normal file
1
static/lib/bootstrap/css/bootstrap.css.map
Normal file
File diff suppressed because one or more lines are too long
6328
static/lib/bootstrap/js/bootstrap.bundle.js
vendored
Normal file
6328
static/lib/bootstrap/js/bootstrap.bundle.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
static/lib/bootstrap/js/bootstrap.bundle.js.map
Normal file
1
static/lib/bootstrap/js/bootstrap.bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
2
static/lib/jquery/jquery-3.5.1.min.js
vendored
Normal file
2
static/lib/jquery/jquery-3.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
static/media/portal/logo/default.png
Normal file
BIN
static/media/portal/logo/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
static/media/portal/logo/plus.png
Normal file
BIN
static/media/portal/logo/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
static/media/thumbs/default.png
Normal file
BIN
static/media/thumbs/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
74
static/page/home.html
Executable file
74
static/page/home.html
Executable file
@ -0,0 +1,74 @@
|
||||
<div class="container-fluid my-3">
|
||||
<div class="row">
|
||||
<div class="col-12 text-white">
|
||||
<h3 class="text-white">Your Portal List</h3>
|
||||
<hr class="bg-white">
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 col-lg-4 mt-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 col-sm-2 col-4">
|
||||
<img class="w-100" src="${GV_base_url}/media/portal/logo/plus.png" alt="New portal">
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-8 col-sm-10 col-8">
|
||||
<a class="btn btn-primary" href="#" data-toggle="modal" data-target="#NewPortal">
|
||||
<b>New portal</b>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% for row in listing_portal:
|
||||
<div class="col-sm-12 col-md-6 col-lg-4 mt-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 col-sm-2 col-4">
|
||||
% if row[2] == None:
|
||||
<a href="${GV_base_url}/portal/?id=${row[0]}">
|
||||
<img class="w-100" src="${GV_base_url}/media/portal/logo/default.png" alt="${row[1]}">
|
||||
</a>
|
||||
% else:
|
||||
<a href="${GV_base_url}/portal/?id=${row[0]}">
|
||||
<img class="w-100" src="${row[2]}" alt="${row[1]}">
|
||||
</a>
|
||||
% endif
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-8 col-sm-10 col-8">
|
||||
<a href="${GV_base_url}/portal/?id=${row[0]}">
|
||||
<h3>${row[1]}</h3>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endfor
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" tabindex="-1" role="dialog" id="NewPortal" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">New portal</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="${GV_base_url}/api/portal/add/" method="post">
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="title" placeholder="Title">
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="website" placeholder="Website">
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="logo" placeholder="Logo's URL">
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="directory" placeholder="Directory">
|
||||
<button class="btn-sm btn-primary" type="submit">
|
||||
Create
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
133
static/page/portal.html
Normal file
133
static/page/portal.html
Normal file
@ -0,0 +1,133 @@
|
||||
<div class="container-fluid my-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3 class="text-white">Portal Information</h3>
|
||||
<hr class="bg-white">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-1 col-md-2 col-sm-2 col-4">
|
||||
% if portal_info['logo'] == None:
|
||||
<img class="w-100" src="${GV_base_url}/media/portal/logo/default.png" alt="${portal_info['title']}">
|
||||
% else:
|
||||
<img class="w-100" src="${portal_info['logo']}" alt="${portal_info['title']}">
|
||||
% endif
|
||||
</div>
|
||||
<div class="col-lg-11 col-md-10 col-sm-10 col-8">
|
||||
<b>${portal_info['title']}</b><br>
|
||||
<a href="${portal_info['website']}" target="_blank">${portal_info['website']}</a><br>
|
||||
<input class="form-control form-control-sm" type="text" value="${portal_info['directory']}" readonly>
|
||||
% if storage_available == True:
|
||||
<span class="badge badge-success">Storage detected</span>
|
||||
% else:
|
||||
<span class="badge badge-danger">Storage not detected</span>
|
||||
% endif
|
||||
% if storage_available:
|
||||
% if checking_status == 'new':
|
||||
<span class="badge badge-primary">${new_file_info['count']} New file detected</span>
|
||||
% elif checking_status == 'miss':
|
||||
<span class="badge badge-danger">Some file is missing</span>
|
||||
% else:
|
||||
<span class="badge badge-success">Files updated</span>
|
||||
% endif
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% if storage_available:
|
||||
% if new_file_info:
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<h3 class="text-white">
|
||||
New Files <span class="badge badge-primary">${new_file_info['count']}</span>
|
||||
</h3>
|
||||
<hr class="bg-white">
|
||||
</div>
|
||||
<% i = 0 %>
|
||||
% for row in new_file_info['info']:
|
||||
<% i += 1 %>
|
||||
<div class="col-lg-4 col-md-4 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<img class="w-100 mb-2" src="${GV_base_url}/media/thumbs/${row['name']}${row['type']}.jpg" alt="thumbnail">
|
||||
|
||||
<h4>
|
||||
${row['name']} <span class="badge badge-primary">${row['type']}</span>
|
||||
</h4>
|
||||
<!-- ${row['file']}<br> -->
|
||||
<span class="badge badge-primary">
|
||||
${"%0.2f" % (row['size']/1000000)} MB (${row['size']})
|
||||
</span>
|
||||
<span class="badge badge-primary">
|
||||
${int(row['width'])} x ${int(row['height'])}
|
||||
</span>
|
||||
<hr>
|
||||
<form action="${GV_base_url}/api/video/add/new" method="post">
|
||||
<div class="form-group">
|
||||
<label>Title</label>
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="title" placeholder="Title" value="${row['name']}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="description" placeholder="Description">
|
||||
</div>
|
||||
<div class="form-group" id="artist_type${i}">
|
||||
<label>Artist</label>
|
||||
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="artist_type" id="artist_exist${i}" value="new" checked>
|
||||
<label class="form-check-label">
|
||||
Existing artist
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<select class="form-control form-control-sm mb-2" name="id_artist" id="artist_id${i}">
|
||||
<option value="" disabled selected>Choose your artist</option>
|
||||
<option value="" disabled>Artist list is empty</option>
|
||||
</select>
|
||||
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="artist_type" id="artist_new${i}" value="exist">
|
||||
<label class="form-check-label">
|
||||
New artist
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<input class="form-control form-control-sm mb-2" type="text" name="name" id="artist_name${i}" placeholder="Artist Name">
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#artist_name${i}").prop("disabled", true);
|
||||
$('#artist_type${i}').click(function() {
|
||||
if ($('#artist_new${i}').is(':checked')) {
|
||||
$("#artist_name${i}").prop("disabled", false);
|
||||
$("#artist_id${i}").prop("disabled", true);
|
||||
}
|
||||
|
||||
else {
|
||||
$("#artist_name${i}").prop("disabled", true);
|
||||
$("#artist_id${i}").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<input type="hidden" name="type" value="${row['type']}">
|
||||
<input type="hidden" name="size" value="${row['size']}">
|
||||
<input type="hidden" name="height" value="${int(row['height'])}">
|
||||
<input type="hidden" name="width" value="${int(row['width'])}">
|
||||
</div>
|
||||
<button class="btn-sm btn-primary" type="submit">
|
||||
Save
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endfor
|
||||
</div>
|
||||
% endif
|
||||
% endif
|
||||
</div>
|
3
static/template/footer.html
Normal file
3
static/template/footer.html
Normal file
@ -0,0 +1,3 @@
|
||||
<footer class="mt-auto bg-dark text-light p-3 text-center">
|
||||
© 2022 Dita Aji Pratama
|
||||
</footer>
|
22
static/template/template.html
Normal file
22
static/template/template.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>${GV_title}</title>
|
||||
|
||||
<script src="${GV_base_url}/lib/jquery/jquery-3.5.1.min.js"></script>
|
||||
|
||||
<link href="${GV_base_url}/lib/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
|
||||
<script src="${GV_base_url}/lib/bootstrap/js/bootstrap.bundle.js"></script>
|
||||
|
||||
<link href="${GV_base_url}/css/style.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body class="d-flex flex-column" style="min-height:100vh;">
|
||||
${topnav}
|
||||
${container}
|
||||
${footer}
|
||||
</body>
|
||||
</html>
|
13
static/template/topnav.html
Executable file
13
static/template/topnav.html
Executable file
@ -0,0 +1,13 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<a class="navbar-brand" href="/">${GV_title}</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/">Home</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
Loading…
Reference in New Issue
Block a user