Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Dec 12, 2024
2 parents 01ea871 + cef3324 commit c991e02
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 5 deletions.
2 changes: 2 additions & 0 deletions resources/assets/sass/solution/propose-page.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "../problem/bootstrap_4point6_custom_xxl"; // this page uses custom styles to support one more bootstrap size: xxl from 1260px and UP

#propose-solution-page {
#propose-solution-overview,
.row.propose-solution-description {
Expand Down
4 changes: 4 additions & 0 deletions resources/lang/en/solution.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
'solution_title' => 'Solution Title',
'solution_description' => 'Solution Description',
'help_us_more_message' => 'Help us more by submitting more solutions!',
'submission_form' => 'Submission Form',
'share_your_solution' => 'Share Your Solution',
'do_you_have_an_idea' => 'Do you have an idea that can help solve a problem? Submit your solution below and join our community of problem-solvers! Your contribution can make a real difference. Fill in the form with your best solution and help us tackle challenges together.',
'about_the_problem' => 'About the Problem',
];
105 changes: 104 additions & 1 deletion resources/views/solution/partials/new-solution-form.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1,104 @@
<p>solution-form-works!</p>
<div class="container px-sm-0">

<div class="row">
<div class="col-12">
<h2>{{ __('solution.submission_form') }}</h2>
</div>
</div>

<form id="problem-form" enctype="multipart/form-data" method="POST" action="{{ route('solutions.user-proposal-store', [request('project_slug'), request('problem_slug')]) }}">

@csrf

<div class="container-fluid p-0">

<div class="row">
<div class="col-sm-12">

<input type="hidden" name="solution-owner-problem" value="{{auth()->user()->id}}">

<div class="solution-language-notifier">
The language for this solution is: {{ $viewModel->language->language_name }}
</div>

<div class="form-row">
<div class="form-group col-sm-12">
<label for="solution-title">Solution Title (<span class="red">*</span>)</label>
<input type="text"
id="solution-title"
name="solution-title"
class="form-control {{ $errors->has('solution-title') ? 'is-invalid' : '' }}"
required
placeholder="Solution Title"
maxlength="100"
{{ $errors->has('solution-title') ? 'aria-describedby="solution-title-feedback"' : '' }}
value="{{ old('solution-title') ? old('solution-title') : '' }}"
>
<div id="solution-title-feedback" class="invalid-feedback">
<strong>{{ $errors->first('solution-title') }}</strong></div>
</div>
</div>

<div class="form-row">
<div class="form-group col-sm-12">
<label for="solution-description">Solution Description (<span
class="red">*</span>)</label>
<textarea
id="solution-description"
name="solution-description"
class="form-control {{ $errors->has('solution-description') ? 'is-invalid' : '' }}"
required
rows="6"
placeholder="Solution Description"
maxlength="400"
{{ $errors->has('solution-description') ? 'aria-describedby="solution-description-feedback"' : '' }}
>{{ old('solution-description') ? old('solution-description') : '' }}</textarea>
<div id="solution-description-feedback" class="invalid-feedback">
<strong>{{ $errors->first('solution-description') }}</strong></div>
</div>
</div>

<div class="form-row js-image-input-container">
<div class="col-sm-12">
<div class="form-group input-file-wrapper">
<label for="solution-image">Solution Image (max-size: 2MB)</label></label>
<br><small>In order to update the currently selected image, please choose a new image by
clicking the button below.</small><br> {{-- bookmark3 - fix spacing --}}
<input type="file"
id="solution-image"
name="solution-image"
class="form-control p-2 h-auto {{ $errors->has('solution-image') ? 'is-invalid' : '' }} js-image-input"
accept="image/png,image/jpeg,image/jpg,image/webp"
placeholder="Solution Image"
>
<div id="solution-image-feedback" class="invalid-feedback">
<strong>{{ $errors->first('solution-image') }}</strong></div>
</div>
<div class="image-preview-container">
<img
loading="lazy"
class="selected-image-preview js-selected-image-preview"
src="/images/solution_default_image.png"
alt="">
</div>
</div>
</div>

</div>
</div>

<div>
<div class="container-fluid p-0">
<div class="row p-0">
<div class="col-lg-2 col-md-3 col-sm-12">
<input class="btn btn-primary btn-slim w-100 mb-3" id="submit-form" type="submit" value="Save">
</div>
</div>
</div>
</div>

</div>

</form>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="container px-sm-0">

<div class="row">
<div class="col-12 my-4 my-lg-5 pt-4">
<x-go-back-link href="/{{ app()->getLocale() .'/'. $viewModel->project->slug . '/problems/' . $viewModel->problem->slug }}"
class="d-none d-lg-block">{{ __("project-problems.back") }}</x-go-back-link>
</div>
</div>

<div class="row propose-solution-description">

<div class="col-12">
<h1 class="section-title text-center">{{ __('solution.share_your_solution') }}</h1>
<div class="section-body pb-5 pb-lg-0">
<p>{{ __('solution.do_you_have_an_idea') }}</p>
</div>
</div>

</div>

<div class="row propose-solution-description">

<div class="col-12 col-lg-7">
<h2 class="section-title">{{ __("solution.about_the_problem") }}</h2>
<div class="section-body pb-5 pb-lg-0">
<p>{!! $viewModel->problem->currentTranslation->description !!}</p>
</div>
</div>

<div class="col-12 col-lg-4 offset-lg-1 align-self-end text-center">
<img src="/images/problems/problem-page-intro-top-question@2x.png" alt="" width="382" height="238" class="img-fluid">
</div>

</div>

</div>
30 changes: 26 additions & 4 deletions resources/views/solution/propose.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,32 @@

@section('content')

<h2>propose-solution-works!</h2>
<div id="propose-solution-page" class="pb-5">

<section id="propose-solution-overview" class="bg-clr-primary-white">
@include('solution.partials.new-solution-form')
</section>
@include('partials.flash-messages-and-errors')

<section id="propose-solution-overview" class="bg-clr-primary-white">
@include('solution.partials.propose-solution-overview')
</section>

<section id="propose-solution-form" class="bg-clr-primary-white bg-image-noise">
@include('solution.partials.new-solution-form')
</section>

</div>

@if (App::environment('local'))
<div class="fixed-bottom"> <!-- bookmark1 - for use only during development -->
<div class="alert alert-danger text-center font-weight-bold"
style="top: -40px; width: 160px; margin: 0 auto; opacity: 0.25">
<div class="d-block d-sm-none">xs (default)</div>
<div class="d-none d-sm-block d-md-none">sm</div>
<div class="d-none d-md-block d-lg-none">md</div>
<div class="d-none d-lg-block d-xl-none">lg</div>
<div class="d-none d-xl-block d-custom_xxl-none">xl</div>
<div class="d-none d-custom_xxl-block">custom_xxl</div>
</div>
</div>
@endif

@endsection

0 comments on commit c991e02

Please sign in to comment.