[%
# Arguments
# data - hash -
# sorted_instances - array - of instances
# url_to_install - string
# url_to_install_admin - string
# module - hash -
# name - string - name of the module
# version - string - version installed
# meta - hash
# miscurls - array<string> - additional urls below the url_to_install
# display - hash
# versions - boolean - weather to display versions or not.
%]
[% IF has_instances;
SET has_admin = 0;
SET has_user = 0;
SET module_name = module.name;
FOR instances IN data.sorted_instances;
has_admin = 1 IF instances.url_to_install_admin;
has_user = 1 IF instances.url_to_install;
LAST; # Since all the instances will have the same capabilities
END;
SET has_other = has_user && module.meta.miscurls.size > 0;
%]
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<table class="table table-striped table-condensed" id="instances">
<thead>
<tr>
[% IF has_user %]
<th id="user-url-title">[% locale.maketext('Site URL') %]</th>
[% END %]
[% IF has_admin %]
<th id="admin-url-title">[% locale.maketext('Administrator [asis,URL]') %]</th>
[% END %]
[% IF has_other %]
<th id="other-url-title">[% locale.maketext('Other [asis,URLs]') %]</th>
[% END %]
[% IF module.meta.display.versions %]
<th>[% locale.maketext('Version') %]</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOR instance IN data.sorted_instances %]
<tr>
[% IF has_user %]
<td>
[% IF instance.url_to_install %]
<a id="manage_user[% slugify(instance.install_filename, '_') %]"
href="[% instance.url_to_install | url %]"
target="_blank"
class="manage_user_url" >
[% instance.url_to_install | html %]
</a>
[% END %]
</td>
[% END %]
[% IF has_admin %]
<td>
[% IF instance.url_to_install_admin %]
<a id="manage_admin_[% slugify(instance.install_filename, '_') %]"
href="[% instance.url_to_install_admin | url %]"
target="_blank"
class="manage_admin_url" >
[% instance.url_to_install_admin | html %]
</a>
[% END %]
</td>
[% END %]
[% IF has_other %]
<td>
[% SET base = instance.url_to_install;
base = base _ '/' IF !base.match('/$');
FOR relmiscurl IN meta.miscurls.keys;
SET misc_url = base _ meta.miscurls.$relmiscurl %]
<div>
[% relmiscurl | html %]:
<a id="manage_misc_[% slugify(instance.install_filename, '_') _ slugify(instance.relmiscurl, '_') %]"
href="[% misc_url | url %]"
target="_blank"
class="manage_other_url">
[% misc_url | html %]
</a>
</div>
[% END;%]
</td>
[% END %]
[% IF module.meta.display.versions %]
<td>
v[% instance.version | html %]
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
</div>
</div>
[% # NOTE: There use to be a copy and remove copy. Not currently implemented %]
[% FOR instance IN data.sorted_instances;
END;
IF module.meta.miscurls;
END %]
[% ELSE %]
<span>
[% locale.maketext('There are no installed instances of this [asis,cPAddon].') %]
</span>
[% END %]