From ba5b2737365592cc511a526a3b14be46c3a75467 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 2 Feb 2013 11:42:52 +0100 Subject: Created a sortable table for the call_routes. #151 --- app/views/call_routes/_index_core.html.haml | 58 +++++++++++++++-------------- app/views/call_routes/index.html.haml | 11 ++---- 2 files changed, 34 insertions(+), 35 deletions(-) (limited to 'app/views/call_routes') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 52a45ba..9eae9ee 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -1,29 +1,31 @@ -- cache(['call_routes_table', call_routes.count, call_routes.reorder(:updated_at).last]) do - %table.table.table-striped - %thead - %tr - %th - %th= t('call_routes.index.name') - %th= t('route_elements.index.pattern') - %th= t('call_routes.index.endpoint') +/ - cache(['call_routes_table', call_routes.count, call_routes.reorder(:updated_at).last]) do +%table.table.table-striped{ :id => "call_routes" } + %thead + %tr + %th + %th= t('call_routes.index.name') + %th= t('route_elements.index.pattern') + %th= t('call_routes.index.endpoint') - %tbody - - for call_route in call_routes - - cache(['call_route_single_table_row', call_route, call_routes.count]) do - %tr - %td= call_route.position - %td= call_route.name - %td - - if call_route.route_elements.any? - = call_route.route_elements.first.pattern - - if call_route.route_elements.count > 1 - = ', ...' - - else - = '-' - %td - - endpoint = call_route.endpoint - - if endpoint - = endpoint - - else - = call_route.endpoint_type - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} + %tbody + - for call_route in call_routes + / - cache(['call_route_single_table_row', call_route, call_routes.count]) do + = content_tag_for :tr, call_route do + %td + %span.handle + %i.icon-resize-vertical + %td= call_route.name + %td + - if call_route.route_elements.any? + = call_route.route_elements.first.pattern + - if call_route.route_elements.count > 1 + = ', ...' + - else + = '-' + %td + - endpoint = call_route.endpoint + - if endpoint + = endpoint + - else + = call_route.endpoint_type + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} diff --git a/app/views/call_routes/index.html.haml b/app/views/call_routes/index.html.haml index 488e1c7..d5181e3 100644 --- a/app/views/call_routes/index.html.haml +++ b/app/views/call_routes/index.html.haml @@ -1,11 +1,8 @@ - content_for :title, t("call_routes.index.page_title") -- if @call_routes && @call_routes.count > 0 - %table.table.table-striped - - @routing_tables.each do |routing_table| - %tr - %td{:colspan => 3} - %h3= routing_table - = render "index_core", :call_routes => @call_routes.where(:routing_table => routing_table) +- if @call_routes && @call_routes.any? + - @routing_tables.each do |routing_table| + %h3= routing_table + = render "index_core", :call_routes => @call_routes.where(:routing_table => routing_table) = render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} -- cgit v1.2.3