aboutsummaryrefslogtreecommitdiff
path: root/app/views/categories/_category.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/categories/_category.html.erb')
-rw-r--r--app/views/categories/_category.html.erb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/views/categories/_category.html.erb b/app/views/categories/_category.html.erb
new file mode 100644
index 0000000..d301fe6
--- /dev/null
+++ b/app/views/categories/_category.html.erb
@@ -0,0 +1,17 @@
+<article class="category" id="category-<%= category.id %>">
+ <header style="background-color: <%= category.color %>">
+ <h1><%= category.taxonomy.name %></h1>
+ <h2><%= category.name %></h2>
+ </header>
+ <p><%= h category.summary %></p>
+ <div class="markdown"><%= h category.description %></div>
+ <section id="stats"><h3>Info</h3>
+ <p><%= pluralize(category.sections_count, 'section') %></p>
+ <p><%= pluralize(category.sections.map { |s| s.resources }.sum(&:count) || 0, 'resources') %></p>
+ </section>
+ <section id="actions">
+ <ul>
+ <li><%= link_to 'edit', edit_category_path(category) %></li>
+ </ul>
+ </section>
+</article>