Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Nov 12, 2024
1 parent 87dc214 commit 20e5f3e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ protected function setDefaultValuesForCommonProjectFields(array $attributes, ?Cr
}

if (!isset($attributes['lp_show_speak_up_btn'])) {
$attributes['lp_show_speak_up_btn'] = false;
$attributes['lp_show_speak_up_btn'] = true;
}

return $attributes;
Expand All @@ -278,6 +278,7 @@ protected function setDefaultValuesForSocialMediaFields(array $attributes): arra
}

public function populateInitialValuesForProjectIfNotSet(CrowdSourcingProject $project): CrowdSourcingProject {
$project->lp_show_speak_up_btn = true;
$project = $this->populateInitialFileValuesForProjectIfNotSet($project);

return $this->populateInitialColorValuesForProjectIfNotSet($project);
Expand Down
6 changes: 6 additions & 0 deletions app/BusinessLogicLayer/UserRoleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function registerUserPolicies() {
return $this->userHasAdminRole($user) || $this->userHasContentManagerRole($user);
});

Gate::define('create-platform-content', function ($user) {
return $this->userHasAdminRole($user)
|| $this->userHasContentManagerRole($user)
|| $this->userHasModeratorRole($user);
});

Gate::define('moderate-content-by-users', function ($user) {
return $this->userHasAdminRole($user)
|| $this->userHasContentManagerRole($user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Gate;

class QuestionnaireController extends Controller {
protected QuestionnaireManager $questionnaireManager;
Expand Down Expand Up @@ -156,15 +157,15 @@ public function showAddResponseAsModeratorToQuestionnaire(CrowdSourcingProject $

public function showQuestionnairePage(CrowdSourcingProject $project, Questionnaire $questionnaire) {
// 1. if the questionnaire is not active, we should not allow the user to see it
if ($questionnaire->status_id !== QuestionnaireStatusLkp::PUBLISHED) {
if (!Gate::allows('create-platform-content') && $questionnaire->status_id !== QuestionnaireStatusLkp::PUBLISHED) {
return redirect()->back()->with(['flash_message_error' => 'The questionnaire is not active.']);
}
// 2. if the questionnaire does not belong to the project, we should not allow the user to see it
if (!$questionnaire->projects->contains($project)) {
return redirect()->back()->with(['flash_message_error' => 'The questionnaire does not belong to the project.']);
}
// 3. if the project is not active, we should not allow the user to see it
if ($project->status_id !== CrowdSourcingProjectStatusLkp::PUBLISHED) {
if (!Gate::allows('create-platform-content') && $project->status_id !== CrowdSourcingProjectStatusLkp::PUBLISHED) {
return redirect()->back()->with(['flash_message_error' => 'The project is not active.']);
}
$viewModel = $this->questionnaireVMProvider->getViewModelForQuestionnairePage($project, $questionnaire);
Expand Down
54 changes: 39 additions & 15 deletions resources/assets/sass/project/landing-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ body {
height: 100%;
}

.frosted {
position: absolute;
overflow: hidden;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.70);
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
}

h1,
h2 {
margin-bottom: 0;
Expand Down Expand Up @@ -146,6 +132,22 @@ body {
}
}

.motto-content {
.frosted {
position: absolute;
overflow: hidden;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.70);
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
}
}

section {
h1,
h2 {
Expand Down Expand Up @@ -201,7 +203,6 @@ ol {
width: 100%;
@include media-breakpoint-up(md) {
padding: 7vh 10vh;
padding-bottom: 0;
}

@include media-breakpoint-down(sm) {
Expand Down Expand Up @@ -1425,3 +1426,26 @@ footer {
list-style-type: none;
}
}

#questionnaire {
position: relative;
background-size: cover;
background-position: center;
}

#questionnaire::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.70);
backdrop-filter: blur(10px); /* Blur effect */
z-index: 1;
}

#questionnaire .content-container {
position: relative;
z-index: 2; /* Ensure content is above the overlay */
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="questionnaire-wrapper">
<div id="questionnaire-wrapper" class="py-5">
<div class="container">
<div id="questionnaire"
class="align-items-center mx-0"
Expand Down

0 comments on commit 20e5f3e

Please sign in to comment.