Skip to content

Commit c923cde

Browse files
committed
contributors.html: Add bootstrap card design
1 parent 07d6d51 commit c923cde

File tree

2 files changed

+52
-21
lines changed

2 files changed

+52
-21
lines changed

static/main.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
.contributor-data {
2+
width: 18rem;
3+
margin-bottom: 1%;
4+
}
5+
6+
.contributor-card .contributor-image {
7+
max-width:auto;
8+
}
9+
10+
.contributors {
11+
display: flex;
12+
flex-wrap: wrap;
13+
justify-content: space-evenly;
14+
}
15+
16+
.github-icon {
17+
display: inline-block;
18+
float: right;
19+
}
20+
21+
.icon {
22+
font-size:30px;
23+
color: black;
24+
}
25+
126
.student {
227
padding-bottom: 20px;
328
}

templates/contributors.html

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
<!DOCTYPE html>
2+
{% load staticfiles %}
23
<html lang="en">
34
<head>
45
<!-- Required meta tags -->
56
<meta charset="utf-8">
67
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
78
<!-- Bootstrap CSS -->
89
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
10+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
11+
<link href="{% static 'main.css' %}" rel="stylesheet">
912
<title>Contributors Data</title>
1013
</head>
1114
<body>
1215
<h1>Details of all the contributors</h1>
1316
<ul>
14-
{% for contributor in contributors %}
15-
<div class="container">
16-
<div class="row">
17-
<div class="col-sm-6 col-md-4">
18-
<div class="thumbnail">
19-
<div class="caption">
20-
<p>login: {{ contributor.login }}</p>
21-
<p>name: {{ contributor.name }}</p>
22-
<p>bio: {{ contributor.bio }}</p>
23-
<p>num_commits: {{ contributor.num_commits }}</p>
24-
<p>reviews: {{ contributor.reviews }}</p>
25-
<p>issues_opened: {{ contributor.issues_opened }}</p>
26-
<p>teams:
27-
{% for team in contributor.teams.all %}
28-
{{ team.name }}
29-
{% endfor %}{# for team in contributor.teams.all #}
30-
</p>
31-
</div>
32-
</div>
17+
<div class="contributors">
18+
{% for contributor in contributors %}
19+
<div class="card contributor-data">
20+
<img class="card-img-top contributor-image"
21+
src="//avatars.githubusercontent.com/{{ contributor.login }}"
22+
alt="Profile picture">
23+
<div class="card-body">
24+
<h5 class="card-title">
25+
{% if contributor.name %}
26+
{{ contributor.name }}
27+
{% else %}
28+
{{ contributor.login }}
29+
{% endif %}
30+
<span class="github-icon">
31+
<a href="//github.com/{{ contributor.login }}" target="_blank">
32+
<i class="fa fa-github icon"></i>
33+
</a>
34+
</span>
35+
</h5>
36+
<p class="card-text">Bio: {{ contributor.bio }}</p>
37+
<p class="card-text">Commits: {{ contributor.num_commits }}</p>
38+
<p class="card-text">Reiviews: {{ contributor.reviews }}</p>
39+
<p class="card-text">Issues Opened: {{ contributor.issues_opened }}</p>
3340
</div>
3441
</div>
42+
{% endfor %}{# for contributor in contributors #}
3543
</div>
36-
<hr>
37-
{% endfor %}{# for contributor in contributors #}
3844
</ul>
3945
</body>
4046
</html>

0 commit comments

Comments
 (0)