-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d074afa
commit bd7d896
Showing
8 changed files
with
77 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{% if is_paginated %} | ||
<ul class="pagination pagination-centered"> | ||
{% if page_obj.has_previous %} | ||
<li><a href="?page=1">⟪⟪</a></li> | ||
<li><a href="?page={{ page_obj.previous_page_number }}">←</a></li> | ||
{% endif %} | ||
{% for i in paginator.page_range %} | ||
<li {% if page_obj.number == i %} class="active" {% endif %}><a href="?page={{i}}">{{i}}</a></li> | ||
{% endfor %} | ||
{% if page_obj.has_next %} | ||
<li><a href="?page={{ page_obj.next_page_number }}">➝</a></li> | ||
<li><a href="?page={{ page_obj.paginator.num_pages }}">⟫⟫</a></li> | ||
{% endif %} | ||
<ul class="pagination"> | ||
{% if page_obj.has_previous %} | ||
<li><a href="?page=1">⟪⟪</a></li> | ||
<li><a href="?page={{ page_obj.previous_page_number }}">←</a></li> | ||
{% endif %} | ||
{% for i in paginator.page_range %} | ||
<li {% if page_obj.number == i %} class="active" {% endif %}><a href="?page={{i}}">{{i}}</a></li> | ||
{% endfor %} | ||
{% if page_obj.has_next %} | ||
<li><a href="?page={{ page_obj.next_page_number }}">➝</a></li> | ||
<li><a href="?page={{ page_obj.paginator.num_pages }}">⟫⟫</a></li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
|
||
{% block title %} | ||
{% trans "Badges" %} | ||
{% endblock %} | ||
{% block title %}Badges{% endblock %} | ||
|
||
{% block content %} | ||
<div class="badgify-badge-list"> | ||
<h2>{% trans "Badges" %}</h2> | ||
{% if not badges %} | ||
<div class="alert alert-success" role="alert"> | ||
<p>{% trans "No badges yet." %}</p> | ||
</div> | ||
{% else %} | ||
<div class="row"> | ||
{% for badge in badges %} | ||
<div class="col-md-3"> | ||
<div class="thumbnail text-center"> | ||
<a href="{{ badge.get_absolute_url }}"> | ||
<img src="{% if badge.image %}{{ badge.image }}{% else %}http://placehold.it/140x140{% endif %}" alt="{{ badge.name }}"> | ||
</a> | ||
<div class="caption"> | ||
<h4 class="text-center">{{ badge.name }}</h4> | ||
<p class="text-muted">{{ badge.description }}</p> | ||
<p class="text-center"><span class="glyphicon glyphicon-user"></span> {{ badge.users_count }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% include "_pagination.html" %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% if not badges %} | ||
<p>No badges yet.</p> | ||
{% else %} | ||
<ul> | ||
{% for badge in badges %} | ||
<li> | ||
<h4><a href="{{ badge.get_absolute_url }}">{{ badge.name }}</a></h4> | ||
<ul> | ||
<li><em>{{ badge.description }}</em></li> | ||
<li><strong>{{ badge.users_count }} users</strong></li> | ||
</ul> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% include "_pagination.html" %} | ||
{% endif %} | ||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,17 @@ | ||
{% load staticfiles i18n %} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Badgify | {% block title %}{% endblock %}</title> | ||
<link href="{% static 'vendor/bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet"> | ||
<link href="{% static 'vendor/bootstrap/dist/css/bootstrap-theme.min.css' %}" rel="stylesheet"> | ||
<link href="{% static 'main.css' %}" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div class="navbar navbar-default navbar-static-top" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand" href="{% url 'home' %}">Badgify</a> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Badgify | {% block title %}{% endblock %}</title> | ||
</head> | ||
<body> | ||
<header> | ||
<h1><a href="{% url 'badge_list' %}">Home</a></h1> | ||
</header> | ||
<hr> | ||
<div class="content"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
<div class="collapse navbar-collapse"> | ||
<ul class="nav navbar-nav pull-right"> | ||
<li><a href="{% url 'home' %}">Home</a></li> | ||
<li><a href="{% url 'badge_list' %}">Badges</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="container"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
<script src="{% static 'vendor/jquery/dist/jquery.min.js' %}"></script> | ||
<script src="{% static 'vendor/bootstrap/dist/js/bootstrap.min.js' %}"></script> | ||
</body> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.conf import settings | ||
from django.conf.urls import patterns, include, url | ||
from django.conf.urls import include, url | ||
from django.conf.urls.static import static | ||
from django.contrib import admin | ||
from django.views.generic import TemplateView | ||
|
||
urlpatterns = patterns('', | ||
urlpatterns = [ | ||
url(r'^admin/', include(admin.site.urls)), | ||
url(r'^badges/', include('badgify.urls')), | ||
url(r'^$', TemplateView.as_view(template_name='home.html'), name='home') | ||
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) | ||
url(r'', include('badgify.urls')), | ||
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) |