new exporter version
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
{{define "scripts"}}{{end}}
|
||||
{{define "body"}}
|
||||
<h1>{{.Title}} </h1>
|
||||
<div>
|
||||
{{.Content}}
|
||||
</div>
|
||||
<div>
|
||||
<a href="/articles/{{.ID}}/edit">Edit</a>
|
||||
<form action="/articles/{{.ID}}" method="post">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ template "title" . }}</title>
|
||||
{{ template "scripts" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "body" . }}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{define "title"}}Create new article{{end}}
|
||||
{{define "scripts"}}
|
||||
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#mytextarea',
|
||||
plugins: 'image',
|
||||
toolbar: 'undo redo | blocks | image | ' +
|
||||
'bold italic backcolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat | help',
|
||||
images_upload_url: "/upload",
|
||||
relative_urls : false,
|
||||
remove_script_host : false,
|
||||
convert_urls : true,
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
{{define "body"}}
|
||||
<form method="post" action="/articles/{{.ID}}">
|
||||
<input type="text" name="title" value="{{.Title}}">
|
||||
<textarea id="mytextarea" name="content">{{.Content}}</textarea>
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
<button id="submit" type="submit" onclick="submitForm()">Edit</button>
|
||||
</form>
|
||||
{{end}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{define "title"}}All articles{{end}}
|
||||
{{define "scripts"}}{{end}}
|
||||
{{define "body"}}
|
||||
{{if eq (len .) 0}}
|
||||
Nothing to see here
|
||||
{{end}}
|
||||
{{range .}}
|
||||
<div>
|
||||
<a href="/articles/{{.ID}}">{{.Title}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<p>
|
||||
<a href="/articles">Create new article</a>
|
||||
|
||||
</p>
|
||||
{{end}}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{define "title"}}Create new article{{end}}
|
||||
{{define "scripts"}}
|
||||
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
|
||||
<script>
|
||||
tinymce.init({
|
||||
selector: '#mytextarea',
|
||||
plugins: 'image',
|
||||
toolbar: 'undo redo | blocks | image | ' +
|
||||
'bold italic backcolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat | help',
|
||||
images_upload_url: "/upload",
|
||||
relative_urls : false,
|
||||
remove_script_host : false,
|
||||
convert_urls : true,
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
{{define "body"}}
|
||||
<form method="post" action="/articles">
|
||||
<input type="text" name="title" placeholder="Enter the title">
|
||||
<textarea id="mytextarea" name="content"></textarea>
|
||||
<button id="submit" type="submit">Create</button>
|
||||
</form>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user