updates
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
//alert("hugo is working");
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{{ define "content" }}
|
||||
<link rel="stylesheet" href="{{ .BaseURL }}/_hugointernal/css/styles.css">
|
||||
<script src="{{ .BaseURL }}/_hugointernal/js/application.js"></script>
|
||||
|
||||
<div class="editor container {{ .Class }}">
|
||||
{{ if eq .Class "complete" }}
|
||||
<h1><textarea id="site-title">{{ .Name }}</textarea></h1>
|
||||
@@ -11,7 +14,7 @@
|
||||
|
||||
{{ if eq .Class "frontmatter-only" }}
|
||||
<div class="frontmatter blocks">
|
||||
{{ template "frontmatter" .FrontMatter }}
|
||||
{{ template "options" .FrontMatter }}
|
||||
<p class="actions">
|
||||
<button class="add">Add field</button>
|
||||
</p>
|
||||
@@ -24,7 +27,7 @@
|
||||
{{ else }}
|
||||
<div class="frontmatter">
|
||||
<div class="blocks">
|
||||
{{ template "frontmatter" .FrontMatter }}
|
||||
{{ template "options" .FrontMatter}}
|
||||
</div>
|
||||
|
||||
<p class="actions">
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
{{ define "frontmatter" }}
|
||||
{{ define "options" }}
|
||||
{{ range $key, $value := . }}
|
||||
|
||||
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
|
||||
<fieldset id="{{ $value.Name }}" data-type="{{ $value.Type }}">
|
||||
<h3>{{ SplitCapitalize $value.Title }}</h3>
|
||||
<span class="actions">
|
||||
<button class="add">+</button>
|
||||
<button class="delete">−</button>
|
||||
</span>
|
||||
{{ template "frontmatter" $value.Content }}
|
||||
<button class="add">+</button>
|
||||
<button class="delete" data-delete="{{ $value.Name }}">−</button>
|
||||
{{ template "options" $value.Content }}
|
||||
</fieldset>
|
||||
{{ else }}
|
||||
|
||||
{{ if not (eq $value.Parent.Type "array") }}
|
||||
<div class="block" id="block-{{ $value.Name }}" data-content="{{ $value.Name }}">
|
||||
<label for="{{ $value.Name }}">{{ SplitCapitalize $value.Title }}</label>
|
||||
<span class="actions">
|
||||
<button class="delete">−</button>
|
||||
</span>
|
||||
<button class="delete" data-delete="block-{{ $value.Name }}">−</button>
|
||||
|
||||
{{ end }}
|
||||
|
||||
@@ -36,7 +32,7 @@
|
||||
{{ if not (eq $value.Parent.Type "array") }}</div>{{ end }}
|
||||
|
||||
{{ if eq $value.Parent.Type "array" }}
|
||||
<span class="actions"><button class="delete">−</button></span></div>
|
||||
<button class="delete" data-delete="{{ $value.Name }}">−</button></div>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user