-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make use of the missing settings of #1
- Loading branch information
Showing
5 changed files
with
507 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{# purpose of this template: build the form to edit an instance of image #} | ||
{% set baseTemplate = app.request.query.getBoolean('raw', false) ? 'raw' : (routeArea == 'admin' ? 'adminBase' : 'base') %} | ||
{% extends 'RKHelperModule::' ~ baseTemplate ~ '.html.twig' %} | ||
|
||
{% block header %} | ||
{{ parent() }} | ||
{{ pageAddAsset('javascript', zasset('@RKHelperModule:js/RKHelperModule.Validation.js', 98)) }} | ||
{{ pageAddAsset('javascript', zasset('@RKHelperModule:js/RKHelperModule.EditFunctions.js', 99)) }} | ||
{{ pageAddAsset('javascript', asset('typeahead/typeahead.bundle.min.js')) }} | ||
{% endblock %} | ||
|
||
{% block title mode == 'create' ? __('Create image') : __('Edit image') %} | ||
{% block admin_page_icon mode == 'create' ? 'plus' : 'pencil-square-o' %} | ||
{% block content %} | ||
<div class="rkhelpermodule-image rkhelpermodule-edit"> | ||
{% form_theme form with [ | ||
'@RKHelperModule/Form/bootstrap_3.html.twig', | ||
'ZikulaFormExtensionBundle:Form:form_div_layout.html.twig' | ||
] %} | ||
{{ form_start(form, {attr: {id: 'imageEditForm', class: 'rkhelper-edit-form'}}) }} | ||
{{ form_errors(form) }} | ||
<fieldset> | ||
<legend>{{ __('Content') }}</legend> | ||
{{ form_row(form.imageTitle) }} | ||
{{ form_row(form.myImage) }} | ||
{{ form_row(form.myDescription) }} | ||
{{ form_row(form.copyright) }} | ||
</fieldset> | ||
|
||
{% if mode != 'create' %} | ||
{{ include('@RKHelperModule/Helper/includeStandardFieldsEdit.html.twig', { obj: image }) }} | ||
{% endif %} | ||
|
||
{# include display hooks #} | ||
{% set hookId = mode != 'create' ? image.id : null %} | ||
{% set hooks = notifyDisplayHooks(eventName='rkhelpermodule.ui_hooks.images.form_edit', id=hookId) %} | ||
{% if hooks is iterable and hooks|length > 0 %} | ||
{% for providerArea, hook in hooks if providerArea != 'provider.scribite.ui_hooks.editor' %} | ||
<fieldset> | ||
{{ hook }} | ||
</fieldset> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if form.moderationSpecificCreator is defined %} | ||
<fieldset id="moderationFieldsSection"> | ||
<legend>{{ __('Moderation') }} <i class="fa fa-expand"></i></legend> | ||
<div id="moderationFieldsContent"> | ||
{{ form_row(form.moderationSpecificCreator) }} | ||
{{ form_row(form.moderationSpecificCreationDate) }} | ||
</div> | ||
</fieldset> | ||
{% endif %} | ||
|
||
{# include return control #} | ||
{% if mode == 'create' %} | ||
<fieldset> | ||
<legend>{{ __('Return control') }}</legend> | ||
{{ form_row(form.repeatCreation) }} | ||
</fieldset> | ||
{% endif %} | ||
|
||
{# include possible submit actions #} | ||
<div class="form-group form-buttons"> | ||
<div class="col-sm-offset-3 col-sm-9"> | ||
{% for action in actions %} | ||
{{ form_widget(attribute(form, action.id)) }} | ||
{% endfor %} | ||
{{ form_widget(form.reset) }} | ||
{{ form_widget(form.cancel) }} | ||
</div> | ||
</div> | ||
{{ form_end(form) }} | ||
</div> | ||
{% endblock %} | ||
{% block footer %} | ||
{{ parent() }} | ||
|
||
{% set editImage = '<span class="fa fa-pencil-square-o"></span>' %} | ||
{% set removeImage = '<span class="fa fa-trash-o"></span>' %} | ||
|
||
<script type="text/javascript"> | ||
/* <![CDATA[ */ | ||
( function($) { | ||
$(document).ready(function() { | ||
// initialise auto completion for user fields | ||
{% if form.moderationSpecificCreator is defined %} | ||
rKHelperInitUserField('rkhelpermodule_image_moderationSpecificCreator', 'getCommonUsersList'); | ||
{% endif %} | ||
rKHelperInitEditForm('{{ mode }}', '{% if mode != 'create' %}{{ image.id }}{% endif %}'); | ||
rKHelperInitUploadField('rkhelpermodule_image_myImage_myImage'); | ||
}); | ||
})(jQuery); | ||
/* ]]> */ | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{# purpose of this template: images list view #} | ||
{% extends routeArea == 'admin' ? 'RKHelperModule::adminBase.html.twig' : 'RKHelperModule::base.html.twig' %} | ||
{% block title own ? __('My images') : __('Image list') %} | ||
{% block admin_page_icon 'list-alt' %} | ||
{% block content %} | ||
<div class="rkhelpermodule-image rkhelpermodule-view"> | ||
|
||
<p class="alert alert-info">{{ __('This entity is for webmaster usage only. Here we can store some images for graphical usage.') }}</p> | ||
|
||
{{ block('page_nav_links') }} | ||
|
||
{{ include('@RKHelperModule/Image/viewQuickNav.html.twig', { workflowStateFilter: false }) }}{# see template file for available options #} | ||
|
||
{% if routeArea == 'admin' %} | ||
<form action="{{ path('rkhelpermodule_image_' ~ routeArea ~ 'handleselectedentries') }}" method="post" id="imagesViewForm" class="form-horizontal" role="form"> | ||
<div> | ||
{% endif %} | ||
<div class="table-responsive"> | ||
<table class="table table-striped table-bordered table-hover{% if routeArea == 'admin' %} table-condensed{% endif %}"> | ||
<colgroup> | ||
{% if routeArea == 'admin' %} | ||
<col id="cSelect" /> | ||
{% endif %} | ||
<col id="cItemActions" /> | ||
<col id="cImageTitle" /> | ||
<col id="cMyImage" /> | ||
<col id="cMyDescription" /> | ||
<col id="cCopyright" /> | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
{% if routeArea == 'admin' %} | ||
<th id="hSelect" scope="col" class="{% if items|length > 0 %}fixed-column {% endif %}text-center z-w02"> | ||
<input type="checkbox" class="rkhelper-mass-toggle" /> | ||
</th> | ||
{% endif %} | ||
<th id="hItemActions" scope="col" class="{% if items|length > 0 %}fixed-column {% endif %}z-order-unsorted">{{ __('Actions') }}</th> | ||
<th id="hImageTitle" scope="col" class="text-left"> | ||
<a href="{{ sort.imageTitle.url }}" title="{{ __f('Sort by %s', {'%s': 'image title'}) }}" class="{{ sort.imageTitle.class }}">{{ __('Image title') }}</a> | ||
</th> | ||
<th id="hMyImage" scope="col" class="text-left"> | ||
<a href="{{ sort.myImage.url }}" title="{{ __f('Sort by %s', {'%s': 'my image'}) }}" class="{{ sort.myImage.class }}">{{ __('My image') }}</a> | ||
</th> | ||
<th id="hMyDescription" scope="col" class="text-left"> | ||
<a href="{{ sort.myDescription.url }}" title="{{ __f('Sort by %s', {'%s': 'my description'}) }}" class="{{ sort.myDescription.class }}">{{ __('My description') }}</a> | ||
</th> | ||
<th id="hCopyright" scope="col" class="text-left"> | ||
<a href="{{ sort.copyright.url }}" title="{{ __f('Sort by %s', {'%s': 'copyright'}) }}" class="{{ sort.copyright.class }}">{{ __('Copyright') }}</a> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
{% for image in items %} | ||
<tr> | ||
{% if routeArea == 'admin' %} | ||
<td headers="hSelect" class="fixed-column text-center"> | ||
<input type="checkbox" name="items[]" value="{{ image.id }}" class="rkhelper-toggle-checkbox" /> | ||
</td> | ||
{% endif %} | ||
<td id="itemActions{{ image.id }}" headers="hItemActions" class="fixed-column actions nowrap z-w02"> | ||
{% set itemActions = knp_menu_get('RKHelperModule:ItemActionsMenu:menu', [], { entity: image, area: routeArea, context: 'view' }) %} | ||
<div class="dropdown"> | ||
<a id="itemActions{{ image.id }}DropDownToggle" role="button" data-toggle="dropdown" data-target="#" href="javascript:void(0);" class="hidden dropdown-toggle"><i class="fa fa-tasks"></i> <span class="caret"></span></a> | ||
{{ knp_menu_render(itemActions, { template: 'ZikulaMenuModule:Override:actions.html.twig' }) }} | ||
</div> | ||
</td> | ||
<td headers="hImageTitle" class="text-left"> | ||
{{ image.imageTitle }} | ||
</td> | ||
<td headers="hMyImage" class="text-left"> | ||
{% if image.myImageMeta|default %} | ||
<a href="{{ image.myImageUrl }}" title="{{ image.getTitleFromDisplayPattern()|e('html_attr') }}"{% if image.myImageMeta.isImage %} class="image-link"{% endif %}> | ||
{% if image.myImageMeta.isImage %} | ||
{% set thumbOptions = attribute(thumbRuntimeOptions, 'imageMyImage') %} | ||
<img src="{{ image.myImage.getPathname()|imagine_filter('zkroot', thumbOptions) }}" alt="{{ image.getTitleFromDisplayPattern()|e('html_attr') }}" width="{{ thumbOptions.thumbnail.size[0] }}" height="{{ thumbOptions.thumbnail.size[1] }}" class="img-thumbnail" /> | ||
{% else %} | ||
{{ __('Download') }} ({{ image.myImageMeta.size|rkhelpermodule_fileSize(image.myImage.getPathname(), false, false) }}) | ||
{% endif %} | ||
</a> | ||
{% endif %} | ||
</td> | ||
<td headers="hMyDescription" class="text-left"> | ||
{{ image.myDescription|safeHtml }} | ||
</td> | ||
<td headers="hCopyright" class="text-left"> | ||
{{ image.copyright }} | ||
</td> | ||
</tr> | ||
{% else %} | ||
<tr class="z-{{ routeArea == 'admin' ? 'admin' : 'data' }}tableempty"> | ||
<td class="text-left" colspan="{% if routeArea == 'admin' %}6{% else %}5{% endif %}"> | ||
{{ __('No images found.') }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
|
||
</tbody> | ||
</table> | ||
</div> | ||
|
||
{% if showAllEntries != 1 and pager|default %} | ||
{{ pager({ rowcount: pager.amountOfItems, limit: pager.itemsPerPage, display: 'page', route: 'rkhelpermodule_image_' ~ routeArea ~ 'view'}) }} | ||
{% endif %} | ||
{% if routeArea == 'admin' %} | ||
<fieldset> | ||
<label for="rKHelperModuleAction" class="col-sm-3 control-label">{{ __('With selected images') }}</label> | ||
<div class="col-sm-6"> | ||
<select id="rKHelperModuleAction" name="action" class="form-control input-sm"> | ||
<option value="">{{ __('Choose action') }}</option> | ||
<option value="delete" title="{{ __('Delete content permanently.') }}">{{ __('Delete') }}</option> | ||
</select> | ||
</div> | ||
<div class="col-sm-3"> | ||
<input type="submit" value="{{ __('Submit') }}" class="btn btn-default btn-sm" /> | ||
</div> | ||
</fieldset> | ||
</div> | ||
</form> | ||
{% endif %} | ||
|
||
{{ block('display_hooks') }} | ||
</div> | ||
{% endblock %} | ||
{% block page_nav_links %} | ||
<p> | ||
{% if canBeCreated %} | ||
{% if hasPermission('RKHelperModule:Image:', '::', 'ACCESS_EDIT') %} | ||
{% set createTitle = __('Create image') %} | ||
<a href="{{ path('rkhelpermodule_image_' ~ routeArea ~ 'edit') }}" title="{{ createTitle|e('html_attr') }}" class="fa fa-plus">{{ createTitle }}</a> | ||
{% endif %} | ||
{% endif %} | ||
{% if showAllEntries == 1 %} | ||
{% set linkTitle = __('Back to paginated view') %} | ||
<a href="{{ path('rkhelpermodule_image_' ~ routeArea ~ 'view') }}" title="{{ linkTitle|e('html_attr') }}" class="fa fa-table">{{ linkTitle }}</a> | ||
{% else %} | ||
{% set linkTitle = __('Show all entries') %} | ||
<a href="{{ path('rkhelpermodule_image_' ~ routeArea ~ 'view', { all: 1 }) }}" title="{{ linkTitle|e('html_attr') }}" class="fa fa-table">{{ linkTitle }}</a> | ||
{% endif %} | ||
</p> | ||
{% endblock %} | ||
{% block display_hooks %} | ||
|
||
{# here you can activate calling display hooks for the view page if you need it #} | ||
{# % if routeArea != 'admin' %} | ||
{% set hooks = notifyDisplayHooks(eventName='rkhelpermodule.ui_hooks.images.display_view', urlObject=currentUrlObject) %} | ||
{% for providerArea, hook in hooks %} | ||
{{ hook }} | ||
{% endfor %} | ||
{% endif % #} | ||
{% endblock %} |
98 changes: 98 additions & 0 deletions
98
src/app/Resources/RKHelperModule/views/Image/edit.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{# purpose of this template: build the form to edit an instance of image #} | ||
{% set baseTemplate = app.request.query.getBoolean('raw', false) ? 'raw' : (routeArea == 'admin' ? 'adminBase' : 'base') %} | ||
{% extends 'RKHelperModule::' ~ baseTemplate ~ '.html.twig' %} | ||
|
||
{% block header %} | ||
{{ parent() }} | ||
{{ pageAddAsset('javascript', zasset('@RKHelperModule:js/RKHelperModule.Validation.js', 98)) }} | ||
{{ pageAddAsset('javascript', zasset('@RKHelperModule:js/RKHelperModule.EditFunctions.js', 99)) }} | ||
{{ pageAddAsset('javascript', asset('typeahead/typeahead.bundle.min.js')) }} | ||
{% endblock %} | ||
|
||
{% block title mode == 'create' ? __('Create image') : __('Edit image') %} | ||
{% block admin_page_icon mode == 'create' ? 'plus' : 'pencil-square-o' %} | ||
{% block content %} | ||
<div class="rkhelpermodule-image rkhelpermodule-edit"> | ||
{% form_theme form with [ | ||
'@RKHelperModule/Form/bootstrap_3.html.twig', | ||
'ZikulaFormExtensionBundle:Form:form_div_layout.html.twig' | ||
] %} | ||
{{ form_start(form, {attr: {id: 'imageEditForm', class: 'rkhelper-edit-form'}}) }} | ||
{{ form_errors(form) }} | ||
<fieldset> | ||
<legend>{{ __('Content') }}</legend> | ||
{{ form_row(form.imageTitle) }} | ||
{{ form_row(form.myImage) }} | ||
{% set allowedLength = getModVar('RKHelperModule', 'descriptionLengthImage', 500) %} | ||
{{ form_row(form.myDescription, { 'attr': { 'maxlength': allowedLength } }) }} | ||
{{ form_row(form.copyright) }} | ||
</fieldset> | ||
|
||
{% if mode != 'create' %} | ||
{{ include('@RKHelperModule/Helper/includeStandardFieldsEdit.html.twig', { obj: image }) }} | ||
{% endif %} | ||
|
||
{# include display hooks #} | ||
{% set hookId = mode != 'create' ? image.id : null %} | ||
{% set hooks = notifyDisplayHooks(eventName='rkhelpermodule.ui_hooks.images.form_edit', id=hookId) %} | ||
{% if hooks is iterable and hooks|length > 0 %} | ||
{% for providerArea, hook in hooks if providerArea != 'provider.scribite.ui_hooks.editor' %} | ||
<fieldset> | ||
{{ hook }} | ||
</fieldset> | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if form.moderationSpecificCreator is defined %} | ||
<fieldset id="moderationFieldsSection"> | ||
<legend>{{ __('Moderation') }} <i class="fa fa-expand"></i></legend> | ||
<div id="moderationFieldsContent"> | ||
{{ form_row(form.moderationSpecificCreator) }} | ||
{{ form_row(form.moderationSpecificCreationDate) }} | ||
</div> | ||
</fieldset> | ||
{% endif %} | ||
|
||
{# include return control #} | ||
{% if mode == 'create' %} | ||
<fieldset> | ||
<legend>{{ __('Return control') }}</legend> | ||
{{ form_row(form.repeatCreation) }} | ||
</fieldset> | ||
{% endif %} | ||
|
||
{# include possible submit actions #} | ||
<div class="form-group form-buttons"> | ||
<div class="col-sm-offset-3 col-sm-9"> | ||
{% for action in actions %} | ||
{{ form_widget(attribute(form, action.id)) }} | ||
{% endfor %} | ||
{{ form_widget(form.reset) }} | ||
{{ form_widget(form.cancel) }} | ||
</div> | ||
</div> | ||
{{ form_end(form) }} | ||
</div> | ||
{% endblock %} | ||
{% block footer %} | ||
{{ parent() }} | ||
|
||
{% set editImage = '<span class="fa fa-pencil-square-o"></span>' %} | ||
{% set removeImage = '<span class="fa fa-trash-o"></span>' %} | ||
|
||
<script type="text/javascript"> | ||
/* <![CDATA[ */ | ||
( function($) { | ||
$(document).ready(function() { | ||
// initialise auto completion for user fields | ||
{% if form.moderationSpecificCreator is defined %} | ||
rKHelperInitUserField('rkhelpermodule_image_moderationSpecificCreator', 'getCommonUsersList'); | ||
{% endif %} | ||
rKHelperInitEditForm('{{ mode }}', '{% if mode != 'create' %}{{ image.id }}{% endif %}'); | ||
rKHelperInitUploadField('rkhelpermodule_image_myImage_myImage'); | ||
}); | ||
})(jQuery); | ||
/* ]]> */ | ||
</script> | ||
{% endblock %} |
Oops, something went wrong.