Merge pull request #6 from chmst/40-weblinks-blog-layout

4.0-compatible-frontend-fixes
This commit is contained in:
Tuan Pham Ngoc 2021-08-14 15:16:03 +07:00 committed by GitHub
commit 515471ca54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 52 deletions

View File

@ -332,8 +332,8 @@
name="float_second"
type="list"
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
useglobal="true"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="right">COM_WEBLINKS_RIGHT</option>
<option value="left">COM_WEBLINKS_LEFT</option>
<option value="none">COM_WEBLINKS_NONE</option>

View File

@ -121,8 +121,8 @@
label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
useglobal="true"
>
<option value="end">COM_WEBLINKS_RIGHT</option>
<option value="start">COM_WEBLINKS_LEFT</option>
<option value="right">COM_WEBLINKS_RIGHT</option>
<option value="left">COM_WEBLINKS_LEFT</option>
<option value="none">COM_WEBLINKS_NONE</option>
</field>
@ -161,10 +161,10 @@
name="float_second"
type="list"
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
useglobal="true"
>
<option value="end">COM_WEBLINKS_RIGHT</option>
<option value="start">COM_WEBLINKS_LEFT</option>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="right">COM_WEBLINKS_RIGHT</option>
<option value="left">COM_WEBLINKS_LEFT</option>
<option value="none">COM_WEBLINKS_NONE</option>
</field>

View File

@ -33,39 +33,42 @@ $listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p> <?php echo Text::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
<?php else : ?>
<div class="com-weblinks-category__items">
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field')) : ?>
<div class="com-weblinks-category__filter btn-group">
<label class="filter-search-lbl visually-hidden" for="filter-search">
<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>
</label>
<input
type="text"
name="filter-search"
id="filter-search"
value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
class="inputbox" onchange="document.adminForm.submit();"
placeholder="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>"
>
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
<button type="reset" name="filter-clear-button" class="btn btn-secondary" onclick="document.getElementById('filter-search').value = '';document.adminForm.submit();"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
<div class="com-weblinks-category__items">
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field')) : ?>
<div class="com-weblinks-category__filter btn-group">
<label class="filter-search-lbl visually-hidden" for="filter-search">
<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>
</label>
<input
type="text"
name="filter-search"
id="filter-search"
value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
class="inputbox" onchange="document.adminForm.submit();"
placeholder="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>"
>
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
<button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="com-weblinks-category__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<?php if ($this->params->get('show_no_contacts', 1)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_WEBLINKS_NO_WEBLINKS'); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="com-weblinks-category__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php else : ?>
<ul class="category list-unstyled">
<?php foreach ($this->items as $i => $item) : ?>
<?php // Shouldn't this be checked in the model?The pagination will be affected
@ -180,7 +183,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<figure class="item-image">
<img src="<?php echo htmlspecialchars($img->url, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $alt; ?> itemprop="thumbnail" />
<?php if (!empty($images->image_first_caption)) : ?>
<?php if (!empty($images->image_second_caption)) : ?>
<figcaption class="caption"><?php echo htmlspecialchars($images->image_second_caption, ENT_COMPAT, 'UTF-8'); ?></figcaption>
<?php endif; ?>
</figure>
@ -198,8 +201,6 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php endforeach; ?>
</ul>
<?php // Code to add a link to submit a weblink. ?>
<?php if ($this->params->get('show_pagination')) : ?>
<div class="com-contact-category__counter w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
@ -211,6 +212,11 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</form>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($canCreate) : ?>
<?php echo HTMLHelper::_('weblinkicon.create', $this->category, $this->category->params); ?>
<?php endif; ?>
</form>
</div>

View File

@ -60,14 +60,16 @@ $params = $this->state->get('params');
<?php echo $this->form->renderField('description'); ?>
<?php echo $this->form->renderField('image_first', 'images'); ?>
<?php echo $this->form->renderField('float_first', 'images'); ?>
<?php echo $this->form->renderField('image_first_alt', 'images'); ?>
<?php echo $this->form->renderField('float_first_alt_empty', 'images'); ?>
<?php echo $this->form->renderField('image_first_alt_empty', 'images'); ?>
<?php echo $this->form->renderField('float_first', 'images'); ?>
<?php echo $this->form->renderField('image_first_caption', 'images'); ?>
<?php echo $this->form->renderField('image_second', 'images'); ?>
<?php echo $this->form->renderField('float_second', 'images'); ?>
<?php echo $this->form->renderField('image_second_alt', 'images'); ?>
<?php echo $this->form->renderField('float_second_alt_empty', 'images'); ?>
<?php echo $this->form->renderField('image_second_alt_empty', 'images'); ?>
<?php echo $this->form->renderField('float_second', 'images'); ?>
<?php echo $this->form->renderField('image_second_caption', 'images'); ?>
<?php if ($captchaEnabled) : ?>

View File

@ -16,25 +16,24 @@ COM_WEBLINKS_ERROR_CATEGORY_NOT_FOUND="Web Link category not found."
COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another Web Link from this category has the same alias (remember it may be a trashed item)."
COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND="Web Link not found."
COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID="Invalid Web link URL."
COM_WEBLINKS_FIELD_CATEGORY_DESC="You must select a Category."
COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for your Web link."
COM_WEBLINKS_FIELD_FIRST_LABEL="First Image"
COM_WEBLINKS_FIELD_IMAGE_ALT_EMPTY_DESC="Decorative Image - no description required"
COM_WEBLINKS_FIELD_IMAGE_ALT_EMPTY_LABEL="No Description"
COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL="Alt Text"
COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL="Caption"
COM_WEBLINKS_FIELD_LANGUAGE_DESC="Assign a language to this web link."
COM_WEBLINKS_FIELD_CAPTION_LABEL="Caption First Image"
COM_WEBLINKS_FIELD_MODIFIED_DESC="The date and time the link was last modified."
COM_WEBLINKS_FIELD_SECOND_DESC="The second image to be displayed."
COM_WEBLINKS_FIELD_SECOND_LABEL="Second Image"
COM_WEBLINKS_FILTER_LABEL="Filter Field"
COM_WEBLINKS_FILTER_SEARCH_DESC="Web Links filter search"
COM_WEBLINKS_FIELD_TITLE_DESC="Your Web Link must have a Title."
COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL."
COM_WEBLINKS_FIELD_URL_LABEL="URL"
COM_WEBLINKS_FLOAT_FIRST_DESC="Controls placement of the first image."
COM_WEBLINKS_FLOAT_FIRST_LABEL="First Image Float"
COM_WEBLINKS_FLOAT_SECOND_DESC="Controls placement of the second image."
COM_WEBLINKS_FLOAT_SECOND_LABEL="Second Image Float"
COM_WEBLINKS_FLOAT_LEFT="Left"
COM_WEBLINKS_FLOAT_NONE="COM_WEBLINKS_FLOAT_NONE"
COM_WEBLINKS_FLOAT_RIGHT="Right"
COM_WEBLINKS_FORM_CREATE_WEBLINK="Submit a Web Link"
COM_WEBLINKS_GRID_TITLE="Title"
COM_WEBLINKS_LINK="Web Link"