parsav  Diff

Differences From Artifact [08f3a58ce1]:

To Artifact [531b5ac1cf]:


     5      5   end
     6      6   
     7      7   local terra 
     8      8   render_profile(co: &lib.srv.convo, actor: &lib.store.actor)
     9      9   	var aux: lib.str.acc
    10     10   	var followed = false -- FIXME
    11     11   	if co.aid ~= 0 and co.who.id == actor.id then
    12         -		aux:compose('<a class="button" href="/conf/profile?go=/@',actor.handle,'">alter</a>')
           12  +		aux:compose('<a accesskey="a" class="button" href="/conf/profile?go=/@',actor.handle,'">alter</a>')
    13     13   	elseif co.aid ~= 0 then
    14     14   		if not followed then
    15         -			aux:compose('<button method="post" class="pos" name="act" value="follow">follow</button>')
           15  +			aux:compose('<button accesskey="f" method="post" class="pos" name="act" value="follow">follow</button>')
    16     16   		elseif followed then
    17         -			aux:compose('<button method="post" class="neg" name="act" value="unfollow">unfollow</button>')
           17  +			aux:compose('<button accesskey="f" method="post" class="neg" name="act" value="unfollow">unfollow</button>')
    18     18   		end
    19         -		aux:lpush('<a class="button" href="/'):push(actor.xid,0):lpush('/chat">chat</a>')
           19  +		aux:lpush('<a accesskey="h" class="button" href="/'):push(actor.xid,0):lpush('/chat">chat</a>')
    20     20   		if co.who.rights.powers:affect_users() and co.who:overpowers(actor) then
    21         -			aux:lpush('<a class="button" href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
           21  +			aux:lpush('<a accesskey="n" class="button" href="/'):push(actor.xid,0):lpush('/ctl">control</a>')
    22     22   		end
    23     23   	else
    24         -		aux:compose('<a class="button" href="/', actor.xid, '/follow">remote follow</a>')
           24  +		aux:compose('<a accesskey="f" class="button" href="/', actor.xid, '/follow">remote follow</a>')
    25     25   	end
    26     26   	var auxp = aux:finalize()
    27     27   	var timestr: int8[26] lib.osclock.ctime_r(&actor.knownsince, &timestr[0])
    28     28   
    29     29   	var strfbuf: int8[28*4]
    30     30   	var stats = co.srv:actor_stats(actor.id)
    31     31   		var sn_posts     = cs(lib.math.decstr_friendly(stats.posts, &strfbuf[ [strfbuf.type.N - 1] ]))
    32     32   		var sn_follows   = cs(lib.math.decstr_friendly(stats.follows, sn_posts.ptr - 1))
    33     33   		var sn_followers = cs(lib.math.decstr_friendly(stats.followers, sn_follows.ptr - 1))
    34     34   		var sn_mutuals   = cs(lib.math.decstr_friendly(stats.mutuals, sn_followers.ptr - 1))
    35         -	var bio = lib.str.plit "<em>tall, dark, and mysterious</em>"
           35  +	var bio = lib.str.plit '<em style="opacity:0.6">tall, dark, and mysterious</em>'
    36     36   	if actor.bio ~= nil then
    37     37   		bio = lib.smackdown.html(cs(actor.bio))
    38     38   	end
    39     39   	var fullname = lib.render.nym(actor,0,nil,false) defer fullname:free()
    40     40   	var comments: lib.str.acc comments:init(64)
    41         -	-- this is really more what epithets are for, i think
    42         -	--if actor.rights.rank > 0 then comments:lpush('<li>staff member</li>') end
           41  +
    43     42   	if co.srv.cfg.master == actor.id then
    44         -		comments:lpush('<li style="--co:-70">founder</li>')
           43  +		var foundertxt = lib.str.plit 'founder'
           44  +		if co.srv.cfg.ui_cue_founder:ref() then
           45  +			if co.srv.cfg.ui_cue_founder.ct == 0 -- empty string, suppress field
           46  +				then foundertxt = pstr.null()
           47  +				else foundertxt = co.srv.cfg.ui_cue_founder
           48  +			end
           49  +		end
           50  +
           51  +		if foundertxt:ref() then
           52  +			comments:lpush('<li style="--co:-70">'):ppush(foundertxt):lpush('</li>')
           53  +		end
    45     54   	end
    46     55   	if co.aid ~= 0 and actor.rights.rank ~= 0 then
           56  +		var stafftxt = lib.str.plit 'site staff'
           57  +		if co.srv.cfg.ui_cue_staff:ref() then
           58  +			if co.srv.cfg.ui_cue_staff.ct == 0 -- empty string, suppress field
           59  +				then stafftxt = pstr.null()
           60  +				else stafftxt = co.srv.cfg.ui_cue_staff
           61  +			end
           62  +		end
           63  +
           64  +		-- this is really more what epithets are for, i think
           65  +		if actor.rights.rank > 0 and stafftxt:ref() then
           66  +			comments:lpush('<li>'):ppush(stafftxt):lpush('</li>')
           67  +		end
           68  +
    47     69   		if co.who:outranks(actor) then
    48     70   			comments:lpush('<li style="--co:50">underling</li>')
    49     71   		elseif actor:outranks(co.who) then
    50     72   			comments:lpush('<li style="--co:-50">outranks you</li>')
    51     73   		end
    52     74   	end
    53     75