-
Notifications
You must be signed in to change notification settings - Fork 32
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
Plans admin #1474
Plans admin #1474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Review just these small details
@plan = find_plan | ||
|
||
@plan_form = PlanForm.new( | ||
plan_params.merge(id: params[:id], site_id: current_site.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to add the id
to the plan_params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if I don't add it, when I update a plan, it generates a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, sorry!
</h2> | ||
<p> | ||
<%= t(".description") %> | ||
<%= @plan.introduction %> | ||
</p> | ||
<p> | ||
<%= t(".latest_update_html", date: l(@plan.updated_at.to_date, format: :long)) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the plan.updated_at
, use the activity gobierto_plans.plan_type_updated
. That activity should be generated when the plans are updated in the API script. Check how is done for budgets.
config/routes.rb
Outdated
namespace :gobierto_plans, as: :plans, path: :plans do | ||
get "/" => "welcome#index" | ||
|
||
resources :plans, only: [:show, :new, :create, :edit, :update, :destroy], path: "" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those are all the actions 💃 You can remove the only
.
config/routes.rb
Outdated
get :data | ||
put :recover | ||
end | ||
resources :plan_types, only: [:new, :create, :edit, :update, :destroy], path: :plan_types do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except: [:show]
@@ -370,6 +370,100 @@ ToDo | |||
|
|||
Los datos del módulo de Observatorio se cargan y se visualizan automáticamente. | |||
|
|||
### Planes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Codecov Report
@@ Coverage Diff @@
## master #1474 +/- ##
==========================================
+ Coverage 78.47% 78.52% +0.04%
==========================================
Files 518 533 +15
Lines 13485 13849 +364
==========================================
+ Hits 10583 10875 +292
- Misses 2902 2974 +72
Continue to review full report at Codecov.
|
I uploaded the latest changes for the front of Plans, now you see GobiertoPlans through plan types and filtering by year you see the plan you want, so the year is a required field. I made a refactor of the indicators, as the update date was missing and an importer has been added to the indicators, so there was a PR in populate-data-indicators. |
The other PR has been merged, can you review the conflicts @apradillap? |
Closes #1457
✌️ What does this PR do?
New admin section: Plans
You can modify details in plans and plan types.
If you need more help, I 've added documentation:
https://github.com/PopulateTools/gobierto/blob/staging/docs/manual_admin.md
🔍 How should this be manually tested?
Create/update/archive a plan
Create/update/archive a plan type
👀 Screenshots
After this PR