Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app/components/explore/side-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export default class SideBar extends Component {
isMapVisible = true;
eventLocationType = null;

@computed('category', 'sub_category', 'event_type', 'startDate', 'endDate', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online')
@computed('category', 'sub_category', 'event_type', 'startDate', 'endDate', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online', 'has_logo', 'has_image')
get hideClearFilters() {
return !(this.category || this.sub_category || this.event_type || this.startDate || this.endDate || this.location || this.ticket_type || this.cfs || this.event_name || this.is_online);
return !(this.category || this.sub_category || this.event_type || this.startDate || this.endDate || this.location || this.ticket_type || this.cfs || this.event_name || this.is_online || this.has_logo || this.has_image);
}

@computed('category', 'sub_category')
Expand All @@ -39,6 +39,16 @@ export default class SideBar extends Component {
return (!this.device.isMobile || this.showFilters);
}

@action
selectLogos(val) {
this.set('has_logo', this.has_logo === val ? null : val);
}

@action
selectImages(val) {
this.set('has_image', this.has_image === val ? null : val);
}

@action
onLocationChangeHandler(lat, lng) {
this.setProperties({
Expand Down Expand Up @@ -172,6 +182,8 @@ export default class SideBar extends Component {
cfs : null,
event_name : null,
is_online : null,
has_logo : null,
has_image : null,
eventLocationType : null
});
}
Expand Down
10 changes: 9 additions & 1 deletion app/controllers/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import Controller from '@ember/controller';

@classic
export default class ExploreController extends Controller {
queryParams = ['category', 'sub_category', 'event_type', 'start_date', 'end_date', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online'];
queryParams = ['category', 'sub_category', 'event_type', 'start_date', 'end_date', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online', 'has_logo', 'has_image'];
event_name = null;
is_online = null;
has_logo = null;
has_image = null;
category = null;
sub_category = null;
event_type = null;
Expand All @@ -30,6 +32,12 @@ export default class ExploreController extends Controller {
if (filterType === 'is_online') {
this.set('is_online', null);
}
if (filterType === 'has_logo') {
this.set('has_logo', null);
}
if (filterType === 'has_image') {
this.set('has_image', null);
}
if (filterType === 'start_date') {
this.set('startDate', null);
}
Expand Down
14 changes: 14 additions & 0 deletions app/routes/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ export default class ExploreRoute extends Route {
val : params.is_online
});
}
if (params.has_image) {
filterOptions.push({
name : 'original-image-url',
op : 'ne',
val : null
});
}
if (params.has_logo) {
filterOptions.push({
name : 'logo-url',
op : 'ne',
val : null
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

if (params.location) {
filterOptions.push({
name : 'location_name',
Expand Down
75 changes: 51 additions & 24 deletions app/templates/components/explore/side-bar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -194,34 +194,61 @@
</div>
</UiAccordion>
</div>
{{/if}}
<div class="item">
<UiAccordion>
<span class="title">
<i class="dropdown icon"></i>
{{t 'Event Call For Speakers' }}
</span>
<div class="content menu">
<div class="ui form">
<div class="grouped fields">
<div class="field">
<UiCheckbox
@label={{t "Open"}}
@checked={{if (eq this.cfs "open") "active"}}
@onChange={{action "selectEventCfs" "open"}} />
<div class="item">
<UiAccordion>
<span class="title">
<i class="dropdown icon"></i>
{{t 'Call For Speakers' }}
</span>
<div class="content menu">
<div class="ui form">
<div class="grouped fields">
<div class="field">
<UiCheckbox
@label={{t "Open"}}
@checked={{if (eq this.cfs "open") "active"}}
@onChange={{action "selectEventCfs" "open"}} />
</div>
<div class="field">
<UiCheckbox
@label={{t "Closed"}}
@class="ui checkbox"
@checked={{if (eq this.cfs "closed") "active"}}
@onChange={{action "selectEventCfs" "closed"}} />
</div>
</div>
<div class="field">
<UiCheckbox
@label={{t "Closed"}}
@class="ui checkbox"
@checked={{if (eq this.cfs "closed") "active"}}
@onChange={{action "selectEventCfs" "closed"}} />
</div>
</div>
</UiAccordion>
</div>
<div class="item">
<UiAccordion>
<span class="title">
<i class="dropdown icon"></i>
{{t 'Images' }}
</span>
<div class="content menu">
<div class="ui form">
<div class="grouped fields">
<div class="field">
<UiCheckbox
@label={{t "Image"}}
@checked={{if this.has_image "active"}}
@onChange={{action "selectImages" "true"}} />
</div>
<div class="field">
<UiCheckbox
@label={{t "Logo"}}
@class="ui checkbox"
@checked={{if this.has_logo "active"}}
@onChange={{action "selectLogos" "true"}} />
</div>
</div>
</div>
</div>
</div>
</UiAccordion>
</div>
</UiAccordion>
</div>
{{/if}}
<div class="item">
<button class="ui red button {{if this.hideClearFilters 'disabled'}}" {{action 'clearFilters'}}>{{t 'Clear Filters'}}</button>
{{#if this.device.isMobile}}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/explore.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="ui stackable grid">
<div class="three wide column">
<Explore::SideBar @model={{this.model}} @category={{this.category}} @sub_category={{this.sub_category}} @event_type={{this.event_type}} @startDate={{this.start_date}} @endDate={{this.end_date}} @event_name={{this.event_name}} @is_online={{this.is_online}} @location={{this.location}} @ticket_type={{this.ticket_type}} @cfs={{this.cfs}} />
<Explore::SideBar @model={{this.model}} @category={{this.category}} @sub_category={{this.sub_category}} @event_type={{this.event_type}} @startDate={{this.start_date}} @endDate={{this.end_date}} @event_name={{this.event_name}} @is_online={{this.is_online}} @has_logo={{this.has_logo}} @has_image={{this.has_image}} @location={{this.location}} @ticket_type={{this.ticket_type}} @cfs={{this.cfs}} />
</div>
<div class="thirteen wide column">
<h1 class="ui header">{{t 'Events'}}</h1>
Expand Down