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

Bugfix/achievements page layout #1187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion frontend/html/achievements/show_achievement.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% block content %}
<div class="stats">
<div class="stats-achievement-details">
{% include "achievements/widgets/achievement.html" %}
{% include "achievements/widgets/achievement.html" with skip_achievement_link=True %}
<div class="stats-achievement-details__info">
<span><strong>Название:</strong> {{ achievement.name }}</span>
<span><strong>Описание:</strong> {{ achievement.description }}</span>
Expand Down
27 changes: 18 additions & 9 deletions frontend/html/achievements/widgets/achievement.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<a href="{% url "show_achievement" achievement.code %}" class="user-achievement">
<span class="user-achievement-wrapper">
<span class="user-achievement-front" {% if achievement.style %}style="{{ achievement.style }}"{% endif %}>
<img src="{{ achievement.image }}" class="user-badge-image" alt="{{ achievement.code }}">
<span class="user-achievement-name">{{ achievement.name }}</span>
</span>
<span class="user-achievement-back" {% if achievement.style %}style="{{ achievement.style }}"{% endif %}>
{{ achievement.description }}
{% if skip_achievement_link %}
<!-- Empty touchStart event for allow to hover with touch event on mobile -->
<span class="user-achievement" ontouchstart="">
{% else %}
<a href="{% url "show_achievement" achievement.code %}" class="user-achievement">
{% endif %}
<span class="user-achievement-wrapper">
<span class="user-achievement-front" {% if achievement.style %}style="{{ achievement.style }}"{% endif %}>
<img src="{{ achievement.image }}" class="user-badge-image" alt="{{ achievement.code }}">
<span class="user-achievement-name">{{ achievement.name }}</span>
</span>
<span class="user-achievement-back" {% if achievement.style %}style="{{ achievement.style }}"{% endif %}>
{{ achievement.description }}
</span>
</span>
{% if skip_achievement_link %}
</span>
</a>
{% else %}
</a>
{% endif %}
7 changes: 4 additions & 3 deletions frontend/html/emails/achievement.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
}

.user-achievement-name {
display: block;
padding-top: 10px;
padding-bottom: 10px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-align: center;
line-height: 1.3em;
}
Expand Down
11 changes: 6 additions & 5 deletions frontend/static/css/components/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
}

.user-achievement-wrapper {
text-overflow: ellipsis;
position: relative;
width: 100%;
height: 100%;
Expand All @@ -268,9 +267,10 @@
}

.user-achievement-name {
display: block;
padding-top: 10px;
padding-bottom: 10px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-align: center;
line-height: 1.3em;
}
Expand All @@ -290,7 +290,7 @@
font-size: 140%;
display: flex;
flex-direction: column;
justify-content: center;
justify-content: space-evenly;
}

.user-achievement-back {
Expand All @@ -300,6 +300,7 @@
justify-content: center;
font-size: 90% !important;
transform: rotateY(180deg);
overflow: hidden;
}

.profile-list {
Expand Down
7 changes: 7 additions & 0 deletions frontend/static/css/components/stats.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
}

.stats-achievement-details__info {
margin-top: 15px;
max-width: 60%;
font-size: 150%;
display: flex;
Expand All @@ -190,6 +191,12 @@
justify-content: center;
}

@media only screen and (max-width : 570px) {
.stats-achievement-details {
flex-wrap: wrap;
}
}

.stats-badges-latest {
display: flex;
flex-direction: row;
Expand Down
Loading