Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
Created July 24, 2013 04:47
Show Gist options
  • Select an option

  • Save jamesarosen/6068136 to your computer and use it in GitHub Desktop.

Select an option

Save jamesarosen/6068136 to your computer and use it in GitHub Desktop.
A Handlebars template that is causing some problems.
<div class="body">
{{#if comment }}
<div class="comment">
{{{ comment.value }}}
</div>
{{#if comment.canMakePrivate}}
<div class="link_light make-private">
<em data-action="make-private" data-audit-id="{{../id}}">{{comment.makePrivateActionLabel}}</em>
</div>
{{/if}}
{{/if}}
{{#if voiceComment }}
{{#if voiceComment.value}}
<div class="comment">
{{{ voiceComment.value }}}
</div>
{{/if}}
<div class='audio player' id='audio_player_{{voiceComment.id}}_events' data-recording-url='{{voiceComment.recordingURL}}'></div>
<div class='call_statistics'>
<h4>{{voiceComment.headerLabel}}</h4>
<dl class='call_info'>
<dt>{{ voiceComment.callFromLabel }}</dt>
<dd>{{ voiceComment.callFrom }}</dd>
<dt>{{ voiceComment.callToLabel }}</dt>
<dd>{{ voiceComment.callTo }}</dd>
<dt>{{ voiceComment.formattedStartedAtLabel }}</dt>
<dd>{{ voiceComment.formattedStartedAt }}</dd>
{{#if voiceComment.location}}
<dt>{{ voiceComment.locationLabel }}</dt>
<dd>{{ voiceComment.location }}</dd>
{{/if}}
<dt>{{ voiceComment.agentLabel }}</dt>
<dd>{{ voiceComment.agentName }}</dd>
<dt>{{ voiceComment.lengthOfPhoneCallLabel }}</dt>
<dd>{{ voiceComment.lengthOfPhoneCall }}</dd>
</dl>
{{#if voiceComment.transcriptionVisible}}
<h4>
{{ voiceComment.transcriptionLabel }}
</h4>
<p>{{voiceComment.transcription}}</p>
{{/if}}
</div>
{{/if}}
{{#if facebookComment }}
{{#if facebookComment.value}}
<div class="comment">
{{{ facebookComment.value }}}
{{#if facebookComment.attachment}}
<p>{{{ facebookComment.attachment }}}</p>
{{/if}}
</div>
{{/if}}
{{#if facebookComment.shares}}
{{#each facebookComment.shares}}
{{{link}}}
{{description}}
{{picture}}
{{/each}}
{{/if}}
{{#if facebookComment.attachments}}
{{#each facebookComment.attachments}}
{{{this}}}
{{/each}}
{{/if}}
{{/if}}
<ul class="attachments">
<div id="gallery" data-toggle="modal-gallery" data-target="#modal-gallery">
{{#each comment.imageAttachments}}
<li class="image">
<a href="{{contentUrl}}" title="{{fileName}}" rel="gallery" tabindex="-1" class="attachment">
<img src="{{thumbnailContentUrl}}"/>
<div class="file_name">{{displayName}}</div>
</a>
</li>
{{/each}}
</div>
{{#each comment.nonImageAttachments}}
<li>
<a href="{{contentUrl}}" target="_blank" class="attachment" type="{{contentType}}" tabindex="-1">
<i class="icon-file"></i> {{ displayName }}
</a>
</li>
{{/each}}
</ul>
{{#if events }}
<ul class="audit-events">
{{#each events}}
<li class="{{type}}">
<i class="event_share icon-share-alt"></i>
<i class="event_change {{iconClass}}"></i>
<div class="info">
<label>
{{ label }}
</label>
{{ value }} {{#if showLink}}<span class="link_light" data-action="show-notification" data-notification-type="{{type}}" data-notification-id="{{id}}">#{{id}}{{/if}}
<del> {{ previous_value }} </del>
<div class="via">
{{ via }}
</div>
</div>
</li>
{{/each}}
</ul>
{{/if}}
<div class="via">
{{ via }}
{{#if hasRawEmail }}
(<a href="#" onclick="window.open('/audits/{{id}}/email.html','emailWindow','toolbar=0, menubar=0, width=620, height=594, location=0, status=0, directories=0, scrollbars=1'); return false;">{{rawEmailLabel}}</a>)
{{/if}}
</div>
<div class="client">
<ul>
<li>{{system.message_id}}</li>
<li>{{system.client}}<li/>
<li>{{system.ip_address}}<li/>
<li>{{system.location}}<li/>
</ul>
</div>
</div>
{{#if comment.screencasts }}
<ul id="screencasts_list">
{{#each comment.screencasts}}
<li style="background: url({{thumbnail}}) no-repeat;" class="screencast-thumb" data-screencast-id="{{id}}" ></li>
{{/each}}
</ul>
{{/if}}
{{#if tweet }}
<div class="tweet-footer-left">
<a class="twitter-timestamp"data-action="timestamp" data-comment-id="{{comment.id}}">{{{created_at}}}</a>
{{{attribution}}}
</div>
<div class="tweet-footer-right">
<div class="actions">
<a href="#" class="twitter-action favorite"
data-action="favorite"
data-comment-id="{{comment.id}}">
<span class="favorite-mode">
<i></i><label>{{favorite_label}}</label>
</span>
<span class="unfavorite-mode">
<i></i><label>{{favorited_label}}</label>
</span>
</a>
<a href="#" class="twitter-action retweet"
data-action="retweet"
data-comment-id="{{comment.id}}">
<span class="retweet-mode">
<i></i><label>{{retweet_label}}</label>
</span>
<span class="unretweet-mode">
<i></i><label>{{retweeted_label}}</label>
</span>
</a>
<a href="#" class="twitter-action reply"
data-action="reply"
data-comment-id="{{comment.id}}">
<i></i><label>{{reply_label}}</label>
</a>
</div>
</div>
{{/if}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment