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

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')) { ...@@ -81,6 +81,7 @@ if (get_config('licensemetadata')) {
} }
$elements['submit'] = array( $elements['submit'] = array(
'type' => 'submitcancel', 'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('save'), get_string('cancel')), 'value' => array(get_string('save'), get_string('cancel')),
'goto' => $goto, 'goto' => $goto,
); );
......
...@@ -733,6 +733,7 @@ class ArtefactTypeComment extends ArtefactType { ...@@ -733,6 +733,7 @@ class ArtefactTypeComment extends ArtefactType {
$form = array( $form = array(
'name' => 'add_feedback_form', 'name' => 'add_feedback_form',
'method' => 'post', 'method' => 'post',
//'class' => 'js-hidden',
'plugintype' => 'artefact', 'plugintype' => 'artefact',
'pluginname' => 'comment', 'pluginname' => 'comment',
'jsform' => true, 'jsform' => true,
......
...@@ -193,6 +193,7 @@ class PluginBlocktypeFolder extends PluginBlocktype { ...@@ -193,6 +193,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
$element['name'] = 'artefactid'; $element['name'] = 'artefactid';
$element['config']['upload'] = false; $element['config']['upload'] = false;
$element['config']['selectone'] = true; $element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['config']['selectfolders'] = true; $element['config']['selectfolders'] = true;
$element['filters'] = array( $element['filters'] = array(
'artefacttype' => array('folder'), 'artefacttype' => array('folder'),
......
...@@ -90,6 +90,7 @@ class PluginBlocktypeHtml extends PluginBlocktype { ...@@ -90,6 +90,7 @@ class PluginBlocktypeHtml extends PluginBlocktype {
$element['title'] = get_string('file', 'artefact.file'); $element['title'] = get_string('file', 'artefact.file');
$element['name'] = 'artefactid'; $element['name'] = 'artefactid';
$element['config']['selectone'] = true; $element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array( $element['filters'] = array(
'artefacttype' => array('file'), 'artefacttype' => array('file'),
'filetype' => self::get_allowed_mimetypes(), 'filetype' => self::get_allowed_mimetypes(),
......
...@@ -123,6 +123,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype { ...@@ -123,6 +123,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
$element['title'] = get_string('media', 'blocktype.file/internalmedia'); $element['title'] = get_string('media', 'blocktype.file/internalmedia');
$element['name'] = 'artefactid'; $element['name'] = 'artefactid';
$element['config']['selectone'] = true; $element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array( $element['filters'] = array(
'artefacttype' => array('file', 'audio', 'video'), 'artefacttype' => array('file', 'audio', 'video'),
'filetype' => self::get_allowed_mimetypes(), 'filetype' => self::get_allowed_mimetypes(),
......
...@@ -124,6 +124,7 @@ class PluginBlocktypePdf extends PluginBlocktype { ...@@ -124,6 +124,7 @@ class PluginBlocktypePdf extends PluginBlocktype {
$element['name'] = 'artefactid'; $element['name'] = 'artefactid';
$element['accept'] = 'application/pdf'; $element['accept'] = 'application/pdf';
$element['config']['selectone'] = true; $element['config']['selectone'] = true;
$element['config']['selectmodal'] = true;
$element['filters'] = array( $element['filters'] = array(
'artefacttype' => array('file'), 'artefacttype' => array('file'),
'filetype' => self::get_allowed_mimetypes(), 'filetype' => self::get_allowed_mimetypes(),
......
...@@ -123,7 +123,6 @@ $smarty->assign('coverletterform', $coverletterform); ...@@ -123,7 +123,6 @@ $smarty->assign('coverletterform', $coverletterform);
$smarty->assign('personalinformationform',$personalinformationform); $smarty->assign('personalinformationform',$personalinformationform);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);'); $smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
$smarty->assign('PAGEHEADING', TITLE); $smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('subsectionheading', get_string('introduction', 'artefact.resume'));
$smarty->assign('SUBPAGENAV', PluginArtefactResume::submenu_items()); $smarty->assign('SUBPAGENAV', PluginArtefactResume::submenu_items());
$smarty->display('artefact:resume:index.tpl'); $smarty->display('artefact:resume:index.tpl');
......
...@@ -71,11 +71,6 @@ class PluginArtefactResume extends PluginArtefact { ...@@ -71,11 +71,6 @@ class PluginArtefactResume extends PluginArtefact {
public static function submenu_items() { public static function submenu_items() {
$tabs = array( $tabs = array(
'index' => array(
'page' => 'index',
'url' => 'artefact/resume',
'title' => get_string('introduction', 'artefact.resume'),
),
'employment' => array( 'employment' => array(
'page' => 'employment', 'page' => 'employment',
'url' => 'artefact/resume/employment.php', 'url' => 'artefact/resume/employment.php',
......
...@@ -275,12 +275,12 @@ function renderpost($post, $indent, $mode) { ...@@ -275,12 +275,12 @@ function renderpost($post, $indent, $mode) {
), ),
'text' => array( 'text' => array(
'type' => 'html', 'type' => 'html',
'class' => 'postnotobjectionable text-danger', 'class' => 'postnotobjectionable pb0 pt0',
'value' => get_string('postnotobjectionable', 'interaction.forum'), 'value' => get_string('postnotobjectionable', 'interaction.forum'),
), ),
'submit' => array( 'submit' => array(
'type' => 'submit', 'type' => 'submit',
'class' => 'btn btn-success', 'class' => 'btn btn-default',
'value' => get_string('postnotobjectionablesubmit', 'interaction.forum'), 'value' => get_string('postnotobjectionablesubmit', 'interaction.forum'),
), ),
'postid' => array( 'postid' => array(
......
...@@ -23,7 +23,7 @@ function addFeedbackError(form, data) { ...@@ -23,7 +23,7 @@ function addFeedbackError(form, data) {
} }
function addFeedbackSuccess(form, data) { function addFeedbackSuccess(form, data) {
addElementClass('add_feedback_form', 'hidden'); // addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) { if ($('overlay')) {
removeElement('overlay'); removeElement('overlay');
} }
...@@ -55,10 +55,15 @@ function addFeedbackSuccess(form, data) { ...@@ -55,10 +55,15 @@ function addFeedbackSuccess(form, data) {
} }
function objectionSuccess(form, data) { function objectionSuccess(form, data) {
addElementClass('objection_form', 'hidden'); // addElementClass('objection_form', 'hidden');
$('objection_form_message').value = ''; $('objection_form_message').value = '';
rewriteCancelButtons(); rewriteCancelButtons();
formSuccess(form, data); 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) { function moveFeedbackForm(tinymceused) {
...@@ -82,8 +87,11 @@ function rewriteCancelButtons() { ...@@ -82,8 +87,11 @@ function rewriteCancelButtons() {
if (getNodeAttribute(button, 'id').substring(0, idprefix.length) == idprefix) { if (getNodeAttribute(button, 'id').substring(0, idprefix.length) == idprefix) {
disconnectAll(button); disconnectAll(button);
connect(button, 'onclick', function (e) { 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(); e.stop();
addElementClass('add_feedback_form', 'hidden'); // addElementClass('add_feedback_form', 'hidden');
if ($('overlay')) { if ($('overlay')) {
removeElement('overlay'); removeElement('overlay');
} }
...@@ -95,8 +103,11 @@ function rewriteCancelButtons() { ...@@ -95,8 +103,11 @@ function rewriteCancelButtons() {
if ($('cancel_objection_form_submit')) { if ($('cancel_objection_form_submit')) {
disconnectAll('cancel_objection_form_submit'); disconnectAll('cancel_objection_form_submit');
connect('cancel_objection_form_submit', 'onclick', function (e) { 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(); e.stop();
addElementClass('objection_form', 'hidden'); //addElementClass('objection_form', 'hidden');
return false; return false;
}); });
} }
......
...@@ -310,6 +310,7 @@ class ImageBrowser { ...@@ -310,6 +310,7 @@ class ImageBrowser {
'alwaysopen' => true, 'alwaysopen' => true,
'publishing' => true, 'publishing' => true,
'selectone' => true, 'selectone' => true,
'selectmodal' => true,
'showbrowsertoggle' => true, 'showbrowsertoggle' => true,
'showlicensetoggle' => true 'showlicensetoggle' => true
), ),
......
...@@ -18,6 +18,7 @@ function objection_form() { ...@@ -18,6 +18,7 @@ function objection_form() {
$form = array( $form = array(
'name' => 'objection_form', 'name' => 'objection_form',
'method' => 'post', 'method' => 'post',
// 'class' => 'js-safe-hidden',
'jsform' => true, 'jsform' => true,
'autofocus' => false, 'autofocus' => false,
'elements' => array(), 'elements' => array(),
...@@ -36,7 +37,7 @@ function objection_form() { ...@@ -36,7 +37,7 @@ function objection_form() {
$form['elements']['submit'] = array( $form['elements']['submit'] = array(
'type' => 'submitcancel', 'type' => 'submitcancel',
'class' => 'btn btn-success', 'class' => 'btn btn-default',
'value' => array(get_string('notifyadministrator'), get_string('cancel')), 'value' => array(get_string('notifyadministrator'), get_string('cancel')),
'confirm' => array(get_string('notifyadministratorconfirm')), 'confirm' => array(get_string('notifyadministratorconfirm')),
); );
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<ul class="list-unstyled list-group"> <ul class="list-unstyled list-group">
{foreach from=$attachments item=item} {foreach from=$attachments item=item}
<li class="list-group-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"> <span class="sr-only">
{str tag=Download section=artefact.file} {$item->title} {str tag=Download section=artefact.file} {$item->title}
</span> </span>
...@@ -68,13 +68,6 @@ ...@@ -68,13 +68,6 @@
</span> </span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></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> </li>
{/foreach} {/foreach}
</ul> </ul>
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
</div> </div>
{/if} {/if}
<div class="mtl mbl">{$post->description|clean_html|safe} <div class="mtl mbl">
</div> {$post->description|clean_html|safe}
</div>
{if $post->files} {if $post->files}
...@@ -56,20 +57,13 @@ ...@@ -56,20 +57,13 @@
</span> </span>
</span> </span>
<span class="fa fa-download fa-lg pull-right pts text-watermark icon-action"></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> </li>
{/foreach} {/foreach}
</ul> </ul>
</div> </div>
</div> </div>
{/if} {/if}
{if $options.viewid && ($post->commentcount || $post->commentcount === 0)} {if $options.viewid && ($post->commentcount || $post->commentcount === 0)}
<div class="comments clearfix ptm mts"> <div class="comments clearfix ptm mts">
{if $post->commentcount > 0} {if $post->commentcount > 0}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{if $config.select} {if $config.select}
<div id="{$prefix}_open_upload_browse_container"> <div id="{$prefix}_open_upload_browse_container">
{if $config.selectone || $config.selectmodal} {if $config.selectmodal}
<div id="{$prefix}_upload_browse" class="filebrowser in-collapsible"> <div id="{$prefix}_upload_browse" class="filebrowser in-collapsible">
{else} {else}
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#{$prefix}_upload_browse"> <button type="button" class="btn btn-default" data-toggle="modal" data-target="#{$prefix}_upload_browse">
......
...@@ -6,5 +6,4 @@ ...@@ -6,5 +6,4 @@
<div> <div>
<a href="{$metadataurl}">{str tag=Details section=artefact.file}</a> <a href="{$metadataurl}">{str tag=Details section=artefact.file}</a>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -20,21 +20,31 @@ ...@@ -20,21 +20,31 @@
<span class="fa pts fa-chevron-down pull-right collapse-indicator"></span> <span class="fa pts fa-chevron-down pull-right collapse-indicator"></span>
</a> </a>
</h4> </h4>
<!-- Attachment list with view and download link -->
<div id="note-attach-{$blockid}" class="collapse"> <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} {foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link"> <li class="list-group-item">
<a href="{$item->downloadpath}"> <a href="{$item->downloadpath}" class="outer-link icon-on-hover">
<div class="file-icon mrs"> <span class="sr-only">
{if $item->iconpath} {str tag=Download section=artefact.file} {$item->title}
<img src="{$item->iconpath}" alt=""> </span>
{else}
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
</div>
{$item->title|truncate:25}
</a> </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> </li>
{/foreach} {/foreach}
</ul> </ul>
......
...@@ -12,18 +12,33 @@ ...@@ -12,18 +12,33 @@
</a> </a>
</h4> </h4>
<!-- Attachment list with view and download link -->
<div id="cv-attach-{$id}" class="collapse"> <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} {foreach from=$attachments item=item}
<li class="list-group-item-text list-group-item-link"> <li class="list-group-item">
<a href="{$item->downloadpath}"> <a href="{$item->downloadpath}" class="outer-link icon-on-hover">
{if $item->iconpath} <span class="sr-only">
<img src="{$item->iconpath}" alt=""> {str tag=Download section=artefact.file} {$item->title}
{else} </span>
<span class="fa fa-{$item->artefacttype} fa-lg text-default"></span>
{/if}
{$item->title|truncate:50}
</a> </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> </li>
{/foreach} {/foreach}
</ul> </ul>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
{/if} {/if}
{if $item.tags} {if $item.tags}
<div class="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} {list_tags owner=$item.owner tags=$item.tags}
</div> </div>
{/if} {/if}
......
...@@ -5,41 +5,61 @@ ...@@ -5,41 +5,61 @@
state is non-persistent. So until Dwoo gets smarter... state is non-persistent. So until Dwoo gets smarter...
*} *}
{assign var='author_link_index' value=1} {assign var='author_link_index' value=1}
{foreach from=$views item=view} {foreach from=$views item=view}
<div class="list-group-item"> <div class="list-group-item">
<h4 class="list-group-item-heading"><a href="{$view.fullurl}">{$view.title}</a></h4> <h4 class="list-group-item-heading">
<div class="list-group-item-text">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div> <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} {if $view.sharedby}
<div class="groupuserdate"> <div class="groupuserdate text-small">
{if $view.group && $loggedin} {if $view.group && $loggedin}
<a href="{group_homepage_url($view.groupdata)}">{$view.sharedby}</a> <a href="{group_homepage_url($view.groupdata)}" class="text-link">
{$view.sharedby}
</a>
{elseif $view.owner && $loggedin} {elseif $view.owner && $loggedin}
{if $view.anonymous} {if $view.anonymous}
{if $view.staff_or_admin} {if $view.staff_or_admin}
{assign var='realauthor' value=$view.sharedby} {assign var='realauthor' value=$view.sharedby}
{assign var='realauthorlink' value=profile_url($view.user)} {assign var='realauthorlink' value=profile_url($view.user)}
{/if} {/if}
{assign var='author' value=get_string('anonymoususer')}
{include file=author.tpl} {assign var='author' value=get_string('anonymoususer')}
{if $view.staff_or_admin}
{assign var='author_link_index' value=`$author_link_index+1`} {include file=author.tpl}
{/if}
{if $view.staff_or_admin}
{assign var='author_link_index' value=`$author_link_index+1`}
{/if}
{else} {else}
<a href="{profile_url($view.user)}">{$view.sharedby}</a> <a href="{profile_url($view.user)}" class="text-link">
{$view.sharedby}
</a>
{/if} {/if}
{else} {else}
{$view.sharedby} {$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} {/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> </div>
{/foreach} {/foreach}
</div> </div>
{else} {else}
<div class="panel-body"> <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> </div>
{/if} {/if}
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