-
Notifications
You must be signed in to change notification settings - Fork 140
Fixed redundant styling on the Activity Page of Teams App #940
Fixed redundant styling on the Activity Page of Teams App #940
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.
Supercool! Thanks and congrats with your first contribution to the teams app! 💯
I have a small syntax thingy, see note.
And the first (merge) commit is not needed. Did you do git pull origin master
and then rebased your branch onto master (and then git push -f
? I think that would get rid of the extra commit.
app/views/activities/index.html.slim
Outdated
label.team_filter | ||
' Team: | ||
= select_tag :team_id, options_for_select(teams.map { |t| [t.display_name, t.id] }, params[:team_id]), include_blank: true, class: 'form-control' | ||
- if teams.count != 0 |
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.
Because of readabilty, I'd vote for:
unless teams.count = 0
orif teams.any?
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.
Yes I again make a pull request after changing it to
if teams.any?
Thanks for the suggestion.
app/views/activities/index.html.slim
Outdated
= select_tag :team_id, options_for_select(teams.map { |t| [t.display_name, t.id] }, params[:team_id]), include_blank: true, class: 'form-control' | ||
- if teams.count != 0 | ||
label.team_filter | ||
= select_tag :team_id, options_for_select(teams.map { |t| [t.display_name, t.id] }, params[:team_id]), include_blank: 'Teams', class: 'form-control' | ||
|
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.
Nice, the string instead of a blank field!!
O, and could you add a before and after screenshot to the description ? |
Thanks @F3PiX for the suggestion, I made the required changes. |
Yes please, close this one and open a new Pull Request 👍 |
I just realised that the issue is not solved with just checking if there 'are' teams. And in a later comment, the proposed solution is to show the teams from the previous season, instead of hiding the button: #934 (comment) So, there are two situations:
Let me know if you need help!! |
Hi @F3PiX |
Aha. In previous years, teams were not 'part time' or 'full time' but 'sponsored' or 'volunteer'. We changed that recently. The weird thing :-) is: that doesn't matter for a team being
Hope that helps!! After that, all 'accepted' or 'selected' teams of a season should show up in the dropdown, according to this line:
The dropdown should show the 'accepted' or 'selected' teams only, for any given season only. I'd think the Hope that this helps! Happy coding! |
Thanks @F3PiX for giving us the detailed explanation. It really helped us to get more familiar with the code and also we learnt a lot when trying to fix the issue. We made the required changes and the new pull request #941 is created by @simransinghal. |
574060e
to
3a76aa4
Compare
Fixed Issue #934
When the there is no team to be displayed then the presence of team drop-down is redundant. So drop down will only be shown when there are teams in the database, else it won't be shown.
If there is no team then:-
If it is:-