diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index b79ddc17..44e4d016 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -89,8 +89,12 @@ linters: - "app/views/admin/schedules/show.html.haml" - "app/views/admin/splashpages/_form.html.haml" - "app/views/admin/splashpages/show.html.haml" - - "app/views/admin/sponsors/_form.html.haml" + - "app/views/admin/sponsors/_carrier_fields.html.haml" + - "pp/views/admin/sponsors/_swag_fields.html.haml" + - "app/views/admin/sponsors/edit.html.haml" - "app/views/admin/sponsors/index.html.haml" + - "app/views/admin/sponsors/new.html.haml" + - "app/views/admin/sponsors/show.html.haml" - "app/views/admin/sponsorship_levels/_form.html.haml" - "app/views/admin/sponsorship_levels/index.html.haml" - "app/views/admin/targets/_form.html.haml" @@ -365,6 +369,7 @@ linters: - "app/views/admin/emails/index.html.haml" - "app/views/admin/events/show.html.haml" - "app/views/admin/reports/index.html.haml" + - "app/views/admin/sponsors/index.html.haml" - "app/views/admin/users/show.html.haml" - "app/views/admin/venues/_form.html.haml" - "app/views/conferences/index.html.haml" diff --git a/app/views/admin/sponsors/edit.html.haml b/app/views/admin/sponsors/edit.html.haml index 73630b3e..d4c0645f 100644 --- a/app/views/admin/sponsors/edit.html.haml +++ b/app/views/admin/sponsors/edit.html.haml @@ -23,12 +23,12 @@ on_text: 'Yes', off_text: 'No' } - @sponsor.swag.each_with_index do |(key, value), index| - =render partial: 'swag_fields', locals: {f: f, index: index, type_value: value[:type].to_s, quantity_value: value[:quantity].to_i} - =render partial: 'swag_fields', locals: {f: f, index: @sponsor.swag_index, type_value: nil, quantity_value: nil} + = render partial: 'swag_fields', locals: {f: f, index: index, type_value: value[:type].to_s, quantity_value: value[:quantity].to_i} + = render partial: 'swag_fields', locals: {f: f, index: @sponsor.swag_index, type_value: nil, quantity_value: nil} - @sponsor.swag_transportation.each_with_index do |(key, value), index| - =render partial: 'carrier_fields', locals: {f: f, index: index, name_value: value[:carrier_name].to_s, tracking_value: value[:tracking_number].to_s, boxes_value: value[:boxes]} - =render partial: 'carrier_fields', locals: {f: f, index: @sponsor.carrier_index, name_value: nil, tracking_value: nil, boxes_value: nil} + = render partial: 'carrier_fields', locals: {f: f, index: index, name_value: value[:carrier_name].to_s, tracking_value: value[:tracking_number].to_s, boxes_value: value[:boxes]} + = render partial: 'carrier_fields', locals: {f: f, index: @sponsor.carrier_index, name_value: nil, tracking_value: nil, boxes_value: nil} .row .col-md-8 diff --git a/app/views/admin/sponsors/index.html.haml b/app/views/admin/sponsors/index.html.haml index 6ae4e7fe..981db762 100644 --- a/app/views/admin/sponsors/index.html.haml +++ b/app/views/admin/sponsors/index.html.haml @@ -9,18 +9,18 @@ %div{ role: 'tabpanel' } %ul.nav.nav-tabs %li.active - %a{'data-toggle' => 'tab', href: '#sponsorship', role: 'tab'} Sponsorship + %a{ 'data-toggle' => 'tab', href: '#sponsorship', role: 'tab' } Sponsorship %li - %a{'data-toggle' => 'tab', href: '#swags', role: 'tab'} Swags + %a{ 'data-toggle' => 'tab', href: '#swags', role: 'tab' } Swags %li - %a{'data-toggle' => 'tab', href: '#unconfirmed', role: 'tab'} Unconfirmed + %a{'data-toggle' => 'tab', href: '#unconfirmed', role: 'tab' } Unconfirmed .tab-content #sponsorship.tab-pane.active - if @conference.sponsors.confirmed.any? .row .col-md-12 - %table.table.table-hover#sponsorship + %table.table.table-hover %thead %th Logo %th Name @@ -36,7 +36,7 @@ %td = link_to sponsor.name, admin_conference_sponsor_path(@conference.short_title, sponsor) %td - = sponsor.amount + = sponsor.amount %td - if sponsor.payed %span.fa.fa-check.text-success @@ -62,7 +62,7 @@ - if @conference.sponsors.confirmed.any? .row .col-md-12 - %table.table.table-hover#swags + %table.table.table-hover %thead %th Logo %th Name @@ -123,7 +123,7 @@ - if @conference.sponsors.unconfirmed.any? .row .col-md-12 - %table.table.table-hover#unconfirmed + %table.table.table-hover#sponsors %thead %th Logo %th Name diff --git a/app/views/admin/sponsors/new.html.haml b/app/views/admin/sponsors/new.html.haml index 5fbeed31..a94b1d03 100644 --- a/app/views/admin/sponsors/new.html.haml +++ b/app/views/admin/sponsors/new.html.haml @@ -2,8 +2,7 @@ .col-md-12 .page-header %h1 - -if @sponsor.new_record? - New + New Sponsor = @sponsor.name .row diff --git a/spec/features/sponsor_spec.rb b/spec/features/sponsor_spec.rb index dafe13db..c10a00b8 100644 --- a/spec/features/sponsor_spec.rb +++ b/spec/features/sponsor_spec.rb @@ -27,7 +27,7 @@ feature Sponsor do expect(flash).to eq('Sponsor successfully created.') click_link 'Unconfirmed' - within('table#unconfirmed') do + within('table#sponsors') do expect(page.has_content?('SUSE')).to be true expect(page.has_content?('The original provider')).to be true expect(page.has_content?('http://www.suse.com')).to be true