1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 16:04:24 +03:00

Доработка компонента user

* Блок с информацией о пользователе вынесен в отдельный файл info-group.tpl
* Мелкие исправления
This commit is contained in:
Denis Shakhov 2014-08-08 23:21:31 +07:00
parent 2787f4cccc
commit b74fa35a5b
7 changed files with 222 additions and 137 deletions

View file

@ -18,19 +18,5 @@
{block 'layout_content' append} {block 'layout_content' append}
{include 'navs/nav.user.info.tpl'} {include 'navs/nav.user.info.tpl'}
{include 'components/user/info.tpl'} {include 'components/user/info.tpl'}
{**
* Стена
*}
<h2 class="header-table mt-30">{lang name='wall.title'}</h2>
{insert name='block' block='wall' params=[
'classes' => 'js-wall-default',
'user_id' => $oUserProfile->getId()
]}
{hook run='profile_whois_item_end' oUserProfile=$oUserProfile}
{hook run='user_info_end' oUserProfile=$oUserProfile}
{/block} {/block}

View file

@ -40,8 +40,6 @@ h6 { font-size: 18px; }
.page-header { color: #333; font-size: 30px; line-height: 1em; margin-bottom: 20px; } .page-header { color: #333; font-size: 30px; line-height: 1em; margin-bottom: 20px; }
.page-header span { color: #aaa; } .page-header span { color: #aaa; }
.header-table { margin-bottom: 0; border-bottom: 1px solid #eee; padding-bottom: 5px; font-size: 14px; font-weight: bold; }
/** /**
* Шапка сайта * Шапка сайта

View file

@ -58,10 +58,18 @@
/** /**
* Large (User, Blog) * Large (User, Blog)
*/ */
.vote--large .vote-heading { text-transform: uppercase; text-align: right; font-size: 11px; margin-bottom: 5px; } .vote--large .vote-heading {
text-transform: uppercase;
text-align: right;
font-size: 11px;
margin-bottom: 5px;
font-family: Arial;
color: #aaa;
}
.vote--large .vote-rating { font: 300 30px/1em 'Open Sans'; text-align: right; } .vote--large .vote-rating { font: 300 30px/1em 'Open Sans'; text-align: right; }
.vote--large .vote-item-up, .vote--large .vote-item-up,
.vote--large .vote-item-down { top: 7px; } .vote--large .vote-item-down { top: 7px; }
.vote--large.vote--count-positive .vote-rating { color: #333; }
/** /**

View file

@ -69,8 +69,28 @@
* О себе * О себе
*/ */
.profile-info-about { .profile-info-about {
padding: 20px; padding: 20px 25px;
margin-bottom: 30px; margin-bottom: 30px;
background: #f7f7f7; background: #f7f7f7;
color: #000; color: #000;
border-radius: 5px;
} }
/**
* Блок с информацией
*/
.user-info-group { margin-bottom: 50px; }
.user-info-group:last-child { margin-bottom: 0; }
.user-info-group-title {
font-size: 20px;
border-bottom: 1px solid #eee;
padding-bottom: 10px;
color: #555;
}
/* Список */
.user-info-group-items .info-list-item-label { width: 150px; }
.user-info-group-items .info-list-item { margin-bottom: 15px; }
.user-info-group-items .info-list-item-content { font-weight: normal; }

View file

@ -0,0 +1,21 @@
{**
* Блок с информацией
*}
{$component = 'user-info-group'}
{if $smarty.local.html || $smarty.local.items}
<div class="{$component} {mod name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {$smarty.local.attributes}>
<h3 class="user-info-group-title">
{$smarty.local.title}
</h3>
<div class="user-info-group-content">
{if $smarty.local.html}
{$smarty.local.html}
{else}
{include 'components/info_list/info_list.tpl' aInfoList=$smarty.local.items sClasses='user-info-group-items'}
{/if}
</div>
</div>
{/if}

View file

@ -1,4 +1,4 @@
{hook run='user_info_begin' oUserProfile=$oUserProfile} {hook run='user_info_begin' user=$oUserProfile}
{** {**
* Функции * Функции
@ -38,165 +38,217 @@
{** {**
* Личное * Личное
*} *}
{$aUserFieldValues = $oUserProfile->getUserFieldValues(true, array(''))} {$items = []}
{$userfields = $oUserProfile->getUserFieldValues(true, array(''))}
{if $oUserProfile->getProfileSex() != 'other' || $oUserProfile->getProfileBirthday() || $oGeoTarget || $oUserProfile->getProfileAbout() || count($aUserFieldValues)} {* Пол *}
{capture 'info_private'} {if $oUserProfile->getProfileSex() != 'other'}
{* Пол *} {$items[] = [
{if $oUserProfile->getProfileSex() != 'other'} 'label' => {lang name='user.profile.personal.gender'},
{list_item sLabel={lang name='user.profile.personal.gender'} sContent="{if $oUserProfile->getProfileSex() == 'man'}{lang name='user.profile.personal.gender_male'}{else}{lang name='user.profile.personal.gender_female'}{/if}"} 'content' => "{if $oUserProfile->getProfileSex() == 'man'}{lang name='user.profile.personal.gender_male'}{else}{lang name='user.profile.personal.gender_female'}{/if}"
{/if} ]}
{* День рождения *}
{if $oUserProfile->getProfileBirthday()}
{list_item sLabel={lang name='user.profile.personal.birthday'} sContent={date_format date=$oUserProfile->getProfileBirthday() format="j F Y" notz=true}}
{/if}
{* Местоположение *}
{if $oGeoTarget}
{capture 'info_private_geo'}
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
{if $oGeoTarget->getCountryId()}
<a href="{router page='people'}country/{$oGeoTarget->getCountryId()}/" itemprop="country-name">{$oUserProfile->getProfileCountry()|escape}</a>{if $oGeoTarget->getCityId()},{/if}
{/if}
{if $oGeoTarget->getCityId()}
<a href="{router page='people'}city/{$oGeoTarget->getCityId()}/" itemprop="locality">{$oUserProfile->getProfileCity()|escape}</a>
{/if}
</span>
{/capture}
{list_item sLabel={lang name='user.profile.personal.place'} sContent=$smarty.capture.info_private_geo}
{/if}
{* Контакты *}
{if $aUserFieldValues}
{foreach $aUserFieldValues as $oField}
{list_item sLabel="{$oField->getTitle()|escape}" sContent=$oField->getValue(true, true)}
{/foreach}
{/if}
{hook run='profile_whois_privat_item' oUserProfile=$oUserProfile}
{/capture}
{list sTitle={lang name='user.profile.personal.title'} sContent=$smarty.capture.info_private}
{/if} {/if}
{hook run='profile_whois_item_after_privat' oUserProfile=$oUserProfile} {* День рождения *}
{if $oUserProfile->getProfileBirthday()}
{$items[] = [
'label' => {lang name='user.profile.personal.birthday'},
'content' => {date_format date=$oUserProfile->getProfileBirthday() format="j F Y" notz=true}
]}
{/if}
{* Местоположение *}
{if $oGeoTarget}
{capture 'info_private_geo'}
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
{if $oGeoTarget->getCountryId()}
<a href="{router page='people'}country/{$oGeoTarget->getCountryId()}/" itemprop="country-name">{$oUserProfile->getProfileCountry()|escape}</a>{if $oGeoTarget->getCityId()},{/if}
{/if}
{if $oGeoTarget->getCityId()}
<a href="{router page='people'}city/{$oGeoTarget->getCityId()}/" itemprop="locality">{$oUserProfile->getProfileCity()|escape}</a>
{/if}
</span>
{/capture}
{$items[] = [
'label' => {lang name='user.profile.personal.place'},
'content' => $smarty.capture.info_private_geo
]}
{/if}
{* Контакты *}
{if $userfields}
{foreach $userfields as $oField}
{list_item sLabel="{$oField->getTitle()|escape}" sContent=$oField->getValue(true, true)}
{/foreach}
{/if}
{include 'components/user/info-group.tpl' title={lang name='user.profile.personal.title'} items=$items}
{** {**
* Контакты * Контакты
*} *}
{$aUserFieldContactValues = $oUserProfile->getUserFieldValues(true, array('contact'))} {$items = []}
{$userfields = $oUserProfile->getUserFieldValues(true, array('contact'))}
{if $aUserFieldContactValues} {foreach $userfields as $field}
{capture 'info_contacts'} {$items[] = [
{foreach $aUserFieldContactValues as $oField} 'label' => "<i class=\"icon-contact icon-contact-{$field->getName()}\"></i> {$field->getTitle()|escape}",
{list_item sLabel="<i class=\"icon-contact icon-contact-{$oField->getName()}\"></i> {$oField->getTitle()|escape}" sContent=$oField->getValue(true, true)} 'content' => $field->getValue(true, true)
{/foreach} ]}
{/capture} {/foreach}
{list sTitle={lang name='user.profile.contact'} sContent=$smarty.capture.info_contacts} {include 'components/user/info-group.tpl' title={lang name='user.profile.contact'} items=$items}
{/if}
{** {**
* Соц. сети * Соц. сети
*} *}
{$aUserFieldContactValues = $oUserProfile->getUserFieldValues(true, array('social'))} {$items = []}
{$userfields = $oUserProfile->getUserFieldValues(true, array('social'))}
{if $aUserFieldContactValues} {foreach $userfields as $field}
{capture 'info_social'} {$items[] = [
{foreach $aUserFieldContactValues as $oField} 'label' => "<i class=\"icon-contact icon-contact-{$field->getName()}\"></i> {$field->getTitle()|escape}",
{list_item sLabel="<i class=\"icon-contact icon-contact-{$oField->getName()}\"></i> {$oField->getTitle()|escape}" sContent=$oField->getValue(true, true)} 'content' => $field->getValue(true, true)
{/foreach} ]}
{/capture} {/foreach}
{list sTitle={lang name='user.profile.social_networks'} sContent=$smarty.capture.info_social} {include 'components/user/info-group.tpl' title={lang name='user.profile.social_networks'} items=$items}
{/if}
{hook run='profile_whois_item' oUserProfile=$oUserProfile}
{** {**
* Активность * Активность
*} *}
{capture 'info_activity'} {$items = []}
{if Config::Get('general.reg.invite')}
{* Кто пригласил пользователя *}
{if $oUserInviteFrom}
{list_item sLabel={lang name='user.profile.activity.invited_by'} sContent="<a href=\"{$oUserInviteFrom->getUserWebPath()}\">{$oUserInviteFrom->getDisplayName()}</a>"}
{/if}
{* Приглашенные пользователем *} {if Config::Get('general.reg.invite')}
{if $aUsersInvite} {* Кто пригласил пользователя *}
{foreach $aUsersInvite as $oUserInvite} {if $oUserInviteFrom}
{$sUsers = $sUsers|cat:"<a href=\"{$oUserInvite->getUserWebPath()}\">{$oUserInvite->getDisplayName()}</a>&nbsp;"} {$items[] = [
{/foreach} 'label' => {lang name='user.profile.activity.invited_by'},
'content' => "<a href=\"{$oUserInviteFrom->getUserWebPath()}\">{$oUserInviteFrom->getDisplayName()}</a>"
{list_item sLabel={lang name='user.profile.activity.invited'} sContent=$sUsers} ]}
{/if}
{/if} {/if}
{* Блоги созданные пользователем *} {* Приглашенные пользователем *}
{if $aBlogsOwner} {if $aUsersInvite}
{foreach $aBlogsOwner as $oBlog} {$users = ''}
{$sBlogsOwner = $sBlogsOwner|cat:"<a href=\"{$oBlog->getUrlFull()}\">{$oBlog->getTitle()|escape}</a>{if ! $oBlog@last}, {/if}"}
{foreach $aUsersInvite as $user}
{$users = $users|cat:"<a href=\"{$user->getUserWebPath()}\">{$user->getDisplayName()}</a>&nbsp;"}
{/foreach} {/foreach}
{list_item sLabel={lang name='user.profile.activity.blogs_created'} sContent=$sBlogsOwner} {$items[] = [
'label' => {lang name='user.profile.activity.invited'},
'content' => $users
]}
{/if} {/if}
{/if}
{* Блоги администрируемые пользователем *} {* Блоги созданные пользователем *}
{if $aBlogAdministrators} {if $aBlogsOwner}
{foreach $aBlogAdministrators as $oBlogUser} {$blogs = ''}
{$oBlog = $oBlogUser->getBlog()}
{$sBlogAdministrators = $sBlogAdministrators|cat:"<a href=\"{$oBlog->getUrlFull()}\">{$oBlog->getTitle()|escape}</a>{if ! $oBlogUser@last}, {/if}"}
{/foreach}
{list_item sLabel={lang name='user.profile.activity.blogs_admin'} sContent=$sBlogAdministrators} {foreach $aBlogsOwner as $blog}
{/if} {$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $blog@last}, {/if}"}
{/foreach}
{* Блоги модерируемые пользователем *} {$items[] = [
{if $aBlogModerators} 'label' => {lang name='user.profile.activity.blogs_created'},
{foreach $aBlogModerators as $oBlogUser} 'content' => $blogs
{$oBlog = $oBlogUser->getBlog()} ]}
{$sBlogModerators = $sBlogModerators|cat:"<a href=\"{$oBlog->getUrlFull()}\">{$oBlog->getTitle()|escape}</a>{if ! $oBlogUser@last}, {/if}"} {/if}
{/foreach}
{list_item sLabel={lang name='user.profile.activity.blogs_mod'} sContent=$sBlogModerators} {* Блоги администрируемые пользователем *}
{/if} {if $aBlogAdministrators}
{$blogs = ''}
{* Блоги в которые вступил пользователь *} {foreach $aBlogAdministrators as $user}
{if $aBlogUsers} {$blog = $user->getBlog()}
{foreach $aBlogUsers as $oBlogUser} {$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $user@last}, {/if}"}
{$oBlog = $oBlogUser->getBlog()} {/foreach}
{$sBlogUsers = $sBlogUsers|cat:"<a href=\"{$oBlog->getUrlFull()}\">{$oBlog->getTitle()|escape}</a>{if ! $oBlogUser@last}, {/if}"}
{/foreach}
{list_item sLabel={lang name='user.profile.activity.blogs_joined'} sContent=$sBlogUsers} {$items[] = [
{/if} 'label' => {lang name='user.profile.activity.blogs_admin'},
'content' => $blogs
]}
{/if}
{hook run='profile_whois_activity_item' oUserProfile=$oUserProfile} {* Блоги модерируемые пользователем *}
{if $aBlogModerators}
{$blogs = ''}
{* Дата регистрации *} {foreach $aBlogModerators as $user}
{list_item sLabel={lang name='user.date_registration'} sContent={date_format date=$oUserProfile->getDateRegister()}} {$blog = $user->getBlog()}
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $user@last}, {/if}"}
{/foreach}
{* Дата последнего визита *} {$items[] = [
{if $oSession} 'label' => {lang name='user.profile.activity.blogs_mod'},
{list_item sLabel={lang name='user.date_last_session'} sContent={date_format date=$oSession->getDateLast()}} 'content' => $blogs
{/if} ]}
{/capture} {/if}
{list sTitle={lang name='user.profile.activity.title'} sContent=$smarty.capture.info_activity} {* Блоги в которые вступил пользователь *}
{if $aBlogUsers}
{$blogs = ''}
{foreach $aBlogUsers as $user}
{$blog = $user->getBlog()}
{$blogs = $blogs|cat:"<a href=\"{$blog->getUrlFull()}\">{$blog->getTitle()|escape}</a>{if ! $user@last}, {/if}"}
{/foreach}
{$items[] = [
'label' => {lang name='user.profile.activity.blogs_joined'},
'content' => $blogs
]}
{/if}
{* Дата регистрации *}
{$items[] = [
'label' => {lang name='user.date_registration'},
'content' => {date_format date=$oUserProfile->getDateRegister()}
]}
{* Дата последнего визита *}
{if $oSession}
{$items[] = [
'label' => {lang name='user.date_last_session'},
'content' => {date_format date=$oSession->getDateLast()}
]}
{/if}
{include 'components/user/info-group.tpl' title={lang name='user.profile.activity.title'} items=$items}
{** {**
* Друзья * Друзья
*} *}
{if $aUsersFriend} {if $aUsersFriend}
<h2 class="header-table mb-15"><a href="{$oUserProfile->getUserWebPath()}friends/">{$aLang.user.friends.title}</a> ({$iCountFriendsUser})</h2> {capture 'user_info_friends'}
{include 'components/user_list_avatar/user_list_avatar.tpl' aUsersList=$aUsersFriend}
{/capture}
{include 'components/user_list_avatar/user_list_avatar.tpl' aUsersList=$aUsersFriend} {include 'components/user/info-group.tpl'
title = "<a href=\"{$oUserProfile->getUserWebPath()}friends/\">{$aLang.user.friends.title}</a> ({$iCountFriendsUser})"
html = $smarty.capture.user_info_friends}
{/if} {/if}
{**
* Стена
*}
{capture 'user_info_wall'}
{insert name='block' block='wall' params=[
'classes' => 'js-wall-default',
'user_id' => $oUserProfile->getId()
]}
{/capture}
{include 'components/user/info-group.tpl' title={lang name='wall.title'} html=$smarty.capture.user_info_wall}
{hook run='user_info_end' user=$oUserProfile}

View file

@ -9,5 +9,5 @@
{/block} {/block}
{block 'layout_user_page_title'} {block 'layout_user_page_title'}
{$aLang.settings_menu} {$aLang.user.settings.title}
{/block} {/block}