Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent version in documentation URLs #819

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions app/helpers/remote_execution_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ def time_in_words_span(time)
end

def documentation_button_rex(section = '')
url = 'http://theforeman.org/plugins/foreman_remote_execution/' +
"#{ForemanRemoteExecution::VERSION.split('.').take(2).join('.')}/index.html#"
url = "https://theforeman.org/plugins/foreman_remote_execution/#{rex_doc_version}/index.html#"
documentation_button section, :root_url => url
end

Expand Down Expand Up @@ -276,4 +275,8 @@ def targeting_hosts(job_invocation, hosts)
actions: template_invocation_actions(task, host, job_invocation, template_invocation) }
end
end

def rex_doc_version
ForemanRemoteExecution::VERSION.split('.').take(2).join('.')
end
end
3 changes: 2 additions & 1 deletion app/views/job_invocations/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<%= _("Foreman can run arbitrary commands on remote hosts using different providers, such as SSH or Ansible. Communication goes through the Smart Proxy so Foreman does not have to have direct access to the target hosts and can scale to control many hosts.") %></br>
</p>
<p><%= link_to _('Learn more about this in the documentation.'),
documentation_url('1.ForemanRemoteExecution1.3Manual', :root_url => 'https://www.theforeman.org/plugins/foreman_remote_execution/1.3/index.html#'), :rel => 'external' %></p>
external_link_path(type: 'plugin_manual', name: 'foreman_remote_execution', version: rex_doc_version, section: "#1.ForemanRemoteExecution#{rex_doc_version}Manual"),
rel: 'external' %></p>
<div class="blank-slate-pf-main-action">
<%= display_link_if_authorized(_("Run Job"), { :action => :create }, { :class => "btn btn-primary btn-lg" }) %>
</div>
Expand Down
Loading