From 2a98824bfc7a7feb3cb78eb418be2eafa17094b4 Mon Sep 17 00:00:00 2001 From: yogesh Date: Mon, 7 Apr 2014 14:03:53 +0530 Subject: [PATCH] adding table-responsive class for user and company listing --- .../{footer.css => footer.css.scss} | 0 .../_navbar_body.html.haml | 4 +- .../companies/_companies_list.html.haml | 49 ++++++++++--------- .../users/_employee_list.html.haml | 6 +-- 4 files changed, 30 insertions(+), 29 deletions(-) rename app/assets/stylesheets/office_automation_employee/{footer.css => footer.css.scss} (100%) diff --git a/app/assets/stylesheets/office_automation_employee/footer.css b/app/assets/stylesheets/office_automation_employee/footer.css.scss similarity index 100% rename from app/assets/stylesheets/office_automation_employee/footer.css rename to app/assets/stylesheets/office_automation_employee/footer.css.scss diff --git a/app/views/layouts/office_automation_employee/_navbar_body.html.haml b/app/views/layouts/office_automation_employee/_navbar_body.html.haml index 6e93d50..143526d 100644 --- a/app/views/layouts/office_automation_employee/_navbar_body.html.haml +++ b/app/views/layouts/office_automation_employee/_navbar_body.html.haml @@ -7,7 +7,7 @@ %li.dropdown = link_to content_tag(:span, "", class: "glyphicon glyphicon-cog") + " #{current_user.company.name} admin" + content_tag(:b, "", class: "caret"), "#", class: "dropdown-toggle", data: { toggle: "dropdown" } - %ul.dropdown-menu.pull-right + %ul.dropdown-menu %li= link_to content_tag(:span, "", class: "glyphicon glyphicon-wrench") + " Company Profile", office_automation_employee.edit_company_path(current_user.company) %li.divider @@ -17,7 +17,7 @@ %li.dropdown = link_to image_tag(current_user.image.small) + content_tag(:b, "", class: "caret"), "#", class: "data-toggle", data: { toggle: "dropdown" } - %ul.dropdown-menu.pull-right + %ul.dropdown-menu - unless can? :manage, OfficeAutomationEmployee::Company %li= link_to content_tag(:span, "", class: "glyphicon glyphicon-edit") + " Profile", office_automation_employee.edit_company_user_path(current_user.company, current_user) diff --git a/app/views/office_automation_employee/companies/_companies_list.html.haml b/app/views/office_automation_employee/companies/_companies_list.html.haml index edabfe8..8e1b605 100644 --- a/app/views/office_automation_employee/companies/_companies_list.html.haml +++ b/app/views/office_automation_employee/companies/_companies_list.html.haml @@ -1,31 +1,32 @@ -%table.table.table-hover - %thead - %tr - %th # - %th Logo - %th Name - %th - %center Employee Count - %th - %center URL - %th Status - %th Remove - - %tbody.rowlink{ "data-link" => "row" } - - companies.each_with_index do |company, index| +.table-responsive + %table.table.table-hover + %thead %tr - %td= index + 1 + %th # + %th Logo + %th Name + %th + %center Employee Count + %th + %center URL + %th Status + %th Remove + + %tbody.rowlink{ "data-link" => "row" } + - companies.each_with_index do |company, index| + %tr + %td= index + 1 - %td= link_to image_tag(company.logo.square, class: "img"), office_automation_employee.edit_company_path(company) + %td= link_to image_tag(company.logo.square, class: "img"), office_automation_employee.edit_company_path(company) - %td= company.name + %td= company.name - %td.rowlink-skip - %center= link_to company.users.count, office_automation_employee.company_users_path(company) + %td.rowlink-skip + %center= link_to company.users.count, office_automation_employee.company_users_path(company) - %td.rowlink-skip - %center= link_to "#{company.company_url}", company.company_url, target: :_blank + %td.rowlink-skip + %center= link_to "#{company.company_url}", company.company_url, target: :_blank - %td.rowlink-skip= link_to (company.status.eql?("Active")? "Deactivate" : "Activate"), office_automation_employee.activation_company_path(company), class: "btn btn-xs btn-warning" + %td.rowlink-skip= link_to (company.status.eql?("Active")? "Deactivate" : "Activate"), office_automation_employee.activation_company_path(company), class: "btn btn-xs btn-warning" - %td.rowlink-skip= link_to content_tag(:span, "", class: "glyphicon glyphicon-remove"), office_automation_employee.company_path(company), method: :delete, class: "btn btn-xs btn-danger" + %td.rowlink-skip= link_to content_tag(:span, "", class: "glyphicon glyphicon-remove"), office_automation_employee.company_path(company), method: :delete, class: "btn btn-xs btn-danger" diff --git a/app/views/office_automation_employee/users/_employee_list.html.haml b/app/views/office_automation_employee/users/_employee_list.html.haml index 8fe8e5c..e73d8f4 100644 --- a/app/views/office_automation_employee/users/_employee_list.html.haml +++ b/app/views/office_automation_employee/users/_employee_list.html.haml @@ -1,5 +1,5 @@ -.col-md-12 - %table.table.table-hover +.table-responsive + %table.table.table-hover.table-condensed %thead %tr %th # @@ -17,7 +17,7 @@ %td= index + 1 %td= link_to image_tag(user.image.thumb.url, class: "img-circle"), office_automation_employee.company_user_path(user.company, user) %td= user.fullname - %td= user.email + %td.col-xs-1= user.email %td= user.roles.to_sentence %td= user.status if can? :edit, user.company %td.rowlink-skip= link_to(content_tag(:span, "", class: "glyphicon glyphicon-edit"), office_automation_employee.edit_company_user_path(user.company, user), class: "btn btn-default") if can?(:edit,user.company) and (cannot? :manage, user.company) and current_user != user