Доработал страницу с профилем пользователя - вывод списка написанных статей

This commit is contained in:
Krivchikov Dmitry 2015-09-25 17:19:52 +03:00
parent 55d7b7bb40
commit 0be5e530ed
13 changed files with 49 additions and 25 deletions

View File

@ -24,21 +24,14 @@ class UserController extends Controller
self::addScript('/js/jquery-ui-1.10.4.custom.min.js');
self::addScript('/js/bootstrap.min.js');
self::addScript('/js/leaflet-0.7.3.js');
self::addScript('http://api-maps.yandex.ru/2.0/?load=package.map&lang=ru-RU');
self::addScript('/js/leaflet.markercluster.js');
self::addScript('/js/app.js?ver=' . App::getConfig('version'));
self::addScript('/js/mapPoint.js?ver=' . App::getConfig('version'));
self::addScript('http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js');
self::addStyle('/css/style.css?ver=' . App::getConfig('version'));
self::addStyle('/css/pageStyle.css?ver=' . App::getConfig('version'));
self::addStyle('/css/user.css?ver=' . App::getConfig('version'));
self::addStyle('/css/bootstrap.min.css');
self::addStyle('/css/bootstrap-theme.min.css');
self::addStyle('http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css');
self::addStyle('/css/leaflet-0.7.3.css');
self::addStyle('/css/MarkerCluster.css');
self::addStyle('/css/MarkerCluster.Default.css');
$articles = Article::model()->getAll(array('where'=>'`author`='.(int)$user->id));

View File

@ -1,27 +1,45 @@
<div id="pageSmoothBackground" style="background-image: url(<?= $randomPoint->getImg('middle') ?>);"></div>
<div class="container" style="background-color: rgba(255,255,255, 0.8);margin-top: -10px;padding-bottom: 30px;">
<div class="container darkHeader">
<div class="topDiv">
Персональный блог пользователя
</div>
<div class="userPic">
<img src="/img/avatars/<?= $user->id ?>.jpg"> <?= $user->nick ?>
</div>
<div class="socialNetworks">
В социальных сетях: <a href="<?= $user->nick ?>" target="_blank"><img src="/img/social/<?= $user->network ?>.png" /></a>
<br/><br/>
Создано точек: <b><?= $user->getPointsCount() ?></b>
</div>
</div>
<div class="container lightBody">
<div class="row">
<div class="col-md-12">
<h1 style="text-align: right;"><?= $user->nick ?> <img src="/img/avatars/<?= $user->id ?>.jpg"></h1>
<div style="text-align: justify;">
<h2>Общая информация</h2>
Имя: <b><?= $user->name ?></b><br/>
Ссылка на профиль с соц. сети: <a href="<?= $user->profile?>" target="_blank"><?= $user->network?></a><br/>
Создано точек: <b><?= $user->getPointsCount() ?></b><br/>
<div class="col-md-12 articlesList">
<h2>Статьи: </h2>
<?php if ($articles): foreach ($articles as $article): ?>
<b><a href="/article/<?= $article->id ?>" target="_blank"><?= $article->title ?></a></b><br/>
<div class="article">
<a href="/article/<?= $article->id ?>" target="_blank" class="h">
<?php if($article->photoId): ?>
<img src="<?= $article->getImg() ?>" />
<?php else: ?>
<img src="/img/noPhoto200150.png" />
<?php endif; ?>
</a>
<a href="/article/<?= $article->id ?>" target="_blank" class="h"><?= $article->title ?></a>
<?= mb_substr(Markdown::getClear(str_replace('"', 'ʺ', $article->text)), 0, 250, 'UTF-8') ?>
<a class="" href="/article/<?= $article->id ?>" role="button"><nobr> читать далее »</nobr></a>
<div class="clear"></div>
</div>
<?php endforeach;
else: ?>
Пока нет статей.
<?php endif;?>
</div>
</div>
</div>
<hr/>
<hr style="margin-bottom: 50px;"/>
<!--googleoff: all-->
<!--noindex-->
<div class="row">

13
public/css/user.css Normal file
View File

@ -0,0 +1,13 @@
.darkHeader {background-color: rgba(55,55,55, 0.8);margin-top: -10px; padding: 150px 50px; color: #fff; text-align: center;}
.darkHeader .topDiv {font-size: 20px;}
.darkHeader .userPic {font-size: 70px; font-family: Ubuntu, inherit;}
.darkHeader .userPic img {height: 70px; border-radius: 5px;}
.darkHeader .socialNetworks {margin-top: 10px;}
.darkHeader .socialNetworks img {height: 30px; margin: 0 5px;}
.lightBody {background-color: rgba(255,255,255, 0.8);margin-top: 0px;padding-bottom: 30px;}
.articlesList {}
.articlesList .article {border: solid 1px #ddd; border-radius: 3px; padding: 4px; margin-bottom: 5px;background-color: rgba(255,255,255, 0.8);}
.articlesList .article img {width: 100px; float: left; margin-right: 10px;}
.articlesList .article .h {font-size: 18px; font-weight: bold; display: block;}

BIN
public/img/social/e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
public/img/social/lj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
public/img/social/ok.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
public/img/social/r.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB