Allow for forward navigation through the company info versions in the view

This commit is contained in:
Paul van Tilburg 2015-06-20 23:30:02 +02:00
parent c15f6c4e2e
commit ad4362f471
1 changed files with 20 additions and 5 deletions

View File

@ -1679,6 +1679,7 @@ module StopTime::Controllers
else
CompanyInfo.last
end
@company_last = @company == CompanyInfo.last
@input = @company.attributes
@history_warn = true if @company != CompanyInfo.last
render :company_form
@ -2745,11 +2746,25 @@ module StopTime::Views
div.alert.alert_info do
text! " Viewing revision #{@company.revision}, " +
" last update at #{@company.updated_at}."
if @company.original.present?
a.btn.btn_default role: "button",
href: R(Company, revision: @company.original.revision) do
_icon("backward")
span "View previous revision"
div.btn_group do
if @company.original.present?
a.btn.btn_default role: "button",
href: R(Company, revision: @company.original.revision) do
_icon("backward")
span "View previous revision"
end
end
unless @company_last
a.btn.btn_default role: "button",
href: R(Company, revision: @company.revision.succ) do
_icon("forward")
span "View next revision"
end
a.btn.btn_default role: "button",
href: R(Company) do
_icon("fast-forward")
span "Most recent revision"
end
end
end
end