From 2918fb6e79253d9b1fec4ee4c67fe9b0e55ece98 Mon Sep 17 00:00:00 2001 From: briri Date: Thu, 23 Mar 2023 14:21:30 -0700 Subject: [PATCH 1/3] fix issue with template visibility setting when creating new templates --- app/controllers/org_admin/templates_controller.rb | 4 ++++ app/views/org_admin/templates/_form.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/org_admin/templates_controller.rb b/app/controllers/org_admin/templates_controller.rb index 0e1dfcebd8..c682e8e4e4 100644 --- a/app/controllers/org_admin/templates_controller.rb +++ b/app/controllers/org_admin/templates_controller.rb @@ -157,6 +157,10 @@ def edit def new authorize Template @template = current_org.templates.new + # If the Org is a funder set the visibility to Public otherwise set to Organizational + # for Orgs that are both, the admin will see controls on the page to let them choose. + # The default is already 'organisationally_visible' so change it if this is a funder + @template.visibility = Template.visibilities[:publicly_visible] if current_org.funder? end # POST /org_admin/templates diff --git a/app/views/org_admin/templates/_form.html.erb b/app/views/org_admin/templates/_form.html.erb index 0a6ec2db62..abf6569b17 100644 --- a/app/views/org_admin/templates/_form.html.erb +++ b/app/views/org_admin/templates/_form.html.erb @@ -29,7 +29,7 @@ <% else %> <% visibility = f.object.visibility - visibility = f.object.funder? ? 'publicly_visible' : 'organisationally_visible' if visibility.nil? + visibility = f.object.org.funder? ? 'publicly_visible' : 'organisationally_visible' if visibility.nil? %> <%= f.hidden_field :visibility, value: visibility %> <% end %> From eba5520df62ef83b1d88bfe4049044457b84da54 Mon Sep 17 00:00:00 2001 From: briri Date: Thu, 23 Mar 2023 15:22:14 -0700 Subject: [PATCH 2/3] make rubocop happy --- app/controllers/org_admin/templates_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/org_admin/templates_controller.rb b/app/controllers/org_admin/templates_controller.rb index c682e8e4e4..bd2da603ad 100644 --- a/app/controllers/org_admin/templates_controller.rb +++ b/app/controllers/org_admin/templates_controller.rb @@ -2,6 +2,7 @@ module OrgAdmin # Controller that handles templates + # rubocop:disable Metrics/ClassLength class TemplatesController < ApplicationController include Paginable include Versionable @@ -414,4 +415,5 @@ def get_referrer(template, referrer) end end end + # rubocop:enable Metrics/ClassLength end From 0cdd9f462e2ace1a309831b8398a5d50ad56e8d1 Mon Sep 17 00:00:00 2001 From: Brian Riley Date: Thu, 13 Apr 2023 11:04:01 -0700 Subject: [PATCH 3/3] Update README.md removed prerequisites section since it's already on the installation wiki --- README.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/README.md b/README.md index 9eeb3b8461..21bb8cecea 100644 --- a/README.md +++ b/README.md @@ -17,24 +17,6 @@ The tool has four main functions: Click here for the latest [releases](https://github.com/DMPRoadmap/roadmap/releases/). -#### Pre-requisites -Roadmap is a Ruby on Rails application and you will need to have: -* Ruby = 2.7.6 -* Rails = 6.1 -* MySQL >= 5.0 OR PostgreSQL - -Further detail on how to install Ruby on Rails applications are available from the Ruby on Rails site: http://rubyonrails.org. - -Further details on how to install MySQL and create your first user and database. Be sure to follow the instructions for your particular environment. -* Install: http://dev.mysql.com/downloads/mysql/ -* Create a user: http://dev.mysql.com/doc/refman/5.7/en/create-user.html -* Create the database: http://dev.mysql.com/doc/refman/5.7/en/creating-database.html - -You may also find the following resources handy: - -* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html -* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ - #### Installation See the [Installation Guide](https://github.com/DMPRoadmap/roadmap/wiki/Installation) on the Wiki.