Skip to content

Commit

Permalink
upgrade media rename feature
Browse files Browse the repository at this point in the history
filename is a label to check media
rename form replace the filename
  • Loading branch information
vincent-peugnet committed Oct 16, 2024
1 parent b786e75 commit 91d6f82
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/view/templates/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
<?php if ($user->issupereditor()) { ?>
<details>
<summary>
<span><?= $media->filename() ?></span>
<i class="fa fa-pencil"></i>
</summary>
<form action="<?= $this->url('mediarename') ?>" method="post">
Expand All @@ -181,6 +180,7 @@
<input type="submit" value="rename">
</form>
</details>
<label for="media_<?= $media->filename() ?>"><?= $media->filename() ?></label>
<?php } else { ?>
<span><?= $media->filename() ?></span>
<?php } ?>
Expand Down
56 changes: 43 additions & 13 deletions assets/css/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,14 @@ table#medialist .thumbnail:hover .lightbox {
display: block;
}

table#medialist details > summary {
list-style: none;
}

table#medialist details i {
visibility: hidden;
}

table#medialist details:hover i {
visibility: visible;
}

table#medialist td.filename span {
table#medialist td.filename label {
font-family: monospace;
white-space: pre;
font-size: 14px;
width: 100%;
}


table code.select-all {
max-width: 254px;
}
Expand Down Expand Up @@ -95,6 +85,46 @@ nav tr.selected a, nav tr.selected td {
color: var(--outline-color);
}

/* Renamming feature */

table#medialist td.filename {
position: relative;
}

table#medialist td.filename label {
margin-right: 15px;
}

table#medialist td.filename details summary {
visibility: hidden;
display: inline;
position: absolute;
right: 0;
}

table#medialist td.filename:hover details summary {
visibility: visible;
}

table#medialist td.filename details[open] {
display: flex;
position: relative;
}

table#medialist td.filename details[open] ~ label {
display: none;
}

table#medialist td.filename details[open] form{
display: flex;
margin-right: 15px;
}

table#medialist td.filename details[open] summary {
visibility: visible;
order: 3;
}


@media (max-width: 550px) {
#gallery li {
Expand Down

0 comments on commit 91d6f82

Please sign in to comment.