Skip to content

Instantly share code, notes, and snippets.

@appcove
Created June 7, 2013 22:41
Show Gist options
  • Save appcove/5732911 to your computer and use it in GitHub Desktop.
Save appcove/5732911 to your computer and use it in GitHub Desktop.
# vim:encoding=utf-8:ts=2:sw=2:expandtab
from AppCove import *
import AppCove.Network
###############################################################################
@Expose
def Request(self, ID=0):
yield
LocationList = AppCove.Network.Location.List()
#============================================================================
self.UI.Title = 'Network Overview'
self.UI.Style('''
tr._LocationRow
{
cursor: pointer;
}
''')
self.UI.Script('''
$(function(){
$('tr._LocationRow').click(function(ev){
ev.preventDefault();
window.location = 'location/edit?RURI=' + encodeURIComponent(window.location.href) + '&L=' + encodeURIComponent($(this).attr('data-Location_MNID'));
});
});
''')
self.UI.Body('''
<table class="List">
<tr>
<th>Location ID</th>
<th>Name</th>
<th>Note</th>
</tr>
''' + JN('''
<tr class="_LocationRow" data-Location_MNID=''' + QA(Row.Location_MNID) + '''>
<td>''' + HS(Row.Location_MNID) + '''</td>
<td>''' + HS(Row.Name) + '''</td>
<td>''' + HS(Row.Note) + '''</td>
<tr>
''' for Row in LocationList) + '''
</table>
''')
yield self.UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment