1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 09:24:25 +03:00

Доработка стены и блоков

This commit is contained in:
Denis Shakhov 2012-03-22 22:18:34 +07:00
parent c599d955e3
commit daf5b07072
23 changed files with 393 additions and 294 deletions

View file

@ -21,6 +21,7 @@ ls.wall = (function ($) {
if (result.bStateError) {
ls.msg.error(null, result.sMsg);
} else {
$('.js-wall-reply-parent-text').val('');
this.loadNew();
ls.hook.run('ls_wall_add_after',[sText, iPid, result]);
}
@ -28,18 +29,17 @@ ls.wall = (function ($) {
return false;
};
this.addReply = function(sText) {
this.addReply = function(sText, iPid) {
var url = aRouter['profile']+this.options.login+'/wall/add/';
var params = {sText: sText, iPid: this.iIdForReply};
var params = {sText: sText, iPid: iPid};
'*addReplyBefore*'; '*/addReplyBefore*';
ls.ajax(url, params, function(result) {
if (result.bStateError) {
ls.msg.error(null, result.sMsg);
} else {
$('#wall-reply-text').val('');
$('#wall-reply-form').hide();
this.loadReplyNew(this.iIdForReply);
ls.hook.run('ls_wall_addreply_after',[sText, this.iIdForReply, result]);
$('.js-wall-reply-text').val('');
this.loadReplyNew(iPid);
ls.hook.run('ls_wall_addreply_after',[sText, iPid, result]);
}
}.bind(this));
return false;
@ -154,14 +154,12 @@ ls.wall = (function ($) {
};
this.toggleReply = function(iId) {
var reply=$('#wall-reply-form');
if (iId==this.iIdForReply) {
reply.toggle();
} else {
reply.insertAfter($('#wall-button-reply-'+iId));
reply.show();
this.iIdForReply=iId;
}
$('#wall-item-' + iId + ' .wall-submit-reply').toggle();
return false;
};
this.expandReply = function(iId) {
$('#wall-item-' + iId + ' .wall-submit-reply').addClass('active');
return false;
};
@ -173,3 +171,14 @@ ls.wall = (function ($) {
return this;
}).call(ls.wall || {},jQuery);
jQuery(document).ready(function($){
$(document).click(function() {
$('.wall-submit-reply.active').removeClass('active');
});
$('body').on("click", ".wall-submit-reply", function(e) {
e.stopPropagation();
});
});

View file

@ -19,7 +19,7 @@
<form class="wall-submit">
<label for="wall-text">Написать на стене:</label>
<p><textarea rows="4" id="wall-text" class="input-text input-width-full"></textarea></p>
<p><textarea rows="4" id="wall-text" class="input-text input-width-full js-wall-reply-parent-text"></textarea></p>
<button type="button" onclick="ls.wall.add(jQuery('#wall-text').val(),0);" class="button button-primary">Отправить</button>
</form>
@ -35,11 +35,5 @@
{/if}
<form id="wall-reply-form" class="wall-submit wall-submit-reply" style="display: none;">
<p><textarea rows="4" id="wall-reply-text" class="input-text input-width-full"></textarea></p>
<button type="button" onclick="ls.wall.addReply(jQuery('#wall-reply-text').val());" class="button button-primary">Отправить</button>
</form>
{include file='footer.tpl'}

View file

@ -15,9 +15,11 @@
{$oWall->getText()}
</div>
{if !$aReplyWall}
<ul class="comment-actions">
<li></li>
<li><a href="#" class="link-dotted" onclick="return ls.wall.toggleReply({$oWall->getId()});">Ответить</a></li>
</ul>
{/if}
</div>
@ -34,6 +36,10 @@
{/if}
</div>
<a href="#" id="wall-button-reply-{$oWall->getId()}" onclick="return ls.wall.toggleReply({$oWall->getId()});" class="link-dotted">Ответить</a>
<form class="wall-submit wall-submit-reply" {if !$aReplyWall}style="display: none"{/if}>
<textarea rows="4" id="wall-reply-text-{$oWall->getId()}" class="input-text input-width-full js-wall-reply-text" placeholder="Ответить..." onclick="return ls.wall.expandReply({$oWall->getId()});"></textarea>
<button type="button" onclick="ls.wall.addReply(jQuery('#wall-reply-text-{$oWall->getId()}').val(), {$oWall->getId()});" class="button button-primary">Отправить</button>
</form>
</div>
{/foreach}

View file

@ -1,7 +1,10 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.talk_blacklist_title}</h3>
</header>
<div class="block-content">
<form onsubmit="return ls.talk.addToBlackList();">
<p><label for="talk_blacklist_add">{$aLang.talk_balcklist_add_label}:</label>
<input type="text" id="talk_blacklist_add" name="add" class="input-text input-width-full autocomplete-users" /></p>
@ -17,4 +20,5 @@
</ul>
{/if}
</div>
</div>
</section>

View file

@ -1,7 +1,9 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.talk_filter_title}</h3>
</header>
<div class="block-content">
<form action="{router page='talk'}" method="GET" name="talk_filter_form">
<p><label for="talk_filter_sender">{$aLang.talk_filter_label_sender}:</label>
<input type="text" id="talk_filter_sender" name="sender" value="{$_aRequest.sender}" class="input-text input-width-full" />
@ -17,4 +19,5 @@
<input type="submit" name="submit_talk_filter" value="{$aLang.talk_filter_submit}" class="button" />
</form>
</div>
</section>

View file

@ -1,6 +1,10 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.block_friends}</h3>
</header>
<div class="block-content">
{if $aUsersFriend}
<ul class="list" id="friends">
{foreach from=$aUsersFriend item=oFriend}
@ -18,4 +22,5 @@
{else}
<div class="notice-empty">{$aLang.block_friends_empty}</div>
{/if}
</div>
</section>

View file

@ -1,6 +1,10 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.talk_speaker_title}</h3>
</header>
<div class="block-content">
{if $oTalk->getUserId()==$oUserCurrent->getId() or $oUserCurrent->isAdministrator()}
<form onsubmit="return ls.talk.addToTalk({$oTalk->getId()});">
<p><label for="talk_speaker_add">{$aLang.talk_speaker_add_label}:</label>
@ -26,4 +30,5 @@
</ul>
{/if}
</div>
</div>
</section>

View file

@ -1,10 +1,20 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.block_blog_info}</h3>
</header>
<div class="block-content">
<p id="block_blog_info"></p>
</div>
</section>
<section class="block">
<header class="block-header">
<h3>{$aLang.block_blog_info_note}</h3>
</header>
<div class="block-content">
<p>{$aLang.block_blog_info_note_text}</p>
</div>
</section>

View file

@ -1,7 +1,10 @@
<div class="block" id="block_blogs">
<header class="block-header">
<h3>{$aLang.block_blogs}</h3>
</header>
<div class="block-content">
<ul class="nav nav-pills">
<li id="block_blogs_item_top" class="active"><a href="#">{$aLang.block_blogs_top}</a></li>
{if $oUserCurrent}
@ -11,7 +14,7 @@
</ul>
<div class="block-content" id="block_blogs_content">
<div id="block_blogs_content">
{$sBlogsTop}
</div>
@ -19,4 +22,5 @@
<footer>
<a href="{router page='blogs'}">{$aLang.block_blogs_all}</a>
</footer>
</div>
</div>

View file

@ -1,7 +1,10 @@
<section class="block block-type-stream" id="block_stream">
<header class="block-header">
<h3><a href="{router page='comments'}" title="{$aLang.block_stream_comments_all}">{$aLang.block_stream}</a></h3>
</header>
<div class="block-content">
<ul class="nav nav-pills">
<li id="block_stream_item_comment" class="active"><a href="#">{$aLang.block_stream_comments}</a></li>
<li id="block_stream_item_topic"><a href="#">{$aLang.block_stream_topics}</a></li>
@ -10,8 +13,9 @@
</ul>
<div class="block-content" id="block_stream_content">
<div id="block_stream_content">
{$sStreamComments}
</div>
</div>
</section>

View file

@ -14,7 +14,11 @@
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.stream_block_config_title}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.stream_settings_note_filter}</small>
<ul class="activity-settings-filter">
@ -34,12 +38,17 @@
{/if}
{/foreach}
</ul>
</div>
</section>
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.stream_block_users_title}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.stream_settings_note_follow_user}</small>
<p><input type="text" id="stream_users_complete" autocomplete="off" class="input-text input-width-200" />
@ -65,12 +74,17 @@
<ul id="stream_block_users_list"></ul>
<p id="stream_no_subscribed_users">{$aLang.stream_no_subscribed_users}</p>
{/if}
</div>
</section>
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.stream_block_users_friends}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.stream_settings_note_follow_friend}</small>
{if count($aStreamFriends)}
@ -89,5 +103,6 @@
{else}
<small class="note">{$aLang.stream_no_subscribed_users}</small>
{/if}
</div>
</section>
{/if}

View file

@ -1,6 +1,10 @@
<section class="block">
<header class="block-header">
<h3>{$aLang.block_tags}</h3>
</header>
<div class="block-content">
{if $aTags}
<ul class="tag-cloud">
{foreach from=$aTags item=oTag}
@ -8,6 +12,7 @@
{/foreach}
</ul>
{else}
<div class="block-empty">{$aLang.block_empty_no_tags}</div>
<div class="notice-empty">{$aLang.block_empty_no_tags}</div>
{/if}
</div>
</section>

View file

@ -1,11 +1,16 @@
{if $aCityList && count($aCityList)>0}
<section class="block">
<header class="block-header">
<h3>{$aLang.block_city_tags}</h3>
</header>
<div class="block-content">
<ul class="tag-cloud">
{foreach from=$aCityList item=aCity}
<li><a class="tag-size-{$aCity.size}" href="{router page='people'}city/{$aCity.name|escape:'url'}/">{$aCity.name|escape:'html'}</a></li>
{/foreach}
</ul>
</div>
</section>
{/if}

View file

@ -1,11 +1,16 @@
{if $aCountryList && count($aCountryList)>0}
<section class="block">
<header class="block-header">
<h3>{$aLang.block_country_tags}</h3>
</header>
<div class="block-content">
<ul class="tag-cloud">
{foreach from=$aCountryList item=aCountry}
<li><a class="tag-size-{$aCountry.size}" href="{router page='people'}country/{$aCountry.name|escape:'url'}/">{$aCountry.name|escape:'html'}</a></li>
{/foreach}
</ul>
</div>
</section>
{/if}

View file

@ -1,6 +1,10 @@
{if $oUserCurrent}
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.userfeed_block_blogs_title}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.userfeed_settings_note_follow_blogs}</small>
{if count($aUserfeedBlogs)}
@ -16,7 +20,8 @@
{/foreach}
</ul>
{else}
<small class="note">{$aLang.userfeed_no_blogs}</small>
<small class="notice-empty">{$aLang.userfeed_no_blogs}</small>
{/if}
</div>
</section>
{/if}

View file

@ -14,7 +14,11 @@
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.userfeed_block_users_title}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.userfeed_settings_note_follow_user}</small>
<div class="stream-settings-userlist">
@ -41,12 +45,17 @@
<ul id="userfeed_block_users_list"></ul>
{/if}
</div>
</div>
</section>
<section class="block block-type-activity">
{if count($aUserfeedFriends)}
<section class="block block-type-activity">
<header class="block-header">
<h3>{$aLang.userfeed_block_users_friends}</h3>
</header>
<div class="block-content">
<small class="note">{$aLang.userfeed_settings_note_follow_friend}</small>
<ul class="stream-settings-friends max-height-200">
@ -62,6 +71,7 @@
</li>
{/foreach}
</ul>
{/if}
</div>
</section>
{/if}
{/if}

View file

@ -6,12 +6,14 @@
}
<div class="comments" id="comments">
{if $bAllowSubscribe and $oUserCurrent}
<input {if $oSubscribeComment and $oSubscribeComment->getStatus()}checked="checked"{/if} type="checkbox" id="comment_subscribe" onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);"> &mdash; <label for="comment_subscribe">{$aLang.comment_subscribe}</label>
{/if}
<header class="comments-header">
<h3>{$iCountComment} {$iCountComment|declension:$aLang.comment_declension:'russian'}</h3>
{if $bAllowSubscribe and $oUserCurrent}
<input {if $oSubscribeComment and $oSubscribeComment->getStatus()}checked="checked"{/if} type="checkbox" id="comment_subscribe" class="input-checkbox" onchange="ls.subscribe.toggle('{$sTargetType}_new_comment','{$iTargetId}','',this.checked);">
<label for="comment_subscribe">{$aLang.comment_subscribe}</label>
{/if}
<a name="comments"></a>
</header>

View file

@ -2,17 +2,18 @@
БЛОКИ
------------------------------------------------------------------- */
.block { padding: 20px; background: #fafafa; margin-bottom: 15px; border-radius: 3px; }
.block { background: #fafafa; margin-bottom: 30px; border-radius: 3px; }
.block h3 { font-size: 20px; line-height: 1em; font-weight: normal; margin-bottom: 20px; }
.block h3 a { text-decoration: none; }
.block .block-header { padding: 13px 20px; background: #EAF6F9; border-bottom: 1px solid #D2E8EF; position: relative; }
.block .block-header h3 { font-size: 16px; line-height: 1em; font-weight: normal; }
.block .block-header h3 a { text-decoration: none; }
.block footer { margin-top: 15px; font-size: 12px; }
.block .block-content { padding: 20px; }
.block .max-height-200 { overflow: auto; max-height: 200px; _height: expression( this.scrollHeight > 200 ? "200px" : "auto" ); position: relative; }
/* Block Type - Activity Settings */
.block.block-type-activity h3 { margin-bottom: 7px; }
.block.block-type-activity p { margin-bottom: 15px; }
.block.block-type-activity ul li { margin-bottom: 5px; }
.block.block-type-activity .note { display: block; margin-bottom: 15px; color: #aaa; }

View file

@ -4,7 +4,7 @@
/* Блок с комментариями */
.comments-header { margin-bottom: 20px; }
.comments-header h3 { font-size: 24px; }
.comments-header h3 { font-size: 24px; margin-bottom: 5px; }
.comments { margin-bottom: 30px; }

View file

@ -168,6 +168,8 @@
.ta-r { text-align: right !important; }
.va-m { vertical-align: middle; }
.hidden { display: none; }
.user, .ls-user { font-weight: bold; color: #333; }
.user .icon-user { margin-right: 3px; }
.user.inactive { color: #aaa; }

View file

@ -8,7 +8,7 @@
.topic .topic-header .topic-url { margin-bottom: 15px; }
.topic .topic-header .topic-url a { background: #eee; border-radius: 3px; padding: 3px 10px 4px; text-decoration: none; }
.topic .topic-header .topic-info { margin-bottom: 25px; color: #777; }
.topic .topic-header .topic-info time { margin-right: 15px; }
.topic .topic-header .topic-info a { margin-right: 15px; }
/* Content */
.topic .topic-content { margin-bottom: 15px; }

View file

@ -3,11 +3,16 @@
-------------------------------------------- */
.wall-submit { margin-bottom: 30px; }
.wall-submit.wall-submit-reply { margin: 10px 0 10px 25px; }
.wall-submit.wall-submit-reply { margin: 2px 0 2px 25px; padding: 7px; background: #fafafa; }
.wall-submit.wall-submit-reply textarea { height: 28px; margin: 0; }
.wall-submit.wall-submit-reply button { display: none; }
.wall-submit.wall-submit-reply.active textarea { height: 80px; margin-bottom: 5px; }
.wall-submit.wall-submit-reply.active button { display: inline-block; }
.wall-submit p { margin-bottom: 5px; }
.comments.wall,
.wall .comment { margin-bottom: 2px; }
.wall .comment-content { margin-bottom: 0; }
.comment.wall-comment-reply { min-height: 0; padding-left: 48px; }
.comment.wall-comment-reply .comment-avatar { width: 30px; height: 30px; }

View file

@ -30,10 +30,10 @@
<div class="topic-info">
<a href="{$oBlog->getUrlFull()}" class="topic-blog">{$oBlog->getTitle()|escape:'html'}</a>
<time datetime="{date_format date=$oTopic->getDateAdd() format='c'}" pubdate title="{date_format date=$oTopic->getDateAdd() format='j F Y, H:i'}">
{date_format date=$oTopic->getDateAdd() format="j F Y, H:i"}
</time>
<a href="{$oBlog->getUrlFull()}" class="topic-blog">{$oBlog->getTitle()|escape:'html'}</a>
</div>
</header>