Commit f101aac5 authored by Toni Gardiner's avatar Toni Gardiner Committed by Robert Lyon

Bug 1465107: STORY#17694-tags-page

behatnotneeded

Change-Id: I78a04afe5face76730dbd463facd5b7570ee2a39
parent 9e21fc53
......@@ -31,6 +31,7 @@ if ($tag = param_variable('tag', null)) {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn-success',
'value' => get_string('submit'),
),
),
......@@ -42,6 +43,7 @@ if ($tag = param_variable('tag', null)) {
'submit' => array(
'type' => 'submit',
'value' => get_string('delete'),
'class' => 'btn-danger',
'confirm' => get_string('confirmdeletetag'),
),
),
......
......@@ -3832,14 +3832,12 @@ function build_portfolio_search_html(&$data) {
$item->ctime = format_date($item->ctime);
if ($item->type == 'view') {
$item->typestr = get_string('view');
$item->icon = $THEME->get_image_url('page');
$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->icon = $THEME->get_image_url('collection');
$c = new Collection(0, (array)$item);
$item->url = $c->get_url();
}
......@@ -3847,7 +3845,6 @@ 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->icon = call_static_method(generate_artefact_class_name($item->artefacttype), 'get_icon', array('id' => $item->id));
if ($item->artefacttype == 'task') {
$item->typestr = get_string('Task', 'artefact.plans');
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -156,3 +156,33 @@
padding: 15px 15px 0;
background-color: rgba($brand-default, 0.2);
}
// Tag result page
.mytags {
margin-top: 25px;
.tagfreq.badge {
background-color: $brand-primary;
}
.tag {
margin-right: 10px;
}
}
.mytags .selected,
.tag-results .selected {
font-weight: bold;
color: $gray;
.badge {
background-color: $gray;
}
}
.tag-results .btn-top-right {
margin-right: -1px;
margin-top: -41px;
}
.tag-filters {
background-color: #f5f5f5;
padding: 10px 15px;
}
.tag-type {
font-size: $font-size-large;
}
// Extra icons to fit db defiend tyopes (cf pagebuilder)
.icon {
&.right {
padding-left: 5px;
}
&.left {
padding-right: 5px;
}
}
.icon-placeholder {
opacity:0;
......
......@@ -140,12 +140,12 @@ blockquote {
.lead,
.lead p {
font-size: floor(($font-size-base * 1.15));
font-size: floor(($font-size-base * 1.10));
font-weight: 300;
line-height: 1.4;
@media (min-width: $screen-sm-min) {
font-size: ($font-size-base * 1.4);
font-size: ($font-size-base * 1.2);
}
&.text-small {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{include file="header.tpl"}
{if $tags}
<div class="rbuttons"><a class="btn" href="{$WWWROOT}tags.php">{str tag=mytags}</a></div>
<div class="edittags mytags">
<h3>{str tag=selectatagtoedit}:</h3>
{foreach from=$tags item=t}
<a class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}edittags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq">({$t->count})</span></a>
{/foreach}
</div>
<div class="text-right btn-top-right btn-group btn-group-top">
<a class="btn btn-default" href="{$WWWROOT}tags.php"><span class="icon icon-lg icon-tag left"></span>{str tag=mytags}</a>
</div>
<h2>{str tag=selectatagtoedit}:</h2>
<div class="mytags">
<ul class="list-unstyled">
{foreach from=$tags item=t}
<li class="text-inline"><a id="tag:{$t->tag|urlencode|safe}" class="tag mrm{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}edittags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq badge">{$t->count}</span></a></li>
{/foreach}
</ul>
</div>
{else}
<div>{str tag=youhavenottaggedanythingyet}</div>
{/if}
{if $tag}
<div class="edittag">
<h3>{str tag=edittag arg1=$tagsearchurl arg2=$tag}</h3>
<div class="detail">{str tag=edittagdescription arg1=$tag}</div>
{$edittagform|safe}
<div class="edittag list-group-item">
<h3 class="list-group-item-heading"><span class="icon icon-pencil mrm"></span>{str tag=edittag arg1=$tagsearchurl arg2=$tag}</h3>
<div class="lead text-small">{str tag=edittagdescription arg1=$tag}</div>
{$edittagform|safe}
</div>
<div class="deletetag">
<h3>{str tag=deletetag arg1=$tagsearchurl arg2=$tag}</h3>
<div class="detail">{str tag=deletetagdescription}</div>
{$deletetagform|safe}
<div class="deletetag list-group-item">
<h3 class="list-group-item-heading"><span class="icon icon-trash mrm text-danger"></span>{str tag=deletetag arg1=$tagsearchurl arg2=$tag}</h3>
<div class="lead text-small">{str tag=deletetagdescription}</div>
{$deletetagform|safe}
</div>
{/if}
......
......@@ -53,6 +53,7 @@
</div>
<div class="clearfix">
</div>
</div>
</footer><!-- footer-wrap -->
......
{foreach from=$data item=result}
<div class="{cycle name=rows values='r0,r1'} listrow">
<div class="listrowright">
<div class="icon-container s">{if $result->icon}<img src="{$result->icon}" alt="{$result->typestr}">{/if}</div>
<h3 class="title"><a href="{$result->url}">{$result->title}</a><span class="filetype"> ({$result->typestr})</span></h3>
<div class="postedon">{$result->ctime}</div>
<div class="detail">{$result->description|str_shorten_html:100|strip_tags|safe}</div>
{if $result->tags}
<div class="tags">{str tag=tags}: {list_tags tags=$result->tags owner=$owner}</div>
{/if}
{foreach from=$data item=result}
<div class="{cycle name=rows values='r0,r1'} list-group-item">
<div class="row">
<div class="col-sm-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>
<p class="mbs">{$result->ctime}</p>
<p class="mbs">{$result->description|str_shorten_html:100|strip_tags|safe}</p>
</div>
<div class="col-sm-4">
{if $result->tags}
<div class="tags">{str tag=tags}: {list_tags tags=$result->tags owner=$owner}</div>
{/if}
</div>
</div>
</div>
{/foreach}
{/foreach}
\ No newline at end of file
{include file="header.tpl"}
{if $tags}
<div class="rbuttons"><a class="btn" href="{$WWWROOT}edittags.php">{str tag=edittags}</a></div>
<div class="tabswrap"><ul class="in-page-tabs">
{foreach from=$tagsortoptions key=tagsortfield item=selectedsort name=tagsortoptions}
<li{if $selectedsort} class="current-tab"{/if}><a href="{$WWWROOT}tags.php?ts={$tagsortfield}"{if $selectedsort} class="current-tab"{/if}>{str tag=sort$tagsortfield}<span class="accessible-hidden sr-only">({str tag=tab}{if $selectedsort} {str tag=selected}{/if})</span></a></li>
{/foreach}
</ul></div>
<div class="subpage mytags">
{foreach from=$tags item=t}
<a id="tag:{$t->tag|urlencode|safe}" class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}tags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq">({$t->count})</span></a>
{/foreach}
</div>
{else}
<div>{str tag=youhavenottaggedanythingyet}</div>
{/if}
<div id="results_container" class="rel tag-results">
<h2 id="results_heading">{str tag=searchresultsfor} <a class="tag" href="{$WWWROOT}tags.php{if $tag}{$results->queryprefix}tag={$tag|urlencode|safe}{/if}">{if $tag}{$tag|str_shorten_text:50}{else}{str tag=alltags}{/if}</a></h2>
<div class="rbuttons"><a class="btn edit-tag{if !$tag} hidden{/if}" href="{$WWWROOT}edittags.php?tag={$tag|urlencode|safe}">{str tag=editthistag}</a></div>
<div id="results_sort">
<strong>{str tag=sortresultsby}</strong>
{foreach from=$results->sortcols item=sortfield name=sortcols}
<a href="{$results->baseurl}{$results->queryprefix}type={$results->filter}&sort={$sortfield}"{if $results->sort == $sortfield} class="selected"{/if}>{str tag=$sortfield}</a>{if !$.foreach.sortcols.last} <span class="sep">|</span>{/if}
{/foreach}
<div class="text-right btn-top-right btn-group btn-group-top">
<a class="btn btn-default" href="{$WWWROOT}edittags.php"><span class="icon icon-lg icon-pencil left"></span>{str tag=edittags}</a>
</div>
<ul class="nav nav-tabs">
{foreach from=$tagsortoptions key=tagsortfield item=selectedsort name=tagsortoptions}
<li{if $selectedsort} class="active"{/if}><a href="{$WWWROOT}tags.php?ts={$tagsortfield}"{if $selectedsort} class="current-tab"{/if}>{str tag=sort$tagsortfield}<span class="accessible-hidden sr-only">({str tag=tab}{if $selectedsort} {str tag=selected}{/if})</span></a></li>
{/foreach}
</ul>
<div class="mytags">
<ul class="list-unstyled">
{foreach from=$tags item=t}
<li class="text-inline"><a id="tag:{$t->tag|urlencode|safe}" class="tag {if $t->tag == $tag}selected{/if}" href="{$WWWROOT}tags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq badge">{$t->count}</span></a></li>
{/foreach}
</ul>
</div>
<div id="results_container" class="panel panel-default tag-results">
<h2 id="results_heading" class="panel-heading">{str tag=searchresultsfor}
<a class="tag secondary-link" href="{$WWWROOT}tags.php{if $tag}{$results->queryprefix}tag={$tag|urlencode|safe}{/if}">{if $tag}{$tag|str_shorten_text:50}{else}{str tag=alltags}{/if}</a>
</h2>
<div class="text-right btn-top-right btn-group btn-group-top">
<a class="btn btn-default edit-tag{if !$tag} hidden{/if}" href="{$WWWROOT}edittags.php?tag={$tag|urlencode|safe}"><span class="icon icon-pencil left"></span>{str tag=editthistag}</a>
</div>
<div id="resultswrap">
<div id="results_filter">
<strong class="filtertitle">{str tag=filterresultsby}</strong>
{foreach from=$results->filtercols key=filtername item=filterdisplay name=filtercols}
<div class="filtername"><a href="{$results->baseurl}{$results->queryprefix}sort={$results->sort}&type={$filtername}"{if $results->filter == $filtername} class="selected"{/if}>{$filterdisplay}</a></div>
{/foreach}
<div class="tag-filters">
<div id="results_sort" class="pull-right">
<strong>{str tag=sortresultsby}</strong>
{foreach from=$results->sortcols item=sortfield name=sortcols}
<a href="{$results->baseurl}{$results->queryprefix}type={$results->filter}&sort={$sortfield}"{if $results->sort == $sortfield} class="selected"{/if}>{str tag=$sortfield}</a>{if !$.foreach.sortcols.last} <span class="sep">|</span>{/if}
{/foreach}
</div>
<div id="results" class="tablerenderer fullwidth listing">
{if $results->data}
{$results->tablerows|safe}
{/if}
<div class="btn-group">
<button type="button" class="btn btn-default select-title dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="icon icon-filter left"></span>
<span class="sr-only">{str tag=filterresultsby}</span>
{foreach from=$results->filtercols key=filtername item=filterdisplay name=filtercols}
<span {if $results->filter != $filtername} class="hidden"{/if}>{$filterdisplay}</span>
{/foreach}
<span class="icon icon-caret-down right"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$results->filtercols key=filtername item=filterdisplay name=filtercols}
<li>
<a href="{$results->baseurl}{$results->queryprefix}sort={$results->sort}&type={$filtername}"{if $results->filter == $filtername} class="selected"{/if}>{$filterdisplay}</a>
</li>
{/foreach}
</ul>
</div>
{$results->pagination|safe}
<div class="cb"></div>
</div>
<div id="results" class="list-group">
{if $results->data}
{$results->tablerows|safe}
{/if}
</div>
</div>
{$results->pagination|safe}
{else}
<div class="no-results">{str tag=youhavenottaggedanythingyet}</div>
{/if}
{include file="footer.tpl"}
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