From b837b19b1950c7bc14a38aa5ea917e91b6f081dd Mon Sep 17 00:00:00 2001 From: pdp8 Date: Wed, 21 Jun 2023 10:32:41 +0200 Subject: erb templates separated --- views/index.erb | 21 +++++++++++++++++++++ views/item.erb | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 views/index.erb create mode 100644 views/item.erb (limited to 'views') diff --git a/views/index.erb b/views/index.erb new file mode 100644 index 0000000..269c495 --- /dev/null +++ b/views/index.erb @@ -0,0 +1,21 @@ + + + + + + +

<%= @dir %> +
+ +
+

+ <% @threads.each do |item| %> + <%= html item %> + <% end %> + <% if @dir == 'inbox' %> +
+ +
+ <% end %> + + diff --git a/views/item.erb b/views/item.erb new file mode 100644 index 0000000..aafc4cc --- /dev/null +++ b/views/item.erb @@ -0,0 +1,39 @@ +
+ <%= @item[:mention] %>  +
+ +
+   +
+ + #<%= @item[:nr] %>' /> + +
+ <% if @dir == 'inbox' %> +   +
+ + #<%= @item[:nr] %>' /> + +
+ <% end %> + <%= @item[:content] %> + <% if @item[:attachment] + @item[:attachment].each do |att| + case att['mediaType'] + when /audio/ %> +
+ <% when /image/ %> +
'>'> + <% when /video/ %> +
+ <% else %> + <%= att %>
+ '><%= att['url'] %> + <% end %> + <% end %> + <% end %> +
+<% @item[:replies].each do |reply| %> + <%= html reply %> +<% end %> -- cgit v1.2.3