Skip to content

Commit 34dda65

Browse files
committed
Add GitHub ribbons
1 parent b95db60 commit 34dda65

File tree

12 files changed

+38
-0
lines changed

12 files changed

+38
-0
lines changed

community/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@
104104
'django.template.context_processors.request',
105105
'django.contrib.messages.context_processors.messages',
106106
],
107+
108+
'libraries':{
109+
'ribbon_link': 'data.templatetags.ribbon_link',
110+
}
107111
},
108112
},
109113
]

data/templatetags/__init__.py

Whitespace-only changes.

data/templatetags/ribbon_link.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django import template
2+
from community.git import get_remote_url
3+
4+
5+
register = template.Library()
6+
7+
8+
@register.simple_tag
9+
def get_ribbon_link():
10+
url = get_remote_url()
11+
link = 'https://' + url.resource + '/' + url.pathname
12+
return link

templates/activity.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<meta content="text/html">
1414
</head>
1515
<body>
16+
{% include 'ribbon.html' %}
1617
<h1>Community Activity</h1>
1718
<br>
1819
<br>

templates/contributors.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>Contributors Data</title>
1010
</head>
1111
<body>
12+
{% include 'ribbon.html' %}
1213
<h1>Details of all the contributors</h1>
1314
<ul>
1415
{% for contributor in contributors %}

templates/gamification.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>Newcomers Data</title>
1010
</head>
1111
<body>
12+
{% include 'ribbon.html' %}
1213
<h1>The gamification leaderboard</h1>
1314
<p>Note: All the datetime is in UTC</p>
1415
<hr>

templates/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title>Community website</title>
66
</head>
77
<body>
8+
{% include 'ribbon.html' %}
89
<img src="static/org_logo.png" alt="org logo" height="42" width="42">
910
<ul>
1011
<li><a href="gci/">Google Code-in</a>

templates/meta_review.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>Meta-review Score Ranking List</title>
1010
</head>
1111
<body>
12+
{% include 'ribbon.html' %}
1213
<h1>Details of meta-review score</h1>
1314
<ul>
1415
{% for participant in participants %}

templates/model.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<title>Visit your models</title>
1010
</head>
1111
<body>
12+
{% include 'ribbon.html' %}
1213
<h1>Visit Your Models and its Imported data</h1>
1314
<hr>
1415
<div class="container">

templates/model/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
99
</head>
1010
<body>
11+
{% include '../../ribbon.html' %}
1112
<div class="container-fluid">
1213
<div class="col-sm-10 ">
1314
{% block content %}{% endblock %}

0 commit comments

Comments
 (0)