You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
160 lines
8.7 KiB
HTML
160 lines
8.7 KiB
HTML
{% extends "layout.html" %}
|
|
{% block content %}
|
|
<div class="container">
|
|
<!-- Upload controls -->
|
|
<div class="row sticky-top">
|
|
<div class="col">
|
|
<div class="row controls-secondary">
|
|
<div class="col">
|
|
<button class="btn btn-info" data-toggle="modal"
|
|
data-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() %}
|
|
<a href="/logout">
|
|
<button title="Logout..." class="btn btn-danger">
|
|
Logout
|
|
</button>
|
|
</a>
|
|
{% else %}
|
|
<a href="/login">
|
|
<button title="Login..." class="btn btn-success">
|
|
Login
|
|
</button>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col">
|
|
<!-- Message zone -->
|
|
<div id="page-alert-zone"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Google Drive Picker -->
|
|
<div class="row">
|
|
<div id="result"></div>
|
|
</div>
|
|
|
|
<!-- Upload(ed) List -->
|
|
<div class="row">
|
|
<h3 style="width: 100%;">Server Files:</h3>
|
|
{% if oidc_isAdmin() %}
|
|
<div class="col scroller" style="height:80vh; overflow-y: scroll;">
|
|
<!-- Uploadeed Files List -->
|
|
<ul class="list-group" style="">
|
|
<span id="notesToView"></span>
|
|
{% for note in notes %}
|
|
<li class="row rtext t{{ loop.index }}" textStrID="{{note['id']}}">
|
|
<div class="col-sm-2 list-group-item text-center">
|
|
<p class="server-file-card text-left">
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/trashcan.svg')}}" title="Delete..."
|
|
alt="Delete" data-toggle="modal" data-target="#deleteDialogModalText"
|
|
onclick="preDeleteText(this.parentElement.parentElement.parentElement)" />
|
|
</p>
|
|
</div>
|
|
|
|
<div class="col-md-10 list-group-item">
|
|
{% 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() %}
|
|
<span class="list-group-item list-group-item-action justify-content-center text-center">
|
|
{{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>
|
|
</span>
|
|
{% elif "www.youtube.com/watch?v=" in note["string"].strip().lower() %}
|
|
<span class="list-group-item list-group-item-action justify-content-center text-center">
|
|
{{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>
|
|
</span>
|
|
{% endif %}
|
|
{% elif note["string"].strip().startswith( ("http:", "https:", "ftp:", "file:") ) %}
|
|
{% if note["string"].strip().endswith( (".jpg", ".jpeg", ".png", ".gif") ) %}
|
|
<div class="list-group-item list-group-item-action justify-content-center text-center">
|
|
<a href="{{note['string']}}" target="_blank">
|
|
{{note["string"]}}
|
|
</a>
|
|
<img class="card-img-top server-image" src="{{note['string']}}" width="650px" height="auto" />
|
|
</div>
|
|
{% else %}
|
|
<a class="list-group-item list-group-item-action" href="{{note['string']}}" target="_blank">
|
|
{{note["string"]}}
|
|
</a>
|
|
{% endif %}
|
|
{% elif note["string"].strip() %}
|
|
<pre class="list-group-item list-group-item-action">{{note["string"]}}</pre>
|
|
{% endif %}
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
|
|
<span id="filesToView"></span>
|
|
{% for file in files %}
|
|
<li class="row r{{ loop.index }}">
|
|
<div class="col list-group-item text-center">
|
|
<p class="server-file-card text-right" fileName="{{file[0]}}" fileHash="{{file[1]}}">
|
|
<span class="file-name" style="float:left;">{{file[0]}}</span>
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/pencil.svg')}}" title="Edit..."
|
|
alt="Edit" data-toggle="modal" data-target="#editDialogModal"
|
|
onclick="preEditFile(this.parentElement)" />
|
|
<img class="menu-item" src="{{ url_for('static', filename='imgs/octicons/trashcan.svg')}}" title="Delete..."
|
|
alt="Delete" data-toggle="modal" data-target="#deleteDialogModal"
|
|
onclick="preDeleteFile(this.parentElement)" />
|
|
</p>
|
|
{% if file[0].lower().endswith( (".png", ".jpg", ".jpeg") ) %}
|
|
<a class="list-group-item-action content-align-center" href="{{ url_for('uploads')}}/{{file[0]}}" target="_blank">
|
|
<img class="card-img-top server-image" 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 class="list-group-item list-group-item-action" href="{{ url_for('uploads')}}/{{file[0]}}" target="_blank">{{file[0]}}</a>
|
|
{% endif %}
|
|
</div>
|
|
</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 %}
|