Skip to content

Commit

Permalink
Improve style for custom fields edit on base BS2
Browse files Browse the repository at this point in the history
Improve style for custom fields edit on base BS2
  • Loading branch information
trungch committed Sep 6, 2017
1 parent ae8e33f commit a1b8664
Show file tree
Hide file tree
Showing 57 changed files with 3,385 additions and 1,198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand All @@ -15,18 +15,25 @@
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p> <?php echo JText::_('COM_CONTACT_NO_ARTICLES'); ?> </p>
<p> <?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?> </p>
<?php else : ?>

<form action="<?php echo htmlspecialchars(JFactory::getURI()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('show_pagination_limit')) : ?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="filters">
<legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>

<?php if ($this->params->get('filter_field')) : ?>
<div class="btn-group">
<label class="filter-search-lbl element-invisible" for="filter-search"><span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span><?php echo JText::_('COM_CONTACT_FILTER_LABEL') . '&#160;'; ?></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();" title="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>&#160;
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<table class="category">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand All @@ -26,7 +26,7 @@
<?php echo JText::_('COM_USERS_PROFILE_USERNAME_LABEL'); ?>
</dt>
<dd>
<?php echo htmlspecialchars($this->data->username); ?>
<?php echo htmlspecialchars($this->data->username, ENT_COMPAT, 'UTF-8'); ?>
</dd>
<dt>
<?php echo JText::_('COM_USERS_PROFILE_REGISTERED_DATE_LABEL'); ?>
Expand All @@ -38,7 +38,7 @@
<?php echo JText::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
</dt>

<?php if ($this->data->lastvisitDate != JFactory::getDbo()->getNullDate()): ?>
<?php if ($this->data->lastvisitDate != $this->db->getNullDate()) : ?>
<dd>
<?php echo JHtml::_('date', $this->data->lastvisitDate); ?>
</dd>
Expand Down
85 changes: 53 additions & 32 deletions source/plg_system_t3/base/html/com_users/profile/default_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,66 @@
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::register('users.spacer', array('JHtmlUsers', 'spacer'));

$fieldsets = $this->form->getFieldsets();
if (isset($fieldsets['core'])) unset($fieldsets['core']);
if (isset($fieldsets['params'])) unset($fieldsets['params']);

foreach ($fieldsets as $group => $fieldset): // Iterate through the form fieldsets
$fields = $this->form->getFieldset($group);
if (count($fields)):
if (isset($fieldsets['core']))
{
unset($fieldsets['core']);
}

if (isset($fieldsets['params']))
{
unset($fieldsets['params']);
}

$tmp = isset($this->data->jcfields) ? $this->data->jcfields : array();
$customFields = array();

foreach ($tmp as $customField)
{
$customFields[$customField->name] = $customField;
}
?>
<fieldset id="users-profile-custom" class="users-profile-custom-<?php echo $group;?>">
<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.?>
<legend><?php echo JText::_($fieldset->label); ?></legend>
<?php endif;?>
<dl class="dl-horizontal">
<?php foreach ($fields as $field):
if (!$field->hidden) :?>
<dt><?php echo $field->title; ?></dt>
<dd>
<?php if (JHtml::isRegistered('users.'.$field->id)):?>
<?php echo JHtml::_('users.'.$field->id, $field->value);?>
<?php elseif (JHtml::isRegistered('users.'.$field->fieldname)):?>
<?php echo JHtml::_('users.'.$field->fieldname, $field->value);?>
<?php elseif (JHtml::isRegistered('users.'.$field->type)):?>
<?php echo JHtml::_('users.'.$field->type, $field->value);?>
<?php else:?>
<?php echo JHtml::_('users.value', $field->value);?>
<?php endif;?>
</dd>
<?php endif;?>
<?php endforeach;?>
</dl>
</fieldset>
<?php endif;?>
<?php endforeach;?>
<?php foreach ($fieldsets as $group => $fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
<?php if (count($fields)) : ?>
<fieldset id="users-profile-custom-<?php echo $group; ?>" class="users-profile-custom-<?php echo $group; ?>">
<?php if (isset($fieldset->label) && ($legend = trim(JText::_($fieldset->label))) !== '') : ?>
<legend><?php echo $legend; ?></legend>
<?php endif; ?>
<?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
<p><?php echo $this->escape(JText::_($fieldset->description)); ?></p>
<?php endif; ?>
<dl class="dl-horizontal">
<?php foreach ($fields as $field) : ?>
<?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
<dt><?php echo $field->title; ?></dt>
<dd>
<?php if (key_exists($field->fieldname, $customFields)) : ?>
<?php echo $customFields[$field->fieldname]->value ?: JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->id)) : ?>
<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
<?php elseif (JHtml::isRegistered('users.' . $field->type)) : ?>
<?php echo JHtml::_('users.' . $field->type, $field->value); ?>
<?php else : ?>
<?php echo JHtml::_('users.value', $field->value); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@

defined('_JEXEC') or die;

JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php');
JHtml::register('users.spacer', array('JHtmlUsers', 'spacer'));
JHtml::register('users.helpsite', array('JHtmlUsers', 'helpsite'));
JHtml::register('users.templatestyle', array('JHtmlUsers', 'templatestyle'));
JHtml::register('users.admin_language', array('JHtmlUsers', 'admin_language'));
JHtml::register('users.language', array('JHtmlUsers', 'language'));
JHtml::register('users.editor', array('JHtmlUsers', 'editor'));
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');


?>
<?php $fields = $this->form->getFieldset('params'); ?>
Expand Down
100 changes: 100 additions & 0 deletions source/plg_system_t3/base/less/frontend-edit.less
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,104 @@ fieldset.radio.btn-group {
content: "\f03e";
}
}
}

// Extrafield
// -----------------------
.edit.item-page,
.profile-edit {
#jform_com_fields_checkboxs {
label.checkbox {
display: inline-block;
margin-right: 10px;
}

input[type="checkbox"] {
margin-left: 0;
margin-top: -2px;
position: relative;
vertical-align: middle;
width: auto;
}
}

.minicolors-input {
height: 28px;
width: auto;
}
}

// Edit profile
// -----------------------
.profile-edit {
#jform_com_fields_user_checkbox {
label.checkbox {
display: inline-block;
margin-right: 10px;
}

input {
position: relative;
margin-left: 0;
margin-right: 5px;
width: auto;
}
}

.minicolors-input {
height: 28px;
width: auto;
}

#jform_com_fields_user_image_chzn {
.chzn-search {
box-sizing: border-box;
}

ul.chzn-results {
box-sizing: border-box;
padding: 0;
margin: 0;
width: 100%;
}
}

#jform_com_fields_user_calendar {
float: left;
}

.chzn-container-single,
.chzn-container {
float: left;
margin-right: 10px;

@media screen and (max-width: 360px) {
width: 100% !important;
}

.chzn-drop {
box-sizing: border-box !important;
}
}
}


// User profile
// ----------------------
.profile {
#users-profile-core {
width: 100%;
}

.dl-horizontal {
dd {
margin-bottom: 10px;
border-bottom: 1px dashed #ddd;
padding-bottom: 10px;

img {
max-width: 100%;
}
}
}
}
Loading

0 comments on commit a1b8664

Please sign in to comment.