Skip to content

Commit

Permalink
Dev Clean up mark-up and CSS to improve accessability and visual layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tpartner committed Sep 18, 2014
1 parent 9651978 commit 545508c
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 59 deletions.
149 changes: 90 additions & 59 deletions application/views/admin/checkintegrity/check_view.php
@@ -1,25 +1,50 @@
<div class='messagebox ui-corner-all'>
<div class='messagebox ui-corner-all data-integrity consistency'>
<div class='header ui-widget-header'><?php $clang->eT("Data consistency check"); ?><br />
<span style='font-size:7pt;'><?php $clang->eT("If errors are showing up you might have to execute this script repeatedly."); ?></span>
<span class='hint'><?php $clang->eT("If errors are showing up you might have to execute this script repeatedly."); ?></span>
</div>

<ul>
<ul class='data-consistency-list'>
<?php
// TMSW Conditions->Relevance: Update this to use relevance processing results
if (isset($conditions))
{?>
<li><?php $clang->eT("The following conditions should be deleted:"); ?></li>
<?php
foreach ($conditions as $condition) {?>
CID:<?php echo $condition['cid'].' '.$clang->gT("Reason:")." {$condition['reason']}";?><br /><?php
}?>
<br />
<li><?php $clang->eT("The following conditions should be deleted:"); ?>
<ul>
<?php
foreach ($conditions as $condition) {?>
<li>CID:<?php echo $condition['cid'].' '.$clang->gT("Reason:")." {$condition['reason']}";?></li><?php
}?>
</ul>
</li>
<?php
}
else
{ ?>
<li><?php $clang->eT("All conditions meet consistency standards."); ?></li><?php
} ?>




<?php
if (isset($assessments))
{?>
<li><?php $clang->eT("The following assessments should be deleted:"); ?>
<ul>
<?php
foreach ($assessments as $assessment) {?>
<li>AID:<?php echo $assessment['id'];?> <?php $clang->eT("Assessment:");?> <?php $clang->eT("Reason:");?> <?php echo $assessment['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
{ ?>
<li><?php $clang->eT("All assessments meet consistency standards."); ?></li><?php
} ?>



<?php
if (isset($questionattributes)) { ?>
Expand Down Expand Up @@ -69,13 +94,14 @@
<?php
if (isset($assessments))
{?>
<li><?php $clang->eT("The following assessments should be deleted:"); ?></li>
<ul>
<?php
foreach ($assessments as $assessment) {?>
<li>AID:<?php echo $assessment['id'];?> <?php $clang->eT("Assessment:");?> <?php $clang->eT("Reason:");?> <?php echo $assessment['reason'];?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following assessments should be deleted:"); ?>
<ul>
<?php
foreach ($assessments as $assessment) {?>
<li>AID:<?php echo $assessment['id'];?> <?php $clang->eT("Assessment:");?> <?php $clang->eT("Reason:");?> <?php echo $assessment['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand All @@ -86,13 +112,14 @@
<?php
if (isset($answers))
{?>
<li><?php $clang->eT("The following answers should be deleted:"); ?></li>
<ul>
<?php
foreach ($answers as $answer) {?>
<li>QID:<?php echo $answer['qid'];?> <?php $clang->eT("Code:");?> <?php $clang->eT("Reason:");?> <?php echo $answer['reason'];?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following answers should be deleted:"); ?>
<ul>
<?php
foreach ($answers as $answer) {?>
<li>QID:<?php echo $answer['qid'];?> <?php $clang->eT("Code:");?> <?php $clang->eT("Reason:");?> <?php echo $answer['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand All @@ -103,13 +130,14 @@
<?php
if (isset($surveys))
{?>
<li><?php $clang->eT("The following surveys should be deleted:"); ?></li>
<ul>
<?php
foreach ($surveys as $survey) {?>
<li>SID:<?php echo $survey['sid'];?> <?php $clang->eT("Reason:");?> <?php echo $survey['reason'];?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following surveys should be deleted:"); ?>
<ul>
<?php
foreach ($surveys as $survey) {?>
<li>SID:<?php echo $survey['sid'];?> <?php $clang->eT("Reason:");?> <?php echo $survey['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand All @@ -120,13 +148,14 @@
<?php
if (isset($surveylanguagesettings))
{?>
<li><?php $clang->eT("The following survey language settings should be deleted:"); ?></li>
<ul>
<?php
foreach ($surveylanguagesettings as $surveylanguagesetting) {?>
<li>SLID:<?php echo $surveylanguagesetting['slid'];?> <?php $clang->eT("Reason:");?> <?php echo $surveylanguagesetting['reason'];?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following survey language settings should be deleted:"); ?>
<ul>
<?php
foreach ($surveylanguagesettings as $surveylanguagesetting) {?>
<li>SLID:<?php echo $surveylanguagesetting['slid'];?> <?php $clang->eT("Reason:");?> <?php echo $surveylanguagesetting['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand Down Expand Up @@ -155,13 +184,14 @@
<?php
if (isset($groups))
{?>
<li><?php $clang->eT("The following groups should be deleted:"); ?></li>
<ul>
<?php
foreach ($groups as $group) {?>
<li>GID:<?php echo $group['gid'];?> <?php $clang->eT("Reason:");?> <?php echo $group['reason'];?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following groups should be deleted:"); ?>
<ul>
<?php
foreach ($groups as $group) {?>
<li>GID:<?php echo $group['gid'];?> <?php $clang->eT("Reason:");?> <?php echo $group['reason'];?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand Down Expand Up @@ -190,13 +220,14 @@
<?php
if (isset($orphantokentables))
{?>
<li><?php $clang->eT("The following old token tables should be deleted because they contain no records or their parent survey no longer exists:"); ?></li>
<ul>
<?php
foreach ($orphantokentables as $tokentable) {?>
<li><?php echo $tokentable;?></li><?php
}?>
</ul>
<li><?php $clang->eT("The following old token tables should be deleted because they contain no records or their parent survey no longer exists:"); ?>
<ul>
<?php
foreach ($orphantokentables as $tokentable) {?>
<li><?php echo $tokentable;?></li><?php
}?>
</ul>
</li>
<?php
}
else
Expand All @@ -217,24 +248,24 @@
<?php
} ?>
</div><br />
<div class='messagebox ui-corner-all'>
<div class='messagebox ui-corner-all data-integrity redundancy'>
<div class='header ui-widget-header'><?php $clang->eT("Data redundancy check"); ?><br />
<span style='font-size:7pt;'><?php $clang->eT("The redundancy check looks for tables leftover after deactivating a survey. You can delete these if you no longer require them."); ?></span>
<span class='hint'><?php $clang->eT("The redundancy check looks for tables leftover after deactivating a survey. You can delete these if you no longer require them."); ?></span>
</div>
<?php if ($redundancyok) { ?>
<br /> <?php $clang->eT("No database action required!"); ?>
<?php } else
{?>
<?php echo CHtml::form(array("admin/checkintegrity/fixredundancy"), 'post');?>
<ul>
<ul class='data-redundancy-list'>
<?php
if (isset($redundantsurveytables))
{?>
<li><?php $clang->eT("The following old survey response tables exist and may be deleted if no longer required:"); ?>
<ul>
<ul class='response-tables-list'>
<?php
foreach ($redundantsurveytables as $surveytable) {?>
<li><input type='checkbox' value='<?php echo $surveytable['table']?>' name='oldsmultidelete[]' /><?php echo $surveytable['details']?></li><?php
<li><input type='checkbox' id='cbox_<?php echo $surveytable['table']?>' value='<?php echo $surveytable['table']?>' name='oldsmultidelete[]' /><label for='cbox_<?php echo $surveytable['table']?>'><?php echo $surveytable['details']?></label></li><?php
}?>
</ul>
</li>
Expand All @@ -245,10 +276,10 @@
if (isset($redundanttokentables) && count($redundanttokentables)>0)
{?>
<li><?php $clang->eT("The following old token list tables exist and may be deleted if no longer required:"); ?>
<ul>
<ul class='token-tables-list'>
<?php
foreach ($redundanttokentables as $tokentable) {?>
<li><input type='checkbox' value='<?php echo $tokentable['table']?>' name='oldsmultidelete[]' /><?php echo $tokentable['details']?></li><?php
<li><input type='checkbox' id='cbox_<?php echo $tokentable['table']?>' value='<?php echo $tokentable['table']?>' name='oldsmultidelete[]' /><label for='cbox_<?php echo $tokentable['table']?>'><?php echo $tokentable['details']?></label></li><?php
}?>
</ul>
</li>
Expand All @@ -257,7 +288,7 @@
</ul><p>
<input type='hidden' name='ok' value='Y' />
<input type='submit' value='<?php $clang->eT("Delete checked items!"); ?>' /> <br />
<span style='color: red; font-size:0.8em;'><?php $clang->eT("Note that you cannot undo a delete if you proceed. The data will be gone."); ?></span></p>
<span class='hint warning'><?php $clang->eT("Note that you cannot undo a delete if you proceed. The data will be gone."); ?></span></p>
</form><?php
} ?>

Expand Down
51 changes: 51 additions & 0 deletions styles/blobblueish/adminstyle.css
Expand Up @@ -1793,3 +1793,54 @@ td.LEMerror {
margin: 0 0.5em;
padding: 0;
}

/* Data consistency & redundancy check */

.messagebox.data-integrity .hint {
line-height: 1em;
}

.messagebox.data-integrity .hint.warning {
color: #EE0000;
}

.messagebox.data-integrity.consistency {
padding-bottom: 1.1em;
}

.messagebox.data-integrity.consistency input[type="submit"] {
margin: 0.8em 0 0 0;
}

.data-consistency-list {
margin: 0.4em 0.8em 0 2.8em;
}

.data-redundancy-list {
margin-right: 0.8em;
}

.data-redundancy-list > li {
padding-top: 0.4em;
}

.data-redundancy-list ul {
margin: 0 0 0.8em 1.1em;
}

.data-redundancy-list ul li {
display: table-row;
}

.data-redundancy-list ul input,
.data-redundancy-list ul label {
display: table-cell;
}

.data-redundancy-list input[type="checkbox"] {
margin-top: 0.15em;
}

.data-redundancy-list ul label {
padding-left: 0.4em;
}
51 changes: 51 additions & 0 deletions styles/darkblue/adminstyle.css
Expand Up @@ -1907,3 +1907,54 @@ td.LEMerror {
margin: 0 0.5em;
padding: 0;
}

/* Data consistency & redundancy check */

.messagebox.data-integrity .hint {
line-height: 1em;
}

.messagebox.data-integrity .hint.warning {
color: #EE0000;
}

.messagebox.data-integrity.consistency {
padding-bottom: 1.1em;
}

.messagebox.data-integrity.consistency input[type="submit"] {
margin: 0.8em 0 0 0;
}

.data-consistency-list {
margin: 0.4em 0.8em 0 2.8em;
}

.data-redundancy-list {
margin-right: 0.8em;
}

.data-redundancy-list > li {
padding-top: 0.4em;
}

.data-redundancy-list ul {
margin: 0 0 0.8em 1.1em;
}

.data-redundancy-list ul li {
display: table-row;
}

.data-redundancy-list ul input,
.data-redundancy-list ul label {
display: table-cell;
}

.data-redundancy-list input[type="checkbox"] {
margin-top: 0.15em;
}

.data-redundancy-list ul label {
padding-left: 0.4em;
}

4 comments on commit 545508c

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tpartner : not sure, but maybe we have to use more bootstrap (or jquery-ui) ?
We have a complete css framework and we don't use a lot :)

@tpartner
Copy link
Collaborator Author

@tpartner tpartner commented on 545508c Sep 19, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bootstrap 3 have http://getbootstrap.com/components/#list-group but not 2.3 : are you OK if

  • I use same css class than bootsrap3
  • Move/update styles/adminstyle.css to use this css class
  • Remove some part of {adminstemplate}/adminstyle.css (leave color, template specific part ... )
  • Make a pull request and assing it to you ?

After we can use same class for other list :)

@tpartner
Copy link
Collaborator Author

@tpartner tpartner commented on 545508c Sep 22, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.