Skip to content

Commit

Permalink
refactor: Remove generated css for target
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Nov 18, 2022
1 parent 715af8a commit 11f78fc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 50 deletions.
2 changes: 1 addition & 1 deletion cmd/fibr/templates/delete-modal.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "delete-modal" }}
<div id="delete-modal-{{ .ID }}" class="modal">
<div id="delete-modal-{{ .ID }}" class="modal delete-modal">
<div class="modal-content">
<h2 class="header">Confirmation</h2>

Expand Down
2 changes: 1 addition & 1 deletion cmd/fibr/templates/desc-modal.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "desc-modal" }}
<div id="desc-modal-{{ .ID }}" class="modal">
<div id="desc-modal-{{ .ID }}" class="modal desc-modal">
<div class="modal-content">
<h2 class="header">Description</h2>

Expand Down
2 changes: 1 addition & 1 deletion cmd/fibr/templates/edit-modal.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "edit-modal" }}
<div id="edit-modal-{{ .ID }}" class="modal">
<div id="edit-modal-{{ .ID }}" class="modal edit-modal">
<div class="modal-content">
<h2 class="header">Rename</h2>

Expand Down
40 changes: 10 additions & 30 deletions cmd/fibr/templates/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,40 +56,20 @@
overflow: auto;
}

{{ range .Files }}
{{ if $root.Request.CanEdit }}
#delete-modal-{{ .ID }}:target,
#edit-modal-{{ .ID }}:target,
{{ end }}

{{ if $root.Request.CanShare }}
#share-form-{{ .ID }}:target,
{{ end }}

{{ if $root.Request.CanWebhook }}
#webhook-form-{{ .ID }}:target,
{{ end }}
{{ end }}
#folder-modal:target {
.delete-modal:target,
.edit-modal:target,
.share-form:target,
.webhook-form:target,
.folder-modal:target {
display: flex;
z-index: 5;
}

{{ range .Files }}
{{ if $root.Request.CanEdit }}
#delete-modal-{{ .ID }}:target ~ .content,
#edit-modal-{{ .ID }}:target ~ .content,
{{ end }}

{{ if $root.Request.CanShare }}
#share-form-{{ .ID }}:target ~ .content,
{{ end }}

{{ if $root.Request.CanWebhook }}
#webhook-form-{{ .ID }}:target ~ .content,
{{ end }}
{{ end }}
#folder-modal:target ~ .content {
.delete-modal:target ~ .content,
.edit-modal:target ~ .content,
.share-form:target ~ .content,
.webhook-form:target ~ .content,
.folder-modal:target ~ .content {
pointer-events: none;
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/fibr/templates/share-form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "share-directory" }}
<div id="share-form" class="modal">
<div id="share-form" class="modal share-form">
<div class="modal-content">
<h2 class="header">Share this directory</h2>

Expand Down
22 changes: 7 additions & 15 deletions cmd/fibr/templates/story.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,14 @@
margin-left: 0.5rem;
}

{{ if .Request.CanEdit }}
{{ range .Files }}
#desc-modal-{{ .ID }}:target,
{{ end }}
#desc-modal:target {
display: flex;
z-index: 5;
}
.desc-modal:target {
display: flex;
z-index: 5;
}

{{ range .Files }}
#desc-modal-{{ .ID }}:target ~ .content,
{{ end }}
#desc-modal:target ~ .content {
pointer-events: none;
}
{{ end }}
.desc-modal:target ~ .content {
pointer-events: none;
}

.context {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion cmd/fibr/templates/webhook-form.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "webhook-directory" }}
<div id="webhook-form" class="modal">
<div id="webhook-form" class="modal webhook-form">
<div class="modal-content">
<h2 class="header">Webhook on this directory</h2>

Expand Down

0 comments on commit 11f78fc

Please sign in to comment.