function row_highlight($attendee, $prefix = "") { $age = $attendee->age() ?: 0; $class = ""; if ($attendee->blacklisted) { $type = BlacklistType::find_by_db_name($attendee->blacklist_type); $class = $type->alert_color; } if ($attendee->canceled) { $class .= " canceled"; } return $prefix ? "{$prefix}-{$class}" : $class; }
<h1>Blacklist Entries</h1> <table class="table table-striped"> <tr> <th>Badge Name</th> <th>Legal Name</th> <th>Trigger Badge Names</th> <th>Trigger Legal Names</th> <th>Reason</th> <th>Type</th> <th>Actions</th> </tr> <?php foreach ($blacklists as $blacklist) { ?> <?php $type = BlacklistType::cached_find_by_db_name($blacklist->type); ?> <tr class="<?php echo $type->alert_color; ?> "> <td><?php echo $blacklist->badge_name ?: "<i>none</i>"; ?> </td> <td><?php echo $blacklist->legal_name ?: "<i>none</i>"; ?> </td> <td><?php echo nl2br($blacklist->trigger_badge_names, false);
<?php include_once '../../../../_includes/framework.php'; require_admin(); if (!isset($form)) { $form = new BlacklistForm(["id" => @$_GET['id']]); } $types = BlacklistType::all(); ?> <input type="hidden" name="_form_class" value="<?php echo get_class($form); ?> "> <input type="hidden" name="_form_file" value="<?php echo basename(__FILE__); ?> "> <input type="hidden" name="id" value="<?php echo $form->id(); ?> "> <div class="row"> <div class="form-group col-sm-6 <?php echo $form->error_on("badge_name") ? "has-error" : ""; ?> "> <?php echo label_tag("badge_name", "Badge Name"); ?> <?php
?> "> <?php echo label_tag("blacklist_type", "Blacklist Type"); ?> <div class="col-sm-12"> <div class="radio"> <label> <?php echo radio_tag($form, "blacklist_type", ""); ?> <span class="label label-default">None</span> </label> </div> <?php foreach (BlacklistType::all() as $type) { ?> <div class="radio"> <label> <?php echo radio_tag($form, "blacklist_type", $type->db_name); ?> <span class="label label-<?php echo $type->alert_color; ?> "><?php echo $type->alert_title; ?> </span> </label> </div>
<?php if ($form->attendee->blacklisted) { $blacklist_type = BlacklistType::find_by_db_name($form->attendee->blacklist_type); $blacklist = $form->attendee->blacklist(); ?> <div class="alert <?php echo $blacklist_type->alert_color ? "alert-{$blacklist_type->alert_color}" : ""; ?> " role="alert"> <p class="lead"> <strong><?php echo $blacklist_type->alert_title; ?> :</strong> <?php echo nl2br($form->attendee->blacklist_message); ?> </p> <?php if ($blacklist) { ?> <p> Automatic match: <code><?php echo $blacklist->display_name(); ?> </code> <?php