Commit 550d72fe authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon
Browse files

Refactor tag page styling (bug: 1465107)

Change-Id: Id1f33a00eadd44757344c26b3e9a249bfe290a00
behatnotneeded: styling only
parent 34806edc
......@@ -239,7 +239,12 @@ class ArtefactTypeAnnotation extends ArtefactType {
}
public static function get_links($id) {
return array();
$annotation = new ArtefactTypeAnnotation($id);
require_once(get_config('libroot') . 'view.php');
$v = new View($annotation->get('view'));
return array(
'_default' => $v->get_url(),
);
}
public function get_view_url($viewid, $showcomment=true, $full=true) {
......
......@@ -3848,13 +3848,15 @@ function build_portfolio_search_html(&$data) {
foreach ($data->data as &$item) {
$item->ctime = format_date($item->ctime);
if ($item->type == 'view') {
$item->typestr = get_string('view');
$item->typestr = 'file';
$item->typelabel = get_string('view');
$v = new View(0, (array)$item);
$v->set('dirty', false);
$item->url = $v->get_url();
}
else if ($item->type == 'collection') {
$item->typestr = get_string('Collection', 'collection');
$item->typestr = 'folder-open';
$item->typelabel = get_string('Collection', 'collection');
$c = new Collection(0, (array)$item);
$item->url = $c->get_url();
}
......@@ -3862,11 +3864,16 @@ function build_portfolio_search_html(&$data) {
safe_require('artefact', $artefacttypes[$item->artefacttype]->plugin);
$links = call_static_method(generate_artefact_class_name($item->artefacttype), 'get_links', $item->id);
$item->url = $links['_default'];
$item->typestr = $item->artefacttype;
if ($item->artefacttype == 'task') {
$item->typestr = get_string('Task', 'artefact.plans');
$item->typestr = 'tasks';
$item->typelabel = get_string('Task', 'artefact.plans');
}
else {
$item->typestr = get_string($item->artefacttype, 'artefact.' . $artefacttypes[$item->artefacttype]->plugin);
if ($item->artefacttype == 'plan') {
$item->typestr = 'plans';
}
$item->typelabel = get_string($item->artefacttype, 'artefact.' . $artefacttypes[$item->artefacttype]->plugin);
}
}
}
......
......@@ -222,7 +222,9 @@
.mytags {
margin-top: 25px;
.tagfreq.badge {
background-color: $brand-primary;
color: inherit;
border: 1px solid $brand-primary;
background-color: transparent;
}
.tag {
margin-right: 10px;
......@@ -233,6 +235,8 @@
font-weight: bold;
color: $gray;
.badge {
border: 1px solid transparent;
color: #ffffff;
background-color: $gray;
}
}
......@@ -241,12 +245,10 @@
margin-top: -41px;
}
.tag-filters {
@extend .clearfix;
background-color: #f5f5f5;
padding: 10px 15px;
}
.tag-type {
font-size: $font-size-large;
}
// reset the padding when the individual font file is collapsed in font install
.individualfiles.form-group {
......
......@@ -89,7 +89,9 @@
.icon-plans:before {
content: $fa-var-check-square-o;
}
.icon-tasks:before {
content: $fa-var-tasks;
}
.icon-recentforumposts:before {
content: $fa-var-comments;
}
......
{foreach from=$data item=result}
<div class="{cycle name=rows values='r0,r1'} list-group-item">
<div class="list-group-item">
<div class="row">
<div class="col-md-8">
{if $result->typestr == 'Page'}
<span class="icon icon-lg text-default pull-left mts icon-file"></span>
{elseif $result->typestr == 'Journal entry'}
<span class="icon icon-lg text-default pull-left mts icon-blogpost"></span>
{elseif $result->typestr == 'Collection'}
<span class="icon icon-lg text-default pull-left mts icon-folder-open"></span>
{elseif $result->typestr == 'Image'}
<span class="icon icon-lg text-default pull-left mts icon-picture-o"></span>
{elseif $result->typestr == 'Folder'}
<span class="icon icon-lg text-default pull-left mts icon-folder"></span>
{elseif $result->typestr == 'Plan'}
<span class="icon icon-lg text-default pull-left mts icon-plans"></span>
{elseif $result->typestr == 'Note'}
<span class="icon icon-lg text-default pull-left mts icon-textbox"></span>
{else}
<span class="icon icon-lg text-default pull-left mts icon-tag"></span>
{/if}
<h3 class="list-group-item-heading title"><a href="{$result->url}" class="mls">{$result->title}</a> <span class="tag-type">({$result->typestr})</span></h3>
<h3 class="list-group-item-heading title text-inline">
<span class="icon left pull-left icon-{$result->typestr}"></span>
<a href="{$result->url}">{$result->title}</a>
</h3>
<span class="tag-type text-lighttone">({$result->typelabel})</span>
<p class="mbs">{$result->ctime}</p>
<p class="mbs">{$result->description|str_shorten_html:100|strip_tags|safe}</p>
<p class="mbs">
{$result->description|str_shorten_html:100|strip_tags|safe}
</p>
</div>
<div class="col-md-4">
{if $result->tags}
<div class="tags">{str tag=tags}: {list_tags tags=$result->tags owner=$owner}</div>
{/if}
{if $result->tags}
<div class="tags">
<strong>{str tag=tags}: </strong>
{list_tags tags=$result->tags owner=$owner}
</div>
{/if}
</div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment