Skip to content
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

Fix multiple days in debates #33

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
83d3f40
change
IvanOrtizp Nov 13, 2020
cb2aacb
a
IvanOrtizp Nov 16, 2020
1076e39
a
IvanOrtizp Nov 16, 2020
a1c5752
guardar cambis
IvanOrtizp Nov 17, 2020
159dc1d
a
IvanOrtizp Nov 18, 2020
f18dab0
Fix multiple days in debates
IvanOrtizp Nov 19, 2020
7103bd1
Fix multiple days in debates
IvanOrtizp Nov 20, 2020
a492491
Fix multiple days in debates
IvanOrtizp Nov 23, 2020
afdbda6
Fix multiple days debates
IvanOrtizp Nov 24, 2020
a8a13a7
Fix multiple days debates
IvanOrtizp Nov 24, 2020
9d2096e
If i apply this change, the end date of debate will ve added
IvanOrtizp Nov 26, 2020
0da9980
The end date of debate will be added
IvanOrtizp Nov 26, 2020
2926662
The end date of debate will be added
IvanOrtizp Nov 27, 2020
95a6bdd
correct the lint errors
IvanOrtizp Nov 30, 2020
d442342
Fix lint errors
IvanOrtizp Dec 2, 2020
8518855
fix rspec errors
IvanOrtizp Dec 3, 2020
8199975
fix rspec errors
IvanOrtizp Dec 3, 2020
43bc3f9
fix rspec errors
IvanOrtizp Dec 3, 2020
09503cb
add first test for multiple dates on debates
IvanOrtizp Dec 11, 2020
d5a303a
add test for multiple dates on debates
IvanOrtizp Dec 11, 2020
0471aa8
add rspec test
IvanOrtizp Dec 14, 2020
0ca84ac
add rspec test for multiple dates
IvanOrtizp Dec 14, 2020
29294c6
add rspec test for multiple dates
IvanOrtizp Dec 14, 2020
5d15a74
add rspec test for multiple dates
IvanOrtizp Dec 15, 2020
6a80f5a
add rspec test for multiple dates
IvanOrtizp Dec 15, 2020
9feace2
add rspec test for multiple dates
IvanOrtizp Dec 15, 2020
107a7d5
Update multiple_date_spec.rb
IvanOrtizp Dec 16, 2020
1155564
correct the arrow style
IvanOrtizp Dec 17, 2020
b0713ac
add the rspec test for multiple dates
IvanOrtizp Dec 17, 2020
a9b93cd
add the rspec test for multiple dates
IvanOrtizp Dec 17, 2020
8a2d06e
add the rspec test for multiple dates
IvanOrtizp Dec 18, 2020
e63357f
add the rspec test for multiple dates
IvanOrtizp Dec 18, 2020
f3bf3ad
add the rspec test for multiple dates
IvanOrtizp Dec 18, 2020
f7c2ff9
add the rspec test for multiple dates
IvanOrtizp Dec 23, 2020
74a44e5
add the rspec test for multiple dates
IvanOrtizp Dec 23, 2020
7594648
correct the rspec errors
IvanOrtizp Jan 11, 2021
b34c4f7
correct the rspec errors
IvanOrtizp Jan 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
}
}

.icon-arrow-thin-right {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this class to be used in the whole of decidim or will it only be used in the cards used by debates? If so maybe it should go in another scss file related to cards or to debates.

color: grey;
height: 30px;
}

.view-side{
@include breakpoint(medium only){
width: 50%;
Expand Down
30 changes: 20 additions & 10 deletions decidim-debates/app/views/decidim/debates/debates/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,29 @@ edit_link(
<% elsif admin_allowed_to?(:close, :debate, debate: debate) %>
<%= link_to t(close_debate_action_text), Decidim::EngineRouter.admin_proxy(debate.component).edit_debate_debate_close_path(debate_id: debate.id, id: debate.id), class: "button hollow expanded button-sc button--icon follow-button" %>
<% end %>

<div class="card extra">
<div class="card__content">
<div class="card__content--multiple">
</br>
<% if debate.start_time.present? && debate.end_time.present? %>
<div class="extra__date">
<% if debate.start_time.strftime("%d") == debate.end_time.strftime("%d") && debate.start_time.strftime("%H") != debate.end_time.strftime("%H") %>
<%= l debate.start_time, format: "%d" %> <span class="extra__month"><%= l debate.start_time, format: "%B" %></span>
<div class="extra__time text-small"> <%= l debate.start_time, format: "%H:%M" %> a <%= l debate.end_time, format: "%H:%M" %></div>
</div>
<% elsif debate.start_time.strftime("%d") != debate.end_time.strftime("%d") && debate.start_time.strftime("%H") != debate.end_time.strftime("%H") %>
<%= l debate.start_time, format: "%d" %> <span class="extra__month"><%= l debate.start_time, format: "%B" %></span>
<div class="extra__time text-small"> <%= l debate.start_time, format: "%H:%M" %></span></div>
<%= icon "arrow-thin-right", class: "icon-arrow-thin-right" %>
</div>

<div class="extra__date">
<%= l debate.end_time, format: "%d" %> <span class="extra__month"> <%= l debate.end_time, format: "%B" %></span>
<div class="extra__time text-small"> <%= l debate.end_time, format: "%H:%M" %></span></div>
</div>
<div class="extra__time">
<%= l debate.start_time, format: "%H:%M" %> - <%= l debate.end_time, format: "%H:%M" %>
</div>
<% end %>
<% end %>

<% if endorsements_enabled? && allowed_to?(:endorse, :debate, debate: debate) %>
<% if endorsements_enabled? && allowed_to?(:endorse, :debate, debate: debate) %>

Choose a reason for hiding this comment

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

Woops! Wrong indentation 🙆🏽‍♀️

<div class="row collapse buttons__row">
<div class="column small-12 collapse">
<%= endorsement_buttons_cell(debate) %>
Expand All @@ -62,6 +73,7 @@ edit_link(
<%= follow_button_for(debate) %>
</div>
</div>

<div class="card extra">
<div class="definition-data">
<div class="definition-data__item definition-data__item">
Expand All @@ -76,14 +88,12 @@ edit_link(
<% end %>
</span>
</div>

Choose a reason for hiding this comment

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

It is unnecessary to remove these blank lines, and it makes it more difficult to focus on the real changes this PR is making ;) The automatic erb linter should take care that .erb files have a concise style, you don't need to worry about it!

<div class="definition-data__item definition-data__item--double">
<span class="definition-data__title">
<%= t ".participants_count" %>
</span>
<span class="definition-data__number"><%= debate_presenter.participants_count %></span>
</div>

<div class="definition-data__item definition-data__item--double">
<span class="definition-data__title">
<%= t ".groups_count" %>
Expand All @@ -106,11 +116,9 @@ edit_link(
<% end %>

<%= render_debate_description(debate) %>

<% if debate.closed? %>
<%= cell("decidim/announcement", { announcement: { title: t(".debate_conclusions_are", date: l(debate.closed_at, format: :decidim_short)), body: simple_format(translated_attribute(debate.conclusions)) }, callout_class: "success" }) %>
<% end %>

<% if translated_attribute(debate.instructions).present? %>
<div class="callout secondary">
<%= decidim_sanitize(simple_format(translated_attribute(debate.instructions), {}, sanitize: false)) %>
Expand All @@ -121,6 +129,7 @@ edit_link(
<%= decidim_sanitize(simple_format(translated_attribute(debate.information_updates), {}, sanitize: false)) %>
</div>
<% end %>

<% if debate.category %>
<ul class="tags tags--debate">
<li><%= link_to translated_attribute(debate.category.name), debates_path(filter: { category_id: debate.category.id }) %></li>
Expand All @@ -147,3 +156,4 @@ edit_link(
form: close_debate_form
}
%>
<% end %>