diff --git a/app/Console/Commands/UpdateCommentTypes.php b/app/Console/Commands/UpdateCommentTypes.php new file mode 100644 index 0000000000..56bd30db70 --- /dev/null +++ b/app/Console/Commands/UpdateCommentTypes.php @@ -0,0 +1,52 @@ +where('type', 'User-User'); + + if($comments->count()) { + $this->line('Updating comment types...'); + $comments->update(['type' => 'Staff-User']); + } else { + $this->info('No comments to update!'); + } + + return 0; + } +} diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 84dfbbcf1a..afb861c3aa 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -101,7 +101,6 @@ function parse($text, &$pings = null) { $config->set('Attr.EnableID', true); $config->set('HTML.DefinitionID', 'include'); $config->set('HTML.DefinitionRev', 2); - $config->set('Cache.DefinitionImpl', null); // TODO: remove this later! if ($def = $config->maybeGetRawHTMLDefinition()) { $def->addElement('include', 'Block', 'Empty', 'Common', array('file*' => 'URI', 'height' => 'Text', 'width' => 'Text')); $def->addAttribute('a', 'data-toggle', 'Enum#collapse,tab'); diff --git a/app/Http/Controllers/Characters/CharacterController.php b/app/Http/Controllers/Characters/CharacterController.php index 1a77d7cc61..e085255668 100644 --- a/app/Http/Controllers/Characters/CharacterController.php +++ b/app/Http/Controllers/Characters/CharacterController.php @@ -147,7 +147,7 @@ public function getCharacterGallery($slug) { return view('character.gallery', [ 'character' => $this->character, - 'submissions' => GallerySubmission::whereIn('id', $this->character->gallerySubmissions->pluck('gallery_submission_id')->toArray())->visible()->accepted()->orderBy('created_at', 'DESC')->paginate(20), + 'submissions' => GallerySubmission::whereIn('id', $this->character->gallerySubmissions->pluck('gallery_submission_id')->toArray())->visible(Auth::user() ?? null)->orderBy('created_at', 'DESC')->paginate(20), ]); } diff --git a/app/Http/Controllers/PermalinkController.php b/app/Http/Controllers/PermalinkController.php index c78bc175f2..ea6ee811d1 100644 --- a/app/Http/Controllers/PermalinkController.php +++ b/app/Http/Controllers/PermalinkController.php @@ -12,6 +12,7 @@ use App\Models\Model; use App\Models\Comment; +use App\Models\Report\Report; class PermalinkController extends Controller { @@ -25,7 +26,7 @@ public function getComment($id) { $comments = Comment::withTrashed()->get(); //$comments = $comments->sortByDesc('created_at'); $comment = $comments->find($id); - + if(!$comment) abort(404); if(!$comment->commentable) abort(404); @@ -33,25 +34,41 @@ public function getComment($id) { switch($comment->type) { case "Staff-User": if(!Auth::check()) abort(404); - $submission = GallerySubmission::find($comment->commentable_id); - $isMod = Auth::user()->hasPower('manage_submissions'); - $isOwner = ($submission->user_id == Auth::user()->id); - $isCollaborator = $submission->collaborators->where('user_id', Auth::user()->id)->first() != null ? true : false; - if(!$isMod && !$isOwner && !$isCollaborator) abort(404); - break; + switch($comment->commentable_type) { + case 'App\Models\Gallery\GallerySubmission': + $submission = GallerySubmission::where('id', $comment->commentable_id)->first(); + $isMod = Auth::user()->hasPower('manage_submissions'); + $isOwner = ($submission->user_id == Auth::user()->id); + $isCollaborator = $submission->collaborators->where('user_id', Auth::user()->id)->first() != null ? true : false; + if(!$isMod && !$isOwner && !$isCollaborator) abort(404); + break; + case 'App\Models\Report\Report': + $report = Report::where('id', $comment->commentable_id)->first(); + $isMod = Auth::user()->hasPower('manage_reports'); + $isOwner = ($report->user_id == Auth::user()->id); + if(!$isMod && !$isOwner) abort(404); + break; + default: + if(!Auth::user()->isStaff) abort(404); + break; + } case "Staff-Staff": if(!Auth::check()) abort(404); - if(!Auth::user()->hasPower('manage_submissions')) abort(404); - break; - default: + if(!Auth::user()->isStaff) abort(404); + // More specific filtering depending on circumstance + switch($comment->commentable_type) { + case 'App\Models\Gallery\GallerySubmission': + if(!Auth::user()->hasPower('manage_submissions')) abort(404); + break; + } break; } if($comment->commentable_type == 'App\Models\User\UserProfile') $comment->location = $comment->commentable->user->url; else $comment->location = $comment->commentable->url; - + return view('comments._perma_layout',[ - 'comment' => $comment, + 'comment' => $comment, ]); } } diff --git a/app/Http/Controllers/Users/AccountController.php b/app/Http/Controllers/Users/AccountController.php index 8a3175e816..6311f0f999 100644 --- a/app/Http/Controllers/Users/AccountController.php +++ b/app/Http/Controllers/Users/AccountController.php @@ -146,6 +146,24 @@ public function postBirthday(Request $request, UserService $service) return redirect()->back(); } + /** + * Changes user last-online setting + * + * @param \Illuminate\Http\Request $request + * @param App\Services\UserService $service + * @return \Illuminate\Http\RedirectResponse + */ + public function postLastOnline(Request $request, UserService $service) + { + if($service->updateLastOnline($request->input('last_online_setting'), Auth::user())) { + flash('Setting updated successfully.')->success(); + } + else { + foreach($service->errors()->getMessages()['error'] as $error) flash($error)->error(); + } + return redirect()->back(); + } + /** * Shows the notifications page. * diff --git a/app/Http/Controllers/Users/UserController.php b/app/Http/Controllers/Users/UserController.php index 2293b96382..395867ea6c 100644 --- a/app/Http/Controllers/Users/UserController.php +++ b/app/Http/Controllers/Users/UserController.php @@ -65,7 +65,7 @@ public function getUser($name) { $characters = $this->user->characters(); if(!Auth::check() || !(Auth::check() && Auth::user()->hasPower('manage_characters'))) $characters->visible(); - + return view('user.profile', [ 'user' => $this->user, 'items' => $this->user->items()->where('count', '>', 0)->orderBy('user_items.updated_at', 'DESC')->take(4)->get(), @@ -84,7 +84,7 @@ public function getUserAliases($name) { $aliases = $this->user->aliases(); if(!Auth::check() || !(Auth::check() && Auth::user()->hasPower('edit_user_info'))) $aliases->visible(); - + return view('user.aliases', [ 'user' => $this->user, 'aliases' => $aliases->orderBy('is_primary_alias', 'DESC')->orderBy('site')->get(), @@ -299,7 +299,7 @@ public function getUserGallery($name) { return view('user.gallery', [ 'user' => $this->user, - 'submissions' => $this->user->gallerySubmissions()->paginate(20), + 'submissions' => $this->user->gallerySubmissions()->visible(Auth::user() ?? null)->paginate(20), 'sublists' => Sublist::orderBy('sort', 'DESC')->get() ]); } @@ -315,7 +315,7 @@ public function getUserFavorites($name) return view('user.favorites', [ 'user' => $this->user, 'characters' => false, - 'favorites' => GallerySubmission::whereIn('id', $this->user->galleryFavorites()->pluck('gallery_submission_id')->toArray())->visible(Auth::check() ? Auth::user() : null)->accepted()->orderBy('created_at', 'DESC')->paginate(20), + 'favorites' => GallerySubmission::whereIn('id', $this->user->galleryFavorites()->pluck('gallery_submission_id')->toArray())->visible(Auth::user() ?? null)->orderBy('created_at', 'DESC')->paginate(20), 'sublists' => Sublist::orderBy('sort', 'DESC')->get() ]); } @@ -335,7 +335,7 @@ public function getUserOwnCharacterFavorites($name) return view('user.favorites', [ 'user' => $this->user, 'characters' => true, - 'favorites' => $this->user->characters->count() ? GallerySubmission::whereIn('id', $userFavorites)->whereIn('id', GalleryCharacter::whereIn('character_id', $userCharacters)->pluck('gallery_submission_id')->toArray())->visible(Auth::check() ? Auth::user() : null)->accepted()->orderBy('created_at', 'DESC')->paginate(20) : null, + 'favorites' => $this->user->characters->count() ? GallerySubmission::whereIn('id', $userFavorites)->whereIn('id', GalleryCharacter::whereIn('character_id', $userCharacters)->pluck('gallery_submission_id')->toArray())->visible(Auth::user() ?? null)->orderBy('created_at', 'DESC')->paginate(20) : null, 'sublists' => Sublist::orderBy('sort', 'DESC')->get() ]); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index eea0273ab5..6c75609ae8 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -19,6 +19,7 @@ class Kernel extends HttpKernel \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, \App\Http\Middleware\TrustProxies::class, + \App\Http\Middleware\ParsePostRequestFields::class, ]; /** diff --git a/app/Http/Middleware/ParsePostRequestFields.php b/app/Http/Middleware/ParsePostRequestFields.php new file mode 100644 index 0000000000..d97998609e --- /dev/null +++ b/app/Http/Middleware/ParsePostRequestFields.php @@ -0,0 +1,71 @@ +isMethod('post')) { + $excludedFields = ['_token', 'password', 'email', 'description', 'text']; + $strippedFields = ['name', 'title']; + + $parsedFields = []; + foreach ($request->except($excludedFields) as $key => $value) { + if (is_array($value)) { + $parsedFields[$key] = $this->parseArray($value, $strippedFields); + } else { + if (is_numeric($value)) { + continue; + } + + if (in_array($key, $strippedFields)) { // we strip these since parse() doesn't remove HTML tags + $parsedFields[$key] = parse(strip_tags($value)); + } else { + $parsedFields[$key] = parse($value); + } + } + } + + $request->merge($parsedFields); + } + + return $next($request); + } + + /** + * Recursively parse array values. + * + * @param array $array + * @param array $strippedFields + * @return array + */ + private function parseArray(array $array, array $strippedFields) : array { + foreach ($array as $key => $value) { + if (is_numeric($value)) { + continue; + } + + if (is_array($value)) { + $array[$key] = $this->parseArray($value, $strippedFields); + } else { + if (in_array($key, $strippedFields)) { + $array[$key] = parse(strip_tags($value)); + } else { + $array[$key] = parse($value); + } + } + } + + return $array; + } +} diff --git a/app/Models/Sales/SalesCharacter.php b/app/Models/Sales/SalesCharacter.php index 94b3f6bd15..1682e9950e 100644 --- a/app/Models/Sales/SalesCharacter.php +++ b/app/Models/Sales/SalesCharacter.php @@ -168,16 +168,18 @@ public function getPriceAttribute() ; break; case 'ota': - return (isset($this->data['autobuy']) ? '
Autobuy: '.$symbol.$this->data['autobuy'] : ''); + return (isset($this->data['autobuy']) ? 'Autobuy: '.$symbol.$this->data['autobuy'].'
' : ''). + (isset($this->data['minimum']) ? 'Minimum: '.$symbol.$this->data['minimum'].'
' : ''); break; case 'xta': - return (isset($this->data['autobuy']) ? '
Autobuy: '.$symbol.$this->data['autobuy'] : ''); + return (isset($this->data['autobuy']) ? 'Autobuy: '.$symbol.$this->data['autobuy'].'
' : ''). + (isset($this->data['minimum']) ? 'Minimum: '.$symbol.$this->data['minimum'].'
' : ''); break; case 'flaffle': return 'Price: '.$symbol.$this->data['price']; break; case 'pwyw': - return 'Minimum: '.$symbol.$this->data['minimum']; + return (isset($this->data['minimum']) ? 'Minimum: '.$symbol.$this->data['minimum'].'
' : ''); break; } } diff --git a/app/Models/User/User.php b/app/Models/User/User.php index a5b3e59d70..88fa72f392 100644 --- a/app/Models/User/User.php +++ b/app/Models/User/User.php @@ -172,7 +172,7 @@ public function items() */ public function gallerySubmissions() { - return $this->hasMany('App\Models\Gallery\GallerySubmission')->where('user_id', $this->id)->orWhereIn('id', GalleryCollaborator::where('user_id', $this->id)->where('type', 'Collab')->pluck('gallery_submission_id')->toArray())->visible($this)->accepted()->orderBy('created_at', 'DESC'); + return $this->hasMany('App\Models\Gallery\GallerySubmission')->where('user_id', $this->id)->orWhereIn('id', GalleryCollaborator::where('user_id', $this->id)->where('type', 'Collab')->pluck('gallery_submission_id')->toArray())->orderBy('created_at', 'DESC'); } /** @@ -348,15 +348,39 @@ public function getLogTypeAttribute() // Check if user is online and display When they were online public function isOnline() { + $onlineStatus = Cache::has('user-is-online-' . $this->id); + $online = Carbon::createFromTimeStamp(strtotime(Cache::get('user-is-online-time-' . $this->id))); + $onlineTime = isset($this->last_seen) ? Carbon::parse($this->last_seen)->diffForHumans() : 'a long time ago'; - $onlineStatus = Cache::has('user-is-online-' . $this->id); - $online = Carbon::createFromTimeStamp(strtotime(Cache::get('user-is-online-time-' . $this->id))); - $onlineTime = isset($this->last_seen) ? Carbon::parse($this->last_seen)->diffForHumans() : 'A long time ago.'; - - if($onlineStatus) $result = ''; - else $result = ''; + $statusHidden = ''; + if ($onlineStatus) { + $statusShow = ''; + } else { + $statusShow = ''; + } - return $result; + switch($this->settings->last_online_setting) { + case 0: + return $statusHidden; + break; + case 1: + return $statusShow; + break; + case 2: + if(Auth::check() && Auth::user()->isStaff){ + return $statusShow; + } else { + return $statusHidden; + } + break; + case 3: + if(Auth::check()){ + return $statusShow; + } else { + return $statusHidden; + } + break; + } } /** diff --git a/app/Models/User/UserSettings.php b/app/Models/User/UserSettings.php index 5c29a7cabe..615db7887d 100644 --- a/app/Models/User/UserSettings.php +++ b/app/Models/User/UserSettings.php @@ -13,7 +13,7 @@ class UserSettings extends Model * @var array */ protected $fillable = [ - 'is_fto', 'submission_count', 'banned_at', 'ban_reason', 'birthday_setting' + 'is_fto', 'submission_count', 'banned_at', 'ban_reason', 'birthday_setting', 'last_online_setting' ]; /** diff --git a/app/Policies/CommentPolicy.php b/app/Policies/CommentPolicy.php index 2ae835b7e6..5b554228ed 100644 --- a/app/Policies/CommentPolicy.php +++ b/app/Policies/CommentPolicy.php @@ -27,7 +27,7 @@ public function create($user) : bool */ public function delete($user, Comment $comment) : bool { - if(auth::user()->isStaff) { + if(Auth::user()->isStaff) { return true; } else { diff --git a/app/Services/CharacterManager.php b/app/Services/CharacterManager.php index e052081461..881425a81a 100644 --- a/app/Services/CharacterManager.php +++ b/app/Services/CharacterManager.php @@ -237,8 +237,8 @@ private function handleCharacterImage($data, $character, $isMyo = false) // Use default images for MYO slots without an image provided if(!isset($data['image'])) { - $data['image'] = asset('images/myo.png'); - $data['thumbnail'] = asset('images/myo-th.png'); + $data['image'] = public_path('images/myo.png'); + $data['thumbnail'] = public_path('images/myo-th.png'); $data['extension'] = 'png'; $data['default_image'] = true; unset($data['use_cropper']); diff --git a/app/Services/SalesService.php b/app/Services/SalesService.php index c747f01dfc..4356c9122e 100644 --- a/app/Services/SalesService.php +++ b/app/Services/SalesService.php @@ -130,10 +130,12 @@ private function processCharacters($sales, $data) case 'ota': if(isset($data['autobuy'][$key])) $charData[$key]['autobuy'] = $data['autobuy'][$key]; if(isset($data['end_point'][$key])) $charData[$key]['end_point'] = $data['end_point'][$key]; + if(isset($data['minimum'][$key])) $charData[$key]['minimum'] = $data['minimum'][$key]; break; case 'xta': if(isset($data['autobuy'][$key])) $charData[$key]['autobuy'] = $data['autobuy'][$key]; if(isset($data['end_point'][$key])) $charData[$key]['end_point'] = $data['end_point'][$key]; + if(isset($data['minimum'][$key])) $charData[$key]['minimum'] = $data['minimum'][$key]; break; case 'flaffle': $charData[$key]['price'] = $data['price'][$key]; diff --git a/app/Services/ShopManager.php b/app/Services/ShopManager.php index 794342dd00..b0a749e12a 100644 --- a/app/Services/ShopManager.php +++ b/app/Services/ShopManager.php @@ -33,7 +33,7 @@ public function buyStock($data, $user) DB::beginTransaction(); try { - $quantity = $data['quantity']; + $quantity = ceil($data['quantity']); if(!$quantity || $quantity == 0) throw new \Exception("Invalid quantity selected."); // Check that the shop exists and is open @@ -50,6 +50,8 @@ public function buyStock($data, $user) // Check if the user can only buy a limited number of this item, and if it does, check that the user hasn't hit the limit if($shopStock->purchase_limit && $this->checkPurchaseLimitReached($shopStock, $user)) throw new \Exception("You have already purchased the maximum amount of this item you can buy."); + if($shopStock->purchase_limit && $quantity > $shopStock->purchase_limit) throw new \Exception("The quantity specified exceeds the amount of this item you can buy."); + $total_cost = $shopStock->cost * $quantity; $character = null; @@ -76,7 +78,7 @@ public function buyStock($data, $user) } // If the item has a limited quantity, decrease the quantity - if($shopStock->is_limited_stock) + if($shopStock->is_limited_stock) { $shopStock->quantity -= $quantity; $shopStock->save(); @@ -84,23 +86,23 @@ public function buyStock($data, $user) // Add a purchase log $shopLog = ShopLog::create([ - 'shop_id' => $shop->id, - 'character_id' => $character ? $character->id : null, - 'user_id' => $user->id, - 'currency_id' => $shopStock->currency->id, - 'cost' => $total_cost, - 'item_id' => $shopStock->item_id, + 'shop_id' => $shop->id, + 'character_id' => $character ? $character->id : null, + 'user_id' => $user->id, + 'currency_id' => $shopStock->currency->id, + 'cost' => $total_cost, + 'item_id' => $shopStock->item_id, 'quantity' => $quantity ]); - + // Give the user the item, noting down 1. whose currency was used (user or character) 2. who purchased it 3. which shop it was purchased from if(!(new InventoryManager)->creditItem(null, $user, 'Shop Purchase', [ - 'data' => $shopLog->itemData, + 'data' => $shopLog->itemData, 'notes' => 'Purchased ' . format_date($shopLog->created_at) ], $shopStock->item, $quantity)) throw new \Exception("Failed to purchase item."); return $this->commitReturn($shop); - } catch(\Exception $e) { + } catch(\Exception $e) { $this->setError('error', $e->getMessage()); } return $this->rollbackReturn(false); @@ -144,4 +146,4 @@ public function getStockPurchaseLimit($shopStock, $user) } return $limit; } -} \ No newline at end of file +} diff --git a/app/Services/UserService.php b/app/Services/UserService.php index c34babbc68..f56aa66eea 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -147,6 +147,17 @@ public function updateDOB($data, $user) return true; } + /** + * Updates user's last-online setting + */ + public function updateLastOnline($data, $user) + { + $user->settings->last_online_setting = $data; + $user->settings->save(); + + return true; + } + /** * Updates the user's avatar. * diff --git a/composer.json b/composer.json index c530929139..70a3429869 100644 --- a/composer.json +++ b/composer.json @@ -8,9 +8,9 @@ ], "license": "MIT", "require": { - "php": "^7.4", + "php": "~8.1", "boxconnect/deviant-php": "dev-master", - "doctrine/dbal": "2.2", + "doctrine/dbal": "^2.2", "erusev/parsedown": "^1.7", "ezyang/htmlpurifier": "^4.10", "fideloper/proxy": "^4.0", @@ -22,7 +22,7 @@ "illuminate/support": "^5.6|^6.0|^7.0|^8.0", "intervention/image": "^2.4", "laracasts/flash": "^3.0", - "laravel/framework": "8.0", + "laravel/framework": "^8.0", "laravel/helpers": "^1.4", "laravel/socialite": "^5.2", "laravel/tinker": "^2.0", @@ -34,7 +34,7 @@ "socialiteproviders/tumblr": "^4.1", "socialiteproviders/twitch": "^5.3", "socialiteproviders/twitter": "^4.1", - "spatie/laravel-honeypot": "^2.3.0" + "spatie/laravel-honeypot": "^4.1" }, "require-dev": { "beyondcode/laravel-dump-server": "^1.0", diff --git a/config/lorekeeper/extension_tracker.php b/config/lorekeeper/extension_tracker.php index 27ef624a57..b2de992f73 100644 --- a/config/lorekeeper/extension_tracker.php +++ b/config/lorekeeper/extension_tracker.php @@ -17,7 +17,8 @@ 'wiki_key' => 'Online_Status', 'creators' => json_encode([ 'Uri' => 'https://github.com/preimpression/', + 'AnimatedCritter' => 'https://github.com/AnimatedCritter/', ]), - 'version' => '2.0.0', + 'version' => '2.1.0', ], ]; diff --git a/config/lorekeeper/settings.php b/config/lorekeeper/settings.php index da04ee4780..e30c84898e 100644 --- a/config/lorekeeper/settings.php +++ b/config/lorekeeper/settings.php @@ -24,7 +24,7 @@ | Do not change this value! | */ - 'version' => '2.1.0', + 'version' => '2.1.7', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2022_09_11_223815_add_last_online_to_user_settings_table.php b/database/migrations/2022_09_11_223815_add_last_online_to_user_settings_table.php new file mode 100644 index 0000000000..d9503b45ec --- /dev/null +++ b/database/migrations/2022_09_11_223815_add_last_online_to_user_settings_table.php @@ -0,0 +1,32 @@ +tinyInteger('last_online_setting')->default(1); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('user_settings', function (Blueprint $table) { + $table->dropColumn('last_online_setting'); + }); + } +} diff --git a/resources/views/account/settings.blade.php b/resources/views/account/settings.blade.php index ffc0ad00ba..26ffd622a8 100644 --- a/resources/views/account/settings.blade.php +++ b/resources/views/account/settings.blade.php @@ -52,6 +52,21 @@ {!! Form::close() !!} +
+

Last-Online Publicity

+ {!! Form::open(['url' => 'account/last-online']) !!} +
+ +
+ {!! Form::select('last_online_setting', ['0' => 'No one can see your online status.', '1' => 'Anyone can see your online status.', '2' => 'Only site staff can see your online status.', '3' => 'Only logged-in users can see your online status.'], Auth::user()->settings->last_online_setting, ['class' => 'form-control']) !!} +
+
+
+ {!! Form::submit('Edit', ['class' => 'btn btn-primary']) !!} +
+ {!! Form::close() !!} +
+

Email Address

Changing your email address will require you to re-verify your email address.

diff --git a/resources/views/admin/reports/report.blade.php b/resources/views/admin/reports/report.blade.php index df38b7577c..d2523d0653 100644 --- a/resources/views/admin/reports/report.blade.php +++ b/resources/views/admin/reports/report.blade.php @@ -6,7 +6,7 @@ {!! breadcrumbs(['Admin Panel' => 'admin', 'Report Queue' => 'admin/reports/pending', 'Report (#' . $report->id . ')' => $report->viewUrl]) !!} @if($report->status !== 'Closed') - @if($report->status == 'Assigned' && auth::user()->id !== $report->staff_id) + @if($report->status == 'Assigned' && Auth::user()->id !== $report->staff_id)
This report is not assigned to you
@elseif($report->status == 'Pending')
This report needs assigning
@@ -52,13 +52,13 @@ @endif
@endif - + @if($report->status == 'Assigned' && $report->user_id == Auth::user()->id || Auth::user()->hasPower('manage_reports')) - @comments([ 'model' => $report, 'perPage' => 5 ]) + @comments([ 'type' => 'Staff-User', 'model' => $report, 'perPage' => 5 ]) @endif - + {!! Form::open(['url' => url()->current(), 'id' => 'reportForm']) !!} - @if($report->status == 'Assigned' && auth::user()->id == $report->staff_id) + @if($report->status == 'Assigned' && Auth::user()->id == $report->staff_id) @if(Auth::user()->hasPower('manage_reports'))
Please include a small paragraph on the solution and as many important details as you deem necessary, as the user will no longer be able to view the comments after the report is closed
@endif
{!! Form::label('staff_comments', 'Staff Comments (Optional)') !!} @@ -69,7 +69,7 @@ @if($report->staff_id == NULL) Assign @endif - @if($report->status == 'Assigned' && auth::user()->id == $report->staff_id) + @if($report->status == 'Assigned' && Auth::user()->id == $report->staff_id) Close
@endif @@ -111,10 +111,10 @@ @endsection @section('scripts') -@parent +@parent @if($report->status !== 'Closed') @endif -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/home/_report_content.blade.php b/resources/views/home/_report_content.blade.php index bed6740018..e82cffd005 100644 --- a/resources/views/home/_report_content.blade.php +++ b/resources/views/home/_report_content.blade.php @@ -33,7 +33,7 @@ @if(Auth::check() && $report->status == 'Assigned' && $report->user == Auth::user() || Auth::user()->hasPower('manage_reports'))
Admins will be alerted by new comments, however to keep the conversation organised we ask that you please reply to the admin comment.
- @comments([ 'model' => $report, 'perPage' => 5 ]) + @comments([ 'type' => 'Staff-User', 'model' => $report, 'perPage' => 5 ]) @elseif($report->status == 'Closed')
You cannot comment on a closed ticket.
@else @@ -48,4 +48,4 @@ {!! $report->staff_comments !!} @endif -@endif \ No newline at end of file +@endif diff --git a/resources/views/inventory/_box.blade.php b/resources/views/inventory/_box.blade.php index df9adcf7a9..c609110794 100644 --- a/resources/views/inventory/_box.blade.php +++ b/resources/views/inventory/_box.blade.php @@ -7,4 +7,14 @@ {!! Form::button('Open', ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'act', 'type' => 'submit']) !!} - \ No newline at end of file + + + diff --git a/routes/lorekeeper/members.php b/routes/lorekeeper/members.php index cbffc43de2..815eb6f96f 100644 --- a/routes/lorekeeper/members.php +++ b/routes/lorekeeper/members.php @@ -34,6 +34,7 @@ Route::get('remove-alias/{id}', 'AccountController@getRemoveAlias'); Route::post('remove-alias/{id}', 'AccountController@postRemoveAlias'); Route::post('dob', 'AccountController@postBirthday'); + Route::post('last-online', 'AccountController@postLastOnline'); Route::get('bookmarks', 'BookmarkController@getBookmarks'); Route::get('bookmarks/create', 'BookmarkController@getCreateBookmark');