From 66a53a49705c269d73f9d51bb0d4a51283049c71 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 4 Feb 2013 13:00:45 +0100 Subject: Changed softkey table to be sortable. #150 --- app/views/softkeys/_index_core.html.haml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'app/views/softkeys/_index_core.html.haml') diff --git a/app/views/softkeys/_index_core.html.haml b/app/views/softkeys/_index_core.html.haml index 398ee51..4ebb29c 100644 --- a/app/views/softkeys/_index_core.html.haml +++ b/app/views/softkeys/_index_core.html.haml @@ -1,15 +1,19 @@ -%table.table.table-striped - %thead - %tr - %th= t('softkeys.index.function') - %th= t('softkeys.index.number') - %th= t('softkeys.index.label') - - %tbody - - for softkey in softkeys.order(:position) +- cache(['softkeys', I18n.locale, current_user, softkeys]) do + %table.table.table-striped{ :id => "softkeys" } + %thead %tr - %td - =softkey.to_s - %td= softkey.number - %td= softkey.label - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file + %th + %th= t('softkeys.index.function') + %th= t('softkeys.index.number') + %th= t('softkeys.index.label') + + %tbody + - for softkey in softkeys + = content_tag_for :tr, softkey do + %td + %span.handle + %i.icon-resize-vertical + %td= softkey.function + %td= softkey.number + %td= softkey.label + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file -- cgit v1.2.3 From 636be20a183fac10637fea700f55f89bc371577b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 4 Feb 2013 13:51:15 +0100 Subject: Refactoring and bugfixes. --- app/views/softkeys/_index_core.html.haml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'app/views/softkeys/_index_core.html.haml') diff --git a/app/views/softkeys/_index_core.html.haml b/app/views/softkeys/_index_core.html.haml index 4ebb29c..70c96bc 100644 --- a/app/views/softkeys/_index_core.html.haml +++ b/app/views/softkeys/_index_core.html.haml @@ -1,5 +1,5 @@ -- cache(['softkeys', I18n.locale, current_user, softkeys]) do - %table.table.table-striped{ :id => "softkeys" } +- cache(['softkeys_table', I18n.locale, current_user, softkeys]) do + %table.table.table-striped %thead %tr %th @@ -7,13 +7,14 @@ %th= t('softkeys.index.number') %th= t('softkeys.index.label') - %tbody + %tbody{ :id => "softkeys", :'data-update-url' => sort_softkeys_url} - for softkey in softkeys - = content_tag_for :tr, softkey do - %td - %span.handle - %i.icon-resize-vertical - %td= softkey.function - %td= softkey.number - %td= softkey.label - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file + - cache(['softkeys_table_tr', I18n.locale, current_user, softkey]) do + = content_tag_for :tr, softkey do + %td + %span.handle + %i.icon-resize-vertical + %td= softkey.function + %td= softkey.number + %td= softkey.label + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file -- cgit v1.2.3 From 87634e025711be508501cce8c05f23085dad8f9d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 4 Feb 2013 14:31:12 +0100 Subject: Bugfixes --- app/views/softkeys/_index_core.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views/softkeys/_index_core.html.haml') diff --git a/app/views/softkeys/_index_core.html.haml b/app/views/softkeys/_index_core.html.haml index 70c96bc..e2cb16c 100644 --- a/app/views/softkeys/_index_core.html.haml +++ b/app/views/softkeys/_index_core.html.haml @@ -12,8 +12,9 @@ - cache(['softkeys_table_tr', I18n.locale, current_user, softkey]) do = content_tag_for :tr, softkey do %td - %span.handle - %i.icon-resize-vertical + - if softkeys.count > 1 + %span.handle + %i.icon-resize-vertical %td= softkey.function %td= softkey.number %td= softkey.label -- cgit v1.2.3 From cd909970e8443ca86ad0be09b26cf5fb616ea303 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 8 Feb 2013 10:06:34 +0100 Subject: softkey.softkey_function vs. softkey.function --- app/views/softkeys/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/softkeys/_index_core.html.haml') diff --git a/app/views/softkeys/_index_core.html.haml b/app/views/softkeys/_index_core.html.haml index e2cb16c..4a06c72 100644 --- a/app/views/softkeys/_index_core.html.haml +++ b/app/views/softkeys/_index_core.html.haml @@ -15,7 +15,7 @@ - if softkeys.count > 1 %span.handle %i.icon-resize-vertical - %td= softkey.function + %td= t("softkeys.functions.#{softkey.softkey_function}") %td= softkey.number %td= softkey.label =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => softkey.sip_account, :child => softkey} \ No newline at end of file -- cgit v1.2.3