142 lines
7.5 KiB
PHP

{{-- resources/views/forms/submit-tech-maker.blade.php --}}
@extends('layouts.master')
@section('content')
<div class="container mt-5">
<div class="row">
<div class="col-md-8 offset-md-2">
<h1 class="mb-4">Engage as a Tech Maker with Polisplexity</h1>
<p class="lead">Join our innovative ecosystem as a Tech Maker and contribute to the future of smart, sustainable cities.</p>
{{-- Introduction Section --}}
<section class="my-5">
<h2>Why Tech Makers are Essential</h2>
<p>Polisplexity thrives on the innovative solutions brought forward by Tech Makers like you. Your technology can drive significant advancements in urban development, sustainability, and smart city solutions.</p>
<ul>
<li>Collaborative Innovation: Work alongside city consultants and engaged citizens to create impactful urban solutions.</li>
<li>Token-Based Recognition: Gain recognition for your contributions through PLY tokens, which symbolize the value and trust your technology brings to the ecosystem.</li>
<li>Community Impact: Have a direct hand in shaping the cities of the future by contributing your unique solutions to real-world challenges.</li>
</ul>
</section>
{{-- Tech Maker Engagement Form --}}
<section class="my-5">
<h2>Submit Your Technology</h2>
<form id="Web3Form" action="{{ route('rfp.store') }}" method="POST" class="needs-validation" novalidate>
@csrf {{-- CSRF token for security --}}
@php
// Extract the last segment from the URL
$formLabelSegment = last(request()->segments());
@endphp
{{-- Hidden Field for Form Identifier/Label --}}
<input type="hidden" name="formLabel" value="{{ $formLabelSegment }}" id="formLabel">
{{-- Technology Name --}}
<div class="form-group mb-3">
<label for="techName" class="form-label">Technology Name:</label>
<input type="text" name="techName" id="techName" class="form-control" required>
<div class="invalid-feedback">
Please enter the name of your technology.
</div>
</div>
{{-- Technology Description --}}
<div class="form-group mb-3">
<label for="techDescription" class="form-label">Technology Description:</label>
<textarea name="techDescription" id="techDescription" class="form-control" rows="4" required></textarea>
<div class="invalid-feedback">
Please provide a description of your technology.
</div>
</div>
{{-- Area of Expertise --}}
<div class="form-group mb-3">
<label for="expertiseArea" class="form-label">Area of Expertise:</label>
<select name="expertiseArea" id="expertiseArea" class="form-select" required>
<option value="">--Select Your Expertise Area--</option>
<option value="sustainable-infrastructure">Sustainable Infrastructure</option>
<option value="smart-city-solutions">Smart City Solutions</option>
<option value="urban-analytics">Urban Analytics</option>
{{-- Additional expertise areas as needed --}}
</select>
<div class="invalid-feedback">
Please select your area of expertise.
</div>
</div>
{{-- Contact Information --}}
<fieldset class="mb-4">
<legend>Contact Information</legend>
{{-- Name --}}
<div class="form-group mb-3">
<label for="contactName" class="form-label">Your Name:</label>
<input type="text" name="contactName" id="contactName" class="form-control" required>
<div class="invalid-feedback">
Please enter your name.
</div>
</div>
{{-- Email --}}
<div class="form-group mb-3">
<label for="contactEmail" class="form-label">Your Email:</label>
<input type="email" name="contactEmail" id="contactEmail" class="form-control" required>
<div class="invalid-feedback">
Please enter a valid email address.
</div>
</div>
{{-- Optional Phone Number --}}
<div class="form-group mb-3">
<label for="contactPhone" class="form-label">Your Phone Number (Optional):</label>
<input type="text" name="contactPhone" id="contactPhone" class="form-control">
</div>
</fieldset>
{{-- Hidden Fields for Web3 Address and Signature --}}
<input type="hidden" name="web3Address" id="web3Address">
<input type="hidden" name="web3Signature" id="web3Signature">
{{-- Web3 Sign Checkbox --}}
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="" id="web3SignCheck">
<label class="form-check-label" for="web3SignCheck">
Check to Sign with Web3
</label>
<small class="form-text text-muted">Checking this will prompt you to sign the form with your Web3 wallet upon submission.</small>
</div>
<button type="submit" class="btn btn-primary">Submit Your Technology</button>
</form>
</section>
{{-- Guidance on Next Steps --}}
<section class="my-5">
<h2>What Happens Next?</h2>
<p>Once you submit your technology, our team will review your submission and reach out to discuss potential collaboration opportunities. Together, we can make cities smarter and more sustainable.</p>
</section>
</div>
</div>
</div>
<script>
document.getElementById('Web3Form').addEventListener('submit', async (e) => {
if (document.getElementById('web3SignCheck').checked) {
e.preventDefault(); // Prevent form from submitting immediately
const signResult = await web3Login(); // Trigger the Web3 login and sign function
if (signResult && signResult.signature) {
// Populate the hidden fields with the address and signature
document.getElementById('web3Address').value = signResult.address;
document.getElementById('web3Signature').value = signResult.signature;
e.target.submit(); // Submit the form after populating the hidden fields
} else {
alert('Signing with Web3 failed or was cancelled. Please try again or submit without signing.');
}
}
});
</script>
@endsection