changeset 66:0ae73ca14d99 draft

Display invite-only group.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 25 Jun 2012 23:32:04 +0900
parents 3e91dd66deb6
children a421c2fefc32
files after5.rb
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Mon Jun 25 14:58:05 2012 +0900
+++ b/after5.rb	Mon Jun 25 23:32:04 2012 +0900
@@ -4,7 +4,7 @@
 # Associative Scheduling Table - after5
 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org]
 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $
-# Last modified Mon Jun 25 14:57:17 2012 on firestorm
+# Last modified Mon Jun 25 23:30:32 2012 on firestorm
 # See http://www.gentei.org/~yuuji/software/after5/
 # このスクリプトはEUCで保存してください。
 $hgid = <<_HGID_.split[1..-2].join(" ")
@@ -1295,7 +1295,7 @@
 'Set From: address of all ML messages to ML address, which is convenient
 to keep responses from cellular phones surely to ML address.  Most cellular
 phones tend to return only from: address.'],
-        'inviteonly'	=> ['管理者のみが加入操作可能',
+        'inviteonly'	=> ['管理者のみ加入操作可能',
                             'Only administrators can add new members.'],
         'invite-error'	=> ['%s への加入はグループ管理者のみが操作できます。',
 "Only administrator of this group(`%s') can add you."],
@@ -3036,10 +3036,6 @@
       @H.elementln("table", {'class'=>'border'}){
 	grmap.sort.collect{|g, ghash|
           memberp = @sc.ismember(user, g)
-          # If this group is inviteonly and the user is not a member of it
-          # nor administrator of it, skip listing.
-          next if !memberp && !@sc.isadmin(user, g) \
-          && @sc.getgroupattr(g, 'inviteonly')
 	  @H.elementln("tr"){
 	    @H.element("td", @sc.isadmin(user, g) ? admclass : nil){
 	      g + "<br>("+@sc.members(g).length.to_s+")"
@@ -3059,8 +3055,15 @@
 	      else
 		ghash['name']
 	      end + '<br>' + \
-	      @H.radio("groupadd-#{g}", "yes", "IN", memberp) + " / " + \
-	      @H.radio("groupadd-#{g}", "no", "OUT", !memberp)
+              # If this group is inviteonly and the user is not a member,
+              # 
+              if memberp && @sc.isadmin(user, g) ||
+                  !@sc.getgroupattr(g, 'inviteonly')
+                @H.radio("groupadd-#{g}", "yes", "IN", memberp) + " / " + \
+                @H.radio("groupadd-#{g}", "no", "OUT", !memberp)
+              else
+                @H.element("small"){"("+msg('inviteonly')+")"}
+              end
 	    } + \
 	    @H.element("td"){
               @H.element("div", {'class'=>'memlist5'}){

yatex.org