diff options
author | Aaron Parecki <aaron@parecki.com> | 2019-09-29 15:36:59 +0200 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2019-09-29 15:36:59 +0200 |
commit | f0c5635c2f072448808f35990b7f8abd84b9607d (patch) | |
tree | 47984c59c55a834c2ca2c2ae4388df2a6a5b6857 /views/new-post.php | |
parent | efe16c375a202cff5c2b07e3c7fb273a2e8bec16 (diff) |
add a dropdown to choose post visibility
Diffstat (limited to 'views/new-post.php')
-rw-r--r-- | views/new-post.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/views/new-post.php b/views/new-post.php index aba4129..dad9427 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -79,8 +79,23 @@ <?php endif ?> + <?php if($this->supported_visibility): ?> + <div class="form-group" style="margin-top: 1em;"> + <label for="visibility">Visibility</label> + <select class="form-control" id="visibility"> + <?php + foreach(['Public','Unlisted','Private'] as $v): + if(in_array(strtolower($v), $this->supported_visibility)): + echo '<option value="'.strtolower($v).'">'.$v.'</option>'; + endif; + endforeach; + ?> + </select> + </div> + <?php endif ?> + <?php if($this->syndication_targets): ?> - <div class="form-group" style="margin-top: 1em;"> + <div id="syndication-targets" class="form-group" style="margin-top: 1em;"> <label for="note_syndicate-to">Syndicate <a href="javascript:reload_syndications()">(refresh list)</a></label> <div id="syndication-container"> <?php @@ -562,6 +577,14 @@ $(function(){ } }); + $("#visibility").on('change', function(e){ + if($(this).val() == 'private') { + $("#syndication-targets").addClass('hidden'); + } else { + $("#syndication-targets").removeClass('hidden'); + } + }); + $("#expand-reply").click(function(){ $('.reply-section').removeClass('hidden'); $(this).addClass('hidden'); @@ -740,6 +763,11 @@ $(function(){ entry["rsvp"] = $("#note_rsvp").val(); } + if($("#visibility").val()) { + formData.append("visibility", $("#visibility").val()); + entry["visibility"] = $("#visibility").val(); + } + function appendPhotoToFormData(photo, prop) { if(photo.external) { if(photo.alt) { |