Skip to content

Commit

Permalink
Merge pull request #557 from hpi-swt2/flexibus/#380/events-view-as-tiles
Browse files Browse the repository at this point in the history
Flexibus/#380/events view as tiles
  • Loading branch information
Jakob Edding authored Feb 8, 2018
2 parents 718a7bf + b4be760 commit e165c14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion app/assets/stylesheets/tile.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}
}

@media screen and (max-width : 899px) and (min-width: 400px){
@media screen and (max-width : 899px) and (min-width: 400px) {
.tile-wrapper {
display: grid;
grid-template-columns: 1fr 1fr
Expand All @@ -14,11 +14,13 @@
.tile-description {
width: 300px;
}

.tile-title {
width: 300px;
}
}


@media screen and (max-width : 480px){
.tile-wrapper {
display: grid;
Expand Down
9 changes: 4 additions & 5 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,10 @@ def human_game_mode
end

def build_description_string
if self.type == 'Rankinglist'
"#{I18n.t('events.index.registration_until')}: #{self.deadline} <br> #{I18n.t('events.index.start_date')}: #{self.startdate}"
else
"#{I18n.t('events.index.max_players')}: #{self.max_teams}"
end
registration_until = "#{I18n.t('events.index.registration_until')}: #{self.deadline}" if self.deadline.present?
start_date = "#{I18n.t('events.index.start_date')}: #{self.startdate}" if self.startdate.present?
return ("#{registration_until} <br> #{start_date}").html_safe if registration_until.present?
"#{I18n.t('events.index.max_players')}: #{self.max_teams}" if self.max_teams.present?
end

def fitting_teams(user)
Expand Down

0 comments on commit e165c14

Please sign in to comment.