From 832adab4342c407db2b17e93eda60dcaaf4a97dd Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 27 Jul 2016 23:33:45 -0400 Subject: refactor post types so icons and names aren't in 3 places --- src/views/admin-page.ecr | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/views') diff --git a/src/views/admin-page.ecr b/src/views/admin-page.ecr index 8581c01..00f2796 100644 --- a/src/views/admin-page.ecr +++ b/src/views/admin-page.ecr @@ -106,22 +106,16 @@ :text => "Show all types.", }, { :type => "divider", - }, { - :id => "blog", - :name => "Blog Post", - :icon => "fa-sticky-note-o", - :text => "Show blog posts.", - }, { - :id => "page", - :name => "Page", - :icon => "fa-bookmark-o", - :text => "Show pages.", - }, { - :id => "project", - :name => "Project", - :icon => "fa-cube", - :text => "Show projects.", - }], + }] + %i{blog page project}.map { |id| + name = POST_TYPES[id][:name] + + { + :id => POST_TYPES[id][:id], + :name => name, + :icon => POST_TYPES[id][:icon], + :text => "Show #{name}s.", + } + } ) %> @@ -1431,6 +1425,11 @@ + + <%= scripts %w{ assets/jquery-2.2.1.min.js -- cgit v1.2.3