Skip to content

Commit

Permalink
add status details attribute and fix proposal edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-elhelou committed Jan 22, 2025
1 parent 9d1b211 commit c3c9c81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/Models/Proposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Proposal extends BaseModel
{
use HasFactory;
protected $guarded = ['donated_amount'];
protected $appends = ['status_str_ar', 'beneficiaries', 'currency_name', 'entity_name', 'proposal_type_type_ar', 'area_name', 'can_complete_donating_status', 'can_complete_execution_status'];
protected $appends = ['status_str_ar', 'beneficiaries', 'currency_name', 'entity_name', 'proposal_type_type_ar', 'area_name', 'can_complete_donating_status', 'can_complete_execution_status', 'status_details'];
protected $with = ['entity', 'area', 'proposalType', 'currency'];
public static $controllable = true;

Expand Down Expand Up @@ -41,6 +41,9 @@ public function getStatusStrArAttribute()
{
return [1 => 'مرحلة جمع التبرعات', 2 => 'مرحلة التنفيذ والتوثيق', 3 => 'بحاجة للأرشفة', 8 => 'مكتمل'][$this->status] ?? '';
}
public function getStatusDetailsAttribute(){
return 'hi how are you';
}

public function getBeneficiariesAttribute()
{
Expand Down Expand Up @@ -121,7 +124,7 @@ public static function headers($user = null)
['sortable' => true, 'value' => 'entity name', 'key' => 'entity_name'],
['sortable' => true, 'value' => 'proposal type', 'key' => 'proposal_type_type_ar'],
['sortable' => true, 'value' => 'area name', 'key' => 'area_name'],
['sortable' => true, 'value' => 'status', 'key' => 'status_str_ar', 'class_value_name' => 'status', 'has_class' => true],
['sortable' => true, 'value' => 'status', 'key' => 'status_str_ar', 'class_value_name' => 'status', 'has_class' => true, 'details_key' => 'status_details'],
// ['sortable' => true, 'value' => 'actions', 'key' => 'actions', 'actions' => ['show', 'update', 'delete']],
];
}
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Proposal/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const form = useForm({
proposal_effects: props.proposal.proposal_effects,
cost: props.proposal.cost,
share_cost: props.proposal.share_cost,
min_documenting_amount: props.proposal.min_documenting_amount,
expected_benificiaries_count: props.proposal.expected_benificiaries_count,
execution_date: props.proposal.execution_date,
publishing_date: props.proposal.publishing_date,
Expand Down Expand Up @@ -220,8 +221,7 @@ const submit = () => {
/>
<InputError :message="form.errors.publishing_date" class="mt-2" />
</div>
<div class="col-span-2">
</div>

<div class="col-span-2">
<InputLabel for="body" value="proposal body" />
<Textarea
Expand Down

0 comments on commit c3c9c81

Please sign in to comment.