Consistent, concise styling of datables

Add a semantic class to aggregate bootstrap classes and consistently
applyt them to all datatables.
This commit is contained in:
James Mason 2018-06-15 18:20:18 -07:00
parent 3bb73f27cf
commit 4ecf078db6
25 changed files with 47 additions and 25 deletions

View file

@ -0,0 +1,21 @@
table.datatable {
@extend .table, .table-striped, .table-bordered, .table-hover;
td.actions {
vertical-align: middle;
align: center;
div.btn-group {
display: flex;
}
a {
@extend .btn;
}
}
td.truncate {
max-width: 1px;
@include text-overflow();
}
}

View file

@ -61,3 +61,6 @@ $navbar-default-link-hover-color: #000000;
// Utility classes // Utility classes
@import "bootstrap/utilities"; @import "bootstrap/utilities";
@import "bootstrap/responsive-utilities"; @import "bootstrap/responsive-utilities";
// semantic classes
@import "osem-datatables";

View file

@ -54,7 +54,7 @@
= link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title) = link_to "#{@conference.booth_limit} booths", edit_admin_conference_path(@conference.short_title)
) )
- if @booths.any? - if @booths.any?
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th %th
%b ID %b ID

View file

@ -59,7 +59,7 @@
.row .row
.col-md-12 .col-md-12
.margin-event-table .margin-event-table
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th %th
%b ID %b ID

View file

@ -16,7 +16,7 @@
You have more registrations than the capacity of the room! You have more registrations than the capacity of the room!
.well .well
%table.table.table-hover.table-borderd.table-striped.datatable#registrations %table.datatable#registrations
%thead %thead
%th %th
%th Name %th Name

View file

@ -18,7 +18,7 @@
= render 'proposal' = render 'proposal'
#history-content.tab-pane #history-content.tab-pane
.col-md-12 .col-md-12
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th ID %th ID
%th Description %th Description

View file

@ -1,7 +1,7 @@
.page-header .page-header
%h3 Users (#{users.length}) %h3 Users (#{users.length})
- if users.present? - if users.present?
%table.table.table-striped.table-bordered.table-hover.datatable#users %table.datatable#users
%thead %thead
%th Name %th Name
%th Email %th Email

View file

@ -9,7 +9,7 @@
Manage organizations in OSEM Manage organizations in OSEM
.row .row
.col-md-12 .col-md-12
%table.table.table-hover.datatable %table.datatable
%thead %thead
%th Name %th Name
%th Upcoming Conferences %th Upcoming Conferences

View file

@ -16,7 +16,7 @@
- if @physical_tickets.any? - if @physical_tickets.any?
.row .row
.col-md-12 .col-md-12
%table.table.table-hover.datatable#tickets %table.datatable#tickets
%thead %thead
%th ID %th ID
%th Type %th Type

View file

@ -11,7 +11,7 @@
.row .row
.col-md-12 .col-md-12
%table.table.table-border.table-hover.datatable#question_users %table.datatable#question_users
%thead %thead
%th Name %th Name
%th Username %th Username

View file

@ -19,7 +19,7 @@
.row .row
.col-md-12 .col-md-12
%div.margin-event-table %div.margin-event-table
%table.table.table-hover.datatable#registrations %table.datatable#registrations
%thead %thead
%tr %tr
%th ID# %th ID#

View file

@ -8,7 +8,7 @@
All submissions and the information that they are missing All submissions and the information that they are missing
.col-md-12 .col-md-12
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th ID %th ID
%th Title %th Title

View file

@ -7,7 +7,7 @@
%p.text-muted %p.text-muted
All submissions where the speakers have special requirements All submissions where the speakers have special requirements
.col-md-12 .col-md-12
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th ID %th ID
%th Title %th Title

View file

@ -7,7 +7,7 @@
%p.text-muted %p.text-muted
All submissions that have no commercial All submissions that have no commercial
.col-md-12 .col-md-12
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th ID %th ID
%th Title %th Title

View file

@ -7,7 +7,7 @@
%p.text-muted %p.text-muted
All event speakers who haven't checked in All event speakers who haven't checked in
.col-md-12 .col-md-12
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th Speaker Name %th Speaker Name
%th Registered? %th Registered?

View file

@ -7,7 +7,7 @@
- if @conference.resources.any? - if @conference.resources.any?
.row .row
.col-md-12 .col-md-12
%table.table.table-hover.datatable %table.datatable
%thead %thead
%th Name %th Name
%th Left( Left/Total ) %th Left( Left/Total )
@ -33,4 +33,3 @@
.row .row
.col-md-12 .col-md-12
= link_to 'Add Resource', new_admin_conference_resource_path, class: 'btn btn-success pull-right', disabled: !(can? :create, Resource.new(conference_id: @conference_id)) = link_to 'Add Resource', new_admin_conference_resource_path, class: 'btn btn-success pull-right', disabled: !(can? :create, Resource.new(conference_id: @conference_id))

View file

@ -1,7 +1,7 @@
.page-header .page-header
%h3 Users (#{users.length}) %h3 Users (#{users.length})
- if users.present? - if users.present?
%table.table.table-striped.table-bordered.table-hover.datatable#users %table.datatable#users
%thead %thead
- if ( can? :toggle_user, @role ) - if ( can? :toggle_user, @role )
%th.col-md-1 %th.col-md-1

View file

@ -8,7 +8,7 @@
- if @conference.tickets.any? - if @conference.tickets.any?
.row .row
.col-md-12 .col-md-12
%table.table.table-hover.datatable#tickets %table.datatable#tickets
%thead %thead
%th Title %th Title
%th Price %th Price

View file

@ -12,7 +12,7 @@
People who bought this ticket People who bought this ticket
.row .row
.col-md-12 .col-md-12
%table.table.table-hover.datatable %table.datatable
%thead %thead
%th # %th #
%th Name %th Name
@ -35,4 +35,3 @@
= buyer.affiliation = buyer.affiliation
%td %td
= @ticket.tickets_paid(buyer) = @ticket.tickets_paid(buyer)

View file

@ -33,7 +33,7 @@
.row .row
.col-md-12 .col-md-12
- if @tracks.any? - if @tracks.any?
%table.table.table-hover.table-striped.table-bordered.datatable#tracks %table.datatable#tracks
%thead %thead
%th ID %th ID
%th Name %th Name

View file

@ -107,7 +107,7 @@
.tab-pane#events .tab-pane#events
.col-md-12 .col-md-12
%table.table.table-hover.datatable %table.datatable
%thead %thead
%th Title %th Title
%th Type %th Type

View file

@ -5,7 +5,7 @@
.col-md-12 .col-md-12
.well .well
%table.table.table-bordered.table-striped.table-hover.datatable#event_registrations %table.datatable#event_registrations
%thead %thead
%th ID %th ID
%th Conference %th Conference

View file

@ -4,7 +4,7 @@
Submissions (#{@user.events.length}) for #{@user.name} Submissions (#{@user.events.length}) for #{@user.name}
.col-md-12 .col-md-12
.well .well
%table.table.table-bordered.table-striped.table-hover.datatable#submissions %table.datatable#submissions
%thead %thead
%th ID %th ID
%th Conference %th Conference

View file

@ -10,7 +10,7 @@
= link_to 'Add User', new_admin_user_path, :class => 'button btn btn-default btn-info' = link_to 'Add User', new_admin_user_path, :class => 'button btn btn-default btn-info'
.row .row
.col-md-12.table-responsive .col-md-12.table-responsive
%table.table.table-striped.table-bordered.table-hover.datatable %table.datatable
%thead %thead
%th ID %th ID
%th Confirmed? %th Confirmed?

View file

@ -13,7 +13,7 @@
= @event.title = @event.title
.well .well
%table.table.table-hover.table-borderd.table-striped.datatable#registrations %table.datatable#registrations
%thead %thead
%th %th
%th Name %th Name