templates

package
v0.0.0-...-0a3e258 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateAdmin, _ = template.New("admin_panel").Parse(`<head>
<title>admin like panel</title>
<style>
  ol {
    display: table;
    margin: 0 auto;
    background: #f3f3f3;
    padding: 1rem;
  }

  ol li {
    list-style-position: inside;
    padding: 0.25rem;
  }
</style>
</head>

<body>
<ol>
  {{range .}}
  <li>
    <a href="../view/{{.ID }}">{{.ID}}</a> submitted by <b>{{.Submitter}}</b> at {{.UploadDate}}
  </li>
  {{end}}
</ol>
</body>

</html>`)

TemplateAdmin is needed for providing one file binary. Otherwise we would need to provide some complicated means to deliver html file.

View Source
var TemplateAdminLogin, _ = template.New("admin_panel_login").Parse(`<!doctype html>
<html>

<head>
  <title>admin like panel</title>
  <style>
    input {
      display: block;
      margin-left: auto;
      margin-right: auto;
    }
  </style>
</head>

<body>
  <form enctype="multipart/form-data" method="post">
    <input type="password" name="password" placeholder="password" required />
    <br />
    <input type="submit" value="Login" />
  </form>
</body>

</html>`)

TemplateAdminLogin is needed for providing one file binary. Otherwise we would need to provide some complicated means to deliver html file.

View Source
var TemplateUpload, _ = template.New("main_page").Parse(`<!doctype html>
<html>

<head>
  <title>another pastebin clone</title>
  <style>
  input {
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  textarea {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 80vw;
    height: 80vh;
  }
</style>
</head>

<body>
  <form enctype="multipart/form-data" method="post">
    <textarea name="{{ .TextFormName }}" placeholder="New text paste"></textarea>
    <br />
    <input type="file" name="{{ .FileFormName }}" />
    <br />
    <input type="submit" value="create paste" />
  </form>
</body>

</html>`)

TemplateUpload is needed for providing one file binary. Otherwise we would need to provide some complicated means to deliver html file.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL