summaryrefslogtreecommitdiff
path: root/views/new-favorite.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-02-27 12:31:06 -0800
committerAaron Parecki <aaron@parecki.com>2017-02-27 12:31:06 -0800
commit1123ed958f7c22116a0c432779aaf1c27fcaf787 (patch)
tree3000bb267e65efb8561c459b7a38d07bda690231 /views/new-favorite.php
parentbb5fd837d12d125f908feb09808df3f6db1fe817 (diff)
basic editing support
* new route `/edit?url=` intended to be used as an edit button target, which detects the type of post and redirects to the appropriate editing interface * implemented the edit interface for favorites
Diffstat (limited to 'views/new-favorite.php')
-rw-r--r--views/new-favorite.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/views/new-favorite.php b/views/new-favorite.php
index 9f191e8..524bb79 100644
--- a/views/new-favorite.php
+++ b/views/new-favorite.php
@@ -2,21 +2,22 @@
<?= partial('partials/header') ?>
<div style="clear: both;" class="notice-pad">
- <div class="alert alert-success hidden" id="test_success"><strong>Success! We found a Location header in the response!</strong><br>Your post should be on your website now!<br><a href="" id="post_href">View your post</a></div>
+ <div class="alert alert-success hidden" id="test_success"><strong>Success!</strong><br>Your post should be on your website now!<br><a href="" id="post_href">View your post</a></div>
<div class="alert alert-danger hidden" id="test_error"><strong>Your endpoint did not return a Location header.</strong><br>See <a href="/creating-a-micropub-endpoint">Creating a Micropub Endpoint</a> for more information.</div>
</div>
<form role="form" style="margin-top: 20px;" id="note_form">
<div class="form-group">
- <label for="note_url">URL to Favorite (<code>like-of</code>)</label>
- <input type="text" id="note_url" value="<?= $this->url ?>" class="form-control">
+ <label for="like_of">URL to Favorite (<code>like-of</code>)</label>
+ <input type="text" id="like_of" value="<?= $this->like_of ?>" class="form-control">
</div>
<div style="float: right; margin-top: 6px;">
- <button class="btn btn-success" id="btn_post">Post</button>
+ <button class="btn btn-success" id="btn_post"><?= $this->url ? 'Save' : 'Post' ?></button>
</div>
+ <input type="hidden" id="edit_url" value="<?= $this->url ?>">
</form>
<div style="clear: both;"></div>
@@ -27,7 +28,6 @@
</div>
</div>
-
<script>
$(function(){
@@ -40,7 +40,8 @@ $(function(){
});
$.post("/favorite", {
- url: $("#note_url").val()
+ like_of: $("#like_of").val(),
+ edit: $("#edit_url").val()
}, function(response){
if(response.location != false) {