Browse Source

Fix #44 - handle acls properly

George S. Baugh 5 năm trước cách đây
mục cha
commit
10bc6bc4f4
2 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 7 0
      lib/Trog/Data/DUMMY.pm
  2. 1 1
      www/templates/acls.tx

+ 7 - 0
lib/Trog/Data/DUMMY.pm

@@ -193,6 +193,13 @@ sub _process ($post) {
     delete $post->{file};
     delete $post->{preview_file};
 
+    delete $post->{route};
+    delete $post->{domain};
+
+    $post->{tags} //= [];
+    push(@{$post->{tags}}, delete $post->{acls}) if $post->{visibility} eq 'private';
+    push(@{$post->{tags}}, delete $post->{visibility});
+
     if ($post->{href}) {
         my $mf = Mojo::File->new("www/$post->{href}");
         my $ext = '.'.$mf->extname();

+ 1 - 1
www/templates/acls.tx

@@ -8,7 +8,7 @@ Visibility<br />
     ACLs / Series<br/ >
     <select multiple class="cooltext" name="acls">
         : for $acls -> $acl {
-            <option value="<: $acl.title :>"><: $acl.data :></option>
+            <option value="<: $acl.aclname :>"><: $acl.data :></option>
         : }
     </select>
 </div>