Commit f163fa6c authored by Pat Kira's avatar Pat Kira Committed by Aaron Wells

Comments on page view (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I2fbc8593a97edf9721edb40fe2ecc0561c98c15b
parent 91927381
......@@ -33,7 +33,7 @@ $deleteform = array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'value' => array(get_string('deleteplan','artefact.plans'), get_string('cancel')),
'goto' => get_config('wwwroot') . '/artefact/plans/index.php',
),
......
......@@ -33,7 +33,7 @@ $deleteform = array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-danger',
'class' => 'btn btn-default',
'value' => array(get_string('deletetask','artefact.plans'), get_string('cancel')),
'goto' => get_config('wwwroot') . '/artefact/plans/plan.php?id='.$todelete->get('parent'),
),
......
......@@ -64,6 +64,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => $baseurl,
),
......
......@@ -37,6 +37,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => group_homepage_url($group),
)
......
......@@ -74,7 +74,7 @@ $searchform = pieform(array(
'name' => 'search',
'checkdirtychange' => false,
'method' => 'post',
'class' => 'form-inline',
'class' => 'form-inline ptl pbl',
'elements' => $elements
)
);
......
......@@ -96,7 +96,7 @@ if ('admin' == $role) {
$searchform = pieform(array(
'name' => 'search',
'checkdirtychange' => false,
'class' => 'search-views-form form-inline',
'class' => 'search-views-form form-inline ptl pbl',
'elements' => array(
'id' => array(
'type' => 'hidden',
......
......@@ -64,7 +64,7 @@ $form = pieform(array(
'checkdirtychange' => false,
'method' => 'post',
'renderer' => 'div',
'class' => 'form-inline',
'class' => 'form-inline ptl pbl',
'elements' => array(
'inputgroup' => array(
'type' => 'fieldset',
......
......@@ -44,6 +44,7 @@ $form = pieform(array(
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'interaction/' .$instance->get('plugin') .
($returnto == 'index' ? '/index.php?group=' . $instance->get('group') : '/view.php?id=' . $instance->get('id')),
......
......@@ -73,6 +73,7 @@ $form = pieform(array(
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topic . '&post=' . $postid
),
......
......@@ -69,10 +69,12 @@ $form = pieform(array(
'autofocus' => false,
'elements' => array(
'title' => array(
'type' => 'html',
'value' => get_string('deletetopicsure', 'interaction.forum'),
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . ($returnto == 'view' ? 'interaction/forum/view.php?id=' . $topic->forumid : 'interaction/forum/topic.php?id=' . $topicid),
),
......
......@@ -67,11 +67,12 @@ if ($forums) {
'renderer' => 'oneline',
'elements' => array(
'submit' => array(
'type' => 'submit',
'class' => $forum->subscribed ? 'btn btn-default btn-xs' : 'btn btn-primary btn-xs',
'value' => $forum->subscribed ? get_string('Unsubscribe', 'interaction.forum') : get_string('Subscribe', 'interaction.forum'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default btn-xs',
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('Unsubscribe', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('Subscribe', 'interaction.forum'),
// 'help' => $i == 0 ? true : false
'help' => false
'help' => false
),
'forum' => array(
'type' => 'hidden',
......
......@@ -85,6 +85,7 @@ class PluginInteractionForum extends PluginInteraction {
),
'fieldset' => array(
'type' => 'fieldset',
'class' => 'last mtl',
'collapsible' => true,
'collapsed' => true,
'legend' => get_string('forumsettings', 'interaction.forum'),
......
......@@ -75,10 +75,10 @@ if ($membership && !$topic->forumsubscribed) {
'autofocus' => false,
'elements' => array(
'submit' => array(
'type' => 'button',
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => $topic->topicsubscribed ? '<span class="fa fa-lg fa-star-o prs text-danger"></span> ' . get_string('unsubscribefromtopic', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('subscribetotopic', 'interaction.forum'),
'class' => $topic->topicsubscribed ? 'btn btn-default' : 'btn btn-default',
'value' => $topic->topicsubscribed ? '<span class="fa fa-times fa-lg text-danger prs"></span>'. get_string('unsubscribefromtopic', 'interaction.forum') : '<span class="fa fa-star fa-lg text-primary prs"></span>' . get_string('subscribetotopic', 'interaction.forum'),
'help' => false
),
'topic' => array(
......
......@@ -182,7 +182,7 @@ if ($membership) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-star-o prs text-danger"></span> ' . get_string('unsubscribefromforum', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('subscribetoforum', 'interaction.forum'),
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('unsubscribefromforum', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('subscribetoforum', 'interaction.forum'),
'help' => false
),
'forum' => 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,7 +55,7 @@ function addFeedbackSuccess(form, data) {
}
function objectionSuccess(form, data) {
addElementClass('objection_form', 'hidden');
// addElementClass('objection_form', 'hidden');
$('objection_form_message').value = '';
rewriteCancelButtons();
formSuccess(form, data);
......
......@@ -57,8 +57,8 @@ $string['reallyaddaccesstoemptyview'] = 'Your page contains no blocks. Do you re
$string['viewdeleted'] = 'Page deleted';
$string['viewsubmitted'] = 'Page submitted';
$string['deletethisview'] = 'Delete this page';
$string['submitthisviewto'] = 'Submit this page to';
$string['submitthiscollectionto'] = 'Submit this collection to';
$string['submitthisviewto'] = 'Submit this page';
$string['submitthiscollectionto'] = 'Submit this collection';
$string['forassessment'] = 'for assessment';
$string['accessfromdate2'] = 'Nobody else can see this page before %s.';
$string['accessuntildate2'] = 'Nobody else can see this page after %s.';
......
......@@ -1375,31 +1375,38 @@ function group_view_submission_form($groupid) {
return pieform(array(
'name' => 'group_view_submission_form_' . $groupid,
'method' => 'post',
'renderer' => 'oneline',
'class' => 'form-inline',
'renderer' => 'div',
'class' => 'form-inline pts pbs',
'autofocus' => false,
'successcallback' => 'group_view_submission_form_submit',
'elements' => array(
'text1' => array(
'class' => 'mrm',
'class' => 'inline text-small',
'type' => 'html', 'value' => get_string('submit', 'group') . ' ',
),
'options' => array(
'type' => 'select',
'class' => 'mrs',
'collapseifoneoption' => false,
'optgroups' => $optgroups,
'options' => $options,
),
'text2' => array(
'type' => 'html',
'class' => 'forassessment mrs',
'class' => 'forassessment text-small',
'value' => get_string('forassessment', 'view'),
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-primary btn-sm',
'value' => get_string('submit')
'inputgroup' => array(
'type' => 'fieldset',
'class' => 'input-group',
'elements' => array(
'options' => array(
'type' => 'select',
'class' => 'form-control',
'collapseifoneoption' => false,
'optgroups' => $optgroups,
'options' => $options,
),
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-primary input-group-btn ',
'value' => get_string('submit')
),
),
),
'group' => array(
'type' => 'hidden',
......
......@@ -281,7 +281,7 @@ function render_license($artefact) {
if (!empty($details)) {
$html = '<a href="' . hsc($license) . '" class="license">';
if ($details->icon) {
$html .= '<img src="' . license_icon_url($details->icon) . '" class="license-icon"' .
$html .= '<img src="' . license_icon_url($details->icon) . '" class="license-icon prm"' .
'alt="' . get_string('licenseiconalt') . '">';
}
$html .= hsc($details->displayname) . '</a>';
......
......@@ -36,6 +36,7 @@ function objection_form() {
$form['elements']['submit'] = array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('notifyadministrator'), get_string('cancel')),
'confirm' => array(get_string('notifyadministratorconfirm')),
);
......@@ -132,6 +133,7 @@ function notrude_form() {
return array(
'name' => 'notrude_form',
'class' => 'form-inline',
'method' => 'post',
'elements' => array(
'objection' => array(
......@@ -140,10 +142,12 @@ function notrude_form() {
),
'text' => array(
'type' => 'html',
'class' => 'pbm',
'value' => get_string('viewobjectionableunmark', 'view'),
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-default',
'value' => get_string('notobjectionable'),
),
),
......
......@@ -3706,7 +3706,7 @@ class View {
$searchform = array(
'name' => 'searchviews',
'checkdirtychange' => false,
'class' => 'search-views-form form-inline',
'class' => 'search-views-form form-inline ptl pbl',
'elements' => array(
'query' => array(
'type' => 'text',
......@@ -6288,26 +6288,38 @@ function view_group_submission_form($view, $tutorgroupdata, $returnto=null) {
$form = array(
'name' => 'view_group_submission_form_' . $viewid,
'method' => 'post',
'renderer' => 'oneline',
'renderer' => 'div',
'class' => 'form-inline ptl pbl',
'autofocus' => false,
'successcallback' => 'view_group_submission_form_submit',
'elements' => array(
'text1' => array(
'type' => 'html',
'class' => 'inline',
'value' => '',
),
'options' => array(
'type' => 'select',
'collapseifoneoption' => false,
'options' => $options,
),
'text2' => array(
'type' => 'html',
'class' => 'prm',
'value' => get_string('forassessment', 'view'),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('submit')
'inputgroup' => array(
'type' => 'fieldset',
'class' => 'input-group',
'elements' => array(
'options' => array(
'type' => 'select',
'class' => 'form-control',
'collapseifoneoption' => false,
'options' => $options,
),
'submit' => array(
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-primary input-group-btn',
'value' => get_string('submit')
)
),
),
'returnto' => array(
'type' => 'hidden',
......
......@@ -3775,7 +3775,7 @@ function build_pagination($params) {
}
// Begin building the output
$output = '<div id="' . $params['id'] . '" class="pagination-wrapper';
$output = '<div id="' . $params['id'] . '" class="pagination-wrapper ptl';
if (isset($params['class'])) {
$output .= ' ' . hsc($params['class']);
}
......
......@@ -49,7 +49,7 @@ $form = pieform(array(
'elements' => array(
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'class' => 'btn btn-default',
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . $goto,
)
......
......@@ -37,7 +37,7 @@ $form = pieform(array(
'name' => 'filter',
'method' => 'post',
'renderer' => 'div',
'class' => 'form-inline',
'class' => 'form-inline ptl pbl',
'elements' => array(
'inputgroup' => array(
'type' => 'fieldset',
......
......@@ -4,15 +4,23 @@
<div id="blogpost-{$postid}" class="panel-body">
{if $artefacttitle}<h3 class="title">{$artefacttitle|safe}</h3>{/if}
<div class="postdetails metadata mbm">{$postedbyon}</div>
{$artefactdescription|clean_html|safe}
<div class="postdetails metadata mbm">
<span class="fa fa-calendar mrs"></span>
{$postedbyon}
</div>
{if $artefact->get('tags')}<div class="tags">{str tag=tags}: {list_tags owner=$artefact->get('owner') tags=$artefact->get('tags')}</div>{/if}
{if $artefact->get('tags')}
<div class="tags metadata">
<span class="fa fa-tags"></span>
<strong>{str tag=tags}:</strong>
{list_tags owner=$artefact->get('owner') tags=$artefact->get('tags')}
</div>
{/if}
{$artefactdescription|clean_html|safe}
{if $license}
<div class="postlicense">
<div class="postlicense mtm mbl">
{$license|safe}
</div>
{/if}
......
{foreach from=$posts item=post}
<div class="post ptm pbm">
<div class="post ptm mbxl">
<h4 class="title">
<a href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">{$post->title}</a>
</h4>
......@@ -53,19 +53,21 @@
{/if}
{if $options.viewid && ($post->commentcount || $post->commentcount === 0)}
<div class="comments">
<div class="comments clearfix ptm mts">
{if $post->commentcount > 0}
<a id="block_0{$post->id}{$options.blockid}" class="commentlink" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">{str tag=Comments section=artefact.comment} ({$post->commentcount})</a>
<a id="block_0{$post->id}{$options.blockid}" class="commentlink text-thin pull-left" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">{str tag=Comments section=artefact.comment} ({$post->commentcount})</a>
{else}
{if $allowcomments}
<span class="nocomments">{str tag=Comments section=artefact.comment} ({$post->commentcount})</span>
<span class="nocomments text-thin pull-left">{str tag=Comments section=artefact.comment} ({$post->commentcount})</span>
{/if}
{if $post->allowcomments}
<p class="text-right">
<a class="addcomment text-thin" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">
<span class="fa fa-lg fa-plus text-primary prs"></span>
{str tag=addcomment section=artefact.comment}
</a>
</p>
{/if}
{/if}
{if $post->allowcomments}
<a class="mtl mbl btn btn-default btn-sm btn-block addcomment" href="{$WWWROOT}artefact/artefact.php?artefact={$post->id}&view={$options.viewid}">
<span class="fa fa-lg fa-plus text-primary prs"></span>
{str tag=addcomment section=artefact.comment}
</a>
{/if}
</div>
{/if}
......
<div class="text-center imageblock panel-body" itemscope itemtype="http://schema.org/ImageObject">
<div class="imageblock panel-body" itemscope itemtype="http://schema.org/ImageObject">
<div class="image">
<a href="{$url}">
<img src="{$src}" alt="{$description}" itemprop="contentURL">
......@@ -10,8 +10,7 @@
{$description}
</div>
{/if}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
</div>
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
{include file="header.tpl"}
<div class="deletemessage">
<h2>{$subheading}</h2>
<p class="lead text-small">{$message}</p>
<p class="lead">{$message}</p>
{$form|safe}
</div>
{include file="footer.tpl"}
......@@ -121,7 +121,7 @@
{/foreach}
{/if}
{if $group_view_submission_form}
<li class="list-group-item text-small list-group-item-default">
<li class="list-group-item list-group-item-default">
<div class="submissionform">
{$group_view_submission_form|safe}
</div>
......
{include file="header.tpl"}
<h2>{$subheading}</h2>
<div class="message deletemessage">{$deleteform|safe}</div>
<div class="message deletemessage">
{$deleteform|safe}
</div>
{include file="interaction:forum:simplepost.tpl" post=$topic groupadmins=$groupadmins}
{include file="footer.tpl"}
......@@ -38,9 +38,14 @@
</span>
</h3>
<div class="text-small threaddetails mtm">
<p>{$topic->body|str_shorten_html:50:true:false|safe}</p>
{if $publicgroup}
<a href="{$topic->feedlink}">
<span class="fa fa-rss"></span>
</a>
{/if}
</h3>
<div class="detail text-small mts">
{$topic->body|str_shorten_html:80:true:false|safe}
</div>
</td>
<td class="postscount text-center">
......@@ -66,19 +71,20 @@
</td>
<td class="control-buttons">
{if $moderator}
<div class="btn-group">
<a href="{$WWWROOT}interaction/forum/edittopic.php?id={$topic->id}&amp;returnto=view" class="btn btn-default btn-xs" title="{str tag="edit"}">
<span class="fa fa-pencil"></span>
<span class="sr-only">
{str tag=edittopicspecific section=interaction.forum arg1=$topic->subject}
</span>
</a>
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id}&amp;returnto=view" class="btn btn-danger btn-xs" title="{str tag="delete"}">
<span class="fa fa-trash"></span>
<a href="{$WWWROOT}interaction/forum/deletetopic.php?id={$topic->id}&amp;returnto=view" class="btn btn-default btn-xs" title="{str tag="delete"}">
<span class="fa fa-trash text-danger"></span>
<span class="sr-only">
{str tag=deletetopicspecific section=interaction.forum arg1=$topic->subject}
</span>
</a>
</div>
</td>
{/if}
</tr>
......
......@@ -47,6 +47,7 @@
</div>
<div id="viewforum">
<<<<<<< HEAD
{if $stickytopics || $regulartopics}
<form action="" method="post" class="mtxl">
......@@ -61,6 +62,46 @@
</tr>
</thead>
=======
<h3 class="pull-left">
{str tag=Topics section="interaction.forum"}
</h3>
{if $membership && ($moderator || ($forum->newtopicusers != 'moderators') && $ineditwindow) }
<div class="btn-top-right ptl pbxl text-right">
<div class="btn-group">
<a href="{$WWWROOT}interaction/forum/edittopic.php?forum={$forum->id}" class="btn btn-default newforumtopic">
<span class="fa fa-plus fa-lg prs text-primary"></span>
{str tag="newtopic" section="interaction.forum"}
</a>
{if $admin}
<a href="{$WWWROOT}interaction/edit.php?id={$forum->id}" class="btn btn-default editforumtitle">
<span class="fa fa-cog"></span>
{str tag="edittitle" section="interaction.forum"}
</a>
<a href="{$WWWROOT}interaction/delete.php?id={$forum->id}" class="btn btn-default deleteforum">
<span class="fa fa-trash text-danger"></span>
{str tag="deleteforum" section="interaction.forum"}
</a>
{/if}
</div>
</div>
{/if}
{if $stickytopics || $regulartopics}
<form action="" method="post" class="ptxl">
<table id="forumtopicstable" class="table fullwidth">
<tr>
<th class="narrow"></th>
<th class="narrow"></th>
<th class="topic">{str tag="Topic" section="interaction.forum"}</th>
<th class="posterth">{str tag="Poster" section="interaction.forum"}</th>
<th class="postscount center">{str tag="Posts" section="interaction.forum"}</th>
<th class="lastpost">{str tag="lastpost" section="interaction.forum"}</th>
{if $moderator}<th class="right btns2"></th>{/if}
</tr>
>>>>>>> Comments on page view (bootstrap)
{if $stickytopics}
{include file="interaction:forum:topics.tpl" topics=$stickytopics moderator=$moderator forum=$forum publicgroup=$publicgroup sticky=true}
{/if}
......@@ -78,6 +119,7 @@
{if $membership && (!$forum->subscribed || $moderator)}
<div class="forumselectwrap form-inline ptl">
<<<<<<< HEAD
<select name="type" id="action">
<option value="default" selected="selected">
{str tag="chooseanaction" section="interaction.forum"}
......@@ -131,6 +173,64 @@
<button type="submit" name="updatetopics" class="btn btn-success">
{str tag="updateselectedtopics" section="interaction.forum"}
</button>
=======
<div class="input-group">
<select name="type" id="action">
<option value="default" selected="selected">
{str tag="chooseanaction" section="interaction.forum"}
</option>
{if !$forum->subscribed}
<option value="subscribe">
{str tag="Subscribe" section="interaction.forum"}
</option>
<option value="unsubscribe">
{str tag="Unsubscribe" section="interaction.forum"}
</option>
{/if}
{if $moderator}
<option value="sticky">