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

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);
$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
......
......@@ -157,7 +157,7 @@ function preSubmit(form, data) {
}
function postSubmit(form, data) {
removeElement(uploadingMessage);
// removeElement(uploadingMessage);
table.doupdate();
formStopProcessing(form, data);
quotaUpdate();
......
{foreach from=$blogs->data item=blog}
<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>
<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="newentry"><a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->id}" class="btn">{str tag=addpost section=artefact.blog}</a></span>
<span class="control-buttons">
{if $blog->locked}
<span class="s dull">{str tag=submittedforassessment section=view}</span>
{else}
<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>
{$blog->deleteform|safe}
{/if}
</span>
</div>
<div id="blogdesc">{$blog->description|clean_html|safe}</div>
<div class="cb"></div>
<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>
<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="newentry">
<a href="{$WWWROOT}artefact/blog/post.php?blog={$blog->id}" class="btn">{str tag=addpost section=artefact.blog}</a>
</span>
<span class="control-buttons">
{if $blog->locked}
<span class="s dull">{str tag=submittedforassessment section=view}</span>
{else}
<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>
{$blog->deleteform|safe}
{/if}
</span>
</div>
<div id="blogdesc">{$blog->description|clean_html|safe}</div>
<div class="cb"></div>
</div>
{/foreach}
{include file="header.tpl"}
<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>
</div>
<div id="myblogs" class="rel">
{if !$blogs->data}
<div>{str tag=youhavenoblogs section=artefact.blog}</div>
{else}
<div id="bloglist" class="fullwidth listing">
{$blogs->tablerows|safe}
</div>
{$blogs->pagination|safe}
{/if}
</div>
<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>
</div>
<div id="myblogs" class="rel">
{if !$blogs->data}
<div>{str tag=youhavenoblogs section=artefact.blog}</div>
{else}
<div id="bloglist" class="fullwidth listing">
{$blogs->tablerows|safe}
</div>
{$blogs->pagination|safe}
{/if}
</div>
{include file="footer.tpl"}
{include file="header.tpl"}
<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>
{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>
{/if}
</div>
<div id="myblogs" class="rel">
<div id="blogdescription">{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}
<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>
{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>
{/if}
</div>
<div id="myblogs" class="rel">
<div id="blogdescription">
{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}
<div id="postlist" class="fullwidth listing">
{$posts.tablerows|safe}
</div>
<div id="blogpost_page_container" class="hidden">{$posts.pagination|safe}</div>
<script>
addLoadEvent(function() {literal}{{/literal}
{$posts.pagination_js|safe}
removeElementClass('blogpost_page_container', 'hidden');
{literal}}{/literal});
</script>
{else}
<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}
</div>
{/if}
{if $posts}
<div id="postlist" class="fullwidth listing">
{$posts.tablerows|safe}
</div>
<div id="blogpost_page_container" class="hidden">{$posts.pagination|safe}</div>
<script>
addLoadEvent(function() {literal}{{/literal}
{$posts.pagination_js|safe}
removeElementClass('blogpost_page_container', 'hidden');
{literal}}{/literal});
</script>
{else}
<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}
</div>
{/if}
{if $enablemultipleblogstext}
<p class="dull center">{str tag=enablemultipleblogstext section=artefact.blog arg1=$WWWROOT}</p>
{/if}
{if $hiddenblogsnotification}
<p class="dull center">{str tag=hiddenblogsnotification section=artefact.blog arg1=$WWWROOT}</p>
{/if}
</div>
{if $enablemultipleblogstext}
<p class="dull center">{str tag=enablemultipleblogstext section=artefact.blog arg1=$WWWROOT}</p>
{/if}
{if $hiddenblogsnotification}
<p class="dull center">{str tag=hiddenblogsnotification section=artefact.blog arg1=$WWWROOT}</p>
{/if}
</div>
{include file="footer.tpl"}
......@@ -33,7 +33,7 @@
</form>
<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}
{include file="footer.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">
<table id="notes" class="table table-striped">
<thead>
......
<div class="collapsible-group">
{foreach from=$data item=item name='notification'}
<div class="notification panel panel-default {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}">
<div class="icon pull-left">
{if $item->read && $item->type == 'usermessage'}
<span class="fa fa-envelope"></span><span class="sr-only">{$item->strtype} - {str tag='read' section='activity'}</span>
{elseif $item->strtype == 'usermessage'}
<span class="fa fa-envelope"></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>
<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}">
<h4 class="panel-heading">
<a class="collapsed" href="#notification-{$item->id}" data-toggle="collapse" aria-expanded="1" aria-controls="notification-{$item->id}">
{if $item->read && $item->type == 'usermessage'}
<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'}
<span class="fa fa-envelope type-icon prl"></span><span class="sr-only">{$item->strtype}</span>
{else}
{assign var="tousr" value=$item->tousr[0]}
{$tousr['username']|truncate:$maxnamestrlength}
<span class="fa fa-wrench type-icon prl"></span>
<span class="sr-only">{$item->strtype}</span>
{/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}
<span>... ({count($item->tousr)})</span>
<span class="sr-only">more</span>
{else}
{assign var="tousr" value=$item->tousr[0]}
{$tousr['username']|truncate:$maxnamestrlength}
{/if}
</span>
<span class="sentdate">
, {$item->date}
</span>
</span>
<span class="fa fa-chevron-down pls collapse-indicator pull-right"></span>
</a>
<span class="panel-control">
<span class="control">
<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>
<span class="sentdate">
, {$item->date}
</span>
</div>
<div class="notification-control">
<div class="control">
<div 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>
</div>
</h4>
<div id="notification-{$item->id}" class="collapse">
{if $item->message}
<div class="content panel-body">
<p class="tousers">
<span class="recipientlist">
<strong>
{str section='artefact.multirecipientnotification' tag='touser'}:
</strong>
{if count($item->tousr) > 1}
<span>
{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>
{else}
<span>
{assign var="tousr" value=$item->tousr[0]}
{if $tousr['link']}<a href="{$tousr['link']}">{/if}
<span class="prm">
{$tousr['display']|truncate:$maxnamestrlength}
</span>
{if $tousr['link']}</a>{/if}
</span>
{/if}
</p>
<p>{$item->message|safe}</p>
</div>
<span class="content-expanded fa fa-chevron-up"></span>
</div>
</a>
<div id="notification-{$item->id}" class="collapse">
{if $item->message}
<div class="content panel-body">
<p class="tousers">
<span class="recipientlist">
<strong>
{str section='artefact.multirecipientnotification' tag='touser'}:
</strong>
{if count($item->tousr) > 1}
<span class="tousers">
{foreach from=$item->tousr item=tousr key=break}
{if ($tousr['link'])}
<a class="prm" href="{$tousr['link']}">
{/if}
<div class="actions panel-footer mbl">
<div class="url">
{if $item->url}
<a class="action" href="{$WWWROOT}{$item->url}">
<span class="fa fa-reply"></span>
{if $item->urltext}
{$item->urltext}
{/if}
{$tousr['display']|truncate:$maxnamestrlength}
{if ($tousr['link'])}
</a>{/if}
{/foreach}
</span>
{else}
<span class="tousers">
{assign var="tousr" value=$item->tousr[0]}
{if $tousr['link']}
<a href="{$tousr['link']}">
</a>
{/if}
{$tousr['display']|truncate:$maxnamestrlength}
{if $tousr['link']}
</a>{/if}
</span>
{/if}
</p>
<p>{$item->message|safe}</p>
</div>
{/if}
<div class="actions panel-footer mbl">
<div class="url">
{if $item->url}
<a class="action" href="{$WWWROOT}{$item->url}">
<span class="fa fa-reply"></span>
{if $item->urltext}
{$item->urltext}
{if $item->return}
<a class="action" href="{$WWWROOT}{$item->return}">
<span class="fa fa-reply-all"></span> {$item->returnoutput}
</a>
{/if}
</a>
{/if}
{if $item->return}
<a class="action" href="{$WWWROOT}{$item->return}">
<span class="fa fa-reply-all"></span> {$item->returnoutput}
</a>
{/if}
</div>
</div>
</div>
</div>
</div>
{/foreach}
</div>
\ No newline at end of file
{include file="header.tpl"}
<div id="notifications">
<form method="post" class="form-inline form-select-filter pbl">
<form method="post" class="form-inline form-select-filter ptl pbl">
<div class="form-group">
<label for="notifications_type">{str section='activity' tag='type'}:</label>
<select id="notifications_type" name="type">
......@@ -21,21 +21,21 @@
<div class="selectall pull-right">
<strong class="prm">{str section='activity' tag='selectall'}: </strong>
<div class="markasread">
<label class="selected" for="markallasread" onclick="toggleChecked('tocheckread'); return false;">
<input type="checkbox" data-tocheckread="true" name="markallasread" id="markallasread">
<label class="selected" for="markallasread">
<input type="checkbox" data-tocheckread="true" name="markallasread" id="markallasread" data-togglecheckbox="tocheckread">
{str tag='markasread' section='activity'}
<span class="accessible-hidden sr-only"> {str tag='selectallread' section='artefact.multirecipientnotification'}</span>
</label>
</div>
<div class="delete">
<label class="selected" for="deleteall" onclick="toggleChecked('tocheckdel'); return false;">
<input type="checkbox" name="deleteall" id="deleteall">
<label class="selected" for="deleteall">
<input type="checkbox" name="deleteall" id="deleteall" data-togglecheckbox="tocheckdel">
{str tag='delete'}
<span class="accessible-hidden sr-only">{str tag='selectalldelete' section='artefact.multirecipientnotification'}</span>
</label>
</div>
</div>
<div id="activitylist" class="notification-list">
<div id="activitylist" class="notification-list ptl">
{$activitylist['tablerows']|safe}
</div>
</form>
......
{include file="header.tpl"}
<div id="notifications">
<form method="post" class="form-inline form-select-filter pbl">
<form method="post" class="form-inline form-select-filter ptl pbl">
<div class="form-group">
<label for="notifications_type">{str section='activity' tag='type'}:</label>
<select id="notifications_type" name="type">
......@@ -20,14 +20,14 @@
<div class="selectall pull-right">
<strong class="prm">{str section='activity' tag='selectall'}: </strong>
<div class="delete">
<label class="selected" for="deleteall" onclick="toggleChecked('tocheckdel'); return false;">
<input type="checkbox" name="deleteall" id="deleteall">
<label class="selected" for="deleteall">
<input type="checkbox" name="deleteall" id="deleteall" data-togglecheckbox="tocheckdel">
{str tag='delete'}
<span class="accessible-hidden sr-only">{str tag='selectalldelete' section='artefact.multirecipientnotification'}</span>
</label>
</div>
</div>
<div id="activitylist" class="notification-list">
<div id="activitylist" class="notification-list ptl">
{$activitylist['tablerows']|safe}
</div>
</form>
......
{include file="header.tpl"}
{if $messages}
<div id="messagethread" class="fullwidth fixwidth message-thread">
{foreach from=$messages item=message}
<div class="{cycle values='r0,r1'} message-item">
<div data-toggle="collapse" data-target="#message-{$message->id}" aria-expanded="false" aria-controls="#message-{$message->id}" class="message-preview clearfix">
<div class="from-user pull-left">
<img src="{profile_icon_url user=$message->fromid maxwidth=20 maxheight=20}" alt="{$message->fromusrname}" class="user-icon-image">
<h5 class="username">
{if ($message->fromusrlink)}
<a href="{$message->fromusrlink}">
{/if}
<span class="accessible-hidden sr-only">{str tag='From' section='mahara'}
</span>
{$message->fromusrname}
{if ($message->fromusrlink)}
</a>
{/if}
</h5>
</div>
<p class="postedon">
{$message->ctime|strtotime|format_date}
</p>
<div class="content-preview">
<p class="content">{$message->message}</p>
</div>
</div>
<div id="message-{$message->id}" class="js-message-content message-content">
<p class="message-recipients">
<strong>
{str tag='labelrecipients' section='artefact.multirecipientnotification'}
</strong>
{foreach from=$message->tousrs item=recipient key="index"}
{if $recipient['link']}
<a href="{$recipient['link']}">
{/if}
<p class="lead">{str tag='labelsubject' section='artefact.multirecipientnotification'} {$messages.[0]->subject}</p>
<div id="messagethread" class="collapsible-group">
{foreach from=$messages item=message name='message'}
<div class="message-item panel panel-collapse collapsible collapsible-group {if $dwoo.foreach.message.first}first{/if}">
<h2 class="message-preview panel-heading">
<a class="collapsed" href="#message-{$message->id}" data-toggle="collapse" aria-expanded="1" aria-controls="#message-{$message->id}">
<span class="user-icon-image">
<img src="{profile_icon_url user=$message->fromid maxwidth=20 maxheight=20}" alt="{$message->fromusrname}">
</span>
{if ($message->fromusrlink != 0)}
<a href="{$message->fromusrlink}">
<span class="accessible-hidden sr-only">
{str tag='labelrecipients' section='artefact.multirecipientnotification'}
{str tag='From' section='mahara'}
</span>
{$recipient['display']}
{if ($index + 1) < count($message->tousrs)} {/if}
{if $recipient['link']}
{$message->fromusrname}
</a>
{/if}
{/foreach}
</p>
<p class="message-subject">
<strong>
{str tag='labelsubject' section='artefact.multirecipientnotification'}
</strong>
<a href="{$link}?replyto={$message->id}&returnto={$returnto}">
<span class="accessible-hidden sr-only">
{else}
{$message->fromusrname}
{/if}
<span class="metadata">
- {$message->ctime|strtotime|format_date}
</span>
<span class="fa fa-chevron-down pls collapse-indicator pull-right"></span>
<span class="content-preview mts">
<p class="content">{$message->message}</p>
</span>
</a>
</h2>
<div id="message-{$message->id}" class="collapse {if $dwoo.foreach.message.last}in{/if}">
<div class="message-content panel-body">
<p class="recipients">
<strong>
{str tag='labelrecipients' section='artefact.multirecipientnotification'}
</strong>
{foreach from=$message->tousrs item=recipient key="index"}
{if $recipient['link']}<a href="{$recipient['link']}">{/if}
<span class="prs">
{$recipient['display']}
{if ($index + 1) < count($message->tousrs)}; {/if}
</span>
{if $recipient['link']}</a>{/if}
{/foreach}
</p>
<p class="date">
<strong>
{str section='activity' tag='date'}:
</strong>
{$message->ctime|strtotime|format_date}
</p>
<p class="subject">
<strong>
{str tag='labelsubject' section='artefact.multirecipientnotification'}
</span>
</strong>
{$message->subject}
</a>
</p>
<p class="messagebody">
{$message->message}
</p>
</div>