<?xml version="1.0" encoding="utf-8"?>
<template_modifications>
<modification type="public" template="member_view" modification_key="justin_downloadedresource" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<!--[XF:tabs:end]-->]]></find>
<replace><![CDATA[<xf:if is="$xf.visitor.hasPermission('resource', 'j_resurce_downloaded') }}">
<a href="{{ link('members/downloads', $user) }}"
class="tabs-tab"
id="downloads"
role="tab">{{ phrase('j_resource_downloaded') }}</a>
</xf:if>
$0]]></replace>
</modification>
<modification type="public" template="member_view" modification_key="justin_resourcetabpane" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<!--[XF:tab_panes:end]-->]]></find>
<replace><![CDATA[<xf:if is="$xf.visitor.hasPermission('resource', 'j_resurce_downloaded') }}">
<li data-href="{{ link('members/downloads', $user) }}" role="tabpanel" aria-labelledby="downloads">
<div class="blockMessage">{{ phrase('loading...') }}</div>
</li>
</xf:if>
$0]]></replace>
</modification>
<modification type="public" template="xfrm_resource_history" modification_key="justin_xfrm_resource_history" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<xf:if is="$hasDelete">
<xf:cell></xf:cell>
</xf:if>]]></find>
<replace><![CDATA[$0
<xf:if is="$xf.visitor.hasPermission('resource', 'j_resurce_downloaded') }}">
<xf:cell>{{ phrase('j_XFRM_downloaders') }}</xf:cell>
</xf:if>]]></replace>
</modification>
<modification type="public" template="xfrm_resource_history" modification_key="justin_resource_history_link" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[ <xf:if is="$hasDelete">
<xf:if is="$version.canDelete()">
<xf:delete href="{{ link('resources/version/delete', $version) }}" />
<xf:else />
<xf:cell class="dataList-cell--alt"></xf:cell>
</xf:if>
</xf:if>]]></find>
<replace><![CDATA[$0
<xf:if is="$xf.visitor.hasPermission('resource', 'j_resurce_downloaded') }}">
<xf:cell>
<a href="{{ link('resources/version/downloaders', $version) }}" data-xf-click="overlay">
{{ phrase('justin_view_downloaders') }}
</a>
</xf:cell>
</xf:if>]]></replace>
</modification>
<modification type="public" template="xfrm_resource_wrapper_macros" modification_key="justin_resourceview" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<xf:if is="$resource.hasViewableDiscussion()">
<a class="tabs-tab {{ $selected == 'discussion' ? 'is-active' : '' }}" href="{{ link('threads', $resource.Discussion) }}">{{ phrase('xfrm_discussion') }}</a>
</xf:if>]]></find>
<replace><![CDATA[$0
<xf:if is="{{ $resource.resource_type == 'download' && $xf.visitor.hasPermission('resource', 'j_resurce_downloaded') }}">
<a class="tabs-tab {{ $selected == 'downloaders' ? 'is-active' : '' }}" href="{{ link('resources/downloaders', $resource) }}">{{ phrase('j_XFRM_downloaders') }}</a>
</xf:if>]]></replace>
</modification>
<modification type="public" template="xfrm_resource_wrapper_macros" modification_key="j_xfrm_resource_wrapper_macros" description="Add texts below resource download button" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[ <xf:button href="{{ link('resources/download', $resource) }}"
class="button--cta"
data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}"
icon="download">{{ phrase('download') }}</xf:button>]]></find>
<replace><![CDATA[$0
<xf:if is="$xf.visitor.hasPermission('resource', 'j_XFRMLikelmit') && !$xf.visitor.hasPermission('resource', 'justin_canbypasslikelimit') ">
<div class="button is-disabled">You need to like resource in order to download it</div>
</xf:if>
<xf:if is="$xf.visitor.hasPermission('resource', 'j_XFRMdownloadlimit') != '-1' && !$xf.visitor.hasPermission('resource', 'justin_canbypassdlimit')">
<div class="button is-disabled">You can download only {$xf.visitor.hasPermission('resource', 'j_XFRMdownloadlimit')} resources in a day</div>
</xf:if>
<xf:if is="$xf.visitor.hasPermission('resource', 'j_XFRMdownloadlimit') != '-1' && !$xf.visitor.hasPermission('resource', 'justin_canbypasspostlimit')">
<div class="button is-disabled">You need minimum {$xf.visitor.hasPermission('resource', 'j_XFRMminposdownloadlimit')} post to download the resource</div>
</xf:if>]]></replace>
</modification>
</template_modifications>