1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

Мелкие доработки и исправления

This commit is contained in:
Denis Shakhov 2014-03-04 15:26:29 +07:00
parent eaed2364bc
commit 9d372bee46
9 changed files with 129 additions and 92 deletions

View file

@ -68,11 +68,10 @@ class ActionBlogs extends Action {
/**
* Получаем из реквеста первые буквы блога
*/
if ($sTitle=getRequestStr('blog_title')) {
if ($sTitle=getRequestStr('sText')) {
$sTitle=str_replace('%','',$sTitle);
}
if (!$sTitle) {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
} else {
$this->Viewer_AssignAjax('bShowOriginal',true);
return;
}
/**
@ -85,7 +84,9 @@ class ActionBlogs extends Action {
$oViewer=$this->Viewer_GetLocalViewer();
$oViewer->Assign('aBlogs',$aResult['collection']);
$oViewer->Assign('oUserCurrent',$this->User_GetUserCurrent());
$oViewer->Assign('sBlogsEmptyList',$this->Lang_Get('blogs_search_empty'));
$oViewer->Assign('sBlogsEmptyList',$this->Lang_Get('search.alerts.empty'));
$oViewer->Assign('bIsSearch', true);
$oViewer->Assign('iSearchCount', count($aResult['collection']));
$this->Viewer_AssignAjax('sText',$oViewer->Fetch("actions/ActionBlogs/blog_list.tpl"));
}

View file

@ -0,0 +1,69 @@
/**
* Активность
*
* @module ls/activity
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
var ls = ls || {};
ls.activity = (function ($) {
"use strict";
/**
* Дефолтные опции
*
* @private
*/
var _defaults = {
};
/**
* Инициализация
*
* @param {Object} options Опции
*/
this.init = function(options) {
var _this = this;
this.options = $.extend({}, _defaults, options);
// Настройки
$('.js-activity-settings-toggle').on('click', function () {
_this.toggleEvent($(this).data('type'));
});
// Подгрузка контента
$.each([ 'all', 'user', 'custom' ], function (iIndex, sValue) {
$('.js-more-activity-' + sValue).more({
url: aRouter['stream'] + 'get_more_' + sValue,
target: '#activity-event-list',
afterload: function (e, data) {
data.context.element.data('param-s-date-last', data.response.sDateLast);
}
});
});
};
/**
*
*/
this.toggleEvent = function (sType) {
var sUrl = aRouter['stream'] + 'switchEventType/',
oParams = {'type': sType};
ls.hook.marker('switchEventTypeBefore');
ls.ajax.load(sUrl, oParams, function(oResponse) {
if ( ! oResponse.bStateError) {
ls.msg.notice(oResponse.sMsgTitle, oResponse.sMsg);
ls.hook.run('ls_stream_switch_event_type_after',[oParams, oResponse]);
}
});
};
return this;
}).call(ls.activity || {}, jQuery);

View file

@ -204,10 +204,12 @@ ls.comments = (function ($) {
* Добавляет комментарий
*/
this.add = function(oForm, iTargetId, sTargetType) {
this.formLock();
var oData = oForm.serializeJSON();
ls.utils.formLock(oForm);
this.previewHide();
ls.ajax.load(this.options.type[sTargetType].url_add, oForm.serializeJSON(), function(oResponse) {
ls.ajax.load(this.options.type[sTargetType].url_add, oData, function(oResponse) {
if (oResponse.bStateError) {
ls.msg.error(null, oResponse.sMsg);
} else {
@ -217,7 +219,7 @@ ls.comments = (function ($) {
ls.hook.run('ls_comments_add_after', [oForm, iTargetId, sTargetType, oResponse]);
}
this.formUnlock();
ls.utils.formUnlock(oForm);
}.bind(this));
};
@ -376,22 +378,6 @@ ls.comments = (function ($) {
this.elements.container.find(this.options.selectors.preview).remove();
};
/**
* Разблокировывает форму
*/
this.formLock = function() {
this.elements.form.text.prop('readonly', true);
this.elements.form.submit.prop('disabled', true);
};
/**
* Блокирует форму
*/
this.formUnlock = function() {
this.elements.form.text.prop('readonly', false);
this.elements.form.submit.prop('disabled', false);
};
/**
* Показывает/скрывает форму комментирования
*
@ -402,7 +388,7 @@ ls.comments = (function ($) {
this.previewHide();
if (this.iFormTargetId == iCommentId && this.elements.form.form.is(':visible')) {
this.elements.form.form.detach();
this.elements.form.form.hide();
this.iFormTargetId = null;
return;
}

View file

@ -31,7 +31,7 @@
<div class="blog">
<header class="blog-header">
{* Голосование *}
{include 'vote.tpl'
{include 'vote.tpl'
sVoteType = 'blog'
sVoteClasses = 'vote-large vote-white'
oVoteObject = $oBlog
@ -63,20 +63,20 @@
{* Управление *}
{if $oUserCurrent && $bUserIsAdministrator}
{$aActionbarItems = [ [ 'icon' => 'icon-edit icon-white', 'url' => "{router page='blog'}edit/{$oBlog->getId()}/", 'text' => $aLang.common.edit ] ]}
{$aActionbarItems = [ [ 'icon' => 'icon-edit', 'url' => "{router page='blog'}edit/{$oBlog->getId()}/", 'text' => $aLang.common.edit ] ]}
{if $oUserCurrent->isAdministrator()}
{$aActionbarItems[] = [
'icon' => 'icon-trash icon-white',
'attributes' => 'data-type="modal-toggle" data-modal-target="modal-blog-delete"',
'icon' => 'icon-trash',
'attributes' => 'data-type="modal-toggle" data-modal-target="modal-blog-delete"',
'text' => $aLang.common.remove
]}
{else}
{$aActionbarItems[] = [
'icon' => 'icon-trash icon-white',
'url' => "{router page='blog'}delete/{$oBlog->getId()}/?security_ls_key={$LIVESTREET_SECURITY_KEY}",
'icon' => 'icon-trash',
'url' => "{router page='blog'}delete/{$oBlog->getId()}/?security_ls_key={$LIVESTREET_SECURITY_KEY}",
'classes' => 'js-blog-remove',
'text' => $aLang.common.remove
'text' => $aLang.common.remove
]}
{/if}

View file

@ -42,7 +42,7 @@
{* Кнопки *}
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_talk_add' sFieldStyle='primary' sFieldText=$aLang.talk_create_submit}
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_preview' sFieldType='button' sFieldText=$aLang.topic_create_submit_save sFieldAttributes='onclick="jQuery(\'#text_preview\').show(); ls.tools.textPreview(\'talk_text\',false); return false;"'}
{include 'forms/fields/form.field.button.tpl' sFieldName='submit_preview' sFieldType='button' sFieldText=$aLang.common.preview_text sFieldAttributes='onclick="jQuery(\'#text_preview\').show(); ls.utils.textPreview($(\'#talk_text\'), $(\'#text_preview\'), false); return false;"'}
</form>
{hook run='talk_add_end'}

View file

@ -3,39 +3,34 @@
*
* @template actions/ActionBlog/blog.tpl
* @scripts <frontend>/common/js/blog.js
*
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
.blog {
.blog {
width: 100%;
padding: 40px;
margin: -40px 0 15px -40px;
margin: -40px 0 40px -40px;
overflow: hidden;
background: #222;
color: rgba(255, 255, 255, .7);
background: #fff;
border-bottom: 1px solid #eee;
}
/* Хидер */
.blog-header { position: relative; padding: 0 0 15px 0; }
.blog-header { position: relative; padding: 0 0 15px 0; }
.blog-header .blog-title { margin-bottom: 7px; color: #fff; }
.blog-header .blog-title { margin-bottom: 7px; }
.blog-header .blog-title i { position: relative; top: -2px; vertical-align: middle; }
.blog-header .vote { position: absolute; top: -15px; right: 0; }
.blog .actionbar { margin-bottom: 0; background: #444; border-color: #555; margin-top: 30px; margin-bottom: 0; }
.blog .actionbar-item-link { color: #ddd; }
.blog .actionbar-item-link:hover { background: #555; }
/* Контент */
.blog .actionbar { margin-bottom: 0; margin-top: 30px; }
.blog-description { margin-bottom: 20px; }
.blog-info-item { margin-bottom: 5px; }
.blog-info-item:last-child { margin-bottom: 0; }
.blog-info-item-label { opacity: .6; }
/**
* Список блогов

View file

@ -53,10 +53,6 @@
.search-form-submit { border: none; position: absolute; top: 7px; right: 7px; cursor: pointer; opacity: .7; filter: alpha(opacity=70); }
.search-form-submit:hover { opacity: 1; filter: alpha(opacity=100); }
.search-form-alphabet { margin-top: 10px; overflow: hidden; }
.search-form-alphabet li { float: left; margin-right: 10px; }
.search-form-alphabet li.active a { color: #333; border: none; }
/**
* Форма авторизации

View file

@ -4,30 +4,25 @@
* @styles css/blocks.css
*}
{extends file='blocks/block.aside.base.tpl'}
{extends 'blocks/block.aside.base.tpl'}
{block name='block_title'}{$aLang.stream_block_config_title}{/block}
{block name='block_type'}activity{/block}
{block 'block_title'}{$aLang.stream_block_config_title}{/block}
{block 'block_type'}activity{/block}
{block name='block_content'}
{block 'block_content'}
{if $oUserCurrent}
<small class="note">{$aLang.stream_settings_note_filter}</small>
<ul class="activity-settings-filter">
{foreach $aStreamEventTypes as $sType => $aEventType}
{if ! ($oConfig->get('module.stream.disable_vote_events') && substr($sType, 0, 4) == 'vote')}
<li>
<label>
<input type="checkbox"
id="strn_et_{$sType}"
{if in_array($sType, $aStreamTypesList)}checked{/if}
onclick="ls.stream.switchEventType('{$sType}')" />
{$langKey = "stream_event_type_`$sType`"}
{$aLang.$langKey}
</label>
</li>
{/if}
{/foreach}
</ul>
<small class="note mb-15">{$aLang.stream_settings_note_filter}</small>
{foreach $aStreamEventTypes as $sType => $aEventType}
{if ! ($oConfig->get('module.stream.disable_vote_events') && substr($sType, 0, 4) == 'vote')}
{$sLangKey = "stream_event_type_`$sType`"}
{include 'forms/fields/form.field.checkbox.tpl'
sFieldInputClasses = 'js-activity-settings-toggle'
sFieldInputAttributes = "data-type=\"{$sType}\""
bFieldChecked = in_array($sType, $aStreamTypesList)
sFieldLabel = $aLang.$sLangKey}
{/if}
{/foreach}
{/if}
{/block}

View file

@ -4,28 +4,23 @@
* @styles css/blocks.css
*}
{extends file='blocks/block.aside.base.tpl'}
{extends 'blocks/block.aside.base.tpl'}
{block name='block_title'}{$aLang.userfeed_block_blogs_title}{/block}
{block name='block_type'}activity{/block}
{block 'block_title'}{$aLang.userfeed_block_blogs_title}{/block}
{block 'block_type'}activity{/block}
{block name='block_content'}
<small class="note">{$aLang.userfeed_settings_note_follow_blogs}</small>
{block 'block_content'}
<small class="note mb-15">{$aLang.userfeed_settings_note_follow_blogs}</small>
{if count($aUserfeedBlogs)}
<ul class="stream-settings-blogs">
{foreach $aUserfeedBlogs as $oBlog}
{$iBlogId = $oBlog->getId()}
<li><input class="userfeedBlogCheckbox input-checkbox"
type="checkbox"
{if isset($aUserfeedSubscribedBlogs.$iBlogId)} checked{/if}
onClick="if (jQuery(this).prop('checked')) { ls.userfeed.subscribe('blogs',{$iBlogId}) } else { ls.userfeed.unsubscribe('blogs',{$iBlogId}) } " />
<a href="{$oBlog->getUrlFull()}">{$oBlog->getTitle()|escape:'html'}</a>
</li>
{/foreach}
</ul>
{if $aUserfeedBlogs}
{foreach $aUserfeedBlogs as $oBlog}
{include 'forms/fields/form.field.checkbox.tpl'
sFieldInputClasses = 'js-userfeed-subscribe'
sFieldInputAttributes = "data-id=\"{$oBlog->getId()}\""
bFieldChecked = isset($aUserfeedSubscribedBlogs[$oBlog->getId()])
sFieldLabel = "<a href=\"{$oBlog->getUrlFull()}\">{$oBlog->getTitle()|escape}</a>"}
{/foreach}
{else}
{include file='alert.tpl' mAlerts=$aLang.userfeed_no_blogs sAlertStyle='info'}
{include 'alert.tpl' mAlerts=$aLang.userfeed_no_blogs sAlertStyle='info'}
{/if}
{/block}