summary refs log tree commit diff
path: root/views
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-07-17 19:09:02 +0200
committerpdp8 <pdp8@pdp8.info>2023-07-17 19:09:02 +0200
commit4ca1c5555f18703d1dac673b1a77d1c919fb4787 (patch)
tree2f57783bdc1786e09737196a2fae07a720452d4f /views
parent2e614738f72c9af634c4a630693d06f144bc24df (diff)
write to json instead of direcories
Diffstat (limited to 'views')
-rw-r--r--views/collection.erb2
-rw-r--r--views/object.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/views/collection.erb b/views/collection.erb
index 4cc449f..9640b7c 100644
--- a/views/collection.erb
+++ b/views/collection.erb
@@ -20,7 +20,7 @@
     <% end %>
     <% unless @dir == 'shared' %>
     <form action='/delete' method='post'>
-      <input type='hidden' name='dir' value='/<%= @dir %>' />
+      <input type='hidden' name='dir' value='<%= @dir %>' />
       <input type='hidden' name='anchor' value='/<%= @dir %>' />
       <button>Delete all</button>
     </form>
diff --git a/views/object.erb b/views/object.erb
index 3e6e617..6ac9f43 100644
--- a/views/object.erb
+++ b/views/object.erb
@@ -1,6 +1,6 @@
 <% @idx +=1
    mention = mention @object['attributedTo']
-   follow = File.exist?(File.join(FOLLOWING_DIR, "#{mention}.json")) ? 'unfollow' : 'follow'
+  JSON.parse(File.read(FOLLOWING))['orderedItems'].include?(@object['attributedTo']) ? follow='unfollow' : follow='follow'
 %>
 <div style='margin-left:<%= @object['indent']%>em' id='<%= @idx %>'>
   <b><a href='<%= @object['attributedTo'] %>', target='_blank'><%= mention %></a></b>&nbsp;