Commit 06d3eb82 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells
Browse files

Notifications (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework
Refactor notifications to use panel styling
BUG: search panel
Notifications
Re-style sendmessage page to use panel classes
Refactor blocktype to use list-group
Adding panels to resume tables

Change-Id: I6da2081e15fb8c2ea933f847958186290596b7c4
parent 6cd4de6a
...@@ -79,7 +79,7 @@ $loggedindate = pieform_element_calendar($calendarform, $calendar); ...@@ -79,7 +79,7 @@ $loggedindate = pieform_element_calendar($calendarform, $calendar);
$searchParams = $search; //store search as it's about to change $searchParams = $search; //store search as it's about to change
list($html, $columns, $pagination, $search) = build_admin_user_search_results($search, $offset, $limit, $search); list($html, $columns, $pagination, $search) = build_admin_user_search_results($search, $offset, $limit);
$js = <<<EOF $js = <<<EOF
......
...@@ -157,7 +157,7 @@ function preSubmit(form, data) { ...@@ -157,7 +157,7 @@ function preSubmit(form, data) {
} }
function postSubmit(form, data) { function postSubmit(form, data) {
removeElement(uploadingMessage); // removeElement(uploadingMessage);
table.doupdate(); table.doupdate();
formStopProcessing(form, data); formStopProcessing(form, data);
quotaUpdate(); quotaUpdate();
......
{foreach from=$blogs->data item=blog} {foreach from=$blogs->data item=blog}
<div class="{cycle name=rows values='r0,r1'} listrow"> <div class="{cycle name=rows values='r0,r1'} listrow">
<h3 class="title"><a href="{$WWWROOT}artefact/blog/view/index.php?id={$blog->id}">{$blog->title}</a></h3> <h3 class="title"><a href="{$WWWROOT}artefact/blog/view/index.php?id={$blog->id}">{$blog->title}</a></h3>
<div class="fr nowrap"> <div class="fr nowrap">
<span class="entries"><a href="{$WWWROOT}artefact/blog/view/index.php?id={$blog->id}">{str tag=nposts section=artefact.blog arg1=$blog->postcount}</a></span> <span class="entries"><a href="{$WWWROOT}artefact/blog/view/index.php?id={$blog->id}">{str tag=nposts section=artefact.blog arg1=$blog->postcount}</a></span>
<span class="newentry"><a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->id}" class="btn">{str tag=addpost section=artefact.blog}</a></span> <span class="newentry">
<span class="control-buttons"> <a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->id}" class="btn">{str tag=addpost section=artefact.blog}</a>
{if $blog->locked} </span>
<span class="s dull">{str tag=submittedforassessment section=view}</span> <span class="control-buttons">
{else} {if $blog->locked}
<a href="{$WWWROOT}artefact/blog/settings/index.php?id={$blog->id}" title="{str tag=settings}"><img src="{theme_url filename='images/btn_configure.png'}" alt="{str(tag=settingsspecific arg1=$blog->title)|escape:html|safe}"></a> <span class="s dull">{str tag=submittedforassessment section=view}</span>
{$blog->deleteform|safe} {else}
{/if} <a href="{$WWWROOT}artefact/blog/settings/index.php?id={$blog->id}" title="{str tag=settings}"><img src="{theme_url filename='images/btn_configure.png'}" alt="{str(tag=settingsspecific arg1=$blog->title)|escape:html|safe}"></a>
</span> {$blog->deleteform|safe}
</div> {/if}
<div id="blogdesc">{$blog->description|clean_html|safe}</div> </span>
<div class="cb"></div>
</div> </div>
<div id="blogdesc">{$blog->description|clean_html|safe}</div>
<div class="cb"></div>
</div>
{/foreach} {/foreach}
{include file="header.tpl"} {include file="header.tpl"}
<div class="text-right btn-top-right"> <div class="text-right btn-top-right">
<a class="btn btn-success" href="{$WWWROOT}artefact/blog/new/index.php">{str section="artefact.blog" tag="addblog"}</a> <a class="btn btn-success" href="{$WWWROOT}artefact/blog/new/index.php">{str section="artefact.blog" tag="addblog"}</a>
</div> </div>
<div id="myblogs" class="rel"> <div id="myblogs" class="rel">
{if !$blogs->data} {if !$blogs->data}
<div>{str tag=youhavenoblogs section=artefact.blog}</div> <div>{str tag=youhavenoblogs section=artefact.blog}</div>
{else} {else}
<div id="bloglist" class="fullwidth listing"> <div id="bloglist" class="fullwidth listing">
{$blogs->tablerows|safe} {$blogs->tablerows|safe}
</div> </div>
{$blogs->pagination|safe} {$blogs->pagination|safe}
{/if} {/if}
</div> </div>
{include file="footer.tpl"} {include file="footer.tpl"}
{include file="header.tpl"} {include file="header.tpl"}
<div class="text-right btn-top-right"> <div class="text-right btn-top-right">
<a class="btn btn-success addpost" href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str section="artefact.blog" tag="addpost"}</a> <a class="btn btn-success addpost" href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str section="artefact.blog" tag="addpost"}</a>
{if !$blog->get('locked')} {if !$blog->get('locked')}
<a class="btn btn-default settings" href="{$WWWROOT}artefact/blog/settings/index.php?id={$blog->get('id')}">{str section="artefact.blog" tag="settings"}</a> <a class="btn btn-default settings" href="{$WWWROOT}artefact/blog/settings/index.php?id={$blog->get('id')}">{str section="artefact.blog" tag="settings"}</a>
{/if} {/if}
</div> </div>
<div id="myblogs" class="rel"> <div id="myblogs" class="rel">
<div id="blogdescription">{clean_html($blog->get('description'))|safe}</div> <div id="blogdescription">
{if $blog->get('tags')}<div class="tags">{str tag=tags}: {list_tags owner=$blog->get('owner') tags=$blog->get('tags')}</div>{/if} {clean_html($blog->get('description'))|safe}
</div>
{if $blog->get('tags')}
<div class="tags">
{str tag=tags}: {list_tags owner=$blog->get('owner') tags=$blog->get('tags')}
</div>
{/if}
{if $posts} {if $posts}
<div id="postlist" class="fullwidth listing"> <div id="postlist" class="fullwidth listing">
{$posts.tablerows|safe} {$posts.tablerows|safe}
</div> </div>
<div id="blogpost_page_container" class="hidden">{$posts.pagination|safe}</div> <div id="blogpost_page_container" class="hidden">{$posts.pagination|safe}</div>
<script> <script>
addLoadEvent(function() {literal}{{/literal} addLoadEvent(function() {literal}{{/literal}
{$posts.pagination_js|safe} {$posts.pagination_js|safe}
removeElementClass('blogpost_page_container', 'hidden'); removeElementClass('blogpost_page_container', 'hidden');
{literal}}{/literal}); {literal}}{/literal});
</script> </script>
{else} {else}
<div class="message"> <div class="message">
{str tag=nopostsyet section=artefact.blog} {if !$blog->get('locked')}<a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str tag=addone section=mahara}</a>{/if} {str tag=nopostsyet section=artefact.blog} {if !$blog->get('locked')}<a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str tag=addone section=mahara}</a>{/if}
</div> </div>
{/if} {/if}
{if $enablemultipleblogstext} {if $enablemultipleblogstext}
<p class="dull center">{str tag=enablemultipleblogstext section=artefact.blog arg1=$WWWROOT}</p> <p class="dull center">{str tag=enablemultipleblogstext section=artefact.blog arg1=$WWWROOT}</p>
{/if} {/if}
{if $hiddenblogsnotification} {if $hiddenblogsnotification}
<p class="dull center">{str tag=hiddenblogsnotification section=artefact.blog arg1=$WWWROOT}</p> <p class="dull center">{str tag=hiddenblogsnotification section=artefact.blog arg1=$WWWROOT}</p>
{/if} {/if}
</div> </div>
{include file="footer.tpl"} {include file="footer.tpl"}
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</form> </form>
<h3>{str tag="uploadprofileicon" section="artefact.file"}</h3> <h3>{str tag="uploadprofileicon" section="artefact.file"}</h3>
<p>{str tag="profileiconsiconsizenotice" section="artefact.file" args=$imagemaxdimensions}</p> <p class="lead ptl pbl">{str tag="profileiconsiconsizenotice" section="artefact.file" args=$imagemaxdimensions}</p>
{$uploadform|safe} {$uploadform|safe}
{include file="footer.tpl"} {include file="footer.tpl"}
{include file="header.tpl"} {include file="header.tpl"}
<p>{str tag=notesdescription1 section=artefact.internal}</p> <p class="lead">{str tag=notesdescription1 section=artefact.internal}</p>
<div class="table-responsive"> <div class="table-responsive">
<table id="notes" class="table table-striped"> <table id="notes" class="table table-striped">
<thead> <thead>
......
<div class="collapsible-group">
{foreach from=$data item=item name='notification'} {foreach from=$data item=item name='notification'}
<div class="notification panel {if !$item->read}unread panel-warning {else} panel-default{/if} {if $dwoo.foreach.notification.last}last{/if}"> <div class="panel panel-collapse collapsible notification collapsible-group {if !$item->read}panel-primary{else}panel-default{/if} {if $dwoo.foreach.notification.first}first{/if} {if $dwoo.foreach.notification.last}last{/if} ">
<a class="header collapsed panel-heading" href="#notification-{$item->id}" data-toggle="collapse" aria-expanded="1" aria-controls="notification-{$item->id}"> <h4 class="panel-heading">
<div class="icon pull-left"> <a class="collapsed" href="#notification-{$item->id}" data-toggle="collapse" aria-expanded="1" aria-controls="notification-{$item->id}">
{if $item->read && $item->type == 'usermessage'} {if $item->read && $item->type == 'usermessage'}
<span class="fa fa-envelope"></span><span class="sr-only">{$item->strtype} - {str tag='read' section='activity'}</span> <span class="fa fa-envelope type-icon prl"></span><span class="sr-only">{$item->strtype} - {str tag='read' section='activity'}</span>
{elseif $item->strtype == 'usermessage'} {elseif $item->strtype == 'usermessage'}
<span class="fa fa-envelope"></span><span class="sr-only">{$item->strtype}</span> <span class="fa fa-envelope type-icon prl"></span><span class="sr-only">{$item->strtype}</span>
{else} {else}
<span class="fa fa-wrench"></span> <span class="fa fa-wrench type-icon prl"></span>
<span class="sr-only">{$item->strtype}</span> <span class="sr-only">{$item->strtype}</span>
{/if}
</div>
<h3 class="subject">
<span class="sr-only">{str section='activity' tag='subject'}</span>
{if !$item->read}
<span class="accessible-hidden sr-only">
{str tag='unread' section='activity'}:
</span>
{/if}
{$item->subject|truncate:40}
</h3>
<div class="metadata">
<span class="sr-only">
{str section='artefact.multirecipientnotification 'tag='fromuser'}:
</span>
{if ($item->fromusr != 0)}
{if ($item->fromusrlink)}
<span class="username">
{/if} {/if}
- {$item->fromusr|display_name|truncate:$maxnamestrlength} <span class="sr-only">{str section='activity' tag='subject'}</span>
{if ($item->fromusrlink)} {if !$item->read}
</span> <span class="accessible-hidden sr-only">
{/if} {str tag='unread' section='activity'}:
{else} </span>
<span class="username">
- {str tag="system"}
</span>
{/if}
<span class="sentdate">
, {$item->date}
</span>
</div>
<div class="notification-control">
<div class="control">
{if !$item->read}
<div class="control-wrapper prm">
<input type="checkbox" class="tocheckread" name="unread-{$item->table}-{$item->id}" id="unread-{$item->table}-{$item->id}">
<label class="marked read" for="unread-{$item->table}-{$item->id}">{str tag='markasread' section='activity'}</label>
</div>
{/if} {/if}
<div class="control-wrapper prl">
<input type="checkbox" class="tocheckdel" name="delete-{$item->table}-{$item->id}" id="delete-{$item->table}-{$item->id}"> {$item->subject|truncate:40}
<label class="marked delete" for="delete-{$item->table}-{$item->id}">{str tag='delete' section='mahara'}</label>
</div> <span class="metadata">
</div> <span class="sr-only">
<span class="content-expanded fa fa-chevron-up"></span> {str section='artefact.multirecipientnotification 'tag='fromuser'}:
</div> </span>
</a> {if ($item->fromusr != 0)}
<div id="notification-{$item->id}" class="collapse">
{if $item->message}
<div class="content panel-body {if $item->url && $item->urltext !== 'Reply'}mbl{/if}">
{if ($item->fromusr != 0)}
<p class="fromusers">
<strong>
{str section='artefact.multirecipientnotification' tag='fromuser'}:
</strong>
{if ($item->fromusrlink)}
<span class="fromusers prm">
<a href="{$item->fromusrlink}">
{/if}
{$item->fromusr|display_name|truncate:$maxnamestrlength}
{if ($item->fromusrlink)} {if ($item->fromusrlink)}
</a> <span class="username">
</span> {/if}
{/if} - {$item->fromusr|display_name|truncate:$maxnamestrlength}
</p> {if ($item->fromusrlink)}
{else} </span>
<p class="fromusers">
<strong>
{str section='artefact.multirecipientnotification' tag='fromuser'}:
</strong>
<span>{str tag="system"}</span>
</p>
{/if}
<p class="tousers">
<strong>
{str section='artefact.multirecipientnotification' tag='touser'}:
</strong>
{if $item->return}
<span class="tousers">
{foreach from=$item->tousr item=tousr key=break}
{if ($tousr['link'])}
<a class="prm" href="{$tousr['link']}">
{/if} {/if}
{$tousr['display']|truncate:$maxnamestrlength} {else}
{if ($tousr['link'])} <span class="username">
</a>{/if} - {str tag="system"}
{/foreach} </span>
{/if}
<span class="sentdate">
, {$item->date}
</span>
<span class="fa fa-chevron-down pls collapse-indicator pull-right"></span>
</span> </span>
{else} </a>
<span> <span class="panel-control">
{assign var="tousr" value=$item->tousr[0]} <span class="control">
{if !$item->read}
<span class="control-wrapper prm">
<input type="checkbox" class="tocheckread" name="unread-{$item->table}-{$item->id}" id="unread-{$item->table}-{$item->id}">
<label class="marked read" for="unread-{$item->table}-{$item->id}">{str tag='markasread' section='activity'}</label>
</span>
{/if}
<span class="control-wrapper prl">
<input type="checkbox" class="tocheckdel" name="delete-{$item->table}-{$item->id}" id="delete-{$item->table}-{$item->id}">
<label class="marked delete" for="delete-{$item->table}-{$item->id}">{str tag='delete' section='mahara'}</label>
</span>
</span> </span>
{if ($tousr['link'])} </span>
<a href="{$tousr['link']}"> </h4>
<div id="notification-{$item->id}" class="collapse">
{if $item->message}
<div class="content panel-body {if $item->urltext !== 'Reply'} mbl no-footer{/if}">
{if ($item->fromusr != 0)}
<p class="fromusers">
<strong>
{str section='artefact.multirecipientnotification' tag='fromuser'}:
</strong>
{if ($item->fromusrlink)}
<span class="fromusers prm">
<a href="{$item->fromusrlink}">
{/if}
{$item->fromusr|display_name|truncate:$maxnamestrlength}
{if ($item->fromusrlink)}
</a>
</span>
{/if} {/if}
</p>
{else}
<p class="fromusers">
<strong>
{str section='artefact.multirecipientnotification' tag='fromuser'}:
</strong>
<span>{str tag="system"}</span>
</p>
{/if}
<p class="tousers">
<strong>
{str section='artefact.multirecipientnotification' tag='touser'}:
</strong>
{if $item->return}
<span> <span>
{$tousr['display']|truncate:$maxnamestrlength} {foreach from=$item->tousr item=tousr key=break}
{if ($tousr['link'])}<a href="{$tousr['link']}">{/if}
<span class="prm">
{$tousr['display']|truncate:$maxnamestrlength}
</span>
{if ($tousr['link'])}</a>{/if}
{/foreach}
</span> </span>
{if ($tousr['link'])} {else}
</a>{/if} <span>
{/if} {assign var="tousr" value=$item->tousr[0]}
</p> {if ($tousr['link'])}<a href="{$tousr['link']}">{/if}
<p>{$item->message|safe}</p> <span class="prm">
{if $item->url && $item->urltext === 'Collection'} {$tousr['display']|truncate:$maxnamestrlength}
<a class="action" href="{$WWWROOT}{$item->url}"> </span>
<span class="fa fa-arrow-right"></span> {if ($tousr['link'])}</a>{/if}
{$item->urltext} </span>
</a> {/if}
{/if} </p>
</div> <p>{$item->message|safe}</p>
{/if} {if $item->url && $item->urltext != 'Reply'}
{if $item->url && $item->urltext === 'Reply'}
<div class="actions panel-footer mbl">
<div class="url">
<a class="action" href="{$WWWROOT}{$item->url}"> <a class="action" href="{$WWWROOT}{$item->url}">
<span class="fa fa-reply"></span> <span class="fa fa-arrow-right"></span>
{$item->urltext} {$item->urltext}
</a> </a>
{if $item->return}
<a class="action" href="{$WWWROOT}{$item->return}">
<span class="fa fa-reply-all"></span> {$item->returnoutput}
</a>
{/if} {/if}
</div> </div>
{/if}
{if $item->url && $item->urltext == 'Reply'}
<div class="actions panel-footer mbl">
<div class="url">
<a class="action" href="{$WWWROOT}{$item->url}">
<span class="fa fa-reply"></span>
{$item->urltext}
</a>
{if $item->return}
<a class="action" href="{$WWWROOT}{$item->return}">
<span class="fa fa-reply-all"></span> {$item->returnoutput}
</a>
{/if}
</div>
</div>
{/if}
</div> </div>
{/if}
</div> </div>
</div>
{/foreach} {/foreach}
</div>
\ No newline at end of file
<div class="collapsible-group">
{foreach from=$data item=item name='notification'} {foreach from=$data item=item name='notification'}
<div class="notification panel panel-default {if $dwoo.foreach.notification.last}last{/if}"> <div class="panel panel-default panel-collapse collapsible notification collapsible-group {if $dwoo.foreach.notification.first}first{/if} {if $dwoo.foreach.notification.last}last{/if}">
<a class="header collapsed panel-heading" href="#notification-{$item->id}" data-toggle="collapse" aria-expanded="1" aria-controls="notification-{$item->id}"> <h4 class="panel-heading">
<div class="icon pull-left"> <a class="collapsed" href="#notification-{$item->id}" data-toggle="collapse" aria-expanded="1" aria-controls="notification-{$item->id}">
{if $item->read && $item->type == 'usermessage'} {if $item->read && $item->type == 'usermessage'}
<span class="fa fa-envelope"></span><span class="sr-only">{$item->strtype} - {str tag='read' section='activity'}</span> <span class="fa fa-envelope type-icon prl"></span><span class="sr-only">{$item->strtype} - {str tag='read' section='activity'}</span>
{elseif $item->strtype == 'usermessage'} {elseif $item->strtype == 'usermessage'}
<span class="fa fa-envelope"></span><span class="sr-only">{$item->strtype}</span> <span class="fa fa-envelope type-icon prl"></span><span class="sr-only">{$item->strtype}</span>
{else}
<span class="fa fa-wrench"></span>
<span class="sr-only">{$item->strtype}</span>
{/if}
</div>
<h3 class="subject">
<span class="sr-only">{str section='activity' tag='subject'}</span>
{if !$item->read}
<span class="accessible-hidden sr-only">
{str tag='unread' section='activity'}:
</span>
{/if}
{$item->subject|truncate:40}
</h3>
<div class="metadata">
<span>
{str section='artefact.multirecipientnotification' tag='touser'}:
</span>
<span class="username">
{if count($item->tousr) > 1}
{assign var="tousr" value=$item->tousr[0]}
{$tousr['username']|truncate:$maxnamestrlength}
<span>... ({count($item->tousr)})<span><span class="sr-only">more</span>
{else} {else}
{assign var="tousr" value=$item->tousr[0]} <span class="fa fa-wrench type-icon prl"></span>
{$tousr['username']|truncate:$maxnamestrlength} <span class="sr-only">{$item->strtype}</span>
{/if} {/if}
<span class="sr-only">{str section='activity' tag='subject'}</span>
{if !$item->read}
<span class="accessible-hidden sr-only">
{str tag='unread' section='activity'}:
</span>
{/if}
{$item->subject|truncate:40}
<span class="metadata">
<span>
{str section='artefact.multirecipientnotification' tag='touser'}:
</span>
<span class="username">
{if count($item->tousr) > 1}
{assign var="tousr" value=$item->tousr[0]}
{$tousr['username']|truncate:$maxnamestrlength