Версия 0.1.0 #1
@@ -41,22 +41,4 @@ final class ProjectsController extends Controller
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return \view('site.projects.about', $result->getData());
 | 
					        return \view('site.projects.about', $result->getData());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function about(string $project, Request $request, ?string $language = null)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $result = $this->projectService->getAbout($project, $language, $request->user());
 | 
					 | 
				
			||||||
        if ($result->isError()) {
 | 
					 | 
				
			||||||
            $this->errors($result);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if ($result->isTranslation()) {
 | 
					 | 
				
			||||||
            return $this->viewPageWithoutTranslation($result);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if ($result->getProject()->http_href !== null) {
 | 
					 | 
				
			||||||
            $link = ProjectSection::Home->url($result->getProject(), $result->getLanguage());
 | 
					 | 
				
			||||||
            return \redirect($result->getProject()->http_href . $link, 302);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return \view('site.projects.about', $result->getData());
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,16 +39,6 @@ final class ProjectService extends Service
 | 
				
			|||||||
        ]);
 | 
					        ]);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function getAbout(string $projectCode, ?string $languageCode, ?User $user = null): ServiceResultError | PagePossibleWithoutTranslation
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $project = $this->projectRepository->getProjectByCode($projectCode);
 | 
					 | 
				
			||||||
        if (\is_null($project)) {
 | 
					 | 
				
			||||||
            return $this->errNotFound('Project not found');
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $this->getAboutByProject($project, $languageCode, $user);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function getAboutByProject(Project $project, ?string $languageCode, ?User $user = null): ServiceResultError | PagePossibleWithoutTranslation
 | 
					    public function getAboutByProject(Project $project, ?string $languageCode, ?User $user = null): ServiceResultError | PagePossibleWithoutTranslation
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (
 | 
					        if (
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user