Refactored CSS with common backend rules for users page.

This commit is contained in:
Alex Tselegidis 2016-07-15 21:15:27 +02:00
parent fe215e8be6
commit afca1a015e
5 changed files with 37 additions and 73 deletions

View file

@ -36,7 +36,7 @@
}); });
</script> </script>
<div id="users-page" class="container-fluid"> <div id="users-page" class="container-fluid backend-page">
<?php <?php
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -77,7 +77,7 @@
<div class="results"></div> <div class="results"></div>
</div> </div>
<div class="details column col-xs-12 col-sm-7"> <div class="record-details column col-xs-12 col-sm-7">
<div class="btn-toolbar"> <div class="btn-toolbar">
<div class="add-edit-delete-group btn-group"> <div class="add-edit-delete-group btn-group">
<button id="add-admin" class="btn btn-primary"> <button id="add-admin" class="btn btn-primary">
@ -218,7 +218,7 @@
<div class="results"></div> <div class="results"></div>
</div> </div>
<div class="details column col-xs-12 col-sm-7"> <div class="record-details column col-xs-12 col-sm-7">
<div class="pull-left"> <div class="pull-left">
<div class="add-edit-delete-group btn-group"> <div class="add-edit-delete-group btn-group">
<button id="add-provider" class="btn btn-primary"> <button id="add-provider" class="btn btn-primary">
@ -492,7 +492,7 @@
<div class="results"></div> <div class="results"></div>
</div> </div>
<div class="details column col-xs-12 col-sm-7"> <div class="record-details column col-xs-12 col-sm-7">
<div class="btn-toolbar"> <div class="btn-toolbar">
<div class="add-edit-delete-group btn-group"> <div class="add-edit-delete-group btn-group">
<button id="add-secretary" class="btn btn-primary"> <button id="add-secretary" class="btn btn-primary">

View file

@ -496,42 +496,6 @@ body .form-horizontal .controls {
cursor: pointer; cursor: pointer;
} }
#users-page .filter-records {
max-width: 380px;
margin-bottom: 20px;
}
#users-page .filter-records .results {
overflow-y: auto;
max-height: 650px;
outline: none;
}
#users-page .secretary-row,
#users-page .provider-row,
#users-page .admin-row {
padding: 10px 7px;
}
#users-page .secretary-row:hover:not(.selected-row),
#users-page .provider-row:hover:not(.selected-row),
#users-page .admin-row:hover:not(.selected-row) {
cursor: pointer;
background-color: #F3F3F3;
}
#users-page .selected-row {
background-color: #F4F4F4;
border-right: 5px solid #35B66F;
}
#users-page .details input,
#users-page .details select,
#users-page .details textarea {
background-color: white;
cursor: pointer;
}
#users-page #secretary-notifications.active, #users-page #secretary-notifications.active,
#users-page #provider-notifications.active, #users-page #provider-notifications.active,
#users-page #admin-notifications.active { #users-page #admin-notifications.active {

View file

@ -35,7 +35,7 @@
*/ */
$('#admins').on('submit', '#filter-admins form', function() { $('#admins').on('submit', '#filter-admins form', function() {
var key = $('#filter-admins .key').val(); var key = $('#filter-admins .key').val();
$('#filter-admins .selected-row').removeClass('selected-row'); $('#filter-admins .selected').removeClass('selected');
this.resetForm(); this.resetForm();
this.filter(key); this.filter(key);
return false; return false;
@ -72,8 +72,8 @@
}); });
this.display(admin); this.display(admin);
$('#filter-admins .selected-row').removeClass('selected-row'); $('#filter-admins .selected').removeClass('selected');
$(e.currentTarget).addClass('selected-row'); $(e.currentTarget).addClass('selected');
$('#edit-admin, #delete-admin').prop('disabled', false); $('#edit-admin, #delete-admin').prop('disabled', false);
}.bind(this)); }.bind(this));
@ -84,7 +84,7 @@
this.resetForm(); this.resetForm();
$('#admins .add-edit-delete-group').hide(); $('#admins .add-edit-delete-group').hide();
$('#admins .save-cancel-group').show(); $('#admins .save-cancel-group').show();
$('#admins .details').find('input, textarea').prop('readonly', false); $('#admins .record-details').find('input, textarea').prop('readonly', false);
$('#admin-password, #admin-password-confirm').addClass('required'); $('#admin-password, #admin-password-confirm').addClass('required');
$('#admin-notifications').prop('disabled', false); $('#admin-notifications').prop('disabled', false);
$('#filter-admins button').prop('disabled', true); $('#filter-admins button').prop('disabled', true);
@ -97,7 +97,7 @@
$('#admins').on('click', '#edit-admin', function() { $('#admins').on('click', '#edit-admin', function() {
$('#admins .add-edit-delete-group').hide(); $('#admins .add-edit-delete-group').hide();
$('#admins .save-cancel-group').show(); $('#admins .save-cancel-group').show();
$('#admins .details').find('input, textarea').prop('readonly', false); $('#admins .record-details').find('input, textarea').prop('readonly', false);
$('#admin-password, #admin-password-confirm').removeClass('required'); $('#admin-password, #admin-password-confirm').removeClass('required');
$('#admin-notifications').prop('disabled', false); $('#admin-notifications').prop('disabled', false);
@ -287,16 +287,16 @@
AdminsHelper.prototype.resetForm = function() { AdminsHelper.prototype.resetForm = function() {
$('#admins .add-edit-delete-group').show(); $('#admins .add-edit-delete-group').show();
$('#admins .save-cancel-group').hide(); $('#admins .save-cancel-group').hide();
$('#admins .details').find('input, textarea').prop('readonly', true); $('#admins .record-details').find('input, textarea').prop('readonly', true);
$('#admins .form-message').hide(); $('#admins .form-message').hide();
$('#admin-notifications').prop('disabled', true); $('#admin-notifications').prop('disabled', true);
$('#admins .required').css('border', ''); $('#admins .required').css('border', '');
$('#admin-password, #admin-password-confirm').css('border', ''); $('#admin-password, #admin-password-confirm').css('border', '');
$('#admins .details').find('input, textarea').val(''); $('#admins .record-details').find('input, textarea').val('');
$('#admin-notifications').removeClass('active'); $('#admin-notifications').removeClass('active');
$('#edit-admin, #delete-admin').prop('disabled', true); $('#edit-admin, #delete-admin').prop('disabled', true);
$('#filter-admins .selected-row').removeClass('selected-row'); $('#filter-admins .selected').removeClass('selected');
$('#filter-admins button').prop('disabled', false); $('#filter-admins button').prop('disabled', false);
$('#filter-admins .results').css('color', ''); $('#filter-admins .results').css('color', '');
}; };
@ -388,7 +388,7 @@
? info + ', ' + admin.phone_number : info; ? info + ', ' + admin.phone_number : info;
var html = var html =
'<div class="admin-row" data-id="' + admin.id + '">' + '<div class="admin-row entry" data-id="' + admin.id + '">' +
'<strong>' + name + '</strong><br>' + '<strong>' + name + '</strong><br>' +
info + '<br>' + info + '<br>' +
'</div><hr>'; '</div><hr>';
@ -407,11 +407,11 @@
AdminsHelper.prototype.select = function(id, display) { AdminsHelper.prototype.select = function(id, display) {
display = display || false; display = display || false;
$('#filter-admins .selected-row').removeClass('selected-row'); $('#filter-admins .selected').removeClass('selected');
$('.admin-row').each(function() { $('.admin-row').each(function() {
if ($(this).attr('data-id') == id) { if ($(this).attr('data-id') == id) {
$(this).addClass('selected-row'); $(this).addClass('selected');
return false; return false;
} }
}); });

View file

@ -37,7 +37,7 @@
*/ */
$('#providers').on('submit', '#filter-providers form', function() { $('#providers').on('submit', '#filter-providers form', function() {
var key = $('#filter-providers .key').val(); var key = $('#filter-providers .key').val();
$('.selected-row').removeClass('selected-row'); $('.selected').removeClass('selected');
this.resetForm(); this.resetForm();
this.filter(key); this.filter(key);
return false; return false;
@ -74,8 +74,8 @@
}); });
this.display(provider); this.display(provider);
$('#filter-providers .selected-row').removeClass('selected-row'); $('#filter-providers .selected').removeClass('selected');
$(e.currentTarget).addClass('selected-row'); $(e.currentTarget).addClass('selected');
$('#edit-provider, #delete-provider').prop('disabled', false); $('#edit-provider, #delete-provider').prop('disabled', false);
}.bind(this)); }.bind(this));
@ -88,7 +88,7 @@
$('#filter-providers .results').css('color', '#AAA'); $('#filter-providers .results').css('color', '#AAA');
$('#providers .add-edit-delete-group').hide(); $('#providers .add-edit-delete-group').hide();
$('#providers .save-cancel-group').show(); $('#providers .save-cancel-group').show();
$('#providers .details').find('input, textarea').prop('readonly', false); $('#providers .record-details').find('input, textarea').prop('readonly', false);
$('#provider-password, #provider-password-confirm').addClass('required'); $('#provider-password, #provider-password-confirm').addClass('required');
$('#provider-notifications').prop('disabled', false); $('#provider-notifications').prop('disabled', false);
$('#providers').find('.add-break, .edit-break, .delete-break, #reset-working-plan').prop('disabled', false); $('#providers').find('.add-break, .edit-break, .delete-break, #reset-working-plan').prop('disabled', false);
@ -108,7 +108,7 @@
$('#providers .save-cancel-group').show(); $('#providers .save-cancel-group').show();
$('#filter-providers button').prop('disabled', true); $('#filter-providers button').prop('disabled', true);
$('#filter-providers .results').css('color', '#AAA'); $('#filter-providers .results').css('color', '#AAA');
$('#providers .details').find('input, textarea').prop('readonly', false); $('#providers .record-details').find('input, textarea').prop('readonly', false);
$('#provider-password, #provider-password-confirm').removeClass('required'); $('#provider-password, #provider-password-confirm').removeClass('required');
$('#provider-notifications').prop('disabled', false); $('#provider-notifications').prop('disabled', false);
$('#provider-services input[type="checkbox"]').prop('disabled', false); $('#provider-services input[type="checkbox"]').prop('disabled', false);
@ -189,7 +189,7 @@
* Cancel add or edit of an provider record. * Cancel add or edit of an provider record.
*/ */
$('#providers').on('click', '#cancel-provider', function() { $('#providers').on('click', '#cancel-provider', function() {
var id = $('#filter-providers .selected-row').attr('data-id'); var id = $('#filter-providers .selected').attr('data-id');
this.resetForm(); this.resetForm();
if (id != '') { if (id != '') {
this.select(id, true); this.select(id, true);
@ -335,13 +335,13 @@
* Resets the admin tab form back to its initial state. * Resets the admin tab form back to its initial state.
*/ */
ProvidersHelper.prototype.resetForm = function() { ProvidersHelper.prototype.resetForm = function() {
$('#filter-providers .selected-row').removeClass('selected-row'); $('#filter-providers .selected').removeClass('selected');
$('#filter-providers button').prop('disabled', false); $('#filter-providers button').prop('disabled', false);
$('#filter-providers .results').css('color', ''); $('#filter-providers .results').css('color', '');
$('#providers .add-edit-delete-group').show(); $('#providers .add-edit-delete-group').show();
$('#providers .save-cancel-group').hide(); $('#providers .save-cancel-group').hide();
$('#providers .details').find('input, textarea').prop('readonly', true); $('#providers .record-details').find('input, textarea').prop('readonly', true);
$('#providers .form-message').hide(); $('#providers .form-message').hide();
$('#provider-notifications').removeClass('active'); $('#provider-notifications').removeClass('active');
$('#provider-notifications').prop('disabled', true); $('#provider-notifications').prop('disabled', true);
@ -355,7 +355,7 @@
$('.breaks').find('.edit-break, .delete-break').prop('disabled', true); $('.breaks').find('.edit-break, .delete-break').prop('disabled', true);
$('#edit-provider, #delete-provider').prop('disabled', true); $('#edit-provider, #delete-provider').prop('disabled', true);
$('#providers .details').find('input, textarea').val(''); $('#providers .record-details').find('input, textarea').val('');
$('#providers input[type="checkbox"]').prop('checked', false); $('#providers input[type="checkbox"]').prop('checked', false);
$('#provider-services input[type="checkbox"]').prop('checked', false); $('#provider-services input[type="checkbox"]').prop('checked', false);
$('#providers .breaks tbody').empty(); $('#providers .breaks tbody').empty();
@ -461,7 +461,7 @@
? info + ', ' + provider.phone_number : info; ? info + ', ' + provider.phone_number : info;
var html = var html =
'<div class="provider-row" data-id="' + provider.id + '">' + '<div class="provider-row entry" data-id="' + provider.id + '">' +
'<strong>' + name + '</strong><br>' + '<strong>' + name + '</strong><br>' +
info + '<br>' + info + '<br>' +
'</div><hr>'; '</div><hr>';
@ -548,7 +548,7 @@
// Select record in filter results. // Select record in filter results.
$('#filter-providers .provider-row').each(function() { $('#filter-providers .provider-row').each(function() {
if ($(this).attr('data-id') == id) { if ($(this).attr('data-id') == id) {
$(this).addClass('selected-row'); $(this).addClass('selected');
return false; return false;
} }
}); });

View file

@ -37,7 +37,7 @@
*/ */
$('#secretaries').on('submit', '#filter-secretaries form', function() { $('#secretaries').on('submit', '#filter-secretaries form', function() {
var key = $('#filter-secretaries .key').val(); var key = $('#filter-secretaries .key').val();
$('#filter-secretaries .selected-row').removeClass('selected-row'); $('#filter-secretaries .selected').removeClass('selected');
this.resetForm(); this.resetForm();
this.filter(key); this.filter(key);
return false; return false;
@ -75,8 +75,8 @@
this.display(secretary); this.display(secretary);
$('#filter-secretaries .selected-row').removeClass('selected-row'); $('#filter-secretaries .selected').removeClass('selected');
$(e.currentTarget).addClass('selected-row'); $(e.currentTarget).addClass('selected');
$('#edit-secretary, #delete-secretary').prop('disabled', false); $('#edit-secretary, #delete-secretary').prop('disabled', false);
}.bind(this)); }.bind(this));
@ -90,7 +90,7 @@
$('#secretaries .add-edit-delete-group').hide(); $('#secretaries .add-edit-delete-group').hide();
$('#secretaries .save-cancel-group').show(); $('#secretaries .save-cancel-group').show();
$('#secretaries .details').find('input, textarea').prop('readonly', false); $('#secretaries .record-details').find('input, textarea').prop('readonly', false);
$('#secretary-password, #secretary-password-confirm').addClass('required'); $('#secretary-password, #secretary-password-confirm').addClass('required');
$('#secretary-notifications').prop('disabled', false); $('#secretary-notifications').prop('disabled', false);
$('#secretary-providers input[type="checkbox"]').prop('disabled', false); $('#secretary-providers input[type="checkbox"]').prop('disabled', false);
@ -104,7 +104,7 @@
$('#filter-secretaries .results').css('color', '#AAA'); $('#filter-secretaries .results').css('color', '#AAA');
$('#secretaries .add-edit-delete-group').hide(); $('#secretaries .add-edit-delete-group').hide();
$('#secretaries .save-cancel-group').show(); $('#secretaries .save-cancel-group').show();
$('#secretaries .details').find('input, textarea').prop('readonly', false); $('#secretaries .record-details').find('input, textarea').prop('readonly', false);
$('#secretary-password, #secretary-password-confirm').removeClass('required'); $('#secretary-password, #secretary-password-confirm').removeClass('required');
$('#secretary-notifications').prop('disabled', false); $('#secretary-notifications').prop('disabled', false);
$('#secretary-providers input[type="checkbox"]').prop('disabled', false); $('#secretary-providers input[type="checkbox"]').prop('disabled', false);
@ -297,11 +297,11 @@
* Resets the admin tab form back to its initial state. * Resets the admin tab form back to its initial state.
*/ */
SecretariesHelper.prototype.resetForm = function() { SecretariesHelper.prototype.resetForm = function() {
$('#secretaries .details').find('input, textarea').val(''); $('#secretaries .record-details').find('input, textarea').val('');
$('#secretaries .add-edit-delete-group').show(); $('#secretaries .add-edit-delete-group').show();
$('#secretaries .save-cancel-group').hide(); $('#secretaries .save-cancel-group').hide();
$('#edit-secretary, #delete-secretary').prop('disabled', true); $('#edit-secretary, #delete-secretary').prop('disabled', true);
$('#secretaries .details').find('input, textarea').prop('readonly', true); $('#secretaries .record-details').find('input, textarea').prop('readonly', true);
$('#secretaries .form-message').hide(); $('#secretaries .form-message').hide();
$('#secretary-notifications').removeClass('active'); $('#secretary-notifications').removeClass('active');
$('#secretary-notifications').prop('disabled', true); $('#secretary-notifications').prop('disabled', true);
@ -310,7 +310,7 @@
$('#secretaries .required').css('border', ''); $('#secretaries .required').css('border', '');
$('#secretary-password, #secretary-password-confirm').css('border', ''); $('#secretary-password, #secretary-password-confirm').css('border', '');
$('#filter-secretaries .selected-row').removeClass('selected-row'); $('#filter-secretaries .selected').removeClass('selected');
$('#filter-secretaries button').prop('disabled', false); $('#filter-secretaries button').prop('disabled', false);
$('#filter-secretaries .results').css('color', ''); $('#filter-secretaries .results').css('color', '');
}; };
@ -410,7 +410,7 @@
? info + ', ' + secretary.phone_number : info; ? info + ', ' + secretary.phone_number : info;
var html = var html =
'<div class="secretary-row" data-id="' + secretary.id + '">' + '<div class="secretary-row entry" data-id="' + secretary.id + '">' +
'<strong>' + name + '</strong><br>' + '<strong>' + name + '</strong><br>' +
info + '<br>' + info + '<br>' +
'</div><hr>'; '</div><hr>';
@ -428,11 +428,11 @@
SecretariesHelper.prototype.select = function(id, display) { SecretariesHelper.prototype.select = function(id, display) {
display = display || false; display = display || false;
$('#filter-secretaries .selected-row').removeClass('selected-row'); $('#filter-secretaries .selected').removeClass('selected');
$('#filter-secretaries .secretary-row').each(function() { $('#filter-secretaries .secretary-row').each(function() {
if ($(this).attr('data-id') == id) { if ($(this).attr('data-id') == id) {
$(this).addClass('selected-row'); $(this).addClass('selected');
return false; return false;
} }
}); });