Skip to content

Commit 569b948

Browse files
feat: Add tracks and rooms filters on sessions page (#4879)
Co-authored-by: iamareebjamal <[email protected]>
1 parent 2ef7f8b commit 569b948

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

app/routes/public/sessions.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ export default class SessionsRoute extends Route {
1010
},
1111
sort: {
1212
refreshModel: true
13+
},
14+
track: {
15+
refreshModel: true
16+
},
17+
room: {
18+
refreshModel: true
1319
}
1420
};
1521

@@ -66,6 +72,30 @@ export default class SessionsRoute extends Route {
6672
});
6773
}
6874

75+
if (params.track) {
76+
filterOptions.push({
77+
name : 'track',
78+
op : 'has',
79+
val : {
80+
name : 'name',
81+
op : 'eq',
82+
val : params.track
83+
}
84+
});
85+
}
86+
87+
if (params.room) {
88+
filterOptions.push({
89+
name : 'microlocation',
90+
op : 'has',
91+
val : {
92+
name : 'name',
93+
op : 'eq',
94+
val : params.room
95+
}
96+
});
97+
}
98+
6999
return {
70100
event : eventDetails,
71101
session : await this.infinity.model('session', {

app/styles/components/all.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
@import 'scheduler';
99
@import 'infinity-loader';
1010
@import 'track-item';
11+
@import 'extras';

app/styles/components/extras.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
a.link-item {
2+
color: #333;
3+
display: table;
4+
5+
&.active {
6+
background-color: rgba(0, 0, 0, .05);
7+
}
8+
9+
&:hover {
10+
background-color: rgba(0, 0, 0, .025);
11+
}
12+
}

app/styles/partials/utils.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
padding: 0 !important;
4646
}
4747

48+
.p-1 {
49+
padding: .25rem !important;
50+
}
51+
4852
.p-4 {
4953
padding: 1rem !important;
5054
}
@@ -73,6 +77,10 @@
7377
margin-bottom: .5rem !important;
7478
}
7579

80+
.mb-1 {
81+
margin-bottom: .25rem !important;
82+
}
83+
7684
.ml-auto {
7785
margin-left: auto !important;
7886
}

app/templates/public.hbs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,40 @@
4343
</div>
4444
<div class="three wide column">
4545
{{#if (not-eq this.session.currentRouteName 'public.cfs.new-speaker')}}
46+
{{#if (eq this.session.currentRouteName 'public.sessions')}}
47+
<div class="ui basic segment">
48+
<h4>
49+
{{t 'Tracks'}}
50+
<LinkTo @route="public.sessions" @models={{array this.model.id}} @query={{hash track=null}} data-tooltip="{{t 'Clear Track Filter'}}">
51+
<i class="minus circle icon" style={{css color='#f00'}}></i>
52+
</LinkTo>
53+
</h4>
54+
{{#each this.model.tracks as |track|}}
55+
<LinkTo
56+
class="p-1 mb-1 rounded-default link-item {{if (eq this.params.track track.name) 'active'}}"
57+
@route="public.sessions"
58+
@models={{array this.model.id}}
59+
@query={{hash track=track.name}}>
60+
<i class="circle icon" style={{css color=track.color}}></i> {{track.name}}
61+
</LinkTo>
62+
{{/each}}
63+
<h4>
64+
{{t 'Rooms'}}
65+
<LinkTo @route="public.sessions" @models={{array this.model.id}} @query={{hash room=null}} data-tooltip="{{t 'Clear Room Filter'}}">
66+
<i class="minus circle icon" style={{css color='#f00'}}></i>
67+
</LinkTo>
68+
</h4>
69+
{{#each this.model.microlocations as |room|}}
70+
<LinkTo
71+
class="p-1 mb-1 rounded-default link-item {{if (eq this.params.room room.name) 'active'}}"
72+
@route="public.sessions"
73+
@models={{array this.model.id}}
74+
@query={{hash room=room.name}}>
75+
<i class="circle icon"></i> {{room.name}}
76+
</LinkTo>
77+
{{/each}}
78+
</div>
79+
{{/if}}
4680
<Public::SocialLinks @externalUrl={{this.model.externalEventUrl}} @socialLinks={{this.model.socialLinks}} />
4781
{{/if}}
4882
</div>

0 commit comments

Comments
 (0)