Commit 47196f0a authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1847168: inbox search tabs styling

- same for outbox search

behatnotneeded

Change-Id: Idc308dc622e4a5f0fcf8a512713997a421b2c22d
parent f8ced5f7
......@@ -282,18 +282,22 @@ $searchdata = new stdClass();
$searchdata->searchtext = $searchtext;
$searchdata->searcharea = $searcharea;
$searchdata->searchurl = 'inbox.php?type=' . $type . '&search=' . $searchtext . '&searcharea=';
$searchdata->all_count = 0;
$searchdata->sender_count = 0;
$searchdata->recipient_count = 0;
$searchdata->sub_count = 0;
$searchdata->mes_count = 0;
$searchdata->tabs = array();
if ($searchtext !== null) {
$searchresults = get_message_search($searchtext, $type, 0, null, "inbox.php", $USER->get('id'));
$searchdata->all_count = $searchresults['All_data']['count'];
$searchdata->sender_count = $searchresults['Sender']['count'];
$searchdata->recipient_count = $searchresults['Recipient']['count'];
$searchdata->sub_count = $searchresults['Subject']['count'];
$searchdata->mes_count = $searchresults['Message']['count'];
unset($searchresults['Recipient']);
foreach ($searchresults as $section => $value) {
$term = new stdClass();
$term->name = $section;
$term->count = $value['count'];
switch ($section) {
case 'All_data': $term->tag = 'labelall'; break;
case 'Sender': $term->tag = 'fromuser'; break;
case 'Subject': $term->tag = 'subject'; break;
case 'Message': $term->tag = 'labelmessage';
}
$searchdata->tabs[] = $term;
}
}
$smarty->assign('searchdata', $searchdata);
$smarty->assign('deleteall', $deleteall);
......
......@@ -51,3 +51,4 @@ $string['labelall'] = 'All';
$string['labelmessage'] = 'Message';
$string['multirecipientnotificationnotenabled'] = 'The module "multirecipientnotifications" needs to be installed and be active. If you are upgrading Mahara from a version older than 16.10.0, please upgrade to that point first and make sure the module is installed and active by visiting "Administration menu" → "Extensions" → "Plugin administration".';
$string['subject'] = 'Subject';
......@@ -210,18 +210,22 @@ $searchdata = new stdClass();
$searchdata->searchtext = $searchtext;
$searchdata->searcharea = $searcharea;
$searchdata->searchurl = 'outbox.php?type=' . $type . '&search=' . $searchtext . '&searcharea=';
$searchdata->all_count = 0;
$searchdata->sender_count = 0;
$searchdata->recipient_count = 0;
$searchdata->sub_count = 0;
$searchdata->mes_count = 0;
$searchdata->tabs = array();
if ($searchtext !== null) {
$searchresults = get_message_search($searchtext, $type, 0, 9999999, "outbox.php", $USER->get('id'));
$searchdata->all_count = $searchresults['All_data']['count'];
$searchdata->sender_count = $searchresults['Sender']['count'];
$searchdata->recipient_count = $searchresults['Recipient']['count'];
$searchdata->sub_count = $searchresults['Subject']['count'];
$searchdata->mes_count = $searchresults['Message']['count'];
unset($searchresults['Sender']);
foreach ($searchresults as $section => $value) {
$term = new stdClass();
$term->name = $section;
$term->count = $value['count'];
switch ($section) {
case 'All_data': $term->tag = 'labelall'; break;
case 'Subject': $term->tag = 'subject'; break;
case 'Message': $term->tag = 'labelmessage'; break;
case 'Recipient': $term->tag = 'touser';
}
$searchdata->tabs[] = $term;
}
}
$smarty->assign('searchdata', $searchdata);
$smarty->assign('deleteall', $deleteall);
......
<form action="{$boxtype}.php" method="post" class="pieform form-inline with-heading">
<div>
<label>{str section='module.multirecipientnotification' tag='labelsearch'}</label>
<label class="inline-label">{str section='module.multirecipientnotification' tag='labelsearch'}</label>
<input type="text" name="search" id="search" autofocus="autofocus" value="{$searchdata->searchtext}">
<input type="hidden" name="searcharea" value="All_data">
<button type="submit" name="buttonsubmit" class="btn-primary submitcancel submit btn">{str tag='go'}</button>
</div>
{if $searchdata->searchtext}
<div>
<div>
<span class="accessible-hidden">{str section='activity' tag='messagetype'}</span>
{if $searchdata->all_count > 0}
<a class="{if $searchdata->searcharea === 'All_data'}filtered{/if}" href="{$searchdata->searchurl}All_data">
{/if}
{str section='module.multirecipientnotification' tag='labelall'}{if $searchdata->all_count > 0} <span class="countresults">({$searchdata->all_count})</span>{/if}
{if $searchdata->all_count > 0}
</a>
{/if}
</div>
<div>
{if $searchdata->sender_count > 0}
<a class="{if $searchdata->searcharea === 'Sender'}filtered{/if}" href="{$searchdata->searchurl}Sender">
{/if}
{str section='module.multirecipientnotification' tag='fromuser'}{if $searchdata->sender_count > 0} <span class="countresults">({$searchdata->sender_count})</span>{/if}
{if $searchdata->sender_count > 0}
</a>
{/if}
</div>
<div>
{if $searchdata->sub_count > 0}
<a class="{if $searchdata->searcharea === 'Subject'}filtered{/if}" href="{$searchdata->searchurl}Subject">
{/if}
{str section='activity' tag='subject'}{if $searchdata->sub_count > 0} <span class="countresults"> ({$searchdata->sub_count})</span>{/if}
{if $searchdata->sub_count > 0}
</form>
{if $searchdata->searchtext}
<div class="notifications-tabswrap">
<span class="accessible-hidden sr-only">{str section='activity' tag='messagetype'}</span>
<ul class="in-page-tabs searchtab nav nav-tabs">
{foreach from=$searchdata->tabs item=term}
<li class="{if $searchdata->searcharea === $term->name}current-tab active{/if}">
{if $term->count > 0}
<a class="{if $searchdata->searcharea === $term->name}current-tab active{/if}" href="{$searchdata->searchurl}{$term->name}">
{str section='module.multirecipientnotification' tag=$term->tag}{if $term->count > 0} <span class="countresults">({$term->count})</span>{/if}
</a>
{/if}
</div>
<div>
{if $searchdata->mes_count > 0}
<a class="countresults {if $searchdata->searcharea === 'Message'}filtered{/if}" href="{$searchdata->searchurl}Message">
{str section='module.multirecipientnotification' tag='labelmessage'} <span class="countresults">({$searchdata->mes_count})</span>
{else}
<a class="inactive">
{str section='module.multirecipientnotification' tag=$term->tag}
<span class="accessible-hidden sr-only">({str tag=tab} {str tag=disabled})</span>
</a>
{/if}
</div>
<div>
{if $searchdata->recipient_count > 0}
<a class="{if $searchdata->searcharea === 'Recipient'}filtered{/if}" href="{$searchdata->searchurl}Recipient" class="btn">
{/if}
{str section='module.multirecipientnotification' tag='touser'} {if $searchdata->recipient_count > 0} <span class="countresults">({$searchdata->recipient_count})</span>{/if}
{if $searchdata->recipient_count > 0}
</a>
{/if}
</div>
</div>
{/if}
</form>
</li>
{/foreach}
</ul>
</div>
{/if}
......@@ -194,6 +194,9 @@ textarea.resizable {
position: relative;
label {
display: block;
&.inline-label {
display: inline-block;
}
}
.form-group {
padding: 0;
......
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