-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,15 @@ | |
cursor: pointer; | ||
} | ||
|
||
#primary-scenario-selector { | ||
font-size: large; | ||
} | ||
|
||
#primary-scenario-selector a { | ||
text-decoration: none; | ||
color: inherit; | ||
} | ||
|
||
.row.text-center | ||
%h1 | ||
=@scenario.name | ||
|
@@ -44,7 +53,17 @@ | |
=link_to assets_scenario_path(@scenario), target: "_blank" do | ||
%i.fa.fa-search | ||
Assets | ||
|
||
.row | ||
#primary-scenario-selector | ||
- if [email protected]_scenario | ||
- old_primary = Scenario.find_by(organization: @scenario.organization, fy_year: @scenario.fy_year, primary_scenario: true) | ||
=link_to toggle_primary_scenario_path(@scenario), | ||
method: :put, | ||
data: old_primary ? {confirm: "This agency already has a Primary Scenario for this fiscal year. Would you like to mark this scenario as the new Primary Scenario?"} : {} do | ||
%i{class: "fa fa-square-o"} | ||
- else | ||
%i{class: "fa fa-times-rectangle-o"} | ||
%strong Primary Scenario | ||
.col-md-4 | ||
// .progress | ||
|
@@ -287,7 +306,10 @@ | |
} | ||
}); | ||
|
||
|
||
// Check the Primary Scenario box if this scenario is new, triggering confirmation if previous scenario selected | ||
if (#{new_scenario == "true"}) { | ||
$('#primary-scenario-selector a').click(); | ||
} | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ | |
get 'assets' | ||
post 'copy' | ||
get 'dotgrants_export' | ||
put 'toggle_primary' | ||
end | ||
end | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
db/migrate/20231218202118_add_primary_scenario_to_scenarios.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddPrimaryScenarioToScenarios < ActiveRecord::Migration[5.2] | ||
def change | ||
add_column :scenarios, :primary_scenario, :boolean | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module TransamCpt | ||
VERSION = "2.35.0" | ||
VERSION = "2.38.0" | ||
end |