From 1564af069472e32ed322bf9acedc9c487bce1a15 Mon Sep 17 00:00:00 2001
From: hellekin <hellekin@cepheide.org>
Date: Tue, 6 Oct 2020 19:29:04 +0200
Subject: First pass at listing Resources

This implements resource listing and pagination.

See /resources
---
 app/views/resources/_resource.html.erb | 10 ++++++++++
 app/views/resources/index.html.erb     |  8 ++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 app/views/resources/_resource.html.erb

(limited to 'app/views')

diff --git a/app/views/resources/_resource.html.erb b/app/views/resources/_resource.html.erb
new file mode 100644
index 0000000..39997ef
--- /dev/null
+++ b/app/views/resources/_resource.html.erb
@@ -0,0 +1,10 @@
+<section id="resource-<%= resource.uuid %>">
+    <header>
+        <h2><%= h resource.name %></h2>
+        <time datetime="<%= h resource.created_at %>" class="created_at">
+        <time datetime="<%= h resource.updated_at %>" class="updated_at">
+        <p class="identifier"><%= resource_url(resource) %></p>
+    </header>
+    <div><%= h resource.description %></div>
+    <code><%= h resource.feature.as_json %></code>
+</section>
diff --git a/app/views/resources/index.html.erb b/app/views/resources/index.html.erb
index 320849a..473bcbb 100644
--- a/app/views/resources/index.html.erb
+++ b/app/views/resources/index.html.erb
@@ -1,2 +1,6 @@
-<h1>Resources#index</h1>
-<p>Find me in app/views/resources/index.html.erb</p>
+<h1>Listing Resources</h1>
+
+<%= paginate @resources %>
+
+<%= render partial: 'resource', collection: @resources %>
+
-- 
cgit v1.2.3