  <metal:ratings-and-tags define-macro="user_rating_set">
    <tal:block tal:condition="view/has_contentrating_support">
      <dl class="content-rating">
	<dt i18n:translate="label_average_rating">Average Rating:</dt>
	<dd><tal:user-rate tal:replace="structure context/@@user_rating_view" /></dd>
	<dt i18n:translate="label_your_rating">Your Rating:</dt>
	<dd tal:define="is_ratable python:checkPermission('Content Ratings: User Rate', here);">
	  <tal:user-rate tal:replace="structure context/@@user_rating_set"
	    tal:condition="is_ratable" />
	    <form tal:condition="not:is_ratable" action="login_form"
	      tal:attributes="action string:$portal_url/login_form">
              <input type="hidden" name="came_from" value=""
                     tal:attributes="value request/URL" />
	      <input class="standalone"
		style="margin-bottom: 1.25em;"
		type="submit"
		value="Log in to add ratings"
		i18n:attributes="value label_login_to_add_ratings;"
		/>
	    </form>
	</dd>
      </dl>
    </tal:block>

    <tal:block tal:condition="view/has_contenttagging_support">
      <metal:block use-macro="context/@@tag_macros/tags_footer">
      </metal:block>
    </tal:block>
  </metal:ratings-and-tags>
