Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
{% extends '@MauticForm/Action/base_form_action.html.twig' %}
{% set footerContent %}
{% if action.properties.asset is defined %}
{% if action.properties.asset is null and action.properties.category is defined %}
<!-- Using last asset from category -->
{% set category = getEntity('Mautic\\CategoryBundle\\Entity\\Category', action.properties.category) %}
{% set categoryName = category ? category.title : '' %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [
{
label: 'mautic.form.field.asset.use_category'|trans({'%category_name%': categoryName}),
icon: 'ri-folder-line',
color: 'warm-gray',
attributes: {
href: path('mautic_asset_index'),
'target': '_blank'
}
}
]
} %}
{% elseif action.properties.asset is not null %}
<!-- Specific asset selected -->
{% set asset = getEntity('Mautic\\AssetBundle\\Entity\\Asset', action.properties.asset) %}
{% if asset %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [
{
label: asset.title,
icon: 'ri-file-line',
color: 'warm-gray',
attributes: securityIsGranted('asset:assets:viewother') ? {
href: path('mautic_asset_action', {'objectAction': 'view', 'objectId': asset.id}),
'target': '_blank'
} : {}
}
]
} %}
{% endif %}
{% endif %}
{% endif %}
{% endset %}
{% block action_label %}
{{ footerContent|raw }}
{% endblock %}

View File

@@ -0,0 +1,258 @@
{% extends '@MauticCore/Default/content.html.twig' %}
{% block mauticContent %}asset{% endblock %}
{% block preHeader %}
{{- include('@MauticCore/Helper/page_actions.html.twig',
{
'item' : activeAsset,
'templateButtons' : {
'close' : securityHasEntityAccess(
permissions['asset:assets:viewown'],
permissions['asset:assets:viewother'],
activeAsset.getCreatedBy()
),
},
'routeBase' : 'asset',
'langVar' : 'asset.asset',
'nameGetter' : 'getTitle',
'targetLabel': 'mautic.asset.assets'|trans
}
) -}}
{{ include('@MauticCore/Modules/category--inline.html.twig', {'category': activeAsset.category}) }}
{{ include('@MauticProject/Modules/projects.html.twig', {'item': activeAsset}) }}
{% endblock %}
{% block headerTitle %} {{ activeAsset.getTitle() }} {% endblock %}
{% block actions %}
{{- include('@MauticCore/Helper/page_actions.html.twig',
{
'item' : activeAsset,
'templateButtons' : {
'edit' : securityHasEntityAccess(
permissions['asset:assets:editown'],
permissions['asset:assets:editother'],
activeAsset.getCreatedBy()
),
'clone' : permissions['asset:assets:create'],
'delete' : securityHasEntityAccess(
permissions['asset:assets:deleteown'],
permissions['asset:assets:deleteother'],
activeAsset.getCreatedBy()
),
},
'routeBase' : 'asset',
'langVar' : 'asset.asset',
'nameGetter' : 'getTitle',
}) -}}
{% endblock %}
{% block publishStatus %}
{{- include('@MauticCore/Helper/publishstatus_badge.html.twig', {
'entity': activeAsset,
'status': 'available'
}) -}}
<div class="label__divider"></div>
{# Asset type #}
{% if activeAsset.getFileType() is defined and activeAsset.getFileType() is not empty %}
{% set fileType = activeAsset.getFileType()|lower %}
{% set extensionGroups = activeAsset.getFileExtensions()|default([]) %}
{% set type = 'fallback' %}
{% for group, exts in extensionGroups %}
{% if fileType in exts %}
{% set type = group %}
{% endif %}
{% endfor %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [{
label: ('mautic.asset.type.' ~ type)|trans,
icon: activeAsset.getIconClass()|default(''),
color: 'high-contrast'
}]
} %}
{% endif %}
{# Disallow indexing #}
{% if activeAsset.getDisallow() is defined and activeAsset.getDisallow() == 1 %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [{
label: 'mautic.asset.tag.disallow.label'|trans,
icon: 'ri-eye-off-fill',
color: 'blue',
icon_only: true
}]
} %}
{% endif %}
{# Storage location #}
{% if activeAsset.getStorageLocation() is defined %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [{
label: ('mautic.asset.tag.storage.' ~ activeAsset.getStorageLocation())|trans,
icon: activeAsset.getStorageLocation() == 'local' ? 'ri-hard-drive-2-fill' : 'ri-cloud-fill',
color: 'blue',
icon_only: true
}]
} %}
{% endif %}
{# Language #}
{% if activeAsset.getLanguage() is defined and activeAsset.getLanguage() is not empty %}
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [{
label: activeAsset.getLanguage()|language_name|capitalize,
icon: 'ri-translate-2',
color: 'warm-gray',
attributes: {
'data-toggle': 'tooltip',
'data-placement': 'top',
'title': 'mautic.core.language'|trans
}
}]
} %}
{% endif %}
{% endblock %}
{% block content %}
<!-- start: box layout -->
<div class="box-layout">
<!-- left section -->
<div class="col-md-9 height-auto">
<div>
<!-- asset detail header -->
{% include '@MauticCore/Helper/description--expanded.html.twig' with {'description': activeAsset.description} %}
<!--/ asset detail header -->
<!-- asset detail collapseable -->
<div class="collapse pr-md pl-md" id="asset-details">
<div class="pr-md pl-md pb-md">
<div class="panel shd-none mb-0">
<table class="table table-hover mb-0">
<tbody>
{{- include(
'@MauticCore/Helper/details.html.twig',
{'entity' : activeAsset}
) -}}
<tr>
<td width="20%">
<span class="fw-b textTitle">
{% trans %}mautic.asset.asset.size{% endtrans %}
</span>
</td>
<td>{{ activeAsset.getSize() }}</td>
</tr>
<tr>
<td width="20%"><span class="fw-b textTitle">{% trans %}mautic.asset.asset.url{% endtrans %}</span></td>
<td>{{ assetDownloadUrl }}</td>
</tr>
<tr>
<td width="20%"><span class="fw-b textTitle">{% trans %}mautic.asset.filename.original{% endtrans %}</span></td>
<td>{{ activeAsset.getOriginalFilename() }}</td>
</tr>
<tr>
{% set location = activeAsset.getStorageLocation() %}
<td width="20%"><span class="fw-b textTitle">{{ ('mautic.asset.filename.' ~ location)|trans }}</span></td>
<td>{{ ('local' == location) ? activeAsset.getPath() : activeAsset.getRemotePath() }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--/ asset detail collapseable -->
</div>
<div>
<!-- asset detail collapseable toggler -->
<div class="hr-expand nm">
<span data-toggle="tooltip" title="Detail">
<a href="javascript:void(0)" class="arrow text-secondary collapsed" data-toggle="collapse"
data-target="#asset-details"><span class="caret"></span> {% trans %}mautic.core.details{% endtrans %}</a>
</span>
</div>
<!--/ asset detail collapseable toggler -->
<!-- some stats -->
<div class="pa-md">
<div class="row">
<div class="col-sm-12">
{% include '@MauticCore/Modules/stat--icon.html.twig' with {
'stats': [
{
'title': 'mautic.asset.asset.downloads.total',
'value': stats.downloads.total,
'tooltip': 'mautic.asset.asset.downloads.total.all_time',
'icon': 'ri-download-line'
},
{
'title': 'mautic.asset.asset.downloads.unique',
'value': stats.downloads.unique,
'tooltip': 'mautic.asset.asset.downloads.unique.all_time',
'icon': 'ri-user-6-line'
}
]
} %}
<div class="panel">
<div class="panel-body box-layout">
<div class="col-md-4 va-m">
<h5 class="text-white dark-md fw-sb mb-xs">
<span class="ri-download-line"></span>
{% trans %}mautic.asset.graph.line.downloads{% endtrans %}
</h5>
</div>
<div class="col-md-8 va-m">
{{- include('@MauticCore/Helper/graph_dateselect.html.twig', {'dateRangeForm' : dateRangeForm, 'class' : 'pull-right'}) -}}
</div>
</div>
<div class="d-flex fd-column pt-0 pl-15 pb-15 pr-15 min-h-256">
{{- include('@MauticCore/Helper/chart.html.twig', {'chartData' : stats.downloads.timeStats, 'chartType' : 'line', 'chartHeight' : 300}) -}}
</div>
</div>
</div>
</div>
</div>
<!--/ stats -->
</div>
{{ customContent('details.stats.graph.below', _context) }}
</div>
<!--/ left section -->
<!-- right section -->
<div class="col-md-3 bdr-l height-auto">
<!-- preview URL -->
<div class="panel shd-none bdr-rds-0 bdr-w-0 mt-sm mb-0">
<div class="panel-body pt-xs">
{% include '@MauticCore/Components/card.html.twig' with {
type: 'link',
href: assetDownloadUrl,
ctaType: 'external',
heading: 'mautic.core.open_link',
attributes: {
'target': '_blank'
}
} %}
{{- include('@MauticAsset/Modules/preview.html.twig',
{
'variant': 'dialog',
'activeAsset' : activeAsset,
'assetDownloadUrl' : url(
'mautic_asset_action',
{'objectAction' : 'preview', 'objectId' : activeAsset.getId()}
)}) -}}
</div>
</div>
<!--/ preview URL -->
<hr class="hr-w-2" style="width:50%">
<!-- activity feed -->
{{- include('@MauticCore/Helper/recentactivity.html.twig', {'logs' : logs}) -}}
</div>
<!--/ right section -->
<input name="entityId" id="entityId" type="hidden" value="{{ activeAsset.getId() }}"/>
</div>
<!--/ end: box layout -->
{% endblock %}

View File

@@ -0,0 +1,125 @@
{% extends '@MauticCore/Default/content.html.twig' %}
{% set header = (activeAsset.getId()) ? 'mautic.asset.asset.menu.edit'|trans({'%name%' : activeAsset.getTitle()}) :
'mautic.asset.asset.menu.new'|trans %}
{% block headerTitle %}{{ header }}{% endblock %}
{% block mauticContent %}asset{% endblock %}
{% block content %}
<script>
mauticAssetUploadEndpoint = "{{ uploadEndpoint }}";
mauticAssetUploadMaxSize = {{ maxSize }};
mauticAssetUploadMaxSizeError = "{{ maxSizeError }}";
mauticAssetUploadExtensions = "{{ extensions }}";
mauticAssetUploadExtensionError = "{{ extensionError }}";
</script>
{{ form_start(form) }}
<!-- start: box layout -->
<div class="box-layout">
<!-- container -->
<div class="col-md-8 col-lg-9 height-auto bdr-r">
<div class="pa-md">
<div class="row">
<div class="col-lg-6">
<div class="col-md-7 pl-0">
{{ form_row(form.storageLocation) }}
</div>
<div class="text-left mt-lg mb-lg{% if startOnLocal %} hide {% endif %}" id="remote-button">
{% if integrations %}
{% include '@MauticCore/Helper/button.html.twig' with {
buttons: [
{
href: path('mautic_asset_remote') ~ '?tmpl=modal',
icon: 'ri-file-search-line',
label: 'mautic.asset.remote.file.browse',
size: 'sm',
spin: true,
variant: 'tertiary',
attributes: {
'data-toggle': 'ajaxmodal',
'data-target': '#RemoteFileModal',
'data-header': 'mautic.asset.remote.file.browse'|trans,
'role': 'button'
}
}
]
} %}
{% endif %}
</div>
<div id="storage-local"{% if not startOnLocal %} class="hide"{% endif %}>
<div class="row">
<div class="form-group col-xs-12 ">
{{ form_label(form.tempName) }}
{{ form_widget(form.tempName) }}
{{ form_errors(form.tempName) }}
<div class="help-block mdropzone-error"></div>
<div class="mdropzone text-center" id="dropzone">
<div class="dz-message">
{% trans %}mautic.asset.drop.file.here{% endtrans %}</h4>
</div>
</div>
</div>
</div>
</div>
<div id="storage-remote"{% if startOnLocal %} class="hide"{% endif %}>
{{ form_row(form.remotePath) }}
</div>
<div>
{{ form_row(form.title) }}
</div>
<div>
{{ form_row(form.alias) }}
</div>
<div>
{{ form_row(form.description) }}
</div>
</div>
<div class="col-lg-6">
<div class="tile jc-center">
<div class="form-group col-xs-12 ">
{{- include('@MauticAsset/Modules/preview.html.twig', {
'variant': 'interactive',
'activeAsset' : activeAsset,
'assetDownloadUrl' : url('mautic_asset_action',
{'objectAction' : 'preview', 'objectId' : activeAsset.getId()}
)}) -}}
</div>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
</div>
</div>
</div>
<div class="col-md-4 col-lg-3 height-auto">
<div class="pr-lg pl-lg pt-md pb-md">
{{ form_row(form.category) }}
{{ form_row(form.projects) }}
{{ form_row(form.language) }}
{{ form_row(form.isPublished, {
'attr': {
'data-none': 'mautic.core.form.unavailable_regardless_of_scheduling',
'data-start': 'mautic.core.form.available_on_scheduled_date',
'data-both': 'mautic.core.form.available_during_scheduled_period',
'data-end': 'mautic.core.form.available_until_scheduled_end'
}
}) }}
{{ form_row(form.publishUp, {'label': 'mautic.core.form.available.available_from'}) }}
{{ form_row(form.publishDown, {'label': 'mautic.core.form.available.unavailable_from'}) }}
{{ form_row(form.disallow) }}
</div>
</div>
</div>
{{ form_end(form) }}
{% if integrations %}
{{- include('@MauticCore/Helper/modal.html.twig', {
'id' : 'RemoteFileModal',
'size' : 'lg',
'footerButtons' : true,
}) -}}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,292 @@
{% set isIndex = tmpl == 'index' ? true : false %}
{% set tmpl = 'list' %}
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
{% block mauticContent %}asset
{% endblock %}
{% block headerTitle %}
{% trans %}mautic.asset.assets{% endtrans %}
{% endblock %}
{% block content %}
{% if isIndex %}
<div id="page-list-wrapper" class="{% if items|length > 0 or searchValue is not empty %}panel {% endif %}panel-default">
{{- include('@MauticCore/Helper/list_toolbar.html.twig', {
'searchValue': searchValue,
'action': currentRoute,
'page_actions': {
'templateButtons': {
'new': permissions['asset:assets:create'],
},
'routeBase': 'asset',
'langVar': 'asset.asset',
},
'bulk_actions': {
'langVar': 'asset.asset',
'routeBase': 'asset',
'templateButtons': {
'delete': permissions['asset:assets:deleteown'] or permissions['asset:assets:deleteother'],
},
},
'quickFilters': [
{
'search': 'mautic.core.searchcommand.isuncategorized',
'label': 'mautic.core.form.uncategorized',
'tooltip': 'mautic.core.search.quickfilter.is_uncategorized',
'icon': 'ri-folder-unknow-line'
},
{
'search': 'mautic.core.searchcommand.ispublished',
'label': 'mautic.core.form.available',
'tooltip': 'mautic.core.search.quickfilter.is_published',
'icon': 'ri-check-line'
},
{
'search': 'mautic.core.searchcommand.isunpublished',
'label': 'mautic.core.form.unavailable',
'tooltip': 'mautic.core.search.quickfilter.is_unpublished',
'icon': 'ri-close-line'
},
{
'search': 'mautic.core.searchcommand.ismine',
'label': 'mautic.core.searchcommand.ismine.label',
'tooltip': 'mautic.core.searchcommand.ismine.description',
'icon': 'ri-user-line'
},
{
'search': 'mautic.asset.asset.searchcommand.isexpired',
'label': 'mautic.core.form.no_longer_available',
'tooltip': 'mautic.asset.asset.searchcommand.isexpired.description',
'icon': 'ri-time-line'
},
{
'search': 'mautic.asset.asset.searchcommand.ispending',
'label': 'mautic.core.form.not_yet_available',
'tooltip': 'mautic.asset.asset.searchcommand.ispending.description',
'icon': 'ri-timer-line'
}
]
}) -}}
<div class="page-list">
{{ block('listResults') }}
</div>
</div>
{% else %}
{{ block('listResults') }}
{% endif %}
{% endblock %}
{% block listResults %}
{% if items|length %}
<div class="table-responsive">
<table class="table table-hover asset-list" id="assetTable">
<thead>
<tr>
{{ include('@MauticCore/Helper/tableheader.html.twig', {
'checkall': 'true',
'target': '#assetTable',
}) }}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.title',
'text' : 'mautic.core.title',
'class' : 'col-asset-title',
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'c.title',
'text' : 'mautic.core.category',
'class' : 'visible-md visible-lg col-asset-category',
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.downloadCount',
'text' : 'mautic.asset.asset.thead.download.count',
'class' : 'visible-md visible-lg col-asset-download-count',
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.dateAdded',
'text' : 'mautic.lead.import.label.dateAdded',
'class' : 'visible-md visible-lg col-asset-dateAdded',
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.dateModified',
'text' : 'mautic.lead.import.label.dateModified',
'class' : 'visible-md visible-lg col-asset-dateModified',
'default' : true,
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.createdByUser',
'text' : 'mautic.core.createdby',
'class' : 'visible-md visible-lg col-asset-createdByUser',
}
) -}}
{{- include(
'@MauticCore/Helper/tableheader.html.twig',
{
'sessionVar' : 'asset',
'orderBy' : 'a.id',
'text' : 'mautic.core.id',
'class' : 'visible-md visible-lg col-asset-id',
}
) -}}
</tr>
</thead>
<tbody>
{% for k, item in items %}
<tr>
<td>
{{- include(
'@MauticCore/Helper/list_actions.html.twig',
{
'item' : item,
'templateButtons' : {
'edit' : securityHasEntityAccess(
permissions['asset:assets:editown'],
permissions['asset:assets:editother'],
item.getCreatedBy()
),
'delete' : securityHasEntityAccess(
permissions['asset:assets:deleteown'],
permissions['asset:assets:deleteother'],
item.getCreatedBy()
),
'clone' : permissions['asset:assets:create'],
},
'routeBase' : 'asset',
'langVar' : 'asset.asset',
'nameGetter' : 'getTitle',
'customButtons' : {
0: {
'attr' : {
'data-toggle' : 'ajaxmodal',
'data-target' : '#AssetPreviewModal',
'href' : path(
'mautic_asset_action',
{'objectAction' : 'preview', 'objectId' : item.getId(), 'stream': 0}
),
},
'btnText' : 'mautic.asset.asset.preview'|trans,
'iconClass' : 'ri-image-circle-line',
},
1: {
'attr' : {
'data-copy' : url('mautic_asset_download', {'slug': item.getId() ~ ':' ~ item.getAlias()}),
'data-toggle' : 'none',
},
'btnText' : 'mautic.core.copy_download_link'|trans,
'iconClass' : 'ri-clipboard-line',
},
},
}
) -}}
</td>
<td>
<div>
{{- include(
'@MauticCore/Helper/publishstatus_icon.html.twig',
{
'item' : item,
'model' : 'asset.asset',
}
) -}}
<a href="{{ path(
'mautic_asset_action',
{'objectAction' : 'view', 'objectId' : item.getId()}
) }}"
data-toggle="ajax">
{{ item.getTitle() }} ({{ item.getAlias() }})
</a>
<i class="{{ item.getIconClass() }}"></i>
{{ customContent('asset.name', _context) }}
{{ include('@MauticProject/Modules/projects.html.twig') }}
</div>
{% set description = item.getDescription() %}
{% if description %}
{{ include('@MauticCore/Helper/description--inline.html.twig', {
'description': description
}) }}
{% endif %}
</td>
<td class="visible-md visible-lg">
{{ include('@MauticCore/Modules/category--expanded.html.twig', {'category': item.getCategory()}) }}
</td>
<td class="visible-md visible-lg">{{ item.getDownloadCount() }}</td>
<td class="visible-md visible-lg" title="{{ item.getDateAdded() ? dateToFullConcat(item.getDateAdded()) : '' }}">
{{ item.getDateAdded() ? dateToDate(item.getDateAdded()) : '' }}
</td>
<td class="visible-md visible-lg" title="{{ item.getDateModified() ? dateToFullConcat(item.getDateModified()) : '' }}">
{{ item.getDateModified() ? dateToDate(item.getDateModified()) : '' }}
</td>
<td class="visible-md visible-lg">{{ item.getCreatedByUser() }}</td>
<td class="visible-md visible-lg">{{ item.getId() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="panel-footer">
{{- include('@MauticCore/Helper/pagination.html.twig', {
'totalItems' : items|length,
'page' : page,
'limit' : limit,
'menuLinkId' : 'mautic_asset_index',
'baseUrl' : path('mautic_asset_index'),
'sessionVar' : 'asset',
}) -}}
</div>
{% else %}
{% if searchValue is not empty %}
{{- include('@MauticCore/Helper/noresults.html.twig', {'tip' : 'mautic.asset.noresults.tip'}) -}}
{% else %}
<div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
{% set childContainer %}
<div class="mb-md">
{% include '@MauticCore/Components/pictogram.html.twig' with {
'pictogram': 'cloud--assets',
'size': '80'
} %}
</div>
{% endset %}
{{ include('@MauticCore/Components/content-block.html.twig', {
heading: 'mautic.asset.onboarding.heading',
subheading: 'mautic.asset.onboarding.subheading',
copy: 'mautic.asset.onboarding.copy',
childContainer: childContainer,
}) }}
</div>
{% endif %}
{% endif %}
{{- include('@MauticCore/Helper/modal.html.twig', {
'id' : 'AssetPreviewModal',
'header' : false,
}) -}}
{{ include('@MauticCore/Modules/protip.html.twig', {
tip: random(['mautic.protip.assets.gating', 'mautic.protip.assets.naming', 'mautic.protip.assets.repurpose', 'mautic.protip.assets.track'])
}) }}
{% endblock %}

View File

@@ -0,0 +1,17 @@
{% block _config_assetconfig_widget %}
<h4 class="fw-sb mt-48 mb-xs">{% trans %}mautic.config.tab.assetconfig{% endtrans %}</h4>
<div class="text-muted small pb-md">{{ 'mautic.core.config.header.assetconfig.description'|trans }}</div>
<div class="row">
<div class="panel panel-default mb-md">
<div class="panel-body">
<div class="row">
{% for f in form.children %}
<div class="col-xs-12">
{{ form_row(f) }}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,113 @@
{% set variant = variant|default('') %}
{% set isPreviewable = activeAsset.isImage() or 'pdf' == activeAsset.getFileType()|lower or activeAsset.getMime() starts with 'video' or activeAsset.getMime() starts with 'audio' %}
{% macro renderPreviewContent(activeAsset, assetDownloadUrl) %}
{% if activeAsset.isImage() %}
<img src="{{ assetDownloadUrl ~ '?stream=1' }}" alt="{{ activeAsset.getTitle()|escape }}" class="img-thumbnail" />
{% elseif 'pdf' == activeAsset.getFileType()|lower %}
<iframe src="{{ assetDownloadUrl ~ '?stream=1#view=FitH' }}" style="width: 100%; height: 70vh; border: none;" title="{{ 'mautic.asset.preview.pdf_iframe_title'|trans({'%title%': activeAsset.getTitle()|escape}) }}"></iframe>
{% elseif activeAsset.getMime() starts with 'video' or activeAsset.getExtension() in ['mpg', 'mpeg', 'mp4', 'webm'] %}
<video src="{{ assetDownloadUrl ~ '?stream=1' }}" controls style="width: 100%;">
{{ 'mautic.asset.no_video_support'|trans }}
</video>
{% elseif activeAsset.getMime() starts with 'audio' or activeAsset.getExtension() in ['mp3', 'ogg', 'wav'] %}
<audio controls>
<source src="{{ assetDownloadUrl ~ '?stream=1' }}" type="{{ activeAsset.getMime() }}">
{{ 'mautic.asset.no_audio_support'|trans }}
</audio>
{% else %}
<div class="d-flex jc-center ai-center text-helper">
<i class="{{ activeAsset.getIconClass() }} ri-lg mr-xs"></i>
<span>{{ 'mautic.asset.no_preview'|trans }}</span>
</div>
{% endif %}
{% endmacro %}
{% if variant == 'interactive' %}
{% if isPreviewable %}
<h5 class="fw-sb mb-xs">{{ 'mautic.asset.asset.preview'|trans }}</h5>
<div class="asset-preview">
{% if activeAsset.isImage() %}
<div class="asset-preview--image">
<div class="asset-preview__label">
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [
{
label: 'mautic.asset.click_to_zoom',
color: 'gray',
size: 'sm'
}
]
} %}
</div>
{{ _self.renderPreviewContent(activeAsset, assetDownloadUrl) }}
</div>
{% elseif 'pdf' == activeAsset.getFileType()|lower %}
<div class="asset-preview__label">
{% include '@MauticCore/Helper/_tag.html.twig' with {
tags: [
{
label: 'mautic.asset.click_to_view_full_size',
color: 'gray',
size: 'sm',
attributes: {
'href': '#',
'data-toggle': 'modal',
'data-target': '#pdf-preview-modal'
}
}
]
} %}
</div>
<div class="pdf-preview-thumbnail">
{{ _self.renderPreviewContent(activeAsset, assetDownloadUrl) }}
</div>
{% include '@MauticCore/Components/modal.html.twig' with {
id: 'pdf-preview-modal',
size: 'xl',
type: 'productive',
modalHeading: activeAsset.getTitle()|escape,
modalAriaLabel: 'PDF Preview',
modalContent: _self.renderPreviewContent(activeAsset, assetDownloadUrl),
hasScrollingContent: false
} %}
{% else %}
{{ _self.renderPreviewContent(activeAsset, assetDownloadUrl) }}
{% endif %}
</div>
{% else %}
<div class="d-flex jc-center ai-center text-helper">
<i class="{{ activeAsset.getIconClass() }} ri-lg mr-xs"></i>
<span>{{ 'mautic.asset.no_preview'|trans }}</span>
</div>
{% endif %}
<div class="clearfix"></div>
{% elseif variant == 'dialog' %}
{% set modalId = 'asset-dialog-preview-modal-' ~ activeAsset.id|default('new') %}
{% if isPreviewable %}
{% include '@MauticCore/Components/tile.html.twig' with {
type: 'mini',
href: '#',
title: 'mautic.asset.open_preview',
icon: 'ri-rectangle-line',
attributes: {
'data-toggle': 'modal',
'data-target': '#' ~ modalId
}
} %}
{% endif %}
{% include '@MauticCore/Components/modal.html.twig' with {
id: modalId,
size: 'xl',
type: 'productive',
modalHeading: activeAsset.getTitle()|escape,
modalAriaLabel: 'mautic.asset.preview.ariaLabel'|trans({'%title%': activeAsset.getTitle()|escape}),
modalContent: _self.renderPreviewContent(activeAsset, assetDownloadUrl)
} %}
{% else %}
{{ _self.renderPreviewContent(activeAsset, assetDownloadUrl) }}
{% endif %}

View File

@@ -0,0 +1,54 @@
{% set isIndex = tmpl == 'index' ? true : false %}
{% set tmpl = 'list' %}
{% extends isIndex ? '@MauticCore/Default/content.html.twig' : '@MauticCore/Default/raw_output.html.twig' %}
{% block mauticContent %}asset{% endblock %}
{% block headerTitle %}{% trans %}mautic.asset.remote.file.browse{% endtrans %}{% endblock %}
{% block content %}
{% if isIndex %}
<div id="page-list-wrapper" class="panel panel-default">
<div class="page-list">
{{ block('mainContent') }}
</div>
</div>
{% else %}
{{ block('mainContent') }}
{% endif %}
{% endblock %}
{% block mainContent %}
{% if integrations|length %}
<!-- start: box layout -->
<div class="box-layout">
<!-- step container -->
<div class="col-md-3">
<div class="pt-md pr-md pb-md">
<ul class="list-group list-group-tabs">
{% for integration in integrations %}
<li class="list-group-item{% if loop.index0 is same as(0) %} active{% endif %}" id="tab{{ integration.getName() }}">
<a href="javascript: void(0);" class="list-group-item-heading steps" onclick="Mautic.updateRemoteBrowser('{{ integration.getName() }}');">
{{ integration.getDisplayName() }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<!--/ step container -->
<!-- container -->
<div class="col-md-9 bdr-l">
<div id="remoteFileBrowser">
<div class="alert alert-warning col-md-6 col-md-offset-3 mt-md">
<p>{% trans %}mautic.asset.remote.select_service{% endtrans %}</p>
</div>
</div>
</div>
<!--/ end: container -->
</div>
<!--/ end: box layout -->
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% if items|length %}
<div class="panel panel-primary mb-0">
<div class="panel-body">
<input type='text' class='remote-file-search form-control mb-lg' autocomplete='off' placeholder="{% trans %}mautic.core.search.placeholder{% endtrans %}" />
<div class="list-group remote-file-list">
{% if items.dirs is defined %}
{% for item in items.dirs %}
<a class="list-group-item" href="javascript: void(0);" onclick="Mautic.updateRemoteBrowser('{{ integration.getName() }}', '/{{ item|trim('/','right') }}');">
{{ item }}
</a>
{% endfor %}
{% for item in items.keys %}
<a class="list-group-item" href="javascript: void(0);" onclick="Mautic.selectRemoteFile('{{ integration.getPublicUrl(item) }}');">
{{ item }}
</a>
{% endfor %}
{% else %}
{% for item in items %}
{% if connector.getAdapter().isDirectory(item) %}
<a class="list-group-item" href="javascript: void(0);" onclick="Mautic.updateRemoteBrowser('{{ integration.getName() }}', '/{{ item|trim('/', 'right') }}');">
{{ item }}
</a>
{% else %}
<a class="list-group-item" href="javascript: void(0);" onclick="Mautic.selectRemoteFile('{{ integration.getPublicUrl(item) }}');">
{{ item }}
</a>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
{% else %}
{{- include('@MauticCore/Helper/noresults.html.twig', {'message' : 'mautic.asset.remote.no_results'}) -}}
{% endif %}

View File

@@ -0,0 +1,21 @@
{% if showMore is defined and showMore is not empty %}
<a href="{{ url('mautic_asset_index', {'search' : searchString}) }}" data-toggle="ajax">
<span>{{ 'mautic.core.search.more'|trans({'%count%' : remaining})|escape }}</span>
</a>
{% else %}
<a class="gsearch--results-common" href="{{ url('mautic_asset_action', {'objectAction' : 'view', 'objectId' : item.getId()}) }}" data-toggle="ajax">
<i class="{{ item.getIconClass() }} gsearch--results-common__icon mr-3"></i>
<span class="fw-sb">{{ item.getTitle()|escape }}</span>
<span class="ml-4 mr-4">#{{ item.getId() }}</span>
{{- include('@MauticCore/Helper/publishstatus_badge.html.twig', {
'entity': item,
'status': 'available',
'simplified': 'true'
}) -}}
<span size="sm" class="pull-right" data-toggle="tooltip" title="{% trans %}mautic.asset.downloadcount{% endtrans %}" data-placement="left">
<i class="ri-download-line"></i>
{{ item.getDownloadCount() }}
</span>
</a>
{% endif %}

View File

@@ -0,0 +1,7 @@
<div>
Hello
{{- include('@MauticAsset/Asset/preview.html.twig', {'activeAsset' : event.extra.asset, 'assetDownloadUrl' : url(
'mautic_asset_action',
{'objectAction' : 'preview', 'objectId' : event.extra.asset.getId()}
)}) -}}
</div>