From fbff52e48d4591a752d83fbebb49a3a355eef5ae Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 24 May 2016 20:42:20 -0400 Subject: add dropdown class and post type dropdown --- src/views/admin-page.ecr | 30 ++++++++++++++++++++++++++++++ src/views/dropdown/item.ecr | 28 ++++++++++++++++++++++++++++ src/views/dropdown/menu.ecr | 19 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 src/views/dropdown/item.ecr create mode 100644 src/views/dropdown/menu.ecr (limited to 'src/views') diff --git a/src/views/admin-page.ecr b/src/views/admin-page.ecr index 39b4de3..eedc41c 100644 --- a/src/views/admin-page.ecr +++ b/src/views/admin-page.ecr @@ -84,6 +84,36 @@ new_post_button %> +
<%= + dropdown( + id: "posts-filter-type", + name: "Type", + css: "posts-filter-menu", + text: "Filter by type.", + icon: "", + default: "all", + items: [{ + id: "all", + name: "All", + text: "Show all types.", + }, { + type: "divider", + }, { + id: "blog", + name: "Blog Posts", + text: "Show blog posts.", + }, { + id: "page", + name: "Pages", + text: "Show pages.", + }, { + id: "project", + name: "Projects", + text: "Show projects.", + }], + ) + %>
+
+ +<% +when "header" +%> + +<% +else +%> +
  • > + + <%= Icon.icon(@item[:icon]?) %> + <%= v(:name) %> + +
  • +<% +end +%> diff --git a/src/views/dropdown/menu.ecr b/src/views/dropdown/menu.ecr new file mode 100644 index 0000000..ca39c1e --- /dev/null +++ b/src/views/dropdown/menu.ecr @@ -0,0 +1,19 @@ + + <%= Icon.icon(@icon) %> + <%= h(@name) %>: + <%= h(@default_name) %> + + + + -- cgit v1.2.3