-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove block actions - Add block.IsActive - Rework business rules - Rework block UX - Progress on site-wide blocks
- Loading branch information
Showing
37 changed files
with
431 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="page" hx-get="/admin/blocks/index" hx-trigger="refreshPage from:window"> | ||
|
||
<div id="menu-bar" hx-push-url="true"> | ||
{{- $token := .Token -}} | ||
{{- range .AdminSections -}} | ||
<a hx-get="/admin/{{.Value}}" class="turboclick {{if eq $token .Value}}selected{{end}}">{{.Label}}</a> | ||
{{- end -}} | ||
</div> | ||
|
||
<div class="table"> | ||
<div role="button" hx-get="/admin/blocks/add" class="link"> | ||
{{icon "add"}} <span>Add a Server-wide Block</span> | ||
</div> | ||
{{.View "list"}} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- $blocks := .ServerWideBlocks.Slice -}} | ||
|
||
{{- range $blocks -}} | ||
<div hx-get="/admin/blocks/{{.BlockID.Hex}}/edit" role="button"> | ||
{{.Type}}: {{.Trigger}} | ||
</div> | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"templateId":"admin-blocks", | ||
"templateRole":"admin", | ||
"model":"block", | ||
"containedBy":["admin"], | ||
"label": "Blocks", | ||
"description": "Domain Owners only. Site Admin", | ||
"actions": { | ||
"index": {"step": "view-html"}, | ||
"list": {"step": "view-html"}, | ||
"add": {"steps":[ | ||
{"step":"as-modal", "background":"/admin/blocks", "steps":[ | ||
{"step": "edit", "form":{ | ||
"type":"layout-vertical", | ||
"label":"Server-Wide Block", | ||
"children":[ | ||
{"type":"select", "path":"type", "label":"Type", "options":{"provider":"block-types"}}, | ||
{"type":"text", "path":"trigger", "label":"Trigger Text"} | ||
] | ||
}} | ||
]} | ||
]}, | ||
"edit": {"steps":[ | ||
{"step":"as-modal", "background":"/admin/blocks", "steps":[ | ||
{"step": "edit", "form":{ | ||
"type":"layout-vertical", | ||
"label":"Server-Wide Block", | ||
"children":[ | ||
{"type":"select", "path":"type", "label":"Type", "options":{"provider":"block-types"}}, | ||
{"type":"text", "path":"trigger", "label":"Trigger Text"} | ||
] | ||
}, "options":["delete:/admin/blocks/{{.BlockID}}/delete"]} | ||
]} | ||
]}, | ||
"delete": {"step": "delete"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,25 @@ | ||
{{- range . -}} | ||
<tr hx-get="/@me/block-edit?blockId={{.BlockID.Hex}}" role="button"> | ||
<td class="text-xl"> | ||
{{- if eq "BLOCK" .Behavior -}} | ||
<span title="Block">{{icon "block"}}</span> | ||
{{- else if eq "MUTE" .Behavior -}} | ||
<span title="Mute">{{icon "mute"}}</span> | ||
{{- else if eq "ALLOW" .Behavior -}} | ||
<span title="Allow">{{icon "thumbs-up"}}</span> | ||
{{- end }} | ||
</td> | ||
<td style="width:100%; vertical-align: middle;"> | ||
<div class="ellipsis"> | ||
{{.Trigger}} | ||
<span class="text-sm text-gray">{{.Comment}}</span> | ||
</div> | ||
</td> | ||
<td class="text-xl align-right" nowrap> | ||
| ||
{{- if ne "ALLOW" .Behavior -}} | ||
{{ if .IsPublic -}} | ||
<span title="Published">{{icon "visible-fill"}}</span> | ||
{{- else -}} | ||
<span title="Not Published">{{icon "invisible"}}</span> | ||
{{- end -}} | ||
<td class="align-right" nowrap> | ||
{{- if .IsActive -}} | ||
<span class="text-green"> | ||
{{- if .IsPublic -}} | ||
<span title="Published">{{icon "visible-fill"}}</span> | ||
{{- else -}} | ||
<span title="Not Published">{{icon "invisible"}}</span> | ||
{{- end -}} | ||
| ||
Active | ||
</span> | ||
{{- else -}} | ||
Inactive | ||
{{- end -}} | ||
|
||
| ||
</td> | ||
</tr> | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.