Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Created November 7, 2013 20:53
Show Gist options
  • Save DeskWOW/7361694 to your computer and use it in GitHub Desktop.
Save DeskWOW/7361694 to your computer and use it in GitHub Desktop.
To limit My Portal cases per brand, record which brand each case is regarding as a case custom field. Then, within "My Cases (List)" you'd use this code.
<table class='mycases'>
<thead>
<tr>
<th></th>
<th>{{desk.system.snippets.case_id}}</th>
<th>{{desk.system.snippets.subject}}</th>
<th>{{desk.system.snippets.from}}</th>
<th>{{desk.system.snippets.created}}</th>
<th>{{desk.system.snippets.status}}</th>
</tr>
</thead>
<tbody>
{% for case in desk.page.content.cases %}
{% if desk.current_brand.name contains case.custom_brand %}
<tr>
<td class='a-casechannel'><img src='{{ case.channel_icon }}'/></td>
<td class='a-caseid'>{{ case.id }}</td>
<td class='a-casesubject'><a href="{{ case.portal_url }}">{{ case.subject }}</a></td>
<td class='a-casefrom'>{{case.customer.first_name}}</td>
<td class='a-casecreated'>{{ case.created_at | in_time_zone: site.timezone | date: '%b %d' }}</td>
<td class='a-casestatus'>{{ case.status.name }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment