diff options
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/admin-page.ecr | 30 | ||||
-rw-r--r-- | src/views/dropdown/item.ecr | 28 | ||||
-rw-r--r-- | src/views/dropdown/menu.ecr | 19 |
3 files changed, 77 insertions, 0 deletions
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 %></div><!-- btn-group --> + <div class='btn-group btn-group-sm'><%= + 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.", + }], + ) + %></div><!-- btn-group --> + <div class='btn-group btn-group-sm pull-right'> <a href='#' diff --git a/src/views/dropdown/item.ecr b/src/views/dropdown/item.ecr new file mode 100644 index 0000000..34f04da --- /dev/null +++ b/src/views/dropdown/item.ecr @@ -0,0 +1,28 @@ +<% +case @item[:type]? +when "divider" +%> + <li class='divider' role='separator'></li> +<% +when "header" +%> + <li class='dropdown-header' role='presentation'> + <%= v(:name) %> + </li> +<% +else +%> +<li <%= li_css %>> + <a + href='#' + title='<%= v(:text) %>' + data-id='<%= v(:id) %>' + data-name='<%= v(:name) %>' + > + <%= Icon.icon(@item[:icon]?) %> + <%= v(:name) %> + </a> +</li> +<% +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 @@ +<a + href='#' + class='btn btn-default' + title='<%= h(@text) %>' + data-toggle='dropdown' +> + <%= Icon.icon(@icon) %> + <%= h(@name) %>: + <span><%= h(@default_name) %></span> + <i class='fa fa-caret-down'></i> +</a> + +<ul + id='<%= h(@id) %>' + class='dropdown-menu <%= h(@css) %>' + data-default='<%= h(@default) %>' +><%= + items +%></ul><!-- dropdown-menu --> |