summaryrefslogtreecommitdiff
path: root/src/main/resources/static/home.html
blob: 7dac764dfdfe6b4e9df2620fa340986180ec575c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Meta tags -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Title -->
    <title>Websketch - {{ directory }}</title>
    <!-- Stylesheets -->
    <link rel="stylesheet" href="{{ url_for('sketch', filename='css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('sketch', filename='vendor/fontawesome-5.1/css/all.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('sketch', filename='vendor/datatable/datatables.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('sketch', filename='css/style.min.css') }}">
</head>

<body>
<div class="conn">

    <!-- Header -->
    <header id="header" class="d-flex align_item_center">
        <div onclick="document.location='/'" class="logo_p">
            <img src="{{ url_for('sketch', filename='images/att-globe.svg') }}" alt="att-globe">
        </div>

        <div class="heading_title_p">
            <h2>Directory: {{ directory }}</h2>
        </div>
    </header>

    <!-- ----- Upload Form ----- -->
    <div class="inputUploadP">
        <form method="post" action="/upload" enctype="multipart/form-data" class="uploadForm">
            <!-- -- Upload File -- -->
            <div class="uploadFile_P">
                <input type="file" name="file" id="file" class="uploadFile"
                       data-multiple-caption="{count} files selected" multiple/>
                <label for="file">
                    <i class="fa fa-upload"></i>
                    <span>Choose a file…</span>
                </label>
                <input type="hidden" name="path" value="{{ directory }}">
            </div>
            <!-- -- Upload Btn -- -->
            <p class="uploadBtn_P">
                <button type="submit" class="uploadBtn btn btn-primary">
                    Upload
                </button>
            </p>
        </form>
    </div>

    {% if is_subdirectory %}
    <section class="backBtn_p">
        <a href="/{{ back }}">
            <i class="fas fa-level-up-alt"></i>
            <span>Back</span>
        </a>
    </section>
    {% endif %}

    <!-- Table -->
    <section class="table_p table-responsive">
        <table id="tableData" class="table table-hover compact">
            <thead>
            <tr>
                <th width="4%"><!--Type (Directory or File)--></th>
                <th>Name</th>
                <th>Size</th>
                <th>Last Modified</th>
                <th></th> <!-- View file -->
            </tr>
            </thead>
            <tbody>
            {% for file in files %}
            <tr>
                <td> <!-- Icon -->
                    {% if file.is_dir %}
                    <button class="file_ic"><i class="far fa-folder"></i></button><!-- Directory icon -->
                    {% else %}
                    <button class="file_ic"><i class="far fa-file"></i></button><!-- File icon -->
                    {% endif %}
                </td>
                <td> <!-- Name -->
                    <a href="/{{ file.rel_path }}">{{ file.name }}{% if file.is_dir %}/{% endif %}</a>
                </td>
                <td data-order="{{ file.size_sort }}"> <!-- File size -->
                    {{ file.size }}
                </td>
                <td data-order="{{ file.last_modified_sort }}"> <!-- File last modified -->
                    {{ file.last_modified }}
                </td>
                <td> <!-- View file -->
                    {% if not file.is_dir %}
                    <a href="/{{ file.rel_path }}?view">View in browser</a>
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </section>

    <footer>
        <p>
            Websketch V22.03
        </p>
    </footer>

</div> <!-- end class conn -->

<!-- Scripts -->
<script src="{{ url_for('sketch', filename='js/jquery-3.4.1.min.js') }}"></script>
<script src="{{ url_for('sketch', filename='vendor/datatable/datatables.min.js') }}"></script>
<script src="{{ url_for('sketch', filename='js/main.js') }}"></script>

</body>
</html>