Show micropub error descriptions
[tt-rss-micropub.git] / commentform.phtml
1 <h2>Reply to this post</h2>
2 <div class="postReply" id="postReply">
3  <form method="post" action="backend.php" id="postReplyForm"
4        dojoType="dijit.form.Form">
5   <script type="dojo/method" event="onSubmit" args="evt">
6   evt.preventDefault();
7   if (this.validate()) {
8       notify_progress('Sending reply...', true);
9
10       new Ajax.Request('backend.php', {
11           parameters: dojo.objectToQuery(this.getValues()),
12           onSuccess: function(transport) {
13               notify_info(transport.responseJSON.message);
14               $('postReplyUrl').writeAttribute(
15                   'href', transport.responseJSON.location
16               );
17               $('postReplyUrl').innerHTML = transport.responseJSON.location;
18               //Effect.Shrink('postReply');
19               //Effect.Grow('postReplySuccess');
20               $('postReply').hide();
21               $('postReplySuccess').show();
22           },
23           onFailure: function(transport) {
24               notify_error(transport.responseText);
25           }
26       });
27   }
28   </script>
29
30   <?php print_hidden('op', 'pluginhandler'); ?>
31   <?php print_hidden('plugin', 'micropub'); ?>
32   <?php print_hidden('method', 'action'); ?>
33   <?php print_hidden('mode', 'post'); ?>
34   <input name="action" value="" id="mpaction"
35          dojoType="dijit.form.TextBox" style="display: none"/>
36
37   <?php print_hidden('postUrl', htmlspecialchars($article['link'])); ?>
38
39   <div style="text-align: right">
40    <button type="submit" name="action"
41      onclick="dijit.byId('mpaction').set('value',this.value);"
42      value="bookmark">🔖 Bookmark</button>
43    <button type="submit" name="action"
44      onclick="dijit.byId('mpaction').set('value',this.value);"
45      value="like">♥ Like</button>
46   </div>
47
48   <textarea name="content" rows="4" cols="60"
49             style="box-sizing: border-box; width:100%; height: auto"
50             dojoType="dijit.form.SimpleTextarea"
51    ></textarea><br/>
52
53   <?php if (count($accounts) == 1) { ?>
54    <?php print_hidden('me', htmlspecialchars(reset($accounts))); ?>
55   <?php } else { ?>
56    <label for="micropub-me">Identity:</label>
57    <?php print_select('micropub-me', $defaultAccount, $accountUrls,
58      'dojoType="dijit.form.Select" size="1"', 'me'); ?>
59    <br/>
60   <?php } ?>
61
62   <button type="submit" name="action"
63     onclick="dijit.byId('mpaction').set('value',this.value);"
64     value="comment">Post comment</button>
65  </form>
66
67  <div class="reply" style="text-align: right">
68   or
69   <a href="<?= htmlspecialchars($quillUrl) ?>" class="mpbutton dijitButton" target="_blank">
70    Reply with Quill
71   </a>
72  </div>
73 </div>
74
75 <div id="postReplySuccess" class="alert alert-success" style="display:none">
76  Post created at <a id="postReplyUrl" href="#"></a>.
77 </div>