<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2018 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
<v:page name="blog-home-page"
        xmlns:vm="http://www.openlinksw.com/vspx/ods/"
        xmlns:v="http://www.openlinksw.com/vspx/"
        style="index.xsl"
        doctype="-//W3C//DTD XHTML 1.0 Transitional//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <vm:page>
    <vm:header>
      <vm:title>Tag meanings</vm:title>
    </vm:header>
    <vm:pagewrapper>
      <vm:variable name="trs_id" type="int" default="null" persist="0" param-name="trs_id"/>

      <vm:navigation on="settings"/>
      <vm:subnavigation-new on="site"/>

      <vm:navigation1 on="admin"/>
      <vm:navigation2 on="application"/>
      <vm:rawheader caption="Tag meanings"/>
      <vm:body>
        <vm:login redirect="index.vspx"/>
        <div id="container">
          <div id="main">
	    <div class="box">
	        <h1>Tag meanings</h1>
	    <?vsp
	      declare cnt, have_cnt int;
	      have_cnt := 0;
	      for select rs_tag from tag_rules where rs_trs = self.trs_id do
	        {
		  cnt := (select count(*) from moat.DBA.moat_user_meanings where mu_trs_id = self.trs_id and mu_tag = rs_tag);
                  ?>
		  <span><a href="moat_tags.vspx?trs_id=<?V self.trs_id ?>&amp;edit=<?V rs_tag ?>&sid=<?V self.sid ?>&realm=<?V self.realm ?>"><?V rs_tag ?></a>(<?V cnt ?>)</span>
		  <?vsp
		  have_cnt := have_cnt + 1;
		}
              if (not have_cnt)
                {
		  ?>
		  <div>You do not have any tags defined.</div>
	    <div>Click <v:url url="--sprintf ('edit_rule.vspx?rid=%d', self.trs_id)" name="tu1" value="here" /> to add new tags.</div>
		  <?vsp
                }
	    ?>
            </div>
	    <v:button action="simple" name="bck1" value="Back">
	      <v:on-post>
				self.vc_redirect ('tags.vspx');
				</v:on-post>
			</v:button>
          </div>
        </div>
      </vm:body>
    </vm:pagewrapper>
  </vm:page>
</v:page>
