Skip to content

Commit

Permalink
Abstracting tabs out from the layout so they can be modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben VandenBos authored and defunkt committed Dec 26, 2009
1 parent 688d309 commit d35295e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
*.gemspec
pkg
nbproject
12 changes: 12 additions & 0 deletions lib/resque/server.rb
Expand Up @@ -41,6 +41,10 @@ def tab(name)
"<li #{class_if_current(dname)}><a href='#{url dname}'>#{name}</a></li>"
end

def tabs
Resque::Server.tabs
end

def redis_get_size(key)
case Resque.redis.type(key)
when 'none'
Expand Down Expand Up @@ -170,5 +174,13 @@ def show(page, layout = true)
def resque
Resque
end

class << self

def tabs
@tabs ||= ["Overview", "Working", "Failed", "Queues", "Workers", "Stats"]
end

end
end
end
9 changes: 3 additions & 6 deletions lib/resque/server/views/layout.erb
Expand Up @@ -11,12 +11,9 @@
<body>
<div class="header">
<ul class='nav'>
<%= tab "Overview" %>
<%= tab "Working" %>
<%= tab "Failed" %>
<%= tab "Queues" %>
<%= tab "Workers" %>
<%= tab "Stats" %>
<% tabs.each do |tab_name| %>
<%= tab tab_name %>
<% end %>
</ul>
</div>

Expand Down

0 comments on commit d35295e

Please sign in to comment.