Skip to content

Commit

Permalink
#143 : Rename folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kraft committed Jan 29, 2024
1 parent f578360 commit af678ba
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
44 changes: 29 additions & 15 deletions odmf/static/templates/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,38 @@ <h5 class="card-title">
<span >..</span>
</span>
</a>
<a py:for="d in directories"
<div py:for="d in directories"
py:if="modes[d]"
class="list-group-item list-group-item-action flexbox mt-1 pt-1 border-top"
class="list-group-item list-group-item-action"
href="${d.href}"
>
<span>
<i class="fas fa-folder fa-lg" />
<span py:content="d.basename" />
</span>
<span>
<span class="badge bg-warning text-bg-warning" py:content="modes[d].name"/>
<button class="btn btn-danger remove-button" data-name="${d.basename}"
py:if="modes[d]>=Mode.admin and d.isempty()"
title="remove directory" data-toggle="tooltip">
<i class="fas fa-trash-can" />
</button>
</span>
</a>
<nav class="nav flexbox">
<a href="${d.href}" class="nav-link active">
<i class="fas fa-folder fa-lg" />
<span py:content="d.basename" />
</a>
<div class="dropdown">
<span class="badge bg-warning text-bg-warning" py:content="modes[d].name"/>
<button class="btn btn-sm btn-light dropdown-toggle"
type="button" data-toggle="dropdown"
aria-expanded="false" aria-haspopup="true"
py:if="modes[curdir]>=Mode.write">

</button>

<div class="dropdown-menu" >
<a class="dropdown-item copy-button" data-name="${d.basename}" data-action="rename"
py:if="modes[d]>=Mode.admin">
<i class="fas fa-pen-to-square" /> rename
</a>
<a class="dropdown-item remove-button" data-name="${d.basename}"
py:if="modes[d]>=Mode.admin and d.isempty()">
<i class="fas fa-trash-can" /> remove empty directory
</a>
</div>
</div>
</nav>
</div>
<div py:for="f in files" class="list-group-item border-top ${class_if(f.ishidden(), 'hiddenfile')}">
<nav class="nav flexbox">
<a href="${f.href}" class="nav-link active">
Expand Down
6 changes: 4 additions & 2 deletions odmf/webpage/filemanager/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ def copyfile(self, dir, filename, newfilename, action):
error = '{path} is not a legal position'
elif not targetpath.islegal():
error = f'{targetpath} not a valid copy destination'
elif not path.isfile():
error = f'{path} is not a file'
elif fa.check_directory(path, users.current) <= fa.Mode.write:
error = f'No write access on {path}'
elif fa.check_directory(targetpath, users.current) <= fa.Mode.write:
error = f'No write access on {targetpath}'
elif targetpath.exists():
error = f'{targetpath} exists already, choose another name'
else:
Expand Down
2 changes: 1 addition & 1 deletion odmf/webpage/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def delete(self, path):
return str(p.parent()).encode('utf-8')


@web.show_in_nav_for(0, 'chart-line')
@web.show_in_nav_for(1, 'chart-line')
class PlotPage(object):
filedialog = PlotFileDialog()

Expand Down

0 comments on commit af678ba

Please sign in to comment.