Commit b9f22590584bb4e488b66ccfc2ffdfa0c59cc632:
    update members.txt entry


Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>

------------------------------------------------------------
www/roster/views/actions/memtext.json.rb                     | ++++++++++++ 
www/roster/views/person/memtext.rb                           | + -
------------------------------------------------------------
26 changes: 25 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/roster/views/actions/memtext.json.rb 
b/www/roster/views/actions/memtext.json.rb
new file mode 100644
index 0000000..2d38505
--- /dev/null
+++ b/www/roster/views/actions/memtext.json.rb
@@ -0,0 +1,24 @@
+# get entry for @userid
+entry = ASF::Person.find(@userid).members_txt(true)
+raise Exception.new("unable to find member entry for #{userid}") unless entry
+
+# identify file to be updated
+members_txt = ASF::SVN['private/foundation/members.txt']
+
+# construct commit message
+message = "Update entry for #{ASF::Person.find(@userid).member_name}"
+
+# update members.txt
+_svn.update members_txt, message: message do |dir, text|
+  # replace entry
+  text.sub! entry, " *) #{@entry.strip}\n\n"
+
+  # save the updated text
+  ASF::Member.text = text
+
+  # return the updated (and normalized) text
+  ASF::Member.text
+end
+
+# return updated committer info
+_committer Committer.serialize(@userid, env)
diff --git a/www/roster/views/person/memtext.rb 
b/www/roster/views/person/memtext.rb
index 2af57ae..7bc7f14 100644
--- a/www/roster/views/person/memtext.rb
+++ b/www/roster/views/person/memtext.rb
@@ -14,7 +14,7 @@ def render
 
           _form.inline method: 'post' do
             _div do
-              _textarea defaultValue: committer.member.info
+              _textarea name: 'entry', defaultValue: committer.member.info
             end
             _button.btn.btn_primary 'submit'
           end

Reply via email to