<if client_id NEQ site_user_id>
<goto url="http://#this_domain#/">
<BREAK>
</if>
<if isDefined("POST.return_to_app") AND POST.return_to_app EQ 1>
<goto url="http://#this_domain#/">
<BREAK>
</if>
<if isDefined("POST.featuretag") AND POST.featuretag NEQ "">
<var POST.featuretag = gutitleFormat(POST.featuretag)>
<if POST.featuretag NEQ "" AND isDefined("GLOBAL.Def.Smaller_Features_Lookup.#POST.featuretag#") AND NOT isDefined("GLOBAL.Def.Features.#POST.featuretag#")>
<!--- add feature --->
<var Model = GLOBAL.Def.Smaller_Features_Lookup[POST.featuretag]>
<insert orb="#Model.tbl#" title="#Model.title#"
notes=""
site_id="631">
<var _tbl = Model.tbl>
<var _idnum = return>
<!--- prepend to site features --->
<var _new = "|#Model.tag#|/#_tbl#-#_idnum#|">
<loop list="#GLOBAL.Def.Site.features#" index="x" delimiters="#CHR(10)#">
<var x = trim(x)>
<if x NEQ "">
<var _new = _new & CHR(10) & x>
</if>
</loop>
<update orb="site" where="site.id = #site_id#"
features="#_new#"
sp_edit_datetime="#now()#">
<!--- "new feature" bulliten --->
<tag.bull
j='/#_tbl#-#_idnum#,/site-#site_id#'
title='#client_name# - new feature'
body='<a href="/#client_id#">#escapeMarkup(client_name)#</a> added #Model.an# <a href="/j:/site-#site_id#?&function=#Model.tag#">#Model.title# feature</a> on <a href="/j:/site-#site_id#">#escapeMarkup(GLOBAL.Def.Disp.site_title)#</a>'
type='new_feature'>
<if return NEQ "pants">
<goto url="http://#this_domain#/#Model.tag#/edit">
</if>
<BREAK>
</if>
</if>
<h3>Add a Feature</h3>
<var _any = 0><!--- were any of the features selectable? --->
<postform>
<div style="margin-left:1em;">
<loop from="1" to="#arrayLen(GLOBAL.Def.Smaller_Features)#" index="x">
<var Model = GLOBAL.Def.Smaller_Features[x]>
<var _taken = 0>
<if listFind(GLOBAL.Def.Site.features,Model.tag,"|") GT 0>
<var _taken = 1>
</if>
<var _pw = 16>
<div class="<if _taken EQ 0>radio_container</if>" style="padding:3px; clear:both;<if _taken EQ 1> opacity:0.6; filter:alpha(opacity=60);</if>">
<div style="float:left; width:1.8em;">
<if _taken EQ 1>
<!---<tag.fico i="tick" linkback="off" style="height:1em;">--->
<else>
<input class="radio" name="featuretag" value="#Model.tag#" style="width:1.12em; height:1.12em; cursor:pointer;" type="radio"<if _taken EQ 1> disabled</if><if _any EQ 0> checked</if>>
</if>
</div>
<div style="margin-left:2em; position:relative; margin-right:1em;">
<div>
<if _taken NEQ 1><b></if>#Model.title#<if _taken NEQ 1></b></if>
</div>
<div style="padding:3px; color:##444;"><small>
<if _taken EQ 1>
You already added this feature to your app.
<else>
#Model.notes#
</if>
</small></div>
</div>
<div style="clear:both;"> </div>
</div>
<if _taken EQ 0>
<var _any = 1>
</if>
</loop>
<if _any EQ 0>
<div align="right" style="margin-right:1em;">
You already added all the features! Stay tuned, we're working
on new features every day.
<p>
<a href="http://#this_domain#/features">#escapeMarkup(GLOBAL.Def.Disp.site_title)# Features ></a>
</p>
</div>
<else>
<div class="pagebtn" align="center">
<input type="submit" value="Add Feature" style="cursor:pointer;" class="button">
</div>
<div> </div>
</if>
<if _any EQ 1>
<tag.jquery>
<script type="text/javascript">
$(document).ready(function() {
activate_radio_containers();
});
<tag.function_activate_radio_containers>
</script>
</if>
</div>
</postform>