Commit 237f3453 authored by Naomi Guyer's avatar Naomi Guyer Committed by Robert Lyon

Bootstrap regressions (BUG 1465107)

Change-Id: I72e2d50714207ca395d66b1622ef93b348210abf
parent 3f1452f6
......@@ -182,7 +182,7 @@ if (!get_record('blocktype_installed', 'active', 1, 'name', 'socialprofile')) {
$profileform = pieform(array(
'name' => 'profileform',
'class' => 'jstabs',
'class' => 'jstabs form-group-nested',
'plugintype' => 'artefact',
'pluginname' => 'internal',
// will be uncommented when js for tabbed interface is called again after form submit
......@@ -197,10 +197,10 @@ 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" class="profile-icon pseudolabel"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php" class="user-icon"><img src="'
$label = '<div id="profileicon" class="profile-icon pseudolabel pull-left"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php" class="user-icon"><img src="'
. profile_icon_url($USER, 100, 100) . '" alt="' . get_string("editprofileicon", "artefact.file") . '"></a></div>';
$descr = '<div class="about-text">' . get_string('aboutprofilelinkdescription', 'artefact.internal', get_config('wwwroot') . 'view/blocks.php?id=' . $r->id);
$descr .= '<p>' . get_string('aboutdescription', 'artefact.internal') . '</p></div>';
$descr = '' . get_string('aboutprofilelinkdescription', 'artefact.internal', get_config('wwwroot') . 'view/blocks.php?id=' . $r->id);
$descr .= '<p>' . get_string('aboutdescription', 'artefact.internal') . '</p>';
}
else {
$label = '';
......
......@@ -290,6 +290,8 @@ $string['wsauthnotenabled'] = 'The web service authentication plugin is disabled
$string['wsdocumentation'] = 'Web service documentation';
$string['wspassword'] = 'Web service password';
$string['wsusername'] = 'Web service username';
$string['webservicesenabled'] = 'Web services enabled';
$string['webservicesnotenabled'] = 'You need to enable at least one Protocol';
// Web Service functions errors
$string['nooauth'] = 'Not enabled for OAuth';
......
......@@ -559,7 +559,7 @@ $elements['submit'] = array(
$designskinform = pieform(array(
'name' => 'designskinform',
'class' => 'jstabs',
'class' => 'jstabs form-group-nested',
'method' => 'post',
//'jsform' => true,
'plugintype' => 'core',
......
......@@ -393,9 +393,9 @@ $navbar-default-border: darken($navbar-default-bg, 6.5%) !default;
// Navbar links
$navbar-default-link-color: #777 !default;
$navbar-default-link-hover-color: #333 !default;
$navbar-default-link-hover-bg: transparent !default;
$navbar-default-link-hover-bg: #F1F1F1 !default;
$navbar-default-link-active-color: #555 !default;
$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default;
$navbar-default-link-active-bg: #F1F1F1 !default;
$navbar-default-link-disabled-color: #ccc !default;
$navbar-default-link-disabled-bg: transparent !default;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -92,7 +92,7 @@ h1 ~ div > .btn-group-top,
position: relative;
z-index: 1;
.btn {
border-top-radius: 0;
@include border-top-radius(0);
border-top:0;
}
.btn-group-top {
......@@ -136,7 +136,7 @@ td.btn-group {
@media (min-width: $screen-xs-max ) {
@include clearfix;
&.btn-group-top .btn {
border-top-radius: 0;
@include border-top-radius(0);
}
}
@media (max-width: $screen-xs-max ) {
......
......@@ -20,7 +20,8 @@
padding: 0;
}
&.fieldset {
&.fieldset,
.form-group-nested & {
.form-group {
padding: 20px 0;
}
......
......@@ -84,7 +84,7 @@ label,
.textarea label {
vertical-align: top;
}
.radio label,
.radio label,
.checkbox label {
margin-top: 0;
}
......@@ -130,3 +130,7 @@ label,
.form-control:disabled {
color: #aaa;
}
.form-message-inline {
vertical-align: top;
}
......@@ -2,22 +2,18 @@
* Modificatiosn to bootstraps default navbar components
*/
.navbar-secondary {
background-color: darken($brand-default, 5%);
&.minor-nav {
margin-top: -21px; // substract the margin used on the level two nav
}
}
.navbar.header {
margin-bottom:0;
padding: 7px 0;
border-bottom:1px solid #f0f0f0;
}
.dropdown-adminnav {
margin-bottom: $grid-gutter-width;
}
body:not(.admin) .navbar.minor-nav {
margin-bottom:0;
margin-bottom: 0;
}
.navbar-fixed-top {
......
......@@ -31,6 +31,9 @@
@media (min-width: $screen-md-min) {
padding: 10px 15px;
}
&:hover {
background: transparent;
}
}
}
......
......@@ -43,7 +43,7 @@
}
&.first .panel-heading a {
border-top-radius: 3px;
@include border-top-radius(3px);
}
legend {
......@@ -64,7 +64,7 @@
padding: 0;
.pieform > .collapsible-group:first-child & {
border-top-radius: 3px;
@include border-top-radius(3px);
}
}
......@@ -83,7 +83,7 @@
position: relative;
padding: 20px 0;
border-bottom: 1px solid #f0f0f0;
&:last-child,
&:last-child,
&.last {
border-bottom: 0;
}
......
......@@ -394,9 +394,9 @@ $navbar-default-border: darken($navbar-default-bg, 6.5%) !default;
// Navbar links
$navbar-default-link-color: #777 !default;
$navbar-default-link-hover-color: #333 !default;
$navbar-default-link-hover-bg: transparent !default;
$navbar-default-link-hover-bg: #F1F1F1 !default;
$navbar-default-link-active-color: #555 !default;
$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default;
$navbar-default-link-active-bg: #F1F1F1 !default;
$navbar-default-link-disabled-color: #ccc !default;
$navbar-default-link-disabled-bg: transparent !default;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{if $MAINNAV}
<nav id="main-nav" class="{if $ADMIN || $INSTITUTIONALADMIN || $STAFF || $INSTITUTIONALSTAFF}{if $DROPDOWNMENU}dropdown-adminnav {else}adminnav {/if}{/if} nav collapse navbar-collapse nav-main main-nav navbar-inverse">
<nav id="main-nav" class="{if $ADMIN || $INSTITUTIONALADMIN || $STAFF || $INSTITUTIONALSTAFF}{if $DROPDOWNMENU}dropdown-adminnav navbar-default{else}adminnav navbar-inverse{/if}{else}navbar-inverse{/if} nav collapse navbar-collapse nav-main main-nav">
<div class="container">
{if $ADMIN || $INSTITUTIONALADMIN || $STAFF || $INSTITUTIONALSTAFF}
<div class="navbar-header">
......
......@@ -25,31 +25,58 @@ safe_require('auth', 'webservice');
$heading = get_string('webservices_title', 'auth.webservice');
$webservice_menu = PluginAuthWebservice::admin_menu_items();
$form = get_config_options_extended();
$serviceenabled = get_string('webservicesenabled', 'auth.webservice');
$servicenotenabled = get_string('webservicesnotenabled', 'auth.webservice');
$inlinejs = <<<JS
jQuery(function ($) {
var webservicesenabled = '$serviceenabled';
var webservicesnotenabled = '$servicenotenabled';
function save_protos_switch(name) {
// Check if we have master switch and at least one protocol active
var master = $('#activate_webservices').find('input:checkbox');
var target = $('#activate_webservices').siblings('.form-group').find('input:checkbox');
if ($(master).filter(':checked').length) {
// master switch is on
if (target.filter(':checked').length === 0) {
$('#needprotocols').removeClass('text-success').addClass('text-danger').text(webservicesnotenabled);
}
else {
$('#needprotocols').removeClass('text-danger').addClass('text-success').text(webservicesenabled);
}
}
else {
$('#needprotocols').removeClass('text-danger').removeClass('text-success').text('');
}
// Save new state
if (!$('#ajax_' + name).length) {
$('#activate_webservice_protos_' + name).append('<input id="ajax_' + name + '" type="hidden" name="ajax" value="1">');
}
$.post('index.php', $('#activate_webservice_protos_' + name).serialize());
}
$('#activate_webservices_enabled').change(function() {
// open the protocols fieldset
if (!$('#needprotocols').length) {
$('#activate_webservices_enabled_container').append('<span id="needprotocols" class="form-message-inline pll"></span>');
}
$('#activate_webservices_enabled').on('change', function() {
var target = $(this).closest('form').siblings('.form-group').find('input:checkbox');
if ($(this).is(':checked')) {
// alert user to switch protocols on if none are active
if ($('#activate_webservices_protos_pseudofieldset').closest('.pseudofieldset').find('input:checkbox:checked').length == 0) {
$('#activate_webservices_protos_pseudofieldset').parent().find('.panel-body').collapse('show');
$('#activate_webservices_protos_pseudofieldset').find('div:first').before('<div class="error">You need to enable at least one Protocol</div>');
if (target.filter(':checked').length === 0) {
$('#needprotocols').removeClass('text-success').addClass('text-danger').text(webservicesnotenabled);
}
else {
$('#needprotocols').removeClass('text-danger').addClass('text-success').text(webservicesenabled);
}
}
else {
// turn all protocols off - not sure if we need this or should leave protocols on when master switch is off
$('#activate_webservices_protos_pseudofieldset').closest('.pseudofieldset').find('input:checkbox').attr('checked', false);
// turn all protocols off
target.prop('checked', false);
$('#activate_webservices').append('<input type="hidden" name="ajax" value="1">');
$('#activate_webservices_pseudofieldset .form-message-inline').text('');
}
// save master switch form
$.post('index.php', $('#activate_webservices').serialize());
......@@ -120,7 +147,7 @@ function activate_webservice_proto_submit(Pieform $form, $values) {
if (!empty($_POST['ajax'])) {
exit;
}
redirect('/webservice/admin/index.php?open=activate_webservices_protos');
redirect('/webservice/admin/index.php');
}
function webservices_function_groups_submit(Pieform $form, $values) {
......@@ -315,7 +342,12 @@ function webservices_master_switch_form() {
function webservices_protocol_switch_form() {
// enable/disable separate protocols of SOAP/XML-RPC/REST
$elements = array();
$elements['label'] = array('title' => ' ', 'type' => 'html', 'value' => '<div class="title">' . get_string('protocol', 'auth.webservice') . '</div>');
$elements['label'] = array(
'title' => ' ',
'type' => 'html',
'class' => 'fake-form',
'value' => '<h4 class="mb0 title">' . get_string('protocol', 'auth.webservice') . '</h4>'
);
foreach (array('soap', 'xmlrpc', 'rest', 'oauth') as $proto) {
$enabled = (get_config('webservice_' . $proto . '_enabled') || 0);
......@@ -988,31 +1020,26 @@ function get_config_options_extended() {
$elements = array(
// fieldset of master switch
'webservicesmaster' => array(
'type' => 'fieldset',
'legend' => get_string('masterswitch', 'auth.webservice'),
'elements' => webservices_master_switch_form(),
'collapsible' => true,
'collapsed' => true,
'name' => 'activate_webservices',
),
// fieldset of protocol switches
'protocolswitches' => array(
'type' => 'fieldset',
'legend' => get_string('protocolswitches', 'auth.webservice'),
'elements' => array(
'protos_help' => array(
'type' => 'html',
'value' => '<div><p>' . get_string('manage_protocols', 'auth.webservice') . '</p></div>',
'type' => 'html',
'value' => '<div><p>' . get_string('manage_protocols', 'auth.webservice') . '</p></div>',
),
'enablewebserviceprotos' => array(
'type' => 'html',
'value' => $protos->build(false),
'masterswitchlabel' => array(
'type' => 'html',
'value' => '<h4 class="mtxl">' . get_string('masterswitch', 'auth.webservice') . '</h4>',
),
'webservicesmasterswitchform' => webservices_master_switch_form()['webservicesmasterswitchform'],
'enablewebserviceprotos' => array(
'type' => 'html',
'value' => $protos->build(false),
)
),
'collapsible' => true,
'collapsed' => true,
'name' => 'activate_webservices_protos',
'name' => 'activate_webservices',
),
// System Certificates
......
......@@ -186,7 +186,7 @@ $webservice_menu = PluginAuthWebservice::admin_menu_items();
$smarty->assign('SUBPAGENAV', $webservice_menu);
// Check that webservices is enabled
$smarty->assign('disabled', (get_config('webservice_enabled') ? false : true));
$smarty->assign('disabledprotocols', (empty($elements['protocol']['options']) ? get_config('wwwroot') . 'webservice/admin/index.php?open=activate_webservices_protos' : false));
$smarty->assign('disabledprotocols', (empty($elements['protocol']['options']) ? get_config('wwwroot') . 'webservice/admin/index.php' : false));
$smarty->display('auth:webservice:testclient.tpl');
die;
......
......@@ -26,7 +26,6 @@ Scenario: Turning Master swtiches and protocol switches on checking test client
And I am on homepage
And I follow "Administration"
And I go to "webservice/admin/index.php"
And I follow "Switch protocols on or off"
# Turning protocol off
And I uncheck "activate_webservice_protos_soap_enabled"
# Going to webservices test client page
......
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