summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-13 10:02:05 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-13 10:02:05 -0700
commit067e9814f077ca8ea2068ee4cf46449770d69d86 (patch)
tree1455faf943ff0ae5141239fb8e715b79d6380948
parentd4d938d634552eed167688409a90cfe698b35653 (diff)
adding delete button (test)
-rw-r--r--cmd/ponzu/main.go4
-rw-r--r--cmd/ponzu/options.go19
-rw-r--r--management/editor/editor.go15
3 files changed, 37 insertions, 1 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go
index 39fa173..ee5ae1f 100644
--- a/cmd/ponzu/main.go
+++ b/cmd/ponzu/main.go
@@ -72,6 +72,9 @@ generate, gen, g <type>:
var (
port int
tls bool
+
+ // for ponzu internal / core development
+ dev bool
)
func init() {
@@ -83,6 +86,7 @@ func init() {
func main() {
flag.IntVar(&port, "port", 8080, "port for ponzu to bind its listener")
flag.BoolVar(&tls, "tls", false, "enable automatic TLS/SSL certificate management")
+ flag.BoolVar(&dev, "dev", false, "modify environment for Ponzu core development")
flag.Parse()
args := flag.Args()
diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go
index 19b61bb..bc96b42 100644
--- a/cmd/ponzu/options.go
+++ b/cmd/ponzu/options.go
@@ -214,6 +214,25 @@ func createProjInDir(path string) error {
return err
}
+ if dev {
+ devClone := exec.Command("git", "clone", local, "--branch", "ponzu-dev", "--single-branch", path)
+ devClone.Stdout = os.Stdout
+ devClone.Stderr = os.Stderr
+
+ err := devClone.Start()
+ if err != nil {
+ return err
+ }
+
+ err = devClone.Wait()
+ if err != nil {
+ return err
+ }
+
+ fmt.Println("Dev build cloned from bosssauce/ponzu:ponzu-dev")
+ return nil
+ }
+
// try to git clone the repository from the local machine's $GOPATH
localClone := exec.Command("git", "clone", local, path)
localClone.Stdout = os.Stdout
diff --git a/management/editor/editor.go b/management/editor/editor.go
index 5e26740..ed684fd 100644
--- a/management/editor/editor.go
+++ b/management/editor/editor.go
@@ -46,10 +46,23 @@ func Form(post Editable, fields ...Field) ([]byte, error) {
addPostDefaultFieldsToEditorView(post, editor)
submit := `
-<div class="input-field">
+<div class="input-field">
<button class="right waves-effect waves-light btn green" type="submit">Save</button>
+ <button class="waves-effect waves-light btn green confirm-delete" type="submit">Delete</button>
</div>
+
+<script>
+ $(function() {
+ var form = $('form'),
+ delete = form.find('button.confirm-delete');
+
+ var action = form.attr('action');
+ console.log(action);
+
+ });
+</script>
`
+
editor.ViewBuf.Write([]byte(submit + `</td></tr></tbody></table>`))
return editor.ViewBuf.Bytes(), nil