Skip to content

Add meetings to process and process group home#2713

Merged
josepjaume merged 7 commits intomasterfrom
feature/meetings-process-home
Feb 22, 2018
Merged

Add meetings to process and process group home#2713
josepjaume merged 7 commits intomasterfrom
feature/meetings-process-home

Conversation

@rbngzlv
Copy link
Copy Markdown
Contributor

@rbngzlv rbngzlv commented Feb 12, 2018

🎩 What? Why?

Show past/upcoming meetings in process/process group home

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry

📷 Screenshots

  • Process home

screen shot 2018-02-12 at 23 26 42

  • Process group home

screen shot 2018-02-12 at 23 26 25

@ghost ghost assigned rbngzlv Feb 12, 2018
@ghost ghost added the in-progress label Feb 12, 2018
@rbngzlv rbngzlv force-pushed the feature/meetings-process-home branch from ab5a319 to 200385f Compare February 13, 2018 06:43
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2018

Codecov Report

Merging #2713 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2713      +/-   ##
==========================================
+ Coverage   98.86%   98.86%   +<.01%     
==========================================
  Files        1548     1552       +4     
  Lines       36675    36776     +101     
==========================================
+ Hits        36258    36359     +101     
  Misses        417      417

<%= translated_attribute meeting.title %>
</h6>
<span class="text-medium">
<%= l meeting.start_time, format: "%d" %> <%= l meeting.start_time, format: "%B %Y" %> -
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format should be delegated to i18n files, you cna add your own format there and link the name here:

http://guides.rubyonrails.org/i18n.html#adding-date-time-formats

</h6>
<span class="text-medium">
<%= l meeting.start_time, format: "%d" %> <%= l meeting.start_time, format: "%B %Y" %> -
<%= meeting.start_time.strftime("%H:%M") %> - <%= meeting.end_time.strftime("%H:%M") %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

@josepjaume josepjaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good job! Check my comments - I think it should be possible to generalize this outside of the participatory processes.


initializer "decidim_meetings.view_hooks" do
if defined? Decidim::ParticipatoryProcesses
Decidim::ParticipatoryProcesses.view_hooks.register(:process_highlighted_elements, priority: Decidim::ViewHooks::HIGH_PRIORITY) do |view_context|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is something that probably most participatory spaces will want, what do you think about generalizing this hook so it can be used by any participatory process? Something like participatory_space_highlighted_elements. Then each participatory space can choose whether to render it on its templates or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you can add this view hook to decidim-core instead of just decidim-participatory_processes so everyone can benefit from it. Then, from the preocess view, render the view hook from core 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly!

@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 16, 2018

@mrcasals @josepjaume can you check if everything is correct now?

@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 16, 2018

I have a question about the change log entry! I need to add two entries, right? One to the participatory processes and another to the meetings, correct?

@xabier
Copy link
Copy Markdown

xabier commented Feb 18, 2018

Hi, I hope not to be late on this. It is not a big issue but "upcoming events" is a much higher value information than "documents" or "related photos" for the process home page. Is it possible to change the order? If this is going to make the PR take considerably longer don't worry.

@josepjaume
Copy link
Copy Markdown
Contributor

@rbngzlv yes I'd do that - even if we've abstracted them away, from the user's perspective it's a change in both sides.

@xabier that's definitely viable by correctly specifying priority (

Decidim.view_hooks.register(:highlighted_elements, priority: Decidim::ViewHooks::HIGH_PRIORITY) do |view_context|
). @rbngzlv can you do this and call it a day? 💃

@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 21, 2018

I already have the :participatory_space_highlighted_elements view hook registered with Decidim::ViewHooks::HIGH_PRIORITY. The "problem" here is that the "documents" and "related photos" are not rendered using view_hooks.

<%= attachments_for current_participatory_space %>
<%= render_hook(:participatory_space_highlighted_elements) %>

If you want, I can change the order and render the view hooks before documents.

@josepjaume
Copy link
Copy Markdown
Contributor

@rbngzlv okay for me. Maybe we can move all that to view hooks at some point?

@rbngzlv rbngzlv force-pushed the feature/meetings-process-home branch from 776327b to 85840bd Compare February 21, 2018 21:00
@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 22, 2018

@josepjaume Done!

@decidim/lot-core It is ready for a second review!

@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 22, 2018

@decidim/lot-core sorry for ping, but I need to also add proposals and results as highlighted content to the process and process group home. I'm waiting to have this PR merged to do it, so we have three small PR, but perhaps you prefer to (or we can) have all changes in this PR?

Copy link
Copy Markdown
Contributor

@josepjaume josepjaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry! I was definitely blocking this. Looks nice the way it is - let's merge this now!

@josepjaume josepjaume merged commit 42fdc04 into master Feb 22, 2018
@josepjaume josepjaume deleted the feature/meetings-process-home branch February 22, 2018 17:03
@ghost ghost removed the in-review label Feb 22, 2018
@rbngzlv
Copy link
Copy Markdown
Contributor Author

rbngzlv commented Feb 22, 2018

Thanks @josepjaume !

@josepjaume
Copy link
Copy Markdown
Contributor

Thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants