Merge pull request #1653 from rahul2240/tracks

Removed datatable if there is no data
This commit is contained in:
Ana María Martínez Gómez 2017-09-01 09:17:11 +02:00 committed by GitHub
commit 30d3296a42
3 changed files with 118 additions and 116 deletions

View file

@ -4,9 +4,6 @@
%h1 %h1
Booths Booths
= "(#{@booths.length})" if @booths.any? = "(#{@booths.length})" if @booths.any?
.pull-right
- if can? :create, Booth
= link_to 'Add Booth', new_admin_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'
%p.text-muted %p.text-muted
All the booth requests All the booth requests
@ -32,6 +29,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?
%table.table.table-striped.table-bordered.table-hover.datatable %table.table.table-striped.table-bordered.table-hover.datatable
%thead %thead
%th %th
@ -74,3 +72,7 @@
%td %td
= link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, booth.id), = link_to 'Edit', edit_admin_conference_booth_path(@conference.short_title, booth.id),
class: 'btn btn-primary' class: 'btn btn-primary'
.row
.col-md-12.text-right
- if can? :create, Booth
= link_to 'New Booth', new_admin_conference_booth_path(@conference.short_title), class: 'button btn btn-primary'

View file

@ -7,6 +7,7 @@
Categorize events in your conference Categorize events in your conference
.row .row
.col-md-12 .col-md-12
- if @tracks.any?
%table.table.table-hover.table-striped.table-bordered.datatable#tracks %table.table.table-hover.table-striped.table-bordered.datatable#tracks
%thead %thead
%th ID %th ID
@ -78,4 +79,4 @@
style: ('border-top-left-radius: 0; border-bottom-left-radius: 0;' if special_style), params: { 'schedule[track_id]' => track.id } style: ('border-top-left-radius: 0; border-bottom-left-radius: 0;' if special_style), params: { 'schedule[track_id]' => track.id }
.row .row
.col-md-12.text-right .col-md-12.text-right
= link_to 'New Track', new_admin_conference_program_track_path(@conference.short_title), class: 'btn btn-success' = link_to 'New Track', new_admin_conference_program_track_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -42,11 +42,10 @@ feature Track do
expected.to change { Track.count }.by(-1) expected.to change { Track.count }.by(-1)
expect(flash).to eq('Track successfully deleted.') expect(flash).to eq('Track successfully deleted.')
within('table#tracks') do expect(page.has_css?('table#tracks')).to be false
expect(page.has_content?(track.name)).to be false expect(page.has_content?(track.name)).to be false
expect(page.has_content?(track.description)).to be false expect(page.has_content?(track.description)).to be false
end end
end
scenario 'updates a track', feature: true, js: true do scenario 'updates a track', feature: true, js: true do
create(:track, program_id: conference.program.id) create(:track, program_id: conference.program.id)