whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit f879d45: reorder name if there is a comma present
Date Thu, 07 Jan 2016 23:56:03 GMT
Commit f879d45e608eec4f62d1d5cbca85dc8df7ccc18a:
    reorder name if there is a comma present


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/secmail/views/forms/icla.js.rb                           | +++++++++ -
------------------------------------------------------------
10 changes: 9 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/secmail/views/forms/icla.js.rb b/www/secmail/views/forms/icla.js.rb
index 963da1d..53eea0f 100644
--- a/www/secmail/views/forms/icla.js.rb
+++ b/www/secmail/views/forms/icla.js.rb
@@ -84,7 +84,15 @@ def render
   # on initial display, default various fields based on headers, and update
   # state 
   def componentDidMount()
-    @realname = @@headers.name
+    name = @@headers.name
+ 
+    # reorder name if there is a single comma present
+    parts = name.split(',')
+    if parts.length == 2 and parts[1] !~ /^\s*(jr|ph\.d)\.?$/i
+      name = "#{parts[1].strip()} #{parts[0]}" 
+    end
+
+    @realname = name
     @email = @@headers.from
     self.componentDidUpdate()
   end

Mime
View raw message