Skip to content

Commit

Permalink
refactor(index haml): dry up nav bar code
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Feb 19, 2019
1 parent f68fce8 commit 944adc8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
14 changes: 14 additions & 0 deletions lib/pact_broker/ui/views/index/_navbar.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%nav.navbase-default{role: "navigation", id: "navigation"}
.container-fluid
.navbar-header
%ul.navbar-right#top-left-menu
%li
- if tag_toggle
%a{href: './?tags=true'}
Show latest tags
- else
%a{href: './'}
Hide latest tags

%a{href: '/hal-browser/browser.html'}
API Browser
13 changes: 1 addition & 12 deletions lib/pact_broker/ui/views/index/show-with-tags.haml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
%body
%link{rel: 'stylesheet', href: '/css/bootstrap.min.css'}
%link{rel: 'stylesheet', href: '/stylesheets/index.css'}
%script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'}
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
%script{type: 'text/javascript', src:'/js/bootstrap.min.js'}
.container
%nav.navbase-default{role: "navigation", id: "navigation"}
.container-fluid
.navbar-header
%ul.navbar-right#top-left-menu
%li
%a{href: './'}
Hide latest tags
%a{href: '/hal-browser/browser.html'}
API Browser
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: false}
%h1.page-header
Pacts
%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down
13 changes: 1 addition & 12 deletions lib/pact_broker/ui/views/index/show.haml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
%body
%link{rel: 'stylesheet', href: '/css/bootstrap.min.css'}
%link{rel: 'stylesheet', href: '/stylesheets/index.css'}
%script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'}
%script{type: 'text/javascript', src:'/javascripts/jquery.tablesorter.min.js'}
%script{type: 'text/javascript', src:'/js/bootstrap.min.js'}
.container
%nav.navbase-default{role: "navigation", id: "navigation"}
.container-fluid
.navbar-header
%ul.navbar-right#top-left-menu
%li
%a{href: './?tags=true'}
Show latest tags
%a{href: '/hal-browser/browser.html'}
API Browser
= render :haml, :'index/_navbar', :layout => false, locals: {tag_toggle: true}
%h1.page-header
Pacts
%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down
3 changes: 3 additions & 0 deletions lib/pact_broker/ui/views/layouts/main.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
%head
%title= defined?(title) ? title : ""
%link{rel: 'shortcut icon', href: '/images/favicon.ico', type:'image/x-icon'}
%link{rel: 'stylesheet', href: '/css/bootstrap.min.css'}
%script{type: 'text/javascript', src:'/javascripts/jquery-2.1.1.min.js'}
%script{type: 'text/javascript', src:'/js/bootstrap.min.js'}
= yield

0 comments on commit 944adc8

Please sign in to comment.