|
|
@@ -15,6 +15,9 @@ use Carbon\CarbonImmutable;
|
|
|
* @property float $default_tester_fee
|
|
|
* @property string $time_of_day
|
|
|
* @property bool $tester_can_claim
|
|
|
+ * @property int $browse_time
|
|
|
+ * @property int $play_money
|
|
|
+ * @property int $play_time
|
|
|
* @property string $template_overrides_json
|
|
|
* @property string $dts_start
|
|
|
* @property string $dts_deadline
|
|
|
@@ -33,7 +36,7 @@ class Project extends Model {
|
|
|
|
|
|
protected static $table = "project";
|
|
|
protected static $id_field = "id";
|
|
|
- protected static $fillable_fields = ["customer_id", "template_id", "template_keys", "name", "test_count", "min_age", "max_age", "default_customer_fee", "default_tester_fee", "time_of_day", "tester_can_claim", "template_overrides_json", "dts_start", "dts_deadline", "dts_created", "dts_updated", "dts_report", "dts_finished", "user_id_finished"];
|
|
|
+ protected static $fillable_fields = ["customer_id", "template_id", "template_keys", "name", "test_count", "min_age", "max_age", "default_customer_fee", "default_tester_fee", "time_of_day", "tester_can_claim", "browse_time", "play_money", "play_time", "template_overrides_json", "dts_start", "dts_deadline", "dts_created", "dts_updated", "dts_report", "dts_finished", "user_id_finished"];
|
|
|
|
|
|
/**
|
|
|
* @var Test[] $tests
|
|
|
@@ -607,5 +610,67 @@ class Project extends Model {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ public function renderBeforeTestSection(): void {
|
|
|
+
|
|
|
+ if(!$this->browse_time && !$this->play_money && !$this->play_time) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ?>
|
|
|
+ <section class="mb-4">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-header">
|
|
|
+ <?=htmlspecialchars(__("Important"))?>
|
|
|
+ </div>
|
|
|
+ <div class="card-body">
|
|
|
+ <ol>
|
|
|
+ <?php
|
|
|
+ if($this->browse_time) {
|
|
|
+ ?>
|
|
|
+ <li>
|
|
|
+ <?=htmlspecialchars(n__(
|
|
|
+ "This test requires %d minute of browsing time.",
|
|
|
+ "This test requires %d minutes of browsing time.",
|
|
|
+ $this->browse_time,
|
|
|
+ $this->browse_time
|
|
|
+ ))?>
|
|
|
+ </li>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ if($this->play_money > 0) {
|
|
|
+ ?>
|
|
|
+ <li>
|
|
|
+ <?=htmlspecialchars(__("This test has a total of £%.02f reimbursible play money.", $this->play_money))?>
|
|
|
+ <?=htmlspecialchars(__("Do not spend more than this."))?>
|
|
|
+ </li>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ if($this->play_time) {
|
|
|
+ ?>
|
|
|
+ <li>
|
|
|
+ <?=htmlspecialchars(n__(
|
|
|
+ "You must play the machine for %d minute.",
|
|
|
+ "You must play the machine for %d minutes.",
|
|
|
+ $this->play_time,
|
|
|
+ $this->play_time
|
|
|
+ ))?>
|
|
|
+ </li>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </ol>
|
|
|
+
|
|
|
+ <div class="custom-control custom-switch">
|
|
|
+ <input class="custom-control-input" id="accept-important-instructions" type="checkbox" value="1" required />
|
|
|
+ <label class="custom-control-label" for="accept-important-instructions"><?=htmlspecialchars(__("I have read and agree to the above."))?></label>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <?php
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|