hcoop-cvs  

[hcoop-cvs] portal app.sig, 1.7, 1.8 app.sml, 1.13, 1.14 apps.mlt, 1.15, 1.16 init.sml, 1.25, 1.26 money.mlt, 1.21, 1.22 portal.mlt, 1.17, 1.18 users.mlt, 1.14, 1.15

Adam Chlipala
Thu, 21 Feb 2008 16:59:24 -0800

Update of /cvsroot/hcoop/portal
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv17903

Modified Files:
        app.sig app.sml apps.mlt init.sml money.mlt portal.mlt 
        users.mlt 
Log Message:
Fixing problems various in membership application and addition

Index: money.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/money.mlt,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** money.mlt   18 Feb 2008 17:46:05 -0000      1.21
--- money.mlt   22 Feb 2008 00:59:15 -0000      1.22
***************
*** 467,472 ****
     val deposit = Balance.depositAmount (#id bal) %>
  
! <h3>Your balance: $<% Util.sub (#amount bal, deposit) %><br>
! Deposit: $<% deposit %></b> (3 months of dues at your current <a 
href="pledge">pledge level</a>)</h3>
  <% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> 
"") then %><h3>Sum of all active balances: $<% Balance.sumOwnedBalances () 
%></h3><% end %>
  
--- 467,475 ----
     val deposit = Balance.depositAmount (#id bal) %>
  
! <!--h3>Your balance: $<% Util.sub (#amount bal, deposit) %><br>
! Deposit: $<% deposit %></b> (3 months of dues at your current <a 
href="pledge">pledge level</a>)</h3-->
! 
! <h3>Your balance: $<% #amount bal %></h3>
! 
  <% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> 
"") then %><h3>Sum of all active balances: $<% Balance.sumOwnedBalances () 
%></h3><% end %>
  

Index: app.sig
===================================================================
RCS file: /cvsroot/hcoop/portal/app.sig,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** app.sig     22 Nov 2007 19:24:00 -0000      1.7
--- app.sig     22 Feb 2008 00:59:15 -0000      1.8
***************
*** 7,10 ****
--- 7,11 ----
           | REJECTED
           | ADDED
+          | BEING_ADDED
  
      val readTosBody : unit -> string
***************
*** 21,25 ****
  
      val lookupApp : int -> app
!     val listApps : status -> app list
  
      val votes : int -> (int * string) list
--- 22,26 ----
  
      val lookupApp : int -> app
!     val listApps : status list -> app list
  
      val votes : int -> (int * string) list
***************
*** 29,32 ****
--- 30,34 ----
      val deny : int * string -> bool
      val approve : int * string -> bool
+     val preAdd : int -> unit
      val add : int -> unit
      val abortAdd : int -> unit

Index: app.sml
===================================================================
RCS file: /cvsroot/hcoop/portal/app.sml,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** app.sml     8 Dec 2007 23:08:53 -0000       1.13
--- app.sml     22 Feb 2008 00:59:15 -0000      1.14
***************
*** 10,13 ****
--- 10,14 ----
         | REJECTED
         | ADDED
+        | BEING_ADDED
  
  val statusFromInt =
***************
*** 17,20 ****
--- 18,22 ----
       | 3 => REJECTED
       | 4 => ADDED
+      | 5 => BEING_ADDED
       | _ => raise C.Sql "Bad status"
  
***************
*** 25,28 ****
--- 27,31 ----
       | REJECTED => 3
       | ADDED => 4
+      | BEING_ADDED => 5
  
  fun statusFromSql v = statusFromInt (C.intFromSql v)
***************
*** 59,67 ****
        | NONE => raise Fail "Membership application not found"
  
! fun listApps status =
      C.map (getDb ()) mkAppRow ($`SELECT id, name, rname, gname, email, 
forward, uses, other, passwd, status, applied, ipaddr, confirmed, decided,
                                        msg, unix_passwd, paypal, checkout
                                 FROM MemberApp
!                                WHERE status = ^(statusToSql status)
                                   AND NOT (status = 2 AND decided < 
CURRENT_TIMESTAMP - INTERVAL '1 MONTH')
                                 ORDER BY applied`)
--- 62,70 ----
        | NONE => raise Fail "Membership application not found"
  
! fun listApps statuses =
      C.map (getDb ()) mkAppRow ($`SELECT id, name, rname, gname, email, 
forward, uses, other, passwd, status, applied, ipaddr, confirmed, decided,
                                        msg, unix_passwd, paypal, checkout
                                 FROM MemberApp
!                                WHERE status IN (^(String.concatWith "," (map 
statusToSql statuses)))
                                   AND NOT (status = 2 AND decided < 
CURRENT_TIMESTAMP - INTERVAL '1 MONTH')
                                 ORDER BY applied`)
***************
*** 117,124 ****
      end
  
  fun add app =
      let
        val _ = C.dml (getDb ()) ($`UPDATE MemberApp
!                                   SET status = 3
                                    WHERE id = ^(C.intToSql app)`)
  
--- 120,132 ----
      end
  
+ fun preAdd app =
+     ignore (C.dml (getDb ()) ($`UPDATE MemberApp
+                               SET status = 5
+                               WHERE id = ^(C.intToSql app)`))
+ 
  fun add app =
      let
        val _ = C.dml (getDb ()) ($`UPDATE MemberApp
!                                   SET status = 4
                                    WHERE id = ^(C.intToSql app)`)
  

Index: users.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/users.mlt,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** users.mlt   8 Dec 2007 19:46:39 -0000       1.14
--- users.mlt   22 Feb 2008 00:59:15 -0000      1.15
***************
*** 28,31 ****
--- 28,33 ----
                        end;
  
+                       App.add ap;
+ 
                        if $"subscribe" = "on" then
                                if not (Pref.subscribe ("hcoop-announce", 
$"name" ^ Init.emailSuffix)) then

Index: portal.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/portal.mlt,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** portal.mlt  18 Feb 2008 17:46:05 -0000      1.17
--- portal.mlt  22 Feb 2008 00:59:15 -0000      1.18
***************
*** 14,19 ****
  <% end %>
  </table>
! <b>Balance: $<% Util.sub (#amount bal, deposit) %></b><br>
! <b>Deposit: $<% deposit %></b> (3 months of dues at your current <a 
href="pledge">pledge level</a>)
  
  <% val polls = Poll.listCurrentPolls ();
--- 14,21 ----
  <% end %>
  </table>
! <!--b>Balance: $<% Util.sub (#amount bal, deposit) %></b><br>
! <b>Deposit: $<% deposit %></b> (3 months of dues at your current <a 
href="pledge">pledge level</a>)-->
! 
! <b>Balance: $<% #amount bal %></b>
  
  <% val polls = Poll.listCurrentPolls ();

Index: init.sml
===================================================================
RCS file: /cvsroot/hcoop/portal/init.sml,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** init.sml    18 Feb 2008 17:46:05 -0000      1.25
--- init.sml    22 Feb 2008 00:59:15 -0000      1.26
***************
*** 160,164 ****
  
  fun validUsername name =
!     size name <= 10
      andalso size name > 0
      andalso Char.isLower (String.sub (name, 0))
--- 160,164 ----
  
  fun validUsername name =
!     size name <= 12
      andalso size name > 0
      andalso Char.isLower (String.sub (name, 0))

Index: apps.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/apps.mlt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** apps.mlt    19 Jan 2008 20:57:32 -0000      1.15
--- apps.mlt    22 Feb 2008 00:59:15 -0000      1.16
***************
*** 84,88 ****
        %><h3>Pending applications</h3><%
  
!       foreach appl in App.listApps App.ACCEPTED do %>
                <br><hr><br>
                <table class="blanks">
--- 84,88 ----
        %><h3>Pending applications</h3><%
  
!       foreach appl in App.listApps [App.ACCEPTED, App.BEING_ADDED] do %>
                <br><hr><br>
                <table class="blanks">
***************
*** 111,114 ****
--- 111,115 ----
        <tr> <td>Proposed uses:</td> <td><% Web.htmlNl (#uses appl) %></td> 
</tr>
        <tr> <td>Other information:</td> <td><% Web.htmlNl (#other appl) 
%></td> </tr>
+       <% if #status appl = App.BEING_ADDED then %><tr> <td colspan="2" 
align="left"><font color="red"><b>WARNING: Someone already followed the add 
link for this application.  Maybe he forgot to finish.</b></font></td></tr><% 
end %>
        </table>
  
***************
*** 122,126 ****
        val id = Web.stoi ($"add");
        val appl = App.lookupApp id;
!       App.add id %>
  
  First, run this on deleuze:
--- 123,127 ----
        val id = Web.stoi ($"add");
        val appl = App.lookupApp id;
!       App.preAdd id %>
  
  First, run this on deleuze:
***************
*** 161,165 ****
  <h3>Pending applications</h3>
  
! <% foreach appl in App.listApps App.PENDING do %>
        <br><hr><br>
        <table class="blanks">
--- 162,166 ----
  <h3>Pending applications</h3>
  
! <% foreach appl in App.listApps [App.PENDING] do %>
        <br><hr><br>
        <table class="blanks">


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
hcoop-cvs mailing list
hcoop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hcoop-cvs
  • [hcoop-cvs] portal app.sig, 1.7, 1.8 app.sml, 1.13, 1.14 apps.mlt, 1.15, 1.16 init.sml, 1.25, 1.26 money.mlt, 1.21, 1.22 portal.mlt, 1.17, 1.18 users.mlt, 1.14, 1.15 Adam Chlipala