Created
May 8, 2012 16:34
-
-
Save zanematthew/2637041 to your computer and use it in GitHub Desktop.
Sample Temp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old js snippet, would be better to move this to the template, the thing is if there's no results this should not be displayed. | |
new_header = '<tr><th class="attending">Add</th><th class="date">Date</th><th class="title">Event</th><th class="track">Track</th><th class="state">State</th></tr>'; | |
// snippet of search.js | |
// Start | |
var results_data_object = {"result":[]}; | |
results_data_object.result.push({ | |
id: this_result['ID'], | |
title: this_result['t'], | |
track: this_result['tr'], | |
date: this_result.dateHTML, | |
city: this_result['c'], | |
current_user: _user.ID, | |
checked: checked, | |
css_class: css_class, | |
action: action, | |
state: this_result['s'], | |
percent: this_percent, | |
url: this_result['url'], // @todo re-gen feed without url for events | |
}); | |
// End | |
// Template | |
<script id="result_event_tpl" type="text/html"> | |
{{#result}} | |
<tr> | |
<td> | |
<input type="checkbox" {{checked }} class="yes_no_handle {{ css_class }}" data-action="{{ action }}" data-current_user_id="{{ current_user }}" data-post_id="{{ id }}" /> | |
</td> | |
<td class="meta">{{ date }}</td> | |
<td> | |
<div class="title"> | |
<a href="{{ url }}">{{ title }}</a> | |
<span title="{{ percent }} % Match" class="tool-tip bar-container" style="width: 100px;"> | |
<span style="width: {{ percent }}px"></span> | |
</span> | |
</div> | |
</td> | |
<td class="meta">{{ city }}</td> | |
<td class="meta">{{ state }}</td> | |
</tr> | |
{{/result}} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment