From c950f4ff5309fe73bccd569f7b99a43b51d168d7 Mon Sep 17 00:00:00 2001 From: David Leung Date: Tue, 23 Oct 2012 10:26:33 -0700 Subject: [PATCH] Added option in views to expand the description past the limit --- web/views/_workers.slim | 10 ++++++++-- web/views/queue.slim | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/views/_workers.slim b/web/views/_workers.slim index fdcf4c99..5f405f90 100644 --- a/web/views/_workers.slim +++ b/web/views/_workers.slim @@ -5,10 +5,16 @@ table class="table table-striped table-bordered workers" th Class th Arguments th Started - - workers.each do |(worker, msg)| + - workers.each_with_index do |(worker, msg), index| tr td= worker td= msg['queue'] td= msg['payload']['class'] - td= msg['payload']['args'].inspect[0..100] + td + - if msg['payload']['args'].to_s.size > 100 + = msg['payload']['args'].inspect[0..100] + "... " + button data-toggle="collapse" data-target="#worker_#{index}" class="btn btn-mini" Show All + .collapse[id="worker_#{index}" style="max-width: 750px;"]= msg['payload']['args'] + - else + = msg['payload']['args'] td== relative_time(msg['run_at'].is_a?(Numeric) ? Time.at(msg['run_at']) : Time.parse(msg['run_at'])) diff --git a/web/views/queue.slim b/web/views/queue.slim index 3d7e6b7e..ca60044f 100644 --- a/web/views/queue.slim +++ b/web/views/queue.slim @@ -7,9 +7,15 @@ table class="table table-striped table-bordered" tr th Class th Arguments - - @messages.each do |msg| + - @messages.each_with_index do |msg, index| tr td= msg['class'] - td= msg['args'].inspect[0..100] + td + - if msg['args'] and msg['args'].to_s.size > 100 + = msg['args'].inspect[0..100] + "... " + button data-toggle="collapse" data-target="#worker_#{index}" class="btn btn-mini" Show All + .collapse[id="worker_#{index}"]= msg['args'] + - else + = msg['args'] == slim :_paging, :locals => { :url => "#{root_path}queues/#{@name}" }