diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-02-02 17:53:16 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-02-02 17:53:16 -0500 |
| commit | ca838d172cbd7fca1f2cba3bb1f095821710920a (patch) | |
| tree | 7b1f288281f265ef88bebdabed3e5747ccae61dc | |
| parent | 6a4e4d30d5428fd0e629081d6a214e9a618ab52f (diff) | |
userlist sort
| -rw-r--r-- | public/assets/stylesheets/staff.css | 14 | ||||
| -rw-r--r-- | server/lib/views/staff.js | 4 | ||||
| -rw-r--r-- | views/staff/_users.ejs | 13 | ||||
| -rw-r--r-- | views/staff/users/show.ejs | 31 |
4 files changed, 58 insertions, 4 deletions
diff --git a/public/assets/stylesheets/staff.css b/public/assets/stylesheets/staff.css index fffadbf..d93e46e 100644 --- a/public/assets/stylesheets/staff.css +++ b/public/assets/stylesheets/staff.css @@ -30,6 +30,15 @@ nav { nav a { margin-left: 10px; } +nav.subnav { + background: white; + padding: 10px; + font-weight: 200; + font-size: 12px; +} +.alphabet a { + margin-left: 5px; +} hr { border: 1px solid #bbb; margin: 10px auto 10px; @@ -62,8 +71,13 @@ hr { user-select: none; } .staff { + background: white; font-size: 15px; } +.staff hr { + border: 1px solid black; + border-top: 0; +} .staff .body a { border-bottom: 1px dotted; } diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index c3ecc97..b772859 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -368,8 +368,10 @@ var staff = module.exports = { helpers: { user: function(user){ + var last_seen = moment( user.last_seen || user.updated_at || user.created_at ) user = user.toObject() - user.last_seen = moment( user.last_seen || user.updated_at || user.created_at ).fromNow() + user.last_seen = last_seen.format("YYYY/MM/DD HH:MM") + " " + last_seen.fromNow() + user.last_charged = user.last_charged && moment( user.last_charged ).format("YYYY/MM/DD HH:MM") user.created_ip = util.num2ip( user.created_ip ) user.last_ip = util.num2ip( user.last_ip ) return user diff --git a/views/staff/_users.ejs b/views/staff/_users.ejs index 46811b6..1af47aa 100644 --- a/views/staff/_users.ejs +++ b/views/staff/_users.ejs @@ -1,3 +1,12 @@ +<nav class="subnav"> + sort by <a href="?sort=date">date</a> ... <a href="?sort=last_seen">recent</a> ... <a href="?sort=name">name</a> ... jump to a letter: + <span class="alphabet"> + [[ "abcdefghijklmnopqrstuvwxyz".split("").forEach(function(letter){ ]] + <a href="?sort=name&letter=[[- letter ]]">[[- letter.toUpperCase() ]]</a> + [[ }) ]] + </span> +</nav> + <table id="users"> [[ users.forEach(function(user){ ]] <tr> @@ -5,6 +14,10 @@ <a href="/staff/users/[[- user.username ]]"><div style="background-image:url([[- user.photo ]])" class="avatar"></div></a> </td> <td> + [[- user.plan_type ]] + [[- user.last_charged ]] + </td> + <td> <a href="/staff/users/[[- user.username ]]">[[- user.username ]]</a> </td> <td> diff --git a/views/staff/users/show.ejs b/views/staff/users/show.ejs index d6a21d5..e441109 100644 --- a/views/staff/users/show.ejs +++ b/views/staff/users/show.ejs @@ -17,13 +17,38 @@ [[- profile.displayName ]] </td> <td class="editLinks"> - <a href="/profile/[[- profile.username ]]">[view profile]</a> - <a href="/staff/users/[[- profile.username ]]/media">[view media]</a> - <a href="https://vvalls.recurly.com/accounts/[[- profile._id ]]">[view on recurly]</a> + <a href="/profile/[[- profile.username ]]">[profile]</a> + <a href="/staff/users/[[- profile.username ]]/media">[media]</a> + [[ if (profile.subscription) { ]] + <a href="https://vvalls.recurly.com/accounts/[[- profile._id ]]">[recurly]</a> + [[ } ]] </td> </tr> </table> + + [[ if (profile.subscription) { ]] + <h2>Subscription</h2> + <table> + <tr> + <th> + plan + </th> + <td> + [[- profile.plan_type ]] + </td> + </tr> + <tr> + <th> + last charged + </th> + <td> + [[- profile.last_charged ]] + </td> + </tr> + </table> + [[ } ]] + <h2>Profile</h2> <table> |
