Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 6 additions & 0 deletions app/controllers/org_admin/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module OrgAdmin
# Controller that handles templates
# rubocop:disable Metrics/ClassLength
class TemplatesController < ApplicationController
include Paginable
include Versionable
Expand Down Expand Up @@ -157,6 +158,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
Expand Down Expand Up @@ -410,4 +415,5 @@ def get_referrer(template, referrer)
end
end
end
# rubocop:enable Metrics/ClassLength
end
2 changes: 1 addition & 1 deletion app/views/org_admin/templates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down