Commit 737386ee authored by Pat Kira's avatar Pat Kira Committed by Aaron Wells

Form styling (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: Ic24bdd78f9207c4f09adce6b20ca55583c1403b8
parent 85b78c1f
......@@ -176,6 +176,7 @@ $elements = array(
'submit' => array(
'type' => 'submit',
'value' => get_string('saveprofile','artefact.internal'),
'class' => 'btn btn-success'
)
);
// Don't include fieldset if 'socialprofile' is not installed
......@@ -200,7 +201,7 @@ function get_desired_fields(&$allfields, $desiredfields, $section) {
global $USER;
if ($section == 'about') {
$r = get_record_select('view', 'type = ? AND owner = ?', array('profile', $USER->id), 'id');
$label = '<div id="profileicon"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php"><img src="'
$label = '<div id="profileicon" class="profile-icon pseudolabel pull-left"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php"><img src="'
. profile_icon_url($USER, 100, 100) . '" alt="' . get_string("editprofileicon", "artefact.file") . '"></a></div>';
$descr = get_string('aboutprofilelinkdescription', 'artefact.internal', get_config('wwwroot') . 'view/blocks.php?id=' . $r->id);
$descr .= get_string('aboutdescription', 'artefact.internal');
......
......@@ -111,6 +111,7 @@ $personalinformationform = pieform(array(
'save' => array(
'type' => 'submit',
'value' => get_string('save'),
'class' => 'btn btn-success'
),
),
),
......
......@@ -252,8 +252,15 @@ class Session {
if (isset($_SESSION['messages'])) {
$this->ensure_session(); // Make it writable and lock against other threads.
foreach ($_SESSION['messages'] as $key => $data) {
$typeClass = $data['type'] === 'ok' ? 'success' : $data['type'];
if ($typeClass === 'error') {
$typeClass = 'danger';
}
if ($data['placement'] == $placement) {
$result .= '<div class="' . $data['type'] . '"><div>';
$result .= '<div class="alert alert-' . $typeClass . '"><div>';
$result .= $data['msg'] . '</div></div>';
unset($_SESSION['messages'][$key]);
}
......
......@@ -60,6 +60,7 @@ $form = pieform(array(
'checkdirtychange' => false,
'method' => 'post',
'renderer' => 'oneline',
'class' => 'filter-form form-inline',
'elements' => $elements
));
......
......@@ -566,8 +566,8 @@ function contextualHelp(formName, helpName, pluginType, pluginName, page, sectio
* help closing the box
*/
function buildContextualHelpBox(content) {
var result = '<div class="fr">';
result += '<a href="" class="help-dismiss" onclick="return false;"><img src="' + config.theme['images/btn_close.png'] + '" alt="' + get_string('closehelp') + '"></a>';
var result = '<div class="pull-right pts">';
result += '<a href="" class="help-dismiss" onclick="return false;"><span class="glyphicon glyphicon-remove"></span></a>';
result += '</div>';
result += '<div id="helpstop">';
result += content;
......
......@@ -1793,7 +1793,7 @@ class View {
. '<input type="hidden" name="action_' . $action . '_' . $actionstring . '" value="1">'
. '<input type="hidden" name="sure" value="1">'
. '<input type="hidden" name="sesskey" value="' . $USER->get('sesskey') . '">'
. '<input type="submit" class="submit" name="removeblock_submit" value="' . get_string('yes') . '">'
. '<input class="submit btn btn-success" type="submit" name="removeblock_submit" value="' . get_string('yes') . '">'
. '</form>';
$baselink = get_config('wwwroot') . 'view/blocks.php?id=' . $this->get('id') . '&c=' . $category . '&new=' . $new;
$SESSION->add_info_msg(get_string('confirmdeleteblockinstance', 'view')
......@@ -3706,22 +3706,24 @@ class View {
$searchform = array(
'name' => 'searchviews',
'checkdirtychange' => false,
'renderer' => 'oneline',
'class' => 'search-views-form form-inline',
'elements' => array(
'query' => array(
'type' => 'text',
'title' => get_string('search') . ': ',
'class' => 'input-small',
'defaultvalue' => $searchdefault,
),
'type' => array(
'title' => get_string('searchwithin'),
'hiddenlabel' => true,
'class' => 'input-small',
'type' => 'select',
'options' => $searchoptions,
'defaultvalue' => $searchtype,
),
'orderby' => array(
'type' => 'select',
'class' => 'input-small',
'title' => get_string('sortby'),
'options' => array('atoz' => get_string('defaultsort', 'view'),
'latestcreated' => get_string('latestcreated', 'view'),
......@@ -3738,6 +3740,7 @@ class View {
),
'submit' => array(
'type' => 'submit',
'class' => 'btn btn-success mtm',
'value' => get_string('search')
)
)
......
......@@ -2079,7 +2079,11 @@ function get_help_icon($plugintype, $pluginname, $form, $element, $page='', $sec
json_encode($pluginname) . ',' . json_encode($page) . ',' .
json_encode($section)
. ',this); return false;'
<<<<<<< HEAD
) . '"><img src="' . $THEME->get_image_url('help') . '" alt="' . get_string('Help') . '" title="' . get_string('Help') . '"></a></span>';
=======
) . '"><span class="glyphicon glyphicon-info-sign"></span><span class="sr-only">Help</span></a></span>';
>>>>>>> Form styling (bootstrap)
}
function pieform_get_help(Pieform $form, $element) {
......
......@@ -233,6 +233,7 @@ abstract class PluginSearch extends Plugin implements IPluginSearch {
'autofocus' => false,
'validate' => false,
'presubmitcallback' => '',
'class' => 'header-search-form',
'elements' => array(
'query' => array(
'type' => 'text',
......
/**
* CSS rules for the file artefact plugin
*
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*/
#profileicons tfoot td.right input.submit {
font-weight: bold;
}
#profileicons tfoot td.right input#settings_delete {
font-weight: normal;
}
/* File upload box */
.fileupload {
margin-bottom: 10px;
padding: 5px 10px;
}
.uploaddisabled {
margin-bottom: 10px;
padding: 5px;
}
.uploadform label {
width: 80px;
display: inline-block;
}
#files_filebrowser_agreement {
margin-bottom: 10px;
margin-left: 80px;
}
#files_filebrowser_agreement label {
margin-left: -80px;
}
.fileuploadlicense {
margin-bottom: 10px;
}
.fileuploadlicense th {
padding-left: 0;
}
input#files_filebrowser_notice {
margin: 2px 1px 0 0;
}
.createfolder-message div {
margin-bottom: 3px;
}
#createfolder {
padding: 5px;
margin: 10px 0 5px 0;
}
/* File list */
tr.folder td.filename {
font-weight: bold;
}
tr.editrow table th,
tr.editrow table td {
border: 0;
background: none;
}
tr.folderhover a,
.foldernav a.folderhover {
text-decoration: none;
}
.icon-drag {
width: 24px;
height: 24px;
cursor: move;
display: table-cell;
vertical-align: top;
}
.file-move-list {
list-style-type: none;
}
.file-move-list li {
margin-left: 0;
}
.file-move-list li:before {
content: '\2192 ';
}
/* File list edit box */
#files_filebrowser_edit_row #files_filebrowser_edit_heading {
font-size: 1.3333em;
}
/* Edit journal post file list */
/* Edit note file list */
/* Edit goals and skill file list */
/* Edit resume composite file list */
#editpost_filebrowser_upload_container,
#editnote_filebrowser_upload_container,
#editgoalsandskills_filebrowser_upload_container,
#editcomposite_filebrowser_upload_container,
#instconf_artefactids_ownertabs {
margin-top: 20px;
}
#instconf_artefactids_ownertabs li.current a {
background-color: #FFFFFF;
}
#instconf_artefactids_upload_browse #artefactchooser-body {
background-color: #FFFFFF;
}
#editpost_filebrowser_upload_browse,
#editpost_filebrowser_open_upload_browse_container,
#editnote_filebrowser_upload_browse,
#editnote_filebrowser_open_upload_browse_container,
#editgoalsandskills_filebrowser_upload_browse,
#editgoalsandskills_filebrowser_open_upload_browse_container,
#editcomposite_filebrowser_upload_browse,
#editcomposite_filebrowser_open_upload_browse_container,
#instconf_artefactids_upload_browse,
#instconf_artefactids_open_upload_browse_container {
padding: 5px;
}
#editpost_filebrowser_agreement,
#editnote_filebrowser_agreement,
#editgoalsandskills_filebrowser_agreement,
#editcomposite_filebrowser_agreement {
margin-bottom: 10px;
margin-left: 80px;
}
#editpost_filebrowser_agreement label,
#editnote_filebrowser_agreement label,
#editgoalsandskills_filebrowser_agreement label,
#editcomposite_filebrowser_agreement label {
margin-left: -80px;
}
/* Edit journal post selected file list */
/* Edit note selected file list */
/* Edit goals and skill selected file list */
/* Edit resume composite selected file list */
#editpost_filebrowser_empty_selectlist,
#editnote_filebrowser_empty_selectlist,
#editgoalsandskills_filebrowser_empty_selectlist,
#editcomposite_filebrowser_empty_selectlist {
margin: 5px 0;
}
#editpost_filebrowser_selectlist,
#editnote_filebrowser_selectlist,
#editgoalsandskills_filebrowser_selectlist,
#editcomposite_filebrowser_selectlist {
margin: 0 0 10px 0;
}
#instconf_folder_selectlist {
margin: 0 0 15px 0;
}
/* Drop file upload */
#file_dropzone_container {
margin: 10px 0 0 0;
}
#file_dropzone_container .dz-message {
padding: 17px 0;
margin: 0;
opacity: 1;
position: relative;
transition: opacity 0.3s ease-in-out 0s;
text-align: center;
}
#file_dropzone_container .dz-preview {
display: none;
}
\ No newline at end of file
......@@ -68,7 +68,7 @@
<tr>
<td></td>
<td>
<input type="submit" class="submit" name="{$prefix}_update[{$fileinfo->id}]" id="{$prefix}_edit_artefact" value="{str tag=savechanges section=artefact.file}" />
<input class="submit btn btn-success" type="submit" name="{$prefix}_update[{$fileinfo->id}]" id="{$prefix}_edit_artefact" value="{str tag=savechanges section=artefact.file}" />
<input type="submit" class="cancel" name="{$prefix}_canceledit" id="{$prefix}_edit_cancel" value="{str tag=cancel}" />
</td>
</tr>
......
......@@ -75,7 +75,7 @@
{if $config.submitbutton}
<input type="submit" class="submit nojs-hidden-block" name="{$prefix}_uploadsubmit" id="{$prefix}_uploadsubmit" value="{str tag=upload section=artefact.file}" />
{/if}
<noscript><input type="submit" class="submit" name="{$prefix}_upload" id="{$prefix}_upload" value="{str tag=upload section=artefact.file}" /></noscript>
<noscript><input class="submit btn btn-success" type="submit" name="{$prefix}_upload" id="{$prefix}_upload" value="{str tag=upload section=artefact.file}" /></noscript>
</div>
</div>
......@@ -95,7 +95,7 @@
<div id="createfolder"{if $uploaddisabled} class="hidden"{/if}><div id="{$prefix}_createfolder_messages" class="createfolder-message"></div>
<label for="{$prefix}_createfolder_name" class="accessible-hidden sr-only">{str tag=createfolder section=artefact.file}</label>
<input type="text" class="text" name="{$prefix}_createfolder_name" id="{$prefix}_createfolder_name" size="40" />
<input type="submit" class="submit" name="{$prefix}_createfolder" id="{$prefix}_createfolder" value="{str tag=createfolder section=artefact.file}" /></div>
<input class="submit btn btn-success" type="submit" name="{$prefix}_createfolder" id="{$prefix}_createfolder" value="{str tag=createfolder section=artefact.file}" /></div>
{/if}
<div id="{$prefix}_foldernav" class="foldernav">
......
{if !$filelist}
<p>{str tag=nofilesfound section=artefact.file}</p>
{else}
<table id="{$prefix}_filelist" class="tablerenderer filelist fullwidth">
<table id="{$prefix}_filelist" class="tablerenderer filelist fullwidth table">
<thead>
<tr>
<th></th>
......
{include file="header.tpl"}
{$settingsformtag|safe}
<table id="profileicons" class="hidden tablerenderer fullwidth table">
<table id="profileicons" class="hidden tablerenderer fullwidth table table-striped">
<thead>
<tr>
<th class="profileiconcell">{str tag="image"}</th>
<th>{str tag="imagetitle" section=artefact.file}</th>
<th class="defaultcell">{str tag="Default" section=artefact.file}</th>
<th class="deletecell">{str tag="delete"}</th>
<th class="">{str tag="Default" section=artefact.file}</th>
<th class="">{str tag="delete"}</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td colspan="4" class="right"><input id="settings_default" type="submit" class="submit" name="default" value="{str tag="setdefault" section=artefact.file}"> <input id="settings_delete" type="submit" class="cancel" name="delete" value="{str tag="deleteselectedicons" section=artefact.file}"></td>
<td colspan="4" class="align-right"><input id="settings_default" class="submit btn btn-success" type="submit" name="default" value="{str tag="setdefault" section=artefact.file}"> <input id="settings_delete" type="submit" class="delete btn btn-danger" name="delete" value="{str tag="deleteselectedicons" section=artefact.file}"></td>
</tr>
</tfoot>
</table>
......
......@@ -45,7 +45,7 @@
</tbody>
</table>
<div class="right activity-buttons">
<input class="submit" type="submit" value="{str tag='markasread' section='activity'}" />
<input class="submit btn btn-success" type="submit" value="{str tag='markasread' section='activity'}" />
<input class="submit btn-del" type="button" value="{str tag='delete'}" onClick="markread(document.notificationlist, 'del'); return false;" />
</div>
</form>
......
......@@ -61,7 +61,7 @@
{if $controls}
<div>
<div id="bookform" class="hidden">{$compositeforms.book|safe}</div>
<button id="addbookbutton" class="cancel" onclick="toggleCompositeForm('book');">{str tag='add'}</button>
<button id="addbookbutton" class="btn btn-success" onclick="toggleCompositeForm('book');">{str tag='add'}</button>
</div>
{/if}
{if $license}
......
......@@ -58,7 +58,7 @@
{if $controls}
<div>
<div id="certificationform" class="hidden">{$compositeforms.certification|safe}</div>
<button id="addcertificationbutton" class="cancel" onclick="toggleCompositeForm('certification');">{str tag='add'}</button>
<button id="addcertificationbutton" class="btn btn-success" onclick="toggleCompositeForm('certification');">{str tag='add'}</button>
</div>
{/if}
{if $license}
......
......@@ -58,7 +58,7 @@
{if $controls}
<div>
<div id="educationhistoryform" class="hidden">{$compositeforms.educationhistory|safe}</div>
<button id="addeducationhistorybutton" class="cancel" onclick="toggleCompositeForm('educationhistory');">{str tag='add'}</button>
<button id="addeducationhistorybutton" class="btn btn-success" onclick="toggleCompositeForm('educationhistory');">{str tag='add'}</button>
</div>
{/if}
{if $license}
......
......@@ -58,7 +58,7 @@
{if $controls}
<div>
<div id="employmenthistoryform" class="hidden">{$compositeforms.employmenthistory|safe}</div>
<button id="addemploymenthistorybutton" class="submit" onclick="toggleCompositeForm('employmenthistory');">{str tag='add'}</button>
<button id="addemploymenthistorybutton" class="submit btn btn-success" onclick="toggleCompositeForm('employmenthistory');">{str tag='add'}</button>
</div>
{/if}
{if $license}
......
......@@ -58,7 +58,7 @@
{if $controls}
<div>
<div id="membershipform" class="hidden">{$compositeforms.membership|safe}</div>
<button id="addmembershipbutton" class="cancel" onclick="toggleCompositeForm('membership');">{str tag='add'}</button>
<button id="addmembershipbutton" class="btn btn-success" onclick="toggleCompositeForm('membership');">{str tag='add'}</button>
</div>
{/if}
{if $license}
......
This diff is collapsed.
// using bootstrap popover to style the help content
span.help {
font-size: $font-size-base + 5;
vertical-align: top;
padding-left:10px;
display: inline-block;
.glyphicon {
color: $mahara-blue;
}
}
.contextualHelp {
position: absolute;
top: 0;
left: 0;
z-index: $zindex-popover;
max-width: $popover-max-width;
width: 300px;
padding: 1px;
// Reset font and text propertes given new insertion method
font-family: $font-family-base;
......@@ -17,25 +26,24 @@
border: 1px solid $popover-fallback-border-color;
border: 1px solid $popover-border-color;
border-radius: $border-radius-large;
padding: 0 14px 8px;
font-size: $font-size-base - 1;
@include box-shadow(0 5px 10px rgba(0,0,0,.2));
// Overrides for proper insertion
white-space: normal;
.fr {
float: right;
.help-dismiss {
font-size: 16px;
color: $gray;
}
h3 {
margin: 0; // reset heading margin
padding: 8px 14px;
margin: 0 -14px 20px;
font-size: $font-size-base;
padding:8px 14px;
background-color: $popover-title-bg;
border-bottom: 1px solid darken($popover-title-bg, 5%);
border-radius: ($border-radius-large - 1) ($border-radius-large - 1) 0 0;
}
p {
padding: 9px;
}
}
// Generic custom css (anything longer than a screen view should have its own component file)
\ No newline at end of file
// Generic custom css (anything longer than a screen view should have its own component file)
/* Generated by Font Squirrel (http://www.fontsquirrel.com) */
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans/OpenSansRegular.eot');
src: url('../fonts/opensans/OpenSansRegular.eot') format('embedded-opentype'),
url('../fonts/opensans/OpenSansRegular.woff2') format('woff2'),
url('../fonts/opensans/OpenSansRegular.woff') format('woff'),
url('../fonts/opensans/OpenSansRegular.ttf') format('truetype'),
url('../fonts/opensans/OpenSansRegular.svg#OpenSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans/OpenSansItalic.eot');
src: url('../fonts/opensans/OpenSansItalic.eot') format('embedded-opentype'),
url('../fonts/opensans/OpenSansItalic.woff2') format('woff2'),
url('../fonts/opensans/OpenSansItalic.woff') format('woff'),
url('../fonts/opensans/OpenSansItalic.ttf') format('truetype'),
url('../fonts/opensans/OpenSansItalic.svg#OpenSansItalic') format('svg');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans/OpenSansLight.eot');
src: url('../fonts/opensans/OpenSansLight.eot') format('embedded-opentype'),
url('../fonts/opensans/OpenSansLight.woff2') format('woff2'),
url('../fonts/opensans/OpenSansLight.woff') format('woff'),
url('../fonts/opensans/OpenSansLight.ttf') format('truetype'),
url('../fonts/opensans/OpenSansLight.svg#OpenSansLight') format('svg');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans/OpenSansLightItalic.eot');
src: url('../fonts/opensans/OpenSansLightItalic.eot') format('embedded-opentype'),
url('../fonts/opensans/OpenSansLightItalic.woff2') format('woff2'),
url('../fonts/opensans/OpenSansLightItalic.woff') format('woff'),
url('../fonts/opensans/OpenSansLightItalic.ttf') format('truetype'),
url('../fonts/opensans/OpenSansLightItalic.svg#OpenSansLightItalic') format('svg');
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans/OpenSansBold.eot');
src: url('../fonts/opensans/OpenSansBold.eot') format('embedded-opentype'),
url('../fonts/opensans/OpenSansBold.woff2') format('woff2'),
url('../fonts/opensans/OpenSansBold.woff') format('woff'),
url('../fonts/opensans/OpenSansBold.ttf') format('truetype'),
url('../fonts/opensans/OpenSansBold.svg#OpenSansBold') format('svg');
font-weight: 700;
font-style: normal;
}
.pseudolabel {
// @extend label;
font-weight: bold;
vertical-align: top;
width: 200px;
......@@ -33,7 +32,6 @@
width:200px;
}
}
div.html {
padding-bottom: 15px;
}
......@@ -50,12 +48,6 @@ select {
@extend .form-control;
}
input[type="text"],