149 lines
8.1 KiB
HTML
149 lines
8.1 KiB
HTML
{% extends "layout.html" %}
|
|
{% block content %}
|
|
<div class="container">
|
|
<!-- Upload controls -->
|
|
<div class="col sticky-top">
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="row controls-secondary">
|
|
<div class="col">
|
|
<button class="btn btn-info" data-bs-toggle="modal"
|
|
data-bs-target="#uploaderModal">Upload...</button>
|
|
</div>
|
|
{% if oidc_isAdmin() %}
|
|
<div class="col">
|
|
<button id="googlePicker" class="btn btn-success">GDrive</button>
|
|
</div>
|
|
<div class="col">
|
|
<button id="notesToViewBtn" class="btn btn-secondary">Notes</button>
|
|
</div>
|
|
<div class="col">
|
|
<button id="filesToViewBtn" class="btn btn-secondary">Files</button>
|
|
</div>
|
|
{% endif %}
|
|
{% if oidc_loggedin() %}
|
|
<div class="col">
|
|
<a title="Logout..." class="btn btn-danger" href="/logout">
|
|
Logout
|
|
</a>
|
|
</div>
|
|
{% else %}
|
|
<div class="col">
|
|
<a class="btn btn-info" href="/login">
|
|
Login
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col">
|
|
<!-- Message zone -->
|
|
<div id="page-alert-zone"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Google Drive Picker -->
|
|
<div class="col">
|
|
<div id="result"></div>
|
|
</div>
|
|
|
|
<!-- Upload(ed) List -->
|
|
<div class="col">
|
|
{% if oidc_isAdmin() %}
|
|
<div class="col scroller" style="height:80vh; overflow-y: scroll;">
|
|
<!-- Uploadeed Files List -->
|
|
<ul class="row list-group" style="">
|
|
<span id="notesToView"></span>
|
|
{% for note in notes %}
|
|
<li class="list-group-item card-text col-sm-12 col-md-6 col-lg-4 t{{ loop.index }}" textStrID="{{note['id']}}">
|
|
<span class="badge badge-primary badge-pill">
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/trashcan.svg')}}" title="Delete..."
|
|
alt="Delete" data-bs-toggle="modal" data-bs-target="#deleteDialogModalText"
|
|
onclick="preDeleteText(this.parentElement.parentElement)" />
|
|
</span>
|
|
{% if "youtu.be" in note["string"].strip().lower() or "www.youtube.com/watch?v=" in note["string"].strip().lower() %}
|
|
{% if "youtu.be" in note["string"].strip() %}
|
|
{{note["string"]}}
|
|
<iframe class="card-img-top"
|
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
autoplay="" allowfullscreen="true" width="650px" height="400px" frameborder="0"
|
|
src="{{note['string'] | replace('youtu.be/', 'www.youtube.com/embed/')}}">
|
|
</iframe>
|
|
{% elif "www.youtube.com/watch?v=" in note["string"].strip().lower() %}
|
|
{{note["string"]}}
|
|
<iframe class="card-img-top"
|
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
autoplay="" allowfullscreen="true" width="650px" height="400px" frameborder="0"
|
|
src="{{note['string'] | replace('www.youtube.com/watch?v=', 'www.youtube.com/embed/')}}">
|
|
</iframe>
|
|
{% endif %}
|
|
{% elif note["string"].strip().startswith( ("http:", "https:", "ftp:", "file:") ) %}
|
|
{% if note["string"].strip().endswith( (".jpg", ".jpeg", ".png", ".gif") ) %}
|
|
<a href="{{note['string']}}" target="_blank">
|
|
{{note["string"]}}
|
|
</a>
|
|
<img class="card-img-top server-image" src="{{note['string']}}" width="650px" height="auto" />
|
|
{% else %}
|
|
<a href="{{note['string']}}" target="_blank">
|
|
{{note["string"]}}
|
|
</a>
|
|
{% endif %}
|
|
{% elif note["string"].strip() %}
|
|
<pre>{{note["string"]}}</pre>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
|
|
<hr/>
|
|
<span id="filesToView"></span>
|
|
{% for file in files %}
|
|
<li class="list-group-item col-sm-12 col-md-6 col-lg-4 r{{ loop.index }}">
|
|
<p class="server-file-card text-right" fileName="{{file[0]}}" fileHash="{{file[1]}}">
|
|
<span class="file-name card-title-text">{{file[0]}}</span>
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/pencil.svg')}}" title="Edit..."
|
|
alt="Edit" data-bs-toggle="modal" data-bs-target="#editDialogModal"
|
|
onclick="preEditFile(this.parentElement)" />
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/trashcan.svg')}}" title="Delete..."
|
|
alt="Delete" data-bs-toggle="modal" data-bs-target="#deleteDialogModal"
|
|
onclick="preDeleteFile(this.parentElement)" />
|
|
</p>
|
|
{% if file[0].lower().endswith( (".png", ".jpg", ".jpeg") ) %}
|
|
<a href="{{ url_for('uploads')}}/{{file[0]}}" target="_blank">
|
|
<img class="card-img-top" src="{{ url_for('uploads')}}/{{file[0]}}" alt="{{file[0]}}" />
|
|
</a>
|
|
{% elif file[0].lower().endswith( (".mp4", ".webm") ) %}
|
|
<video class="card-img-top" src="{{ url_for('uploads')}}/{{file[0]}}" controls></video>
|
|
{% else %}
|
|
<a href="{{ url_for('uploads')}}/{{file[0]}}" target="_blank">{{file[0]}}</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% else %}
|
|
</div>
|
|
<div class="row justify-content-center">
|
|
<h3>Log in with an Admin account to view files...</h3>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock content %}
|
|
|
|
{% block scripts %}
|
|
<!-- Created scripts -->
|
|
<script src="{{ url_for('static', filename='js/post-ajax.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/ajax.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/ui-logic.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/events.js')}}"></script>
|
|
|
|
{% if oidc_isAdmin() %}
|
|
<!-- The Google API Loader script. -->
|
|
<script src="{{ url_for('static', filename='js/google-picker-logic.js')}}"></script>
|
|
<script type="text/javascript" src="https://apis.google.com/js/api.js?onload=loadPicker"></script>
|
|
{% endif %}
|
|
{% endblock scripts %}
|