diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:54:38 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2024-11-21 13:54:38 +0530 |
commit | 6a16bbdcdb40406592e47ee8d489f857837e5c96 (patch) | |
tree | 8d1a9f72115a106657e059f56e5b47df1a92f483 /src/templates |
Initial commit
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/base.html | 17 | ||||
-rw-r--r-- | src/templates/profile.html | 24 | ||||
-rw-r--r-- | src/templates/viewDir.html | 106 | ||||
-rw-r--r-- | src/templates/viewHome.html | 29 |
4 files changed, 176 insertions, 0 deletions
diff --git a/src/templates/base.html b/src/templates/base.html new file mode 100644 index 0000000..98e5787 --- /dev/null +++ b/src/templates/base.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> + +<head> + <title>Cloud Maker</title> + <link rel="stylesheet" href="/static/style.css"> + <script src="/static/script.js"></script> +</head> + +<body> + <main> + {{ template "main" . }} + </main> +</body> + +</html> + diff --git a/src/templates/profile.html b/src/templates/profile.html new file mode 100644 index 0000000..6e6fccd --- /dev/null +++ b/src/templates/profile.html @@ -0,0 +1,24 @@ +{{ define "main" }} + <header> + <a href="/"><h1>Cloud Maker</h1></a> + <a href="/"><img src="/static/icons/bs/house-door.svg"></a> + </header> + + <form id="profile" name="profile" method="POST"> + <h2>Profile</h2> + + <label for="username">Username</label> + <input id="username" name="username" value="{{.Username}}" required> + + <label for="password">New Password</label> + <input type="password" id="password" name="password"> + + <label for="confirm-pass">Confirm Password</label> + <input type="password" id="confirm-pass" name="confirm-pass"> + + <button>Update</button> + {{ if .Message }} + <p class="{{.Status}}">{{ .Message }}</p> + {{ end }} + </form> +{{ end }} diff --git a/src/templates/viewDir.html b/src/templates/viewDir.html new file mode 100644 index 0000000..9d45242 --- /dev/null +++ b/src/templates/viewDir.html @@ -0,0 +1,106 @@ +{{ define "main" }} +{{ $location := .File.URI }} +{{ $path := .File.Path }} +<form id="file_manager" name="file_manager" enctype="multipart/form-data" method="post"> + + <div class="form-header"> + <h4 class="html-path clickable">{{ .File.HTMLPath }}</h4> + <div class="form-actions clickable"> + <button class="back-button" formaction="/view/{{$location}}/.."> <img src="/static/icons/bs/actions/arrow-left-short.svg"> <b>Back</b> </button> + <button class="cut-button" formaction="?action=cut"> <img src="/static/icons/bs/actions/scissors.svg"> <b>Cut</b> </button> + <button class="copy-button" formaction="?action=copy"> <img src="/static/icons/bs/actions/copy.svg"> <b>Copy</b> </button> + <button class="delete-button" onclick="deleteAction(this)"> <img src="/static/icons/bs/actions/trash.svg"> <b>Delete</b> </button> + <button class="download-button" formaction="/download/{{$location}}"> <img src="/static/icons/bs/actions/download.svg"> <b>Download</b> </button> + <input type="checkbox" id="upload-button"> + <label for="upload-button"><img src="/static/icons/bs/actions/upload.svg"> <b>Upload</b> </label> + <div id="file-upload-box"> + <input type="file" name="attachments" multiple> + <span class="actions"> + <button formaction="/upload/{{$location}}"><img src="/static/icons/bs/actions/upload.svg"> <b>Submit</b> </button> + </span> + </div> + </div> + + {{ if .CutCount }} + <details id="cut-buffer"> + <summary class="clickable"> + <span> <img src="/static/icons/bs/actions/scissors.svg"> Files in Cut Buffer ({{ .CutCount }}) </span> + <span class="actions"> + <button type="submit" class="paste-button" formaction="?action=cut-paste"> + <img src="/static/icons/bs/actions/clipboard.svg"> <b>Paste</b> + </button> + <button type="submit" class="clear-button" formaction="?action=cancel-cut"> + <img src="/static/icons/bs/actions/backspace.svg"> <b>Clear</b> + </button> + </span> + </summary> + <div class="content"> + {{ range .CutBuffer }} <div>{{ . }}</div> {{ end }} + </div> + </details> + {{ end }} + + {{ if .CopyCount }} + <details id="copy-buffer"> + <summary class="clickable"> + <span> <img class="icon" src="/static/icons/bs/actions/copy.svg"> Files in Copy Buffer ({{ .CopyCount }}) </span> + <span class="actions"> + <button type="submit" class="paste-button" formaction="/view/{{$location}}?action=copy-paste"> <img src="/static/icons/bs/actions/clipboard.svg"> <b>Paste</b> </button> + <button type="submit" class="clear-button" formaction="/view/{{$location}}?action=cancel-copy"> <img src="/static/icons/bs/actions/backspace.svg"> <b>Clear</b> </button> + </span> + </summary> + <div class="content"> + {{ range .CopyBuffer }} <div>{{ . }}</div> {{ end }} + </div> + </details> + {{ end }} + </div> + + <div class="table clickable" id="file-list"> + <div class="thead"> + <label class="tr" for="file-list-header"> + <input class="th" type="checkbox" id="file-list-header" name="file-list-header" onchange="toggleAll(this)"> + <span class="th"></span> + <span class="th">File</span> + <span class="th">Size</span> + <span class="th">Date</span> + <span class="th">Time</span> + <span class="th">Info</span> + </label> + </div> + <div class="tbody"> + {{ range .File.Data }} + {{ $name := .Info.Name }} + <label class="tr mode-{{.Mode}}" for="-file-entry--{{$name}}"> + <input class="td" type="checkbox" id="-file-entry--{{$name}}" name="-file-entry--{{$name}}"> + <span class="td"><img src="{{.IconPath}}"></span> + <span class="td"><a href="/view/{{$location}}/{{$name}}">{{$name}}</a></span> + <span class="td">{{ .Size }}</span> + <span class="td">{{ .ModDate }}</span> + <span class="td">{{ .ModTime }}</span> + <span class="td">{{ .Details }}</span> + </label> + {{ end }} + </div> + </div> + + {{ if .FileCount }} + <p class="info hint">Hint: aestrik (*) indicates mime-type (media type) of file in Info section.</p> + {{ else }} + <p class="info empty-folder-msg">Empty Folder</p> + {{ end }} +</form> + +<form action="?action=newdir" method="post"> + <input type="checkbox" id="newdir-cb" name="newdir-cb"> + <label for="newdir-cb"><img src="/static/icons/bs/actions/folder-plus.svg"></label> + <div id="newdir-bg" onclick="document.getElementById('newdir-cb').checked = false;"></div> + <div id="newdir-box"> + <p><b>Create New Folder</b></p> + <p> + <input type="text" name="newdir" placeholder="Folder Name" required> + <button formaction="?action=newdir"><img src="/static/icons/bs/actions/check.svg"></button> + </p> + </div> +</form> +{{ end }} diff --git a/src/templates/viewHome.html b/src/templates/viewHome.html new file mode 100644 index 0000000..bd841d2 --- /dev/null +++ b/src/templates/viewHome.html @@ -0,0 +1,29 @@ +{{ define "main" }} +{{ $location := .File.URI }} +{{ $path := .File.Path }} +<header> + <a href="/"><h1>Cloud Maker</h1></a> + <a href="/profile"><img src="/static/icons/bs/person-circle.svg"></a> +</header> + +<form id="device_manager" name="device_manager" method="POST"> + + <div class="drives"> + {{ range .File.Data }} + {{ $name := .Info.Name }} + <a class="drive" href="/view/{{$location}}/{{$name}}"> + <span><img src="/static/icons/bs/hdd.svg"></span> + <span> + <div>{{ $name }}</div> + <div class="desc">drive</div> + </span> + </a> + {{ end }} + </div> + + {{ if not .FileCount }} + <p class="info">No Drives Mounted.</p> + {{ end }} + +</form> +{{ end }} |