Commit 76abfc58 authored by Pat Kira's avatar Pat Kira Committed by Aaron Wells

Add view artefact to attachment list (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework
Objectionable material in viewpage, artefact and topic (bootstrap)
Inpage menu (bootstrap)
Style commnet form as a tab (bootstrap)
Tidy up filebrowsers

Change-Id: I967612dfb3cde35673bd40ca20751058908de266
parent 87cd215b
......@@ -81,6 +81,7 @@ if (get_config('licensemetadata')) {
}
$elements['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('save'), get_string('cancel')),
'goto' => $goto,
);
......
......@@ -733,6 +733,7 @@ class ArtefactTypeComment extends ArtefactType {
$form = array(
'name' => 'add_feedback_form',
'method' => 'post',
//'class' => 'js-hidden',
'plugintype' => 'artefact',
'pluginname' => 'comment',
'jsform' => true,
......
......@@ -193,6 +193,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
$element['name'] = 'artefactid';
$element['config']['upload'] = false;
$element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['config']['selectfolders'] = true;
$element['filters'] = array(
'artefacttype' => array('folder'),
......
......@@ -90,6 +90,7 @@ class PluginBlocktypeHtml extends PluginBlocktype {
$element['title'] = get_string('file', 'artefact.file');
$element['name'] = 'artefactid';
$element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array(
'artefacttype' => array('file'),
'filetype' => self::get_allowed_mimetypes(),
......
......@@ -123,6 +123,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
$element['title'] = get_string('media', 'blocktype.file/internalmedia');
$element['name'] = 'artefactid';
$element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array(
'artefacttype' => array('file', 'audio', 'video'),
'filetype' => self::get_allowed_mimetypes(),
......
......@@ -124,6 +124,7 @@ class PluginBlocktypePdf extends PluginBlocktype {
$element['name'] = 'artefactid';
$element['accept'] = 'application/pdf';
$element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array(
'artefacttype' => array('file'),
'filetype' => self::get_allowed_mimetypes(),
......
......@@ -123,7 +123,6 @@ $smarty->assign('coverletterform', $coverletterform);
$smarty->assign('personalinformationform',$personalinformationform);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('subsectionheading', get_string('introduction', 'artefact.resume'));
$smarty->assign('SUBPAGENAV', PluginArtefactResume::submenu_items());
$smarty->display('artefact:resume:index.tpl');
......
......@@ -71,11 +71,6 @@ class PluginArtefactResume extends PluginArtefact {
public static function submenu_items() {
$tabs = array(
'index' => array(
'page' => 'index',
'url' => 'artefact/resume',
'title' => get_string('introduction', 'artefact.resume'),
),
'employment' => array(
'page' => 'employment',
'url' => 'artefact/resume/employment.php',
......
......@@ -275,12 +275,12 @@ function renderpost($post, $indent, $mode) {
),
'text' => array(
'type' => 'html',
'class' => 'postnotobjectionable text-danger',
'class' => 'postnotobjectionable pb0 pt0',
'value' => get_string('postnotobjectionable', 'interaction.forum'),
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success',
'class' => 'btn btn-default',
'value' => get_string('postnotobjectionablesubmit', 'interaction.forum'),
),
'postid' => array(
......
......@@ -23,7 +23,7 @@ function addFeedbackError(form, data) {
}
function addFeedbackSuccess(form, data) {
addElementClass('add_feedback_form', 'hidden');
// addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) {
removeElement('overlay');
}
......@@ -55,10 +55,15 @@ function addFeedbackSuccess(form, data) {
}
function objectionSuccess(form, data) {
addElementClass('objection_form', 'hidden');
// addElementClass('objection_form', 'hidden');
$('objection_form_message').value = '';
rewriteCancelButtons();
formSuccess(form, data);
// close the form when the form is submited
// Using bootstrap modal
if ($j('#report-form').length) {
$j('#report-form').modal('hide');
}
}
function moveFeedbackForm(tinymceused) {
......@@ -82,8 +87,11 @@ function rewriteCancelButtons() {
if (getNodeAttribute(button, 'id').substring(0, idprefix.length) == idprefix) {
disconnectAll(button);
connect(button, 'onclick', function (e) {
// Reset the form on cancel
// To do reset the form without reloading the page
$j('#comment-form').reset();
e.stop();
addElementClass('add_feedback_form', 'hidden');
// addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) {
removeElement('overlay');
}
......@@ -95,8 +103,11 @@ function rewriteCancelButtons() {
if ($('cancel_objection_form_submit')) {
disconnectAll('cancel_objection_form_submit');
connect('cancel_objection_form_submit', 'onclick', function (e) {
// Get objectionable form form id and hide on click
// Using bootstrap modal
$j('#report-form').modal('hide');
e.stop();
addElementClass('objection_form', 'hidden');
//addElementClass('objection_form', 'hidden');
return false;
});
}
......
......@@ -310,6 +310,7 @@ class ImageBrowser {
'alwaysopen' => true,
'publishing' => true,
'selectone' => true,
'selectmodal' => true,
'showbrowsertoggle' => true,
'showlicensetoggle' => true
),
......
......@@ -18,6 +18,7 @@ function objection_form() {
$form = array(
'name' => 'objection_form',
'method' => 'post',
// 'class' => 'js-safe-hidden',
'jsform' => true,
'autofocus' => false,
'elements' => array(),
......@@ -36,7 +37,7 @@ function objection_form() {
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'class' => 'btn btn-default',
'value' => array(get_string('notifyadministrator'), get_string('cancel')),
'confirm' => array(get_string('notifyadministratorconfirm')),
);
......
......@@ -46,7 +46,7 @@
<ul class="list-unstyled list-group">
{foreach from=$attachments item=item}
<li class="list-group-item">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover" {if $item->description} title="{$item->description}" data-toggle="tooltip"{/if}>
<span class="sr-only">
{str tag=Download section=artefact.file} {$item->title}
</span>
......@@ -68,13 +68,6 @@
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
{if $item->description}
<div class="description ptm">
<p class="text-small">
{$item->description}
</p>
</div>
{/if}
</li>
{/foreach}
</ul>
......
......@@ -15,8 +15,9 @@
</div>
{/if}
<div class="mtl mbl">{$post->description|clean_html|safe}
</div>
<div class="mtl mbl">
{$post->description|clean_html|safe}
</div>
{if $post->files}
......@@ -56,20 +57,13 @@
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
<!-- {if $file->description}
<div class="description ptm">
<p class="text-small">
{$file->description}
</p>
</div>
{/if} -->
</li>
{/foreach}
</ul>
</div>
</div>
{/if}
{if $options.viewid && ($post->commentcount || $post->commentcount === 0)}
<div class="comments clearfix ptm mts">
{if $post->commentcount > 0}
......
......@@ -13,7 +13,7 @@
{if $config.select}
<div id="{$prefix}_open_upload_browse_container">
{if $config.selectone || $config.selectmodal}
{if $config.selectmodal}
<div id="{$prefix}_upload_browse" class="filebrowser in-collapsible">
{else}
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#{$prefix}_upload_browse">
......
......@@ -6,5 +6,4 @@
<div>
<a href="{$metadataurl}">{str tag=Details section=artefact.file}</a>
</div>
</div>
</div>
\ No newline at end of file
......@@ -20,21 +20,31 @@
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a>
</h4>
<!-- Attachment list with view and download link -->
<div id="note-attach-{$blockid}" class="collapse">
<ul class="list-unstyled list-group">
<ul class="list-unstyled list-group mb0">
{foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link">
<a href="{$item->downloadpath}">
<div class="file-icon mrs">
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$item->title|truncate:25}
<li class="list-group-item">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<span class="sr-only">
{str tag=Download section=artefact.file} {$item->title}
</span>
</a>
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
<span class="title list-group-item-heading plm inline">
<a href="{$item->viewpath}" class="inner-link">
{$item->title}
</a>
<span class="metadata"> -
[{$item->size|display_size}]
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
</li>
{/foreach}
</ul>
......
......@@ -12,18 +12,33 @@
</a>
</h4>
<!-- Attachment list with view and download link -->
<div id="cv-attach-{$id}" class="collapse">
<ul class="list-unstyled list-group">
<ul class="list-unstyled list-group mb0">
{foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link">
<a href="{$item->downloadpath}">
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
{$item->title|truncate:50}
<li class="list-group-item">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<span class="sr-only">
{str tag=Download section=artefact.file} {$item->title}
</span>
</a>
{if $item->iconpath}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
<span class="title list-group-item-heading plm">
<a href="{$item->viewpath}" class="inner-link">
{$item->title}
</a>
<span class="metadata"> -
[{$item->size|display_size}]
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
</li>
{/foreach}
</ul>
......
......@@ -12,7 +12,7 @@
{/if}
{if $item.tags}
<div class="tags">
<strong>{str tag=tags}:</strong>
<span class="text-thin">{str tag=tags}:</span>
{list_tags owner=$item.owner tags=$item.tags}
</div>
{/if}
......
......@@ -5,41 +5,61 @@
state is non-persistent. So until Dwoo gets smarter...
*}
{assign var='author_link_index' value=1}
{foreach from=$views item=view}
<div class="list-group-item">
<h4 class="list-group-item-heading"><a href="{$view.fullurl}">{$view.title}</a></h4>
<div class="list-group-item-text">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
<h4 class="list-group-item-heading">
<a href="{$view.fullurl}">{$view.title}</a>
</h4>
{if $view.description}
<p>
{$view.description|str_shorten_html:100:true|strip_tags|safe}
</p>
{/if}
{if $view.sharedby}
<div class="groupuserdate">
{if $view.group && $loggedin}
<a href="{group_homepage_url($view.groupdata)}">{$view.sharedby}</a>
<div class="groupuserdate text-small">
{if $view.group && $loggedin}
<a href="{group_homepage_url($view.groupdata)}" class="text-link">
{$view.sharedby}
</a>
{elseif $view.owner && $loggedin}
{if $view.anonymous}
{if $view.staff_or_admin}
{assign var='realauthor' value=$view.sharedby}
{assign var='realauthorlink' value=profile_url($view.user)}
{/if}
{assign var='author' value=get_string('anonymoususer')}
{include file=author.tpl}
{if $view.staff_or_admin}
{assign var='author_link_index' value=`$author_link_index+1`}
{/if}
{if $view.anonymous}
{if $view.staff_or_admin}
{assign var='realauthor' value=$view.sharedby}
{assign var='realauthorlink' value=profile_url($view.user)}
{/if}
{assign var='author' value=get_string('anonymoususer')}
{include file=author.tpl}
{if $view.staff_or_admin}
{assign var='author_link_index' value=`$author_link_index+1`}
{/if}
{else}
<a href="{profile_url($view.user)}">{$view.sharedby}</a>
<a href="{profile_url($view.user)}" class="text-link">
{$view.sharedby}
</a>
{/if}
{else}
{else}
{$view.sharedby}
{/if}
<span class="postedon">
- {if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view.mtime|strtotime|format_date:'strftimedate'}</span>
</div>
{/if}
<span class="postedon text-muted">
- {if $view.mtime == $view.ctime}
{str tag=Created}
{else}
{str tag=Updated}
{/if}
{$view.mtime|strtotime|format_date:'strftimedate'}
</span>
</div>
</div>
{/foreach}
</div>
{else}
<div class="panel-body">
<p class="lead text-small">{str tag=noviews section=view}</p>
<p class="text-thin text-small">{str tag=noviews section=view}</p>
</div>
{/if}
......@@ -24,12 +24,11 @@
{/if}
{if $reportedaction}
<div class="reportedaction ptm pbl">
<div class="reportedaction alert alert-danger mtl">
{$post->postnotobjectionableform|safe}
</div>
{elseif $highlightreported}
<div class="reportedaction text-danger ptm">
{str tag=postobjectionable section=interaction.forum}
</div>
......@@ -37,7 +36,6 @@
<div class="forum-post-btns text-right">
{if !$chronological}
{if ($moderator || ($membership && !$closed)) && $ineditwindow}
<a href="{$WWWROOT}interaction/forum/editpost.php?parent={$post->id}" class="mll">
<span class="fa fa-reply"></span>
......
......@@ -40,11 +40,11 @@
{$post->body|clean_html|safe}
{if $post->edit}
<div class="editstopost">
<h4 class="title">
<div class="editstopost mtl">
<h5 class="title">
{str tag="editstothispost" section="interaction.forum"}
</h4>
<ul>
</h5>
<ul class="list-unstyled text-small">
{foreach from=$post->edit item=edit}
<li>
<a href="{profile_url($edit.editor)}"
......@@ -55,7 +55,7 @@
<img src="{profile_icon_url user=$edit.editor maxwidth=20 maxheight=20}" alt="{str tag=profileimagetext arg1=$edit.editor|display_default_name}">
{$edit.editor|display_name}
</a> -
<span class="posttime">
<span class="posttime text-muted">
{$edit.edittime}
</span>
</li>
......
......@@ -93,8 +93,7 @@ jQuery(function($) {
height = 0;
image = $(carousel[i]).find('.item img');
console.log(image);
for (j = 0; j < image.length; j = j + 1){
if($(image[j]).height() > height){
height = $(image[j]).height();
......
......@@ -10,34 +10,53 @@
{/if}
<p>{$description|clean_html|safe}</p>
{if isset($attachments)}
<table class="attachments fullwidth">
<thead class="expandable-head">
<tr>
<td colspan="2">
<a class="toggle" href="#">{str tag=attachedfiles section=artefact.blog}</a>
<span class="fr">
<img class="fl" src="{theme_url filename='images/attachment.png'}" alt="{str tag=attachments section=artefact.blog}">
{$attachments|count}
</span>
</td>
</tr>
</thead>
<tbody class="expandable-body">
<div class="has-attachment panel panel-default collapsible">
<h5 class="panel-heading">
<a href="#atrtefact-attach" class="text-left pts pbm collapsed" aria-expanded="false" data-toggle="collapse">
<span class="fa fa-paperclip prm"></span>
<span class="text-small">{str tag=attachedfiles section=artefact.blog}</span>
<span class="metadata">({$attachments|count})</span>
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a>
</h5>
<!-- Attachment list with view and download link -->
<div id="atrtefact-attach" class="collapse">
<ul class="list-unstyled list-group mb0">
{foreach from=$attachments item=item}
<tr class="{cycle values='r0,r1'}">
{if $icons}<td class="icon-container"><img src="{$item->iconpath}" alt=""></td>{/if}
<td><a href="{$item->viewpath}">{$item->title}</a>
({$item->size}) - <strong><a href="{$item->downloadpath}">{str tag=Download section=artefact.file}</a></strong>
<br>{$item->description}</td>
</tr>
<li class="list-group-item">
<a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<span class="sr-only">
{str tag=Download section=artefact.file} {$item->title}
</span>
</a>
{if $item->icon}
<img src="{$item->iconpath}" alt="">
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
<span class="title list-group-item-heading plm inline">
<a href="{$item->viewpath}" class="inner-link">
{$item->title}
</a>
<span class="metadata"> -
[{$item->size|display_size}]
</span>
</span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></span>
</li>
{/foreach}
</tbody>
</table>
</ul>
</div>
</div>
{/if}
{if $license}
<div class="artefactlicense">
<div class="artefactlicense ptl pbl">
{$license|safe}
</div>
{/if}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<div class="col-md-9">
{if $notrudeform}
<div class="message deletemessage">
<div class="message deletemessage alert alert-danger">
{$notrudeform|safe}
</div>
{/if}
......@@ -44,28 +44,41 @@
<div class="text-right btn-top-right btn-group btn-group-top pull-right">
{if $LOGGEDIN}
<a id="toggle_watchlist_link" class="watchlist btn btn-sm btn-default" href="">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="fa fa-ellipsis-h fa-lg"></span>
<span class="sr-only">More options</span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li>
<a id="toggle_watchlist_link" class="watchlist" href="">
{if $viewbeingwatched}
<span class="fa fa-eye-slash prs"></span>
{else}
<span class="fa fa-eye prs"></span>
{/if}
{if $artefact}
{if $viewbeingwatched}
{str tag=removefromwatchlistartefact section=view arg1=$view->get('title')}
<span class="fa fa-eye-slash prs"></span>
{else}
{str tag=addtowatchlistartefact section=view arg1=$view->get('title')}
<span class="fa fa-eye prs"></span>
{/if}
{else}
{if $viewbeingwatched}
{str tag=removefromwatchlist section=view}
{if $artefact}
{if $viewbeingwatched}
{str tag=removefromwatchlistartefact section=view arg1=$view->get('title')}
{else}