Skip to content

Commit

Permalink
Report an issue menu item #456
Browse files Browse the repository at this point in the history
If logged out, takes you directly to the github issue tracker (configurable link).
If logged in, takes you to a page that directs the user to Github by preference, but also provides the feedback form as an alternative
  • Loading branch information
stuzart committed Apr 29, 2021
1 parent 7204ede commit bca3610
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/controllers/homes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class HomesController < ApplicationController
helper HumanDiseasesHelper

before_action :redirect_to_sign_up_when_no_user
before_action :login_required, only: %i[feedback send_feedback create_or_join_project]
before_action :login_required, only: %i[feedback send_feedback create_or_join_project report_issue]
before_action :redirect_to_create_or_join_if_no_member, only: %i[index]

respond_to :html, only: [:index]
Expand All @@ -25,6 +25,12 @@ def feedback
end
end

def report_issue
respond_to do |format|
format.html
end
end

def isa_colours
respond_to do |format|
format.html
Expand Down
7 changes: 5 additions & 2 deletions app/views/layouts/navbar/_help_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
<li><%= link_to 'About', about_home_path -%></li>
<% end %>
<li><%= link_to t("menu.api"), '/api' %></li>
<% if logged_in_and_registered? %>
<li role="presentation" class="dropdown-header visible-md-block">Feedback</li>
<% if logged_in_and_registered? %>
<li><%= link_to 'Provide feedback', feedback_home_path -%></li>
<li><%= link_to t('menu.report_issue'), report_issue_home_path %></li>
<% else %>
<li><%= link_to t('menu.report_issue'), Seek::Config.issue_tracker, target: :_blank %></li>
<% end %>

</ul>
</li>
1 change: 1 addition & 0 deletions config/initializers/seek_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def load_seek_config_defaults!
Seek::Config.default :header_image_link,"http://www.fair-dom.org"
Seek::Config.default :copyright_addendum_enabled,false
Seek::Config.default :copyright_addendum_content,'Additions copyright ...'
Seek::Config.default :issue_tracker, 'https://github.com/seek4science/seek/issues'

#Imprint
Settings.defaults[:imprint_enabled]= false
Expand Down
10 changes: 9 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ en:
documentation: "Help"
admin: "Server administration"
help: "Help documentation"
api: "API documentation"
api: "API documentation"
account: "Account"
faq: "FAQ"
jerm_templates: "JERM templates"
feedback: "Provide feedback"
report_issue: 'Report an issue'
isa_best_practice: "ISA best practice"
vocabularies: "Vocabularies"

Expand Down Expand Up @@ -147,3 +148,10 @@ an activity that is larger than a %{project}, and can be associated with a fundi
about_managed_programme: "If you don't think a %{programme} is necessary, and you won't expect to need to create additional %{projects} in the future,
you can choose to have a %{project} linked to a site managed %{programme} instead."

report_a_bug: '<p>
To report a bug or other issue, it is preferable to use the %{issue_tracker_link}. A Github account and it will be public and open.
</p>
<p>
Alternatively, if you are unable to use the %{issue_tracker_link}, or the issue is of a private nature, then you can use the %{feedback_link}.
<p>'

1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
get :privacy
get :about
get :create_or_join_project
get :report_issue
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/seek/config_setting_attributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ project_description:
project_keywords:
dm_project_name:
dm_project_link:
issue_tracker:
header_image_link:
header_image_title:
header_image_enabled:
Expand Down

0 comments on commit bca3610

Please sign in to comment.