Sha256: 108f66202187e4d8725f490b1a83c9f64430d90fb737554e883a08a0c3a495ec
Contents?: true
Size: 1.42 KB
Versions: 4
Compression:
Stored size: 1.42 KB
Contents
module App::Usr::List extend Waxx::View extend self has( :id, :usr_name, :last_login_date, :failed_login_count, #"person_id: person.id", #"person.first_name", #"person.last_name", #"company_name: company.company_name" ) module Html extend Waxx::Html extend self def get(x, d, message:{}) title = "People" App::Html.admin(x, title: title, content: content(x, data: (d||{}), title: title), js_ready: %( $('#usrs tr').click(function(ev){ location=$(ev.target.parentElement).attr('href'); }) ) ) end def content(x, data:{}, title:"Untitled") re = [%(<table id="usrs" class="table table-hover"> <tr><th>ID</th><th>Name</th><th>Company</th><th>User Name</th><th>Last Login</th><th>Failed Logins</th></tr> )] re << data.map{|u| %(<tr href="/usr/record/#{u/:id}" style="cursor:pointer;"><td>#{u/:id}</td> <td>#{h u/:first_name} #{h u/:last_name}</td> <td>#{h u/:company_name}</td> <td>#{u/:usr_name}</td> <td>#{u['last_login_date'].nil? ? "" : "#{u['last_login_date'].f("%d-%b-%Y @%H:%M")} from #{u/:last_login_host}"}</td> <td>#{u/:failed_login_count}</td> </tr>) } re << %(</table><a href="/usr/record/0" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> Add User</a>) re.join end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
waxx-0.2.0 | skel/app/usr/list.rb |
waxx-0.1.4 | skel/app/usr/list.rb |
waxx-0.1.3 | skel/app/usr/list.rb |
waxx-0.1.2 | skel/app/usr/list.rb |