-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from slovensko-digital/SD-2693/project-regist…
…er-internal SD-2693/project-register-internal
- Loading branch information
Showing
72 changed files
with
2,253 additions
and
548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
class Admin::ProjectsController < AdminController | ||
before_action :load_project, only: [:update] | ||
|
||
def update | ||
@project.update!(project_params) | ||
redirect_to admin_page_path(@project.page) | ||
end | ||
before_action :load_project | ||
|
||
private | ||
|
||
def load_project | ||
@project = Project.find(params[:id]) | ||
end | ||
|
||
def project_params | ||
params.require(:project).permit(:category) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class PhaseRevisionController < ApplicationController | ||
def show | ||
@project = Project.find_by!(id: params[:project_id]) | ||
@phase_revision = PhaseRevision.find_published_revision(@project.id, params[:revision_type]) | ||
|
||
if @phase_revision | ||
@revision = @phase_revision.revision | ||
@ratings_by_type = @phase_revision.ratings.index_by(&:rating_type) | ||
@metadata.og.title = @revision.title | ||
@metadata.og.description = 'Kolaboratívne hodnotenie projektu metodikou Red Flags.' | ||
|
||
render :show | ||
end | ||
end | ||
|
||
def pdf | ||
@project = Project.find_by!(id: params[:project_id]) | ||
@phase_revision = PhaseRevision.find_published_revision(@project.id, params[:revision_type]) | ||
|
||
if @phase_revision | ||
@revision = @phase_revision.revision | ||
@ratings_by_type = @phase_revision.ratings.index_by(&:rating_type) | ||
@metadata.og.title = @revision.title | ||
@metadata.og.description = 'Kolaboratívne hodnotenie projektu metodikou Red Flags.' | ||
|
||
render layout: "no_header_footer" | ||
end | ||
end | ||
|
||
def show_history | ||
@project = Project.find_by!(id: params[:project_id]) | ||
@phase_revision = PhaseRevision.find_revision_history(@project.id, params[:revision_type], params[:version]) | ||
|
||
if @phase_revision | ||
@revision = @phase_revision.revision | ||
@ratings_by_type = @phase_revision.ratings.index_by(&:rating_type) | ||
@metadata.og.title = @revision.title | ||
@metadata.og.description = 'Kolaboratívne hodnotenie projektu metodikou Red Flags.' | ||
|
||
render :show | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
class ProjectsController < ApplicationController | ||
def show | ||
@project = Project.find(params[:id]).published_revision | ||
@ratings_by_type = @project.ratings.index_by(&:rating_type) | ||
@metadata.og.title = @project.title | ||
@metadata.og.description = 'Kolaboratívne hodnotenie projektu metodikou Red Flags.' | ||
end | ||
|
||
def index | ||
@selected_tag = params[:tag] | ||
@projects = Project.published | ||
@projects = @projects.with_tag(params[:tag]) if ProjectsHelper::ALLOWED_TAGS.keys.include?(params[:tag]) | ||
@projects = @projects.map { |p| p.published_revision }.sort_by(&:aggregated_rating) | ||
@projects = Project.filtered_projects(@selected_tag, params[:sort]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.