Skip to content

Commit

Permalink
Merge pull request #226 from cooperfellows/UDOIT_issue168
Browse files Browse the repository at this point in the history
Udoit issue168 - Add Unique ID to Form Elements fixes #168
  • Loading branch information
bagofarms authored Feb 9, 2017
2 parents e564b95 + e0cf516 commit e3950a4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
8 changes: 4 additions & 4 deletions templates/partials/result_item/contrast.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<div class="left">
<div class="form-group no-margin margin-bottom">
<?php if ( isset($group_item->back_color) ): ?>
<label for="newcontent[1]">Replace Background Color <?= $group_item->back_color; ?></label>
<input class="color {hash:true,caps:false} form-control back-color" type="text" name="newcontent[1]" value="<?= $group_item->back_color; ?>" placeholder="Replacement for Background Color <?= $group_item->back_color; ?>">
<label for="<?= $this->e($item_id); ?>-bgcolor">Replace Background Color <?= $group_item->back_color; ?></label>
<input class="color {hash:true,caps:false} form-control back-color" type="text" name="newcontent[1]" value="<?= $group_item->back_color; ?>" placeholder="Replacement for Background Color <?= $group_item->back_color; ?>" id="<?= $this->e($item_id);?>-bgcolor">
<?php endif; ?>

<label for="newcontent[0]">Replace Foreground Color <?= $group_item->fore_color; ?></label>&nbsp;<span class="contrast-invalid hidden red"><span class="glyphicon glyphicon-remove"></span>&nbsp;Ratio Invalid (<span class="contrast-ratio"></span>:1)</span>
<input class="color {hash:true,caps:false} form-control fore-color" type="text" name="newcontent[0]" value="<?= $group_item->fore_color; ?>" placeholder="Replacement for Foreground Color <?= $group_item->fore_color; ?>">
<label for="<?= $this->e($item_id); ?>-fgcolor">Replace Foreground Color <?= $group_item->fore_color; ?></label>&nbsp;<span class="contrast-invalid hidden red"><span class="glyphicon glyphicon-remove"></span>&nbsp;Ratio Invalid (<span class="contrast-ratio"></span>:1)</span>
<input class="color {hash:true,caps:false} form-control fore-color" type="text" name="newcontent[0]" value="<?= $group_item->fore_color; ?>" placeholder="Replacement for Foreground Color <?= $group_item->fore_color; ?>" id="<?= $this->e($item_id); ?>-fgcolor">
<label><input name="add-bold" type="checkbox" value="bold" />&nbsp;Make this text bold</label>&nbsp;<label><input name="add-italic" type="checkbox" value="italic" />&nbsp;Make this text <span style="font-style: italics;">italicized</span></label><br />
<input type="text" name="threshold" class="threshold hidden" value="<?= $group_item->text_type; ?>">
</div>
Expand Down
3 changes: 2 additions & 1 deletion templates/partials/result_item/header_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
?>
<div class="form-group no-margin margin-bottom">
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New heading text">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text For This Heading</label>
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New heading text" id="<?= $this->e($item_id); ?>-input">
<label><input class="remove-heading" type="checkbox" />&nbsp;Delete this Header completely instead</label><br />
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
</div>
3 changes: 2 additions & 1 deletion templates/partials/result_item/image_alt.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
*/
?>
<div class="fix-alt input-group">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Provide New Alt Text For This Image</label>
<span class="counter">100</span>
<input class="form-control" type="text" name="newcontent" maxlength="100" placeholder="New alt text">
<input class="form-control" type="text" name="newcontent" maxlength="100" placeholder="New alt text" id="<?= $this->e($item_id); ?>-input">
<span class="input-group-btn">
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
</span>
Expand Down
3 changes: 2 additions & 1 deletion templates/partials/result_item/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
?>
<div class="form-group no-margin margin-bottom">
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text for This Link</label>
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text" id="<?= $this->e($item_id); ?>-input">
<label><input class="remove-link" type="checkbox" />Delete this Link completely instead</label><br />
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
</div>
3 changes: 2 additions & 1 deletion templates/partials/result_item/link_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
?>
<div class="form-group no-margin margin-bottom">
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text for This Link</label>
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text" id="<?= $this->e($item_id); ?>-input">
<label><input class="remove-link" type="checkbox" />&nbsp;Delete this Link completely instead</label><br />
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
</div>
3 changes: 2 additions & 1 deletion templates/partials/result_item/suspicious_link_text.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
*/
?>
<div class="input-group">
<input class="form-control" type="text" name="newcontent" placeholder="New link description">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter a New Description for This Link</label>
<input class="form-control" type="text" name="newcontent" placeholder="New link description" id="<?= $this->e($item_id); ?>">
<span class="input-group-btn">
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
</span>
Expand Down
4 changes: 2 additions & 2 deletions templates/partials/result_item/table_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*/
?>
<hr>
<p>Select which part of the table to convert to a header</p>
<div class="input-group">
<select class="form-control" name="newcontent">
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Select which part of the table to convert to a header</label>
<select class="form-control" name="newcontent" id="<?= $this->e($item_id); ?>-input">
<option value="row">The first row</option>
<option value="col">The first column</option>
<option value="both">Both the first row and column</option>
Expand Down
3 changes: 2 additions & 1 deletion templates/partials/result_item/table_header_scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
* Primary Author Contact: Jacob Bates <[email protected]>
*/
?>
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Select which part of the table to convert to a header</label>
<div class="input-group">
<select class="form-control" name="newcontent">
<select class="form-control" name="newcontent" id="<?= $this->e($item_id); ?>-input">
<option value="col">col</option>
<option value="row">row</option>
</select>
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/results_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}

if ( ! empty($result_template)) {
echo($this->fetch("partials/result_item/{$result_template}", ['group_item' => $group_item]));
echo($this->fetch("partials/result_item/{$result_template}", ['group_item' => $group_item, 'item_id' => $li_id]));
}
?>
</form>
Expand Down

0 comments on commit e3950a4

Please sign in to comment.