<metal:block metal:use-macro="here/standard_template_macro">
    <metal:block fill-slot="meta">
        <meta tal:define="description here/description;
                          content python:here.html2text(description);"
              tal:condition="content"
              tal:attributes="content content" name="description" />
        <meta tal:condition="here/keywords"
              tal:attributes="content here/keywords" name="keywords" />
        <meta tal:attributes="content here/contributor" name="author" />
        <meta tal:attributes="content here/gl_get_selected_language"
              name="dc.language" />
        <meta tal:attributes="content string:${here/title} | ${here/site_title}"
              name="title" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </metal:block>

    <metal:block metal:fill-slot="header-title">
        <title tal:content="string:${here/title} | ${here/site_title}" />
    </metal:block>

    <metal:block fill-slot="head">
        <link rel="alternate" type="application/rdf+xml" title="RDF"
              tal:attributes="href here/absolute_url" />
    </metal:block>

    <metal:block tal:define="is_ratable here/is_ratable;
                              site_object_index python:(here.getFormsTool()
                                                .getForm('site_object_index'))"
                 fill-slot="body">
        <h1><metal:block use-macro="site_object_index/macros/icon"/>
            <span tal:replace="here/title_or_id" />
            <tal:block condition="is_ratable"
                            replace="structure here/user_rating_view|nothing"/>
                <span class="available_langs" tal:condition="python:here.item_has_title(here, here.title)">
                    <span i18n:translate="">Item only translated in </span>
                    <span tal:repeat="lang here/gl_get_languages_map">
                        <a tal:content="python:' %s' % lang['title']" tal:condition="python:not lang['selected'] and here.getLocalProperty('title', lang['id'])" tal:attributes="href python:'gl_changeLanguage?old_lang=%s' % (lang['id'])" />
                    </span>
                </span>
        </h1>

        <metal:block use-macro="site_object_index/macros/action_buttons"/>

        <!-- Map widget -->
        <tal:block condition="python:here.prop_details('geo_location')['show']"
            content="structure python:here.portal_map.render_object_map(here.geo_location)"/>

        <table border="0" cellspacing="2" cellpadding="2" tal:define="portal_map here/getGeoMapTool;">

        <tr tal:condition="python:here.size>0">
            <th i18n:translate="">Download</th>
            <td tal:define="download_url here/getDownloadUrl">
                <a tal:define="size python:here.utShowSizeKb(here.size);
							icon python:here.rstk['icon_for_content_type'](here.content_type);
							title python:icon['title'];
							url python:icon['url'];"
				tal:attributes="href download_url">
					<img tal:attributes="src url;
								alt title;
								title title" />
					<span tal:replace="string:${here/downloadfilename} (${title}, ${size} Kb)"/></a>
            </td>
        </tr>

        <tal:block content="structure python: here.prop_display_tr('releasedate')" />
        <metal:block use-macro="site_object_index/macros/contributor_tr" />
        <tal:block content="structure python: here.prop_display_tr('coverage')" />

		<tal:block condition="here/is_geo_enabled">
			<tr tal:define="title python:portal_map.getSymbolTitle(here.geo_type);
							picture python:portal_map.getSymbolPicture(here.geo_type)"
							tal:condition="python: title != ''and here.geo_location">
				<th i18n:translate="Type (translate as a noun)">Type</th>
				<td>
					<img tal:condition="picture" tal:attributes="src string:${portal_map/absolute_url}/getSymbolPicture?id=${here/geo_type}; alt title; title title" />
					<span tal:replace="title" />
				</td>
			</tr>
		</tal:block>

        <tal:block content="structure python: here.prop_display_tr('keywords')" />

        </table>

        <tal:block define="versions here/getVersions" condition="python:len(versions) > 0">
        <h2 i18n:translate="">Older versions</h2>
        <table border="0" cellspacing="2" cellpadding="2">
        <tr>
        <th i18n:translate="">Date</th>
        <th i18n:translate="">Created by</th>
        <th i18n:translate="">Download file</th></tr>
        <tr tal:repeat="item python:versions">
            <td><tal:block define="modif item/modification_time|nothing"
                condition="modif" content="python:here.utShowFullDateTime(modif)" /></td>
            <td><span tal:replace="python:getattr(item, 'username', '')">version user</span></td>
            <td><a rel="external"
                tal:attributes="href string:showVersionData?vid=${item/getId}"
                tal:content="python:here.getVersionFilename(item.getId())">download</a></td>
        </tr>
        </table>
        </tal:block>

        <div tal:define="description python:here.prop_value_or_none('description')"
            tal:condition="description" tal:content="structure description" />

        <tal:block content="structure here/set_content_rating" />

        <tal:block content="structure here/comments_box" />
    </metal:block>
</metal:block>
