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')) {
}
$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,7 +15,8 @@
</div>
{/if}
<div class="mtl mbl">{$post->description|clean_html|safe}
<div class="mtl mbl">
{$post->description|clean_html|safe}
</div>
......@@ -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">
......
......@@ -7,4 +7,3 @@
<a href="{$metadataurl}">{str tag=Details section=artefact.file}</a>
</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">
<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}
</div>
{$item->title|truncate:25}
<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}">
<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}
{$item->title|truncate:50}
<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">
<div class="groupuserdate text-small">
{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}
{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}
{$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>
<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}
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