diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-27 23:33:45 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-27 23:33:45 -0400 |
commit | 832adab4342c407db2b17e93eda60dcaaf4a97dd (patch) | |
tree | c680120a6c688218900885c16063397e7bed0fcc /src/views/admin-page.ecr | |
parent | 911d4fa9eb9f42e65facfa63e46ffcba660766ad (diff) | |
download | guff-832adab4342c407db2b17e93eda60dcaaf4a97dd.tar.bz2 guff-832adab4342c407db2b17e93eda60dcaaf4a97dd.zip |
refactor post types so icons and names aren't in 3 places
Diffstat (limited to 'src/views/admin-page.ecr')
-rw-r--r-- | src/views/admin-page.ecr | 31 |
1 files changed, 15 insertions, 16 deletions
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.", + } + } ) %></div><!-- btn-group --> @@ -1431,6 +1425,11 @@ </div><!-- modal --> </body> + + <script type='text/javascript'><!-- + var DATA = <%= page_data %>; + // --> + </script> <%= scripts %w{ assets/jquery-2.2.1.min.js |