Skip to content

Instantly share code, notes, and snippets.

@bxh-io
Created December 4, 2012 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bxh-io/4204614 to your computer and use it in GitHub Desktop.
Save bxh-io/4204614 to your computer and use it in GitHub Desktop.
{{#if isGlobalQuestion}}
{{#if content.global_answers.length}}
<a class="global-answers selected">{{content.number_of_community_answers}}</a>
{{else}}
No Community Answers
{{/if}}
{{else}}
{{#if content.global_answers.length}}
{{#if content.number_of_course_answers.length}}
<!-- If there are both course and global answers-->
<a {{action switchAnswers target="parentView"}} {{bindAttr class=":course-answers notGlobalAnswers:selected"}}>{{content.number_of_course_answers}} <span class="ss-icon">&#xF501;</span></a>
<a {{action switchAnswers target="parentView"}} {{bindAttr class=":global-answers notCourseAnswers:selected"}}>{{content.number_of_community_answers}}</a>
{{else}}
<!-- Only global answers -->
<span class="course-answers">{{content.number_of_community_answers}}</span>
<span>No Community Answers</span>
{{/if}}
{{else}}
<!-- No global answers here -->
{{#if content.number_of_course_answers.length}}
<!-- Some course answers but no global answers -->
<span class="course-answers">{{content.number_of_course_answers}}</span>
<span>No Community Answers</span>
{{else}}
No Answers at all
{{/if}}
{{/if}}
{{/if}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment