Closed aaronskiba closed 1 month ago
app/views/org_admin/templates/_form.html.erb
<% if current_user.org.funder? && !current_user.org.funder_only? %>
<!-- If the Org is a funder and another org type then allow then to set the visibility -->
<div class="form-group col-xs-8">
<%= f.label _('Visibility'), class: 'control-label' %>
Portage Network
is the only org
where org.funder?
is true. If we were to set the org to 'funder_only', then users wouldn't be able to toggle template.visibility
.app/views/org_admin/templates/_show.html.erb
<% if current_user.org.funder? && !current_user.org.funder_only? %>
<!-- If the Org is a funder and another org type then allow then to set the visibility -->
<dt><%= _('Visibility') %></dt>
<dd>
<% if template.visibility == 'organisationally_visible' %>
<%= _('for internal %{org_name} use only') % {org_name: template.org.name} %>
<% else %>
<%= _('available to the public') + (template.published? ? '' : ' (once published)') %>
<% end %>
</dd>
<% end %>
If the Org is a funder and another org type then allow then to set the visibility
, but it is only for viewing. Maybe this if check doesn't need to be here at all?app/views/org_admin/templates/index.html.erb
<% if !current_user.org.funder_only? %>
<li role="presentation"
class="<%= action_name == 'customisable' ? 'active' : '' %>">
<%= link_to(_('Customisable Templates'),
customisable_org_admin_templates_path, { role: 'tab' }) %>
</li>
<% end %>
'Customisable Templates'
tab should be accessible. If current_user.org.funder_only?
evaluates to true, then this tab will not be accessible.As long as we aren't changing Portage Network to be a "funder only" Org, there shouldn't be any unwanted behaviour here.
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
4.0.2+portage-4.0.3
Explanation
The following method within
app/models/org.rb
evaluates to false for all organizations currently in DMP Assistant's db.Given the problems this created for issue https://github.com/portagenetwork/roadmap/issues/755, the usage of this method should be examined throughout the codebase.