Skip to content

Commit

Permalink
tweak function docs and sales comments checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Dec 7, 2023
1 parent 576a33b commit 49776ac
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/Models/Character/CharacterDesignUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function scopeCharacters($query) {
}

/**
* Scope a query to sort submissions oldest first.
* Scope a query to sort updates by oldest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand All @@ -190,7 +190,7 @@ public function scopeSortOldest($query) {
}

/**
* Scope a query to sort submissions by newest first.
* Scope a query to sort updates by newest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Character/CharacterTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function scopeCompleted($query) {
}

/**
* Scope a query to sort submissions oldest first.
* Scope a query to sort transfers by oldest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand All @@ -108,7 +108,7 @@ public function scopeSortOldest($query) {
}

/**
* Scope a query to sort submissions by newest first.
* Scope a query to sort transfers by newest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Report/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function scopeViewable($query, $user) {
}

/**
* Scope a query to sort submissions oldest first.
* Scope a query to sort reports by oldest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand All @@ -133,7 +133,7 @@ public function scopeSortOldest($query) {
}

/**
* Scope a query to sort submissions by newest first.
* Scope a query to sort reports by newest first.
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function bookmarks() {
* Gets all of a user's liked / disliked comments.
*/
public function commentLikes() {
return $this->hasMany('App\Models\Comment\CommentLike;');
return $this->hasMany('App\Models\Comment\CommentLike');
}

/**********************************************************************************************
Expand Down
4 changes: 3 additions & 1 deletion resources/views/sales/_sales.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
</div>
</div>

@if ((isset($sales->comments_open_at) && $sales->comments_open_at < Carbon\Carbon::now()) || (Auth::check() && Auth::user()->hasPower('edit_pages')) || !isset($sales->comments_open_at))
@if ((isset($sales->comments_open_at) && $sales->comments_open_at < Carbon\Carbon::now())
|| (Auth::check() && (Auth::user()->hasPower('manage_sales') || Auth::user()->hasPower('comment_on_sales')))
|| !isset($sales->comments_open_at))
<?php $commentCount = App\Models\Comment\Comment::where('commentable_type', 'App\Models\Sales\Sales')
->where('commentable_id', $sales->id)
->count(); ?>
Expand Down
7 changes: 3 additions & 4 deletions resources/views/sales/sales.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
@include('sales._sales', ['sales' => $sales, 'page' => true])

@if (
(isset($sales->comments_open_at) && $sales->comments_open_at < Carbon\Carbon::now()) ||
(Auth::check() && Auth::user()->hasPower('manage_sales')) ||
(Auth::check() && Auth::user()->hasPower('comment_on_sales')) ||
!isset($sales->comments_open_at))
(isset($sales->comments_open_at) && $sales->comments_open_at < Carbon\Carbon::now())
|| (Auth::check() && (Auth::user()->hasPower('manage_sales') || Auth::user()->hasPower('comment_on_sales')))
|| !isset($sales->comments_open_at))
<hr class="mb-5" />
@comments(['model' => $sales, 'perPage' => 5])
@else
Expand Down

0 comments on commit 49776ac

Please sign in to comment.