NASER add type for apps list

This commit is contained in:
Montzar.ah.01
2026-04-25 12:54:33 +00:00
parent c159163601
commit cf50c3371f
3 changed files with 13 additions and 6 deletions
+8 -2
View File
@@ -25,7 +25,13 @@ class App extends Model
]; ];
protected $TYPE = [ protected $TYPE = [
1=>'خانگی', 1=>'(خانگی)',
2=>'همکار' 2=>'(همکار)'
]; ];
public function getTypeFaAttribute(): string
{
return $this->TYPE[$this->type] ?? '';
}
} }
+3 -3
View File
@@ -19,7 +19,7 @@ if (isset($task)) {
?> ?>
@extends('app') @extends('app')
@section('content') @section('content')
<div class="w-full mt-[90px] justify-center container flex "> <div class="w-full mt-[70px] justify-center container flex ">
<div class="bg-white w-[350px] rounded-xl "> <div class="bg-white w-[350px] rounded-xl ">
<h1 class="w-[350px] bg-cyan-500 rounded-t-xl text-center p-1.5 font-bold text-slate-50">{{isset($task) ? "ویرایش وظیفه" : "ایجاد وظیفه جدید"}} <h1 class="w-[350px] bg-cyan-500 rounded-t-xl text-center p-1.5 font-bold text-slate-50">{{isset($task) ? "ویرایش وظیفه" : "ایجاد وظیفه جدید"}}
</h1> </h1>
@@ -96,7 +96,7 @@ if (isset($task)) {
</button> </button>
<div id="dropdown-list" <div id="dropdown-list"
class="hidden absolute z-20 mt-1 w-full bg-white border border-gray-300 rounded-lg shadow-lg"> class="hidden absolute z-20 w-full bg-white border border-gray-300 rounded-lg shadow-lg">
<div class="p-2 border-b"> <div class="p-2 border-b">
<input type="text" id="search-input" <input type="text" id="search-input"
@@ -134,7 +134,7 @@ if (isset($task)) {
@if(!empty($apps) && count($apps) > 0) @if(!empty($apps) && count($apps) > 0)
@foreach($apps as $app) @foreach($apps as $app)
<option value="{{ $app->id }}" {{ old('app', $task->app ?? '') == $app->id ? 'selected' : '' }}> <option value="{{ $app->id }}" {{ old('app', $task->app ?? '') == $app->id ? 'selected' : '' }}>
{{ $app->name_fa }} {{ $app->name_fa }} {{ $app->type_fa }}
</option> </option>
@endforeach @endforeach
@endif @endif
+2 -1
View File
@@ -769,9 +769,10 @@ $priorityColors = [
// اپ // اپ
const appNameEl = document.getElementById('modalTaskAppName'); const appNameEl = document.getElementById('modalTaskAppName');
const appTypes = {1:'خانگی', 2:'همکار'};
if (appNameEl) { if (appNameEl) {
const app = (appsList || []).find(a => String(a.id) === String(task.app)); const app = (appsList || []).find(a => String(a.id) === String(task.app));
appNameEl.textContent = app?.name_fa || '-'; appNameEl.textContent = app?.name_fa ` (${appTypes[app.type]})` || '-';
} }
// اولویت // اولویت