Allow for forward navigation through the company info versions in the view
This commit is contained in:
parent
c15f6c4e2e
commit
ad4362f471
25
stoptime.rb
25
stoptime.rb
|
@ -1679,6 +1679,7 @@ module StopTime::Controllers
|
||||||
else
|
else
|
||||||
CompanyInfo.last
|
CompanyInfo.last
|
||||||
end
|
end
|
||||||
|
@company_last = @company == CompanyInfo.last
|
||||||
@input = @company.attributes
|
@input = @company.attributes
|
||||||
@history_warn = true if @company != CompanyInfo.last
|
@history_warn = true if @company != CompanyInfo.last
|
||||||
render :company_form
|
render :company_form
|
||||||
|
@ -2745,11 +2746,25 @@ module StopTime::Views
|
||||||
div.alert.alert_info do
|
div.alert.alert_info do
|
||||||
text! " Viewing revision #{@company.revision}, " +
|
text! " Viewing revision #{@company.revision}, " +
|
||||||
" last update at #{@company.updated_at}."
|
" last update at #{@company.updated_at}."
|
||||||
if @company.original.present?
|
div.btn_group do
|
||||||
a.btn.btn_default role: "button",
|
if @company.original.present?
|
||||||
href: R(Company, revision: @company.original.revision) do
|
a.btn.btn_default role: "button",
|
||||||
_icon("backward")
|
href: R(Company, revision: @company.original.revision) do
|
||||||
span "View previous revision"
|
_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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue