-
Notifications
You must be signed in to change notification settings - Fork 8
Change explorer structure to table #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| # -*- coding: utf-8 -*- | ||
| import os | ||
| from flask import Flask, render_template, redirect, request | ||
| from filesystem import Folder, File | ||
| from action import * | ||
| from flask import request | ||
| from os import error | ||
|
|
||
| from flask import redirect | ||
| from flask import request | ||
|
|
||
| from action import * | ||
| from filesystem import Folder, File | ||
|
|
||
| app = Flask(__name__) | ||
| app.config.update( | ||
| DEBUG=True, | ||
|
|
@@ -48,4 +49,4 @@ def create_directory(path = "/"): | |
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| app.run(host="0.0.0.0") | ||
| app.run(host="127.0.0.1", port=8080) # for local testing | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxtortime could you please at least leave port setting as default. I don't think it's critical to this PR.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'll change to default port setting. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,75 @@ | ||
| {% extends "index.html" %} | ||
|
|
||
| {% block content %} | ||
| <div class="row"> | ||
| <div class="span12"> | ||
| <h1 class="page-header">{{ folder.name }}</h1> | ||
| <!-- New Directory Modal --> | ||
| <div id ="newDirectory" class="modal fade" role="dialog"> | ||
| <div class="modal-dialog"> | ||
| <!--Modal content--> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <button type="button" class="close" data-dismiss="modal">×</button> | ||
| <h4>Making new directory</h4> | ||
| </div> | ||
| <div class="modal-body"> | ||
| <form action="{{ url_for('create_directory') }}" method="post" id="mdform"> | ||
| <label> 디렉토리 이름을 입력하세요 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxtortime Not everybody OK with Korean :)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for missing that thing. |
||
| <input type="text" name="new_directory_name"> | ||
| </label> | ||
| <input class='btn btn-primary' type="submit" value="Create directory"> | ||
| <input id="folder_path" type="hidden" value="{{folder.path}}" name="directory_root"> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {% if folder.chunks %} | ||
| <ul class="breadcrumb"> | ||
| {% for chunk in folder.chunks() %} | ||
| <li> | ||
| <a href="/files/{{ chunk.path }}">{{ chunk.chunk }}</a> | ||
| <span class="divider">/</span> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| {% endif %} | ||
| <div class="row"> | ||
| <div class="span6"> | ||
| <h3 class="page-header">Folders:</h3> | ||
| <form action="new_directory" method="post"> | ||
| <input type="text" name="new_directory_name"> | ||
| <input type="submit" value="Create directory"> | ||
| <input type="hidden" value="{{folder.path}}" name="directory_root"> | ||
| </form> | ||
|
|
||
| <ul class="nav nav-tabs nav-stacked"> | ||
| <div> | ||
| {% if folder.chunks %} | ||
| <ul class="breadcrumb"> | ||
| <a href="{{ url_for('index') }}">SetupBox</a> | ||
| {% for chunk in folder.chunks() %} | ||
| <li> | ||
| <a href="/files/{{ chunk.path }}">/ {{ chunk.chunk }}</a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| {% endif %} | ||
| </div> | ||
|
|
||
| <div id="folderView" class="col-md-12 col-xs-12" style="padding:0px;"> | ||
| <table class="table table-bordered table-foldersystem"> | ||
| <thead> | ||
| <tr class="active"> | ||
| <th>Type</th> | ||
| <th>Name</th> | ||
| <th>Size</th> | ||
| <th>Last modification time</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {% for folder in folder.folders %} | ||
| <li><a href="/files/{{ folder.path }}"> <img src="../static/img/folder.png" width="20" alt="icon"> {{ folder.name }}</a></li> | ||
| {% if not folder.name == ".git" %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxtortime I'd prefer keep this explicit |
||
| <tr class="folders_row"> | ||
| <td><img src="{{ url_for('static',filename='img/folder.png') }}" width="20" alt="icon"></td> | ||
| <td id="{{ folder.path }}" class="folders"> | ||
| <a href="/files/{{ folder.path }}">{{ folder.name }}</a> | ||
| </td> | ||
| <td>{{ folder.size }}</td> | ||
| <td>{{ folder.date }}</td> | ||
| </tr> | ||
| {% endif %} | ||
| {% endfor %} | ||
| </ul> | ||
| </div> | ||
| <div class="span6"> | ||
| <h3 class="page-header">Files:</h3> | ||
| <ul class="nav nav-tabs nav-stacked"> | ||
|
|
||
| {% for file in folder.files %} | ||
| <li><a href="/files/{{ file.path }}"> <img src="../static/img/{{ file.extension }}.png" width="20" alt="icon"> {{ file.name }}</a></li> | ||
| <tr class="files_row"> | ||
| <td> | ||
| <img src="{{ url_for('static',filename='img/'+ file.extension) }}.png" width="20" alt="icon"> | ||
| </td> | ||
| <td id="{{ file.path }}" class='files'><a href="/files/{{ file.path }}">{{ file.name }}</a></td> | ||
| <td>{{ file.size }}</td> | ||
| <td>{{ file.date }}</td> | ||
| </tr> | ||
| {% endfor %} | ||
| </ul> | ||
| </div> | ||
|
|
||
| </tbody> | ||
| </table> | ||
| </div> | ||
| {% endblock %} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxtortime why did you remove
render_template, would it work without it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used Pycharm and It works fine.
But I don't know why it works fine and Pycharm remove 'render_template'.
I'll find the reason.