Skip to content

Commit

Permalink
refactor: adjusting to better fit Laravel, HTML, and LK standards. Al…
Browse files Browse the repository at this point in the history
…so, fixing a couple wrong words.
  • Loading branch information
preimpression committed Sep 3, 2024
1 parent ef6e937 commit e8e0ba7
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 16 deletions.
18 changes: 18 additions & 0 deletions app/Models/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ public function getUrlAttribute() {
return url('activities/'.$this->id);
}

/**
* Gets the admin edit URL.
*
* @return string
*/
public function getAdminUrlAttribute() {
return url('admin/data/activities/edit/'.$this->id);
}

/**
* Gets the power required to edit this model.
*
* @return string
*/
public function getAdminPowerAttribute() {
return 'edit_data';
}

/**
* Get the data attribute as an associative array.
*
Expand Down
10 changes: 6 additions & 4 deletions resources/views/activities/_activities_list.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div class="row">
@foreach ($activities as $activity)
<div class="col-md-3 col-6 mb-3 text-center">
<div class="shop-image">
<a href="{{ $activity->url }}"><img class="img-fluid" src="{{ $activity->imageUrl }}" alt="{{ $activity->name }}" /></a>
</div>
<div class="shop-name mt-1">
@if($activity->has_image)
<div class="activity-image">
<a href="{{ $activity->url }}"><img class="img-fluid" src="{{ $activity->imageUrl }}" alt="{{ $activity->name }}" /></a>
</div>
@endif
<div class="activity-name mt-1">
<a href="{{ $activity->url }}" class="h5 mb-0">{{ $activity->name }}</a>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/activities/activity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@endsection

@section('activities-content')
<x-admin-edit title="Activity" :object="$activity" />
{!! breadcrumbs(['Activities' => 'activities', $activity->name => $activity->url]) !!}

<h1>
Expand All @@ -15,9 +16,10 @@
<p>{!! $activity->parsed_description !!}</p>
</div>

@if (View::exists('activities.modules.' . $activity->module))
@include('activities.modules.' . $activity->module, ['settings' => $activity->data])
@if (View::exists('activities.modules._' . $activity->module))
@include('activities.modules._' . $activity->module, ['settings' => $activity->data])
@endif

@endsection

@section('scripts')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/activities/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@extends('activities.layout')

@section('activities-title')
Shop Index
Activities Index
@endsection

@section('activities-content')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/activities/layout.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@extends('layouts.app')

@section('title')
Shops ::
Activities ::
@yield('activities-title')
@endsection

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h3>You must collect...</h3>
<h2 class="h3">You must collect...</h2>
<div class="mt-3 square-grid">
@foreach ($collection->ingredients as $ingredient)
<div class="square-column text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'col-lg-6' => count($recipes) > 1,
])>
<div class="d-flex mt-4">
<h2>{{ $recipe->name }}</h2>
<h2 class="h3">{{ $recipe->name }}</h2>
@if ($activity->service->checkRecipe(Auth::user(), $recipe))
{!! Form::open(['url' => 'activities/' . $activity->id . '/act']) !!}
{!! Form::hidden('recipe_id', $recipe->id) !!}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{-- Default rewards are only default if we're not choosing --}}
@if (!$activity->data->choose_reward)
<h3>Submission Approval will Reward:</h3>
<h2 class="h3">Submission Approval will Reward:</h2>
<table class="table table-sm mb-0">
<thead>
<tr>
Expand All @@ -21,7 +21,7 @@
</table>
@endif

<h3 class="mt-4">Submission Entry</h3>
<h2 class="h3 mt-3">Submission Entry</h2>
<div class="form-group">
{!! Form::label('comments', 'Submission') !!}
{!! Form::textarea('comments', $activity->data->template ?? null, ['class' => 'form-control wysiwyg']) !!}
Expand All @@ -40,12 +40,11 @@
@endif

@if ($activity->data->show_rewards)
<h2>Rewards</h2>
<p>Select the rewards you would like to claim with this submission</p>
<h2 class="h3 mt-3">Rewards</h2>
<p>Add the rewards you would like to claim with this submission.</p>
@include('widgets._loot_select', ['loots' => null, 'showLootTables' => false, 'showRaffles' => false])
@endif


<div class="text-right">
{!! Form::submit('Submit', ['class' => 'btn btn-primary']) !!}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{!! Form::open(['url' => 'activities/' . $activity->id . '/act']) !!}
<h3>Select Items to Turn In</h3>

<h2 class="h3">Select Items to Turn In</h2>

@if ($activity->data->quantity)
<p>You are required to select {{ $activity->data->quantity }} item(s) to turn in.</p>
@endif

@include('widgets._inventory_select', ['user' => Auth::user(), 'inventory' => $inventory, 'categories' => $categories, 'selected' => [], 'hideCollapse' => true])

<div class="text-right">
{!! Form::submit('Turn in Items', ['class' => 'btn btn-primary']) !!}
</div>
Expand Down

0 comments on commit e8e0ba7

Please sign in to comment.