@extends('layouts.demo10.base') @php $projectStatus = strtolower($currentProject->status ?? 'active'); $projectDescription = filled($currentProject->description) ? $currentProject->description : 'N/A'; $createdDate = optional($currentProject->created_at)->format('F, d, Y') ?? 'N/A'; $updatedDate = optional($currentProject->updated_at)->format('F, d, Y') ?? 'N/A'; $schemaDesignUrl = route('tenants.projects.schema_design', ['projectName' => $currentProject->slug]) . '?tenant_id=' . $currentProject->id; $projectImportUrl = route('tenants.projects.import', ['projectName' => $currentProject->slug]); $dataSourceType = strtolower($dataSourceConnection->source_type ?? 'odk'); $dataSourceUpdatedDate = optional($dataSourceConnection?->updated_at)->format('F, d, Y') ?? 'N/A'; $dataSourceStatus = strtolower($dataSourceConnection->status ?? 'inactive'); $dataSourceUsesToken = (bool) data_get($dataSourceConnection?->settings, 'use_auth_token', false); $dataSourceColspan = $dataSourceType === 'csv' ? 6 : 7; $groupedPiiAttributes = collect($attributes ?? [])->groupBy('table'); $dataSourceConfig = [ 'id' => $dataSourceConnection?->id, 'type' => $dataSourceType, 'base_url' => $dataSourceConnection?->base_url, 'project_id' => $dataSourceConnection?->project_id, 'form_id' => $dataSourceConnection?->form_id, 'username' => $dataSourceConnection?->username, 'file_name' => $dataSourceConnection?->file_name, 'file_path' => $dataSourceConnection?->file_path, 'use_auth_token' => $dataSourceUsesToken, ]; $adminFormTabs = [ [ 'key' => 'progress', 'label' => 'Progress', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'progress']), ], [ 'key' => 'component1', 'label' => 'Component 1', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'component1']), ], [ 'key' => 'component2', 'label' => 'Component 2', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'component2']), ], [ 'key' => 'component3', 'label' => 'Component 3', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'component3']), ], [ 'key' => 'component4', 'label' => 'Component 4', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'component4']), ], [ 'key' => 'baseline', 'label' => 'Baseline', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'baseline']), ], [ 'key' => 'import', 'label' => 'Import', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'import']), ], [ 'key' => 'group', 'label' => 'Group', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'group']), ], [ 'key' => 'user', 'label' => 'User', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'user']), ], [ 'key' => 'alert', 'label' => 'Alert', 'route' => route('tenants.projects.admin_forms', ['projectName' => $currentProject->slug, 'tab' => 'alert']), ], ]; $activeTab = $activeTab ?? 'import'; $adminFormValidTabs = ['beneficiaries', 'financial', 'import', 'threshold', 'group', 'user', 'alert', 'alert_engine']; $adminFormDefaultTab = 'import'; $querySettingsTab = request('tab', 'general'); $queryAdminTab = request('adminTab'); $settingsTabKeys = [ 'general', 'data-source', 'schema-design', 'tenant-domain', 'tenant-themes', 'Themes-configuration', 'import', 'cron-scheduler', 'pii-management', 'view-data', 'theme', 'admin-forms', ]; $settingsActiveTab = in_array($querySettingsTab, $settingsTabKeys, true) ? $querySettingsTab : 'general'; $adminFormActiveTab = $adminFormDefaultTab; if ($queryAdminTab && in_array($queryAdminTab, $adminFormValidTabs, true)) { $settingsActiveTab = 'admin-forms'; $adminFormActiveTab = $queryAdminTab; } elseif (!in_array($querySettingsTab, $settingsTabKeys, true) && in_array($querySettingsTab, $adminFormValidTabs, true)) { $settingsActiveTab = 'admin-forms'; $adminFormActiveTab = $querySettingsTab; } elseif (in_array($activeTab, $adminFormValidTabs, true)) { $adminFormActiveTab = $activeTab; } @endphp @section('content')

Projects Settings

Project/{{ $currentProject->name }}/Settings
{{--
--}}
{{--
@can('edit.projects') @else @endcan
--}}
@can('view.general')@endcan @can('view.data_source')@endcan @can('view.schema_design')@endcan @can('view.tenant_themes')@endcan @can('view.themes-configuration')@endcan @can('view.import')@endcan @can('view.cron_scheduler')@endcan @can('view.pii_management')@endcan @can('view.datasets')@endcan

General Information

Project Name Project Description Status Start Date Last Modified
{{ $currentProject->name }} {{ $projectDescription }} {{ $projectStatus === 'active' ? 'Active' : 'Inactive' }} {{ $createdDate }} {{ $updatedDate }}
{{-- EDIT BUTTON --}} @can('edit.general') @else @endcan {{-- DELETE BUTTON --}} @can('delete.general') @else @endcan

{{ $dataSourceType === 'api' ? 'API Connection Information' : ($dataSourceType === 'csv' ? 'CSV File Information' : 'ODK Connection Information') }}

@if($dataSourceType === 'api') @elseif($dataSourceType === 'csv') @else @endif @if($dataSourceConnection) @if($dataSourceType === 'api') @elseif($dataSourceType === 'csv') @else @endif @else @endif
API Name URL Auth Username Last Date Status
File Name File Path Source Last Date Status
Server Project ID Form ID Auth Last Date Status
{{ $dataSourceConnection->name ?: 'API Data Source' }} {{ $dataSourceConnection->base_url ?: '--' }} {{ $dataSourceUsesToken ? 'Token' : 'Basic' }} {{ $dataSourceUsesToken ? 'Token Enabled' : ($dataSourceConnection->username ?: '--') }} {{ $dataSourceUpdatedDate }} {{ ucfirst($dataSourceConnection->status ?? 'Configured') }}
@can('edit.data_source')@endcan @can('delete.data_source')@endcan
{{ $dataSourceConnection->file_name ?: 'CSV File' }} {{ $dataSourceConnection->file_path ?: '--' }} {{ strtoupper($dataSourceType) }} {{ $dataSourceUpdatedDate }} {{ ucfirst($dataSourceConnection->status ?? 'Configured') }}
{{ $dataSourceConnection->base_url ?: '--' }} {{ $dataSourceConnection->project_id ?: '--' }} {{ $dataSourceConnection->form_id ?: '--' }} {{ $dataSourceUsesToken ? 'Token' : 'Basic' }} {{ $dataSourceUpdatedDate }} {{ ucfirst($dataSourceConnection->status ?? 'Configured') }}
No data source configured yet.

Schema Design Information

@forelse($schemaHistories as $schemaHistory) @php $latestSchemaImport = $importHistories ->where('schema_history_id', $schemaHistory->id) ->sortByDesc('created_at') ->first(); $schemaFileName = filled($schemaHistory->schema_file) ? basename((string) $schemaHistory->schema_file) : 'N/A'; $generatedBy = $schemaHistory->user?->name ?? $latestSchemaImport?->user?->name ?? 'N/A'; $generatedAt = optional($schemaHistory->created_at)->format('F, d, Y') ?? 'N/A'; @endphp @empty @endforelse
Schema File Generated By Generated At
{{ $schemaFileName }} {{ $generatedBy }} {{ $generatedAt }}
@can('edit.schema_design') @endcan @can('delete.schema_design') @endcan
No schema generated yet.
@php $domainsData = $tenantDomains->map(function ($td) { return [ 'id' => $td->id, 'domain' => $td->domain, 'domain_type' => $td->domain_type, 'domain_scheme' => $td->domain_scheme, 'project' => $td->project?->name, 'theme_id' => $td->theme_id, 'theme_name' => $td->theme?->name, 'verification_mode' => $td->verification_mode, 'expected_cname_target' => $td->expected_cname_target, 'expected_ip_address' => $td->expected_ip_address, 'expected_targets' => $td->verification_targets ?: array_values(array_filter([ $td->expected_cname_target, $td->expected_ip_address, ])), 'notes' => $td->notes, 'is_primary' => (bool) $td->is_primary, 'status' => $td->status, 'verified_at' => $td->verified_at?->format('M d, Y'), 'created_by' => $td->createdBy?->name, ]; })->values(); $domainThemeOptions = collect($themes ?? [])->map(fn($theme) => [ 'id' => $theme->id, 'name' => $theme->name, ])->values(); $defaultDomainTargets = array_values(array_unique(array_filter((array) config('tenant_domains.default_expected_targets', [])))); $defaultDomainTargetsText = implode(', ', $defaultDomainTargets); $defaultDomainScheme = config('tenant_domains.default_scheme', 'https'); $defaultActiveThemeId = $currentThemeSetting?->theme_id; $primaryTarget = $defaultDomainTargets[0] ?? parse_url(config('app.url'), PHP_URL_HOST) ?? '127.0.0.1'; $primaryTargetType = filter_var($primaryTarget, FILTER_VALIDATE_IP) ? 'A' : 'CNAME'; @endphp

Configured Domains

Add New Domain

@csrf

Enter host only, without protocol. Example: tenant.dev.ifrap.com

Comma ya new line separated targets. Blank chhorne par app-level fallback use hoga.

Add Base Theme

Select how the application interface should appear to you.

{{-- Default Theme 1 --}}
Default Theme
Clean and minimal
{{-- Default Theme 2 --}}
Default Theme
Clean and minimal
{{-- Government Progress Theme --}}
Government Progress Theme
Formal and professional
{{-- Branding Assets --}}

Branding Assets

Select how the application interface should appear to you.

Primary Logo
Dark Logo
Favicon
{{-- Color Theme --}}

Color Theme

Choose colors for your tenant workspace.

Primary color
Cobalt Blue
#111FF
Secondary color
Forest Green
#111FF
Accent color
Royal Purple
#111FF
Text color
Dark
#111FF
{{-- Typography & Layout --}}

Typography & Layout

Choose typography for your tenant workspace.

{{-- Additional Settings --}}

Additional Settings

@can('process.import') @endcan

Import Information

@forelse($importHistories as $history) @php $importStatus = strtolower($history->status ?? 'failed'); $isImportSuccess = $importStatus === 'success'; @endphp @empty @endforelse
Imported By Imported Date Total Records Form ID Status
{{ $history->user?->name ?? 'N/A' }} {{ optional($history->created_at)->format('F, d, Y') ?? 'N/A' }} {{ $history->total_imported ?? 'N/A' }} {{ $history->odkConnection?->form_id ?? 'N/A' }} {{ ucfirst($importStatus) }}
No import history available yet.

PII Management

@can('view.pii_management')
@if($groupedPiiAttributes->isNotEmpty())
@foreach($groupedPiiAttributes as $tableName => $tableAttributes) @php $tableSlug = \Illuminate\Support\Str::slug($tableName); @endphp
{{ $tableName }}
@foreach($tableAttributes as $index => $attribute) @endforeach
@endforeach
@can('edit.pii_management')
@endcan @else
No dataset attributes found in the connected database.
@endif
@else
You do not have permission to view PII Management.
@endcan
@can('create.cron_scheduler') @endcan

Cron Scheduler

@canany(['edit.cron_scheduler', 'delete.cron_scheduler', 'run.cron_scheduler', 'toggle.cron_scheduler']) @endcanany @forelse($cronSchedules as $schedule) @canany(['edit.cron_scheduler', 'delete.cron_scheduler', 'run.cron_scheduler', 'toggle.cron_scheduler']) @endcanany @empty @endforelse
Schedule Name ODK Connection Frequency Time Last Run Next Run StatusActions
{{ $schedule->name ?: '--' }}
{{ $schedule->odkConnection?->form_id ?: 'N/A' }} {{ $schedule->odkConnection?->base_url ?: '' }}
{{ ucfirst($schedule->frequency ?: '--') }} @if($schedule->frequency === 'weekly' && $schedule->day_of_week) {{ ucfirst($schedule->day_of_week) }} @endif @if($schedule->frequency === 'monthly' && $schedule->day_of_month) Day {{ $schedule->day_of_month }} @endif {{ $schedule->time ?: '--' }} {{ $schedule->last_run_at ? $schedule->last_run_at->format('M d, Y H:i') : 'Never' }} {{ $schedule->next_run_at ? $schedule->next_run_at->format('M d, Y H:i') : 'N/A' }} {{ $schedule->is_active ? 'Active' : 'Inactive' }}
@can('toggle.cron_scheduler') @endcan @can('run.cron_scheduler') @endcan @can('edit.cron_scheduler') @endcan @can('delete.cron_scheduler') @endcan
No cron schedules configured yet.
@can('delete.view_data') @endcan @can('edit.view_data') @endcan

View Data

{{-- Theme Selection Card --}}

Available Themes

@if($currentThemeSetting ?? null) Active: {{ $currentThemeSetting->theme_slug ?? '—' }} @endif
@forelse($themes ?? [] as $theme) @php $isActive = ($currentThemeSetting ?? null) && $currentThemeSetting->theme_id === $theme->id; $config = $theme->default_config ?? []; @endphp @empty @endforelse
Theme Colors Version Author Status Action
{{ $theme->name }} {{ \Illuminate\Support\Str::limit($theme->description, 50) }}
@foreach(['primary_color', 'secondary_color', 'accent_color', 'header_bg_color', 'footer_bg_color'] as $ck) @if(isset($config[$ck]))
@endif @endforeach
v{{ $theme->version }} {{ $theme->author ?? '—' }} @if($isActive) Active @else Inactive @endif
Preview @if(!$isActive)
@csrf
@else Customize @endif
No themes found. Run php artisan db:seed --class=ThemeSeeder
{{-- Customize Section (only if active theme exists) --}} @if($currentThemeSetting ?? null)

Customize Active Theme

Open Customize
{{-- Color Preview Boxes --}} @php $colorPreviews = [ 'Primary' => $currentThemeSetting->primary_color, 'Header' => $currentThemeSetting->header_bg_color, 'Sidebar' => $currentThemeSetting->sidebar_bg_color, 'Footer' => $currentThemeSetting->footer_bg_color, 'Accent' => $currentThemeSetting->accent_color, ]; @endphp @foreach($colorPreviews as $label => $color)
{{ $label }}
{{ $color ?? '—' }}
@endforeach
{{-- Site Branding Info --}}
Site Name

{{ $currentThemeSetting->site_name ?: '—' }}

Font

{{ $currentThemeSetting->heading_font ?: 'Inter' }}

Header

{{ $currentThemeSetting->show_header ? 'Visible' : 'Hidden' }}

Footer

{{ $currentThemeSetting->show_footer ? 'Visible' : 'Hidden' }}

@php $settingsLogo1 = $currentThemeSetting->logo1_path ?: $currentThemeSetting->logo_path; $settingsLogo2 = $currentThemeSetting->logo2_path; @endphp @if($settingsLogo1)
Theme Logos
Logo 1 @if($settingsLogo2) Logo 2 @endif
@endif
@csrf
Theme Logos Upload
Navbar ke dono logos ke liye files select karke upload karein.
{{-- Module Toggles --}} @if(isset($tenantModules) && $tenantModules->isNotEmpty())

Theme Modules

@foreach($tenantModules as $mod) @endforeach
Module Key Sort Order Status Toggle
{{ ucfirst(str_replace('_', ' ', $mod->module_key)) }} {{ $mod->module_key }} {{ $mod->sort_order }} @if($mod->is_enabled) Enabled @else Disabled @endif
@csrf
@endif @else {{-- No active theme CTA --}}

No Active Theme

Activate a theme from the table above to start customizing.

@endif
@can('edit.projects')

Edit Project

@csrf

Add Projects

Edit Data Source

@csrf

ODK Central Connection

Projects/{{ $currentProject->name }}/Data Source/ODK Connection

@can('create.cron_scheduler')

Add Cron Schedule

@csrf
@endcan @can('edit.cron_scheduler')

Edit Cron Schedule

@csrf
@endcan @canany(['run.cron_scheduler', 'process.import'])

Running Import

Please wait, we are importing data from ODK Central.

@endcanany @endcan
@include('pages.project.admin-forms.partials.component1')
@include('pages.project.admin-forms.partials.component2')
@include('pages.project.admin-forms.partials.component3')
@include('pages.project.admin-forms.partials.component4')
@include('pages.project.admin-forms.partials.baseline')
@include('pages.project.admin-forms.partials.import')
@include('pages.project.admin-forms.partials.hands')
@include('pages.project.admin-forms.partials.NRSP')
@include('pages.project.admin-forms.partials.TRDP')
@include('pages.project.admin-forms.partials.SAFCO')
@include('pages.project.admin-forms.partials.SARSO')
@include('pages.project.admin-forms.partials.MAIN')
@include('pages.project.admin-forms.partials.group')
@include('pages.project.admin-forms.partials.user')
@include('pages.project.admin-forms.partials.alert')
@include('pages.project.admin-forms.partials.alert_engine')
@include('pages.project.admin-forms.partials.beneficiaries')
@include('pages.project.admin-forms.partials.financial')
@endsection @section('scripts') @vite('resources/js/pages/project-settings.js') @vite('resources/js/ImportDataset/view-dataset.js') @endsection