Skip to content

Commit

Permalink
rename "filter modal" to "events modal"
Browse files Browse the repository at this point in the history
this is a more generic name
  • Loading branch information
elad-eyal committed Nov 27, 2020
1 parent 4b0ca8e commit 1f83a47
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/helpers/events_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def split_filter_string(s)

def filter_link(qname, text='')
link_to text, '#',
class: [ 'show_filter_modal', ('filter_icon' unless text.present?), params[qname].present? ] ,
class: [ 'show_events_modal', ('filter_icon' unless text.present?), params[qname].present? ] ,
data: { url: filter_modal_events_url(request.query_parameters.merge(which_filter: qname)) }
end

Expand Down
21 changes: 0 additions & 21 deletions app/views/events/_filters_modal_holder.html.haml

This file was deleted.

20 changes: 20 additions & 0 deletions app/views/events/_modal_holder.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#events-modal.modal{style: "display: none;"}

:coffeescript
update_events_modal = (url) ->
$.ajax(
dataType: "html",
url: url,
success: (data) ->
$('#events-modal').modal('show')
$('#events-modal').html(data)
error: () ->
location.reload(true)
)

$('.show_events_modal').on 'click', ->
update_events_modal(this.dataset['url'])

$("#events-modal").draggable({
handle: ".modal-header"
});
2 changes: 1 addition & 1 deletion app/views/events/_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
= action_button "small danger", t('destroy'), event, data: { confirm: t('are_you_sure')}, method: :delete
- elsif current_user.is_speaker_in?(event)
= action_button "small", t('edit'), edit_cfp_event_path(event)
= render partial: 'events/filters_modal_holder'
= render partial: 'events/modal_holder'
2 changes: 1 addition & 1 deletion app/views/events/attachments.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
= actions_bar do
= will_paginate @events
= render 'below_table'
= render partial: 'filters_modal_holder'
= render partial: 'modal_holder'
2 changes: 1 addition & 1 deletion app/views/events/ratings.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
= actions_bar do
= will_paginate @events
= render 'below_table'
= render partial: 'filters_modal_holder'
= render partial: 'modal_holder'
2 changes: 1 addition & 1 deletion test/features/filtering_event_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EditingEventRatingTest < FeatureTest
visit "/#{@conference.acronym}/events/"

# click the filter icon next to table header "Type"
find('th', text: 'Type').find('.show_filter_modal').trigger('click')
find('th', text: 'Type').find('.show_events_modal').trigger('click')
assert_content page, 'Select filter for'

check 'Film'
Expand Down

0 comments on commit 1f83a47

Please sign in to comment.