You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/02/14 17:05:46 UTC
[whimsy.git] [1/1] Commit 912146c: sort by public name
Commit 912146c0e633252069fbe6d16cc63fc372f87393:
sort by public name
Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>
------------------------------------------------------------
www/roster/main.rb | +
www/roster/views/committee.js.rb | +++++++++ ------
------------------------------------------------------------
16 changes: 10 additions, 6 deletions.
------------------------------------------------------------
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 952d50f..065bae0 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -9,6 +9,7 @@
require 'wunderbar/sinatra'
require 'wunderbar/bootstrap/theme'
require 'wunderbar/react'
+require 'wunderbar/underscore'
require 'ruby2js/filter/functions'
require 'ruby2js/filter/require'
diff --git a/www/roster/views/committee.js.rb b/www/roster/views/committee.js.rb
index 524e25e..0bbded9 100644
--- a/www/roster/views/committee.js.rb
+++ b/www/roster/views/committee.js.rb
@@ -35,7 +35,6 @@ def render
class PMCMembers < React
def initialize
- @roster = {}
@state = :closed
end
@@ -77,13 +76,15 @@ def componentWillMount()
# compute roster
def componentWillReceiveProps()
- @roster = []
+ roster = []
for id in @@committee.roster
person = @@committee.roster[id]
person.id = id
- @roster << person
+ roster << person
end
+
+ @roster = roster.sort_by {|person| person.name}
end
# open search box
@@ -127,7 +128,7 @@ def render
if @@auth
_tr onDoubleClick: self.select do
- _td((@state == :open ? '' : '+'), colspan: 4)
+ _td((@state == :open ? '' : "\u2795"), colspan: 3)
end
end
end
@@ -148,11 +149,13 @@ def componentWillMount()
# compute list of committers
def componentWillReceiveProps()
- @committers = []
+ committers = []
for id in @@committee.committers
- @committers << {id: id, name: @@committee.committers[id]}
+ committers << {id: id, name: @@committee.committers[id]}
end
+
+ @committers = committers.sort_by {|person| person.name}
end
# open search box