Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend: com_contact view review #17217

Closed
wants to merge 32 commits into from
Closed

Conversation

zero-24
Copy link
Contributor

@zero-24 zero-24 commented Jul 23, 2017

Summary of Changes

Review frontend com_contact views

Testing Instructions

Install sample testing data and navigate all the com_contact frontend views.

Expected result

All still works

Actual result

The views have cs errors ;)

Documentation Changes Required

None

<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;'; ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt the php part be on new line, like line 39 below

<?php echo $item->event->afterDisplayTitle; ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('show_position_headings')) : ?>
<?php echo $item->con_position; ?><br />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many tabs

<?php echo $item->con_position; ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_email_headings')) : ?>
<?php echo $item->email_to; ?><br />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many tabs

<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings') && !empty ($item->mobile)) : ?>
<?php echo JText::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many tabs

</th>
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings')) : ?>
<th class="item-suburb">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs extra tab

@zero-24
Copy link
Contributor Author

zero-24 commented Jul 23, 2017

Thanks @brianteeman i have just fixed the comments.

<?php if ($this->items[$i]->published == 0) : ?>
<li class="row-fluid system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else : ?>
<li class="row-fluid cat-list-row<?php echo $i % 2; ?>" >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space ?>" >

@zero-24
Copy link
Contributor Author

zero-24 commented Jul 24, 2017

Fixed thanks @Quy

<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<?php if (!isset($this->items[$this->parent->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif; ?>
<div <?php echo $class; ?> >
Copy link
Contributor

@Quy Quy Aug 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before and after <?php echo $class; ?>.

<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : ?>
<?php if (!isset($this->children[$this->category->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add ;

<dd>
<span class="contact-webpage">
<a href="<?php echo $this->contact->webpage; ?>" target="_blank" rel="noopener noreferrer" itemprop="url">
<?php echo JStringPunycode::urlToUTF8($this->contact->webpage); ?></a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent and move </a> to the next line.

<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->pagesTotal > 1)) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space

<?php break; ?>
<?php case 'profile_dob': ?>
<?php echo '<dd>' . JHtml::_('date', $profile->text, JText::_('DATE_FORMAT_LC4'), false) . '</dd>'; ?>
<?php break; ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent

@Heggi93
Copy link

Heggi93 commented Aug 21, 2017

I have not tested this item.

No errors found


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17217.

@Heggi93
Copy link

Heggi93 commented Aug 21, 2017

I have tested this item ✅ successfully on 48824b1

No errors found


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17217.

<?php if (!isset($this->items[$this->parent->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif; ?>
<div<?php echo $class; ?>>
<?php $class = ''; ?>
<h3 class="page-header item-title">
<a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
Copy link
Contributor

@Quy Quy Aug 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent and move </a> to next line. Do the same for line 34.

@ghost
Copy link

ghost commented Aug 27, 2017

@zero-24 can you please Update Instruction which Codestyle-Errors are meant so Tester know what to look for?

<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_page_heading') != 0 ) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space after 0

<?php endif; ?>
<?php if ($this->params->get('show_country_headings')) : ?>
<td class="item-state" itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="addressCountry"><?php echo $item->country; ?></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into multiple lines? If yes, do the same in the above lines?

@zero-24
Copy link
Contributor Author

zero-24 commented Aug 29, 2017

@franz-wohlkoenig please explain what you want from me? I'm a bit lost with your comment? :(

</h2>
</div>
<?php endif; ?>

<?php $show_contact_category = $tparams->get('show_contact_category'); ?>

<?php if ($show_contact_category === 'show_no_link') : ?>
<h3>
<span class="contact-category"><?php echo $this->contact->category_title; ?></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines. Same for lines 49-50.

<?php echo $this->loadTemplate('address'); ?>

<?php if ($tparams->get('allow_vcard')) : ?>
<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS'); ?>
<a href="<?php echo JRoute::_('index.php?option=com_contact&amp;view=contact&amp;id=' . $this->contact->id . '&amp;format=vcf'); ?>">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? This line looks good to me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 105: Indent and move </a> to the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -8,37 +8,34 @@
*/

defined('_JEXEC') or die;

?>
<?php if (JPluginHelper::isEnabled('user', 'profile')) :
$fields = $this->item->profile->getFieldset('profile'); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style

<?php echo '<dt>' . $profile->label . '</dt>'; ?>
<?php $profile->text = htmlspecialchars($profile->value, ENT_COMPAT, 'UTF-8'); ?>
<?php switch ($profile->id) :
case 'profile_website': ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first switch case can not be written different sadly :(

@Quy
Copy link
Contributor

Quy commented Aug 31, 2017

I have tested this item ✅ successfully on 2efc080

Code review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17217.

@zero-24
Copy link
Contributor Author

zero-24 commented Nov 7, 2017

Same here I'm closing this as it is conflicting and this is going to be moved against 4.0-dev in a later PR. Thanks @Quy , @franz-wohlkoenig , @Heggi93 & @brianteeman your comments they are not going to be missing. I'm going to implement as much as possible directly in the new PR. Thanks for all the work on the reviews 👍 ❤️

@zero-24 zero-24 closed this Nov 7, 2017
@zero-24 zero-24 deleted the com_contact branch November 7, 2017 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants