[RFC] Use cells for meeting m cards#3022
Conversation
3801b85 to
8eb8a76
Compare
| <div class="column"> | ||
| <article class="card card--meeting"> | ||
| <div class="card__content"> | ||
| <%= cell("decidim/meetings/meeting_m", model).header %> |
There was a problem hiding this comment.
<%= render :header %>, I think
There was a problem hiding this comment.
I've tried it, it also works, do you prefer <%= render :header %>?
Codecov Report
@@ Coverage Diff @@
## master #3022 +/- ##
==========================================
- Coverage 98.62% 98.59% -0.03%
==========================================
Files 1699 1711 +12
Lines 40602 40788 +186
==========================================
+ Hits 40042 40216 +174
- Misses 560 572 +12 |
3b05d3d to
a3a526d
Compare
a3a526d to
576a6f7
Compare
da05d74 to
68a74db
Compare
|
@agustibr there are some conflicts 😄 |
| let!(:meeting) { create(:meeting) } | ||
|
|
||
| context "when rendering" do | ||
| it do |
There was a problem hiding this comment.
Ok, i'll add the description
| let!(:meeting) { create(:meeting) } | ||
|
|
||
| context "when rendering" do | ||
| it do |
| let!(:meeting) { create(:meeting) } | ||
|
|
||
| context "when rendering" do | ||
| it do |
|
@mrcasals I've fixed the merge conflict |
|
|
||
| delegate :user_signed_in?, to: :parent_controller | ||
|
|
||
| delegate :current_user, to: :parent_controller |
There was a problem hiding this comment.
Could you please merge this two delegates?
| end | ||
|
|
||
| def resource_cell | ||
| model.component.manifest.card |
There was a problem hiding this comment.
Maybe memoize this?
@resource_cell ||= model.component.manifest.card
|
|
||
| module Decidim | ||
| class CardCell < Decidim::ViewModel | ||
| # This cell renders the card of the given instance of a Component |
There was a problem hiding this comment.
Could you please move the docs above the class?
|
|
||
| delegate :user_signed_in?, to: :parent_controller | ||
|
|
||
| delegate :current_user, to: :parent_controller |
There was a problem hiding this comment.
Can you also merge these?
| module Meetings | ||
| class MeetingCell < Decidim::Meetings::ViewModel | ||
| # This cell renders the meeting card for an instance of a Meeting | ||
| # the default size is the Medium Card (:m) |
There was a problem hiding this comment.
Can you move the docs above the class?
| module Decidim | ||
| module Meetings | ||
| class MeetingListItemCell < Decidim::Meetings::MeetingCell | ||
| # This cell renders the List Item Card (:list_item) meeting card |
There was a problem hiding this comment.
Can you move the docs above the class?
| module Decidim | ||
| module Meetings | ||
| class MeetingMCell < Decidim::Meetings::MeetingCell | ||
| # This cell renders the Medium (:m) meeting card |
There was a problem hiding this comment.
Can you move the docs above the class?
|
@oriolgual thanks, I have updated/reviewed the PR considering your comments. |
|
OMG 😍 🎉 🎈 🎊 |
* master: [RFC] Use cells for meeting m cards (#3022) Do not force Postgresql user to be admin when enabling trigram extension (#3053) Make organization reference_prefix required (#3056) admin can duplicate/copy meetings (#3051) Fix question form errors not being displayed (#3046) Erb whitespace cutting (#3047) Show debates statistics on space show and homepage (#3016) Fix broken translated field after form errors (#3026) Move decidim executable to "exe" folder (#3028) Friendlier buttons (#3027) Feedback needed after Endorsing when user has no user_groups (#2998) Fix seeding error on generator specs (#3021) fix spelling error in threshold (#3019) Migration plus seeds (#2933)
|
YAY! 🏄♂️ 🎉 |
🎩 What? Why?
This PR starts from commit ea666c7 from @mrcasals and is possible to merge with PR #2897 that includes proposal_m cell.
This PR is done with the idea to make the code review easier.
Adding
card_forhelper indecidim-coreto facilitate te use of cards from everywhere, the Component should have the attributecardpointing to the cell's component path, making it possible (size is optional):Adding the
meeting_cellcomponent todecidim-meetings(decidim-corealready hascellsfrom @decidim/lot-core) in two sizes or variations; medium and list_item, the following will render the medium size:The medium cell includes a subcell
header:he following will render the list_iteml size:
📌 Related Issues
📋 Subtasks
CHANGELOGentryViewModelandCellsto make it possible to add cards to resources.CardHelperwithcard_forthat returns a card given an instance of a the Component attributecardfrom the ComponentManifest.AuthorBoxCellandProfileCell; Removeshared/author_referencepartials.ViewModelandCardCellsdocs/advanced/view_models_aka_cells.mdrspec-cellsfor testingCellsViewModelandCells. AddMeetingCellwith two variations:MeetingMCellandMeetingListItemCell.cardattribute to the component's manifestshared/author_referencepartials.📷 Screenshots (optional)
meeting
:mcard:meeting
:hcard: