1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Move poll button into partial

This commit is contained in:
Brian Goff 2013-09-23 11:28:26 -04:00
parent 7f4766570d
commit a4cb27b273
2 changed files with 14 additions and 16 deletions

14
web/views/_poll.erb Normal file
View file

@ -0,0 +1,14 @@
<% if params[:poll] %>
<script>
setInterval("window.location.reload(true)", 2000);
</script>
<% end %>
<% unless current_path == '' %>
<div class="span2 pull-right actions">
<% if params[:poll] %>
<a id="live-poll" class="btn btn-block btn-primary active" href="<%= root_path %><%= current_path %>"><%= t('StopPolling') %></a>
<% else %>
<a id="live-poll" class="btn btn-block btn-primary" href="<%= root_path %><%= current_path %>?poll=true"><%= t('LivePoll') %></a>
<% end %>
</div>
<% end %>

View file

@ -7,11 +7,6 @@
<link href="<%= root_path %>stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
<script type="text/javascript" src="<%= root_path %>javascripts/locales/jquery.timeago.<%= locale %>.js"></script>
<% if params[:poll] %>
<script>
setInterval("window.location.reload(true)", 2000);
</script>
<% end %>
</head>
<body class="admin">
<div class="navbar navbar-fixed-top">
@ -22,17 +17,6 @@
<div class="container">
<div class="row">
<div class="span12 summary_bar">
<div class="row">
<% unless current_path == '' %>
<div class="span2 pull-right actions">
<% if params[:poll] %>
<a id="live-poll" class="btn btn-block btn-primary active" href="<%= root_path %><%= current_path %>"><%= t('StopPolling') %></a>
<% else %>
<a id="live-poll" class="btn btn-block btn-primary" href="<%= root_path %><%= current_path %>?poll=true"><%= t('LivePoll') %></a>
<% end %>
</div>
<% end %>
</div>
<%= erb :_summary %>
</div>