aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-04-20 16:17:47 +0800
committerWeitian LI <liweitianux@gmail.com>2014-04-20 16:17:47 +0800
commitd477d14d624bea299a62199799607155d43a4226 (patch)
treec82c424f77993b7138f01249c99cd3309612d012 /templates
parent0005d0926d15d9034d8cb47da3861e5ab6dd02f1 (diff)
downloaddjango-skaschool-d477d14d624bea299a62199799607155d43a4226.tar.bz2
* implemented the index page
o base.html, navbar.html, favicon.html, index.html o added static files related to index page * performed south migrations * implemented registration templates * implemented regiration views and pages
Diffstat (limited to 'templates')
-rw-r--r--templates/activation_complete.html22
-rw-r--r--templates/base.html85
-rw-r--r--templates/bootstrap.html3
-rw-r--r--templates/favicon.html5
-rw-r--r--templates/form.html17
-rw-r--r--templates/form_horizontal.html17
-rw-r--r--templates/form_inline.html17
-rw-r--r--templates/form_with_files.html17
-rw-r--r--templates/home.html7
-rw-r--r--templates/index.html50
-rw-r--r--templates/navbar.html51
-rw-r--r--templates/pagination.html25
-rw-r--r--templates/registration/activate.html24
-rw-r--r--templates/registration/activation_complete.html22
-rw-r--r--templates/registration/activation_email.txt10
-rw-r--r--templates/registration/activation_email_subject.txt2
-rw-r--r--templates/registration/registration_closed.html11
-rw-r--r--templates/registration/registration_complete.html27
-rw-r--r--templates/registration/registration_form.html22
19 files changed, 308 insertions, 126 deletions
diff --git a/templates/activation_complete.html b/templates/activation_complete.html
new file mode 100644
index 0000000..11ca25e
--- /dev/null
+++ b/templates/activation_complete.html
@@ -0,0 +1,22 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# step 4. activation complete #}
+
+{% block title %}
+成功激活 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h2>成功激活</h2>
+ <p class="lead">您已成功激活账户。</p>
+
+ <br />
+ <p><a href="#" class="btn btn-primary">登录</a></p>
+ </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/base.html b/templates/base.html
index df9c111..81766a4 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,25 +1,76 @@
-{% extends 'bootstrap.html' %}
+{% extends 'bootstrap3/bootstrap3.html' %}
-{% load url from future %}
+{% comment %}
+'base.html' for skaschool
+based on 'django-bootstrap3'
+
+Weitian LI <liweitianux@gmail.com>
+2014/04/19
+{% endcomment %}
{% load bootstrap3 %}
+{% load url from future %}
+{% load staticfiles %}
-{% block bootstrap3_content %}
- <div class="container">
- <h1>{% block title %}(no title){% endblock %}</h1>
+{# title #}
+{% block bootstrap3_title %}
+ {% block title %}(title){% endblock %}
+{% endblock %}
- <p>
- <a href="{% url 'home' %}">home</a>
- <a href="{% url 'form_default' %}">form</a>
- <a href="{% url 'form_horizontal' %}">form_horizontal</a>
- <a href="{% url 'form_inline' %}">form_inline</a>
- <a href="{% url 'form_with_files' %}">form_with_files</a>
- <a href="{% url 'pagination' %}">pagination</a>
- </p>
+{# bootstrap3_extra_head #}
+{% block bootstrap3_extra_head %}
+ {# custom css #}
+ {% block custom_css %}
+ <link href="{% static 'css/base.css' %}" rel="stylesheet">
+ {# css_extra #}
+ {% block css_extra %}{% endblock %}
+ {% endblock %} {# custom_css #}
+ {# add favicon #}
+ {% block favicon %}
+ {% include 'favicon.html' %}
+ {% endblock %}
+{% endblock %}
- {% bootstrap_messages %}
+{# body #}
+{% block bootstrap3_content %}
+ {# add block page #}
+ {% block page %}
+ {# message #}
+ {% block message %}
+ {# show 'django.contrib.messages' in Bootstrap alert containers #}
+ {% bootstrap_messages %}
+ {% endblock %} {# message #}
+ {# header #}
+ {% block header %}
+ <header role="banner">
+ {# navigation bar #}
+ {% block navbar %}
+ {% include 'navbar.html' %}
+ {% endblock %} {# navbar #}
+ {# header_extra #}
+ {% block header_extra %}{% endblock %}
+ </header>
+ {% endblock %} {# header #}
+ {# main #}
+ {% block main %}
+ <main role="main">
+ {# sidebar #}
+ {% block sidebar %}{% endblock %}
+ {# content #}
+ {% block content %}{% endblock %}
+ </main>
+ {% endblock %} {# main #}
+ {# footer #}
+ {% block footer %}{% endblock %}
+ {% endblock page %} {# page #}
+{% endblock %} {# bootstrap3_content #}
- {% block content %}(no content){% endblock %}
- </div>
+{# bootstrap3_extra_scripts #}
+{% block bootstrap3_extra_script %}
+ {# extra javascript files #}
+ {% block js_extra %}{% endblock %}
+ {# custom script (e.g. built-in js code) #}
+ {% block custom_script %}{% endblock %}
+{% endblock %} {# bootstrap3_extra_script #}
-{% endblock %}
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/bootstrap.html b/templates/bootstrap.html
deleted file mode 100644
index 5e5b581..0000000
--- a/templates/bootstrap.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{% extends 'bootstrap3/bootstrap3.html' %}
-
-{% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %}
diff --git a/templates/favicon.html b/templates/favicon.html
new file mode 100644
index 0000000..e6a0255
--- /dev/null
+++ b/templates/favicon.html
@@ -0,0 +1,5 @@
+{# Favicons: to be included in 'base.html' #}
+{% load staticfiles %}
+<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{% static 'images/apple-touch-icon-144-precomposed.png' %}">
+<link rel="shortcut icon" href="{% static 'images/favicon.png' %}">
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/form.html b/templates/form.html
deleted file mode 100644
index dca0f83..0000000
--- a/templates/form.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'base.html' %}
-
-{% load bootstrap3 %}
-
-{% block title %}
- Forms
-{% endblock %}
-
-{% block content %}
-
- <form role="form" method="post">
- {% csrf_token %}
- {% bootstrap_form form %}
- {% buttons submit='OK' reset="Cancel" %}{% endbuttons %}
- </form>
-
-{% endblock %}
diff --git a/templates/form_horizontal.html b/templates/form_horizontal.html
deleted file mode 100644
index d9fc0c3..0000000
--- a/templates/form_horizontal.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'base.html' %}
-
-{% load bootstrap3 %}
-
-{% block title %}
- Forms
-{% endblock %}
-
-{% block content %}
-
- <form role="form" class="form-horizontal" method="post">
- {% csrf_token %}
- {% bootstrap_form form layout="horizontal" %}
- {% buttons submit='OK' reset='Cancel' layout='horizontal' %}{% endbuttons %}
- </form>
-
-{% endblock %}
diff --git a/templates/form_inline.html b/templates/form_inline.html
deleted file mode 100644
index 493bd18..0000000
--- a/templates/form_inline.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'base.html' %}
-
-{% load bootstrap3 %}
-
-{% block title %}
- Forms
-{% endblock %}
-
-{% block content %}
-
- <form role="form" class="form-inline" method="post">
- {% csrf_token %}
- {% bootstrap_form form layout='inline' %}
- {% buttons submit='OK' reset='Cancel' layout='inline' %}{% endbuttons %}
- </form>
-
-{% endblock %}
diff --git a/templates/form_with_files.html b/templates/form_with_files.html
deleted file mode 100644
index 3e5e83f..0000000
--- a/templates/form_with_files.html
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'demo/base.html' %}
-
-{% load bootstrap3 %}
-
-{% block title %}
- Forms
-{% endblock %}
-
-{% block content %}
-
- <form role="form" method="post" enctype="multipart/form-data" {% if layout != 'vertical' %}class="form-{{ layout }}"{% endif %}>
- {% csrf_token %}
- {% bootstrap_form form layout=layout %}
- {% buttons submit='OK' reset="Cancel" %}{% endbuttons %}
- </form>
-
-{% endblock %}
diff --git a/templates/home.html b/templates/home.html
deleted file mode 100644
index 64d4501..0000000
--- a/templates/home.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends 'base.html' %}
-
-{% block title %}django-bootstrap3{% endblock %}
-
-{% block content %}
- This is <em>bootstrap3</em> for <strong>Django</strong>.
-{% endblock %}
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..1904f8c
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,50 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+
+{# index page for skaschool #}
+
+{% block title %}
+首页 | 2014 SKA Summer School
+{% endblock %}
+
+{% block css_extra %}
+ <link href="{% static 'css/index.css' %}" rel="stylesheet">
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h1>第二届 中国SKA暑期学校</h1>
+ <h1>暨 中国-新西兰联合SKA暑期学校</h1>
+ <h2>China-New Zealand Joint SKA Summer School</h2>
+
+ <br />
+ <p class="lead">
+ 上海,2014,6月28日-7月5日 <br />
+ June 28 - July 05, 2014, Shanghai
+ </p>
+
+ <br />
+ <p>
+ <a href="#" class="btn btn-outline-inverse btn-lg">了解更多</a>
+ <a href="{% url 'registration_register' %}" class="btn btn-outline-inverse btn-lg">注册参加</a>
+ </p>
+ </div>
+{% endblock %} {# content #}
+
+{% block footer %}
+ <footer class="container" role="contentinfo">
+ <p>Brought to you by: <strong>Weitian LI</strong>.</p>
+ <ul class="masthead-links">
+ <li>Powered by:</li>
+ <li><a href="https://www.djangoproject.com/">Django</a></li>
+ <li><a href="http://getbootstrap.com/">Bootstrap</a></li>
+ </ul>
+ </footer>
+{% endblock %}
+
+{% block js_extra %}
+ <script src="{% static 'js/index.js' %}" type="text/javascript"></script>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/navbar.html b/templates/navbar.html
new file mode 100644
index 0000000..00d285f
--- /dev/null
+++ b/templates/navbar.html
@@ -0,0 +1,51 @@
+{# navbar: to be included in 'base.html' #}
+{% load url from future %}
+{% load staticfiles %}
+<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <!-- Brand and toggle get grouped for better mobile display -->
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ska-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 'index' %}">SKA暑期学校</a>
+ </div> <!-- navbar-header -->
+ <!-- Collect the nav links, forms, and other content for toggling -->
+ <div class="collapse navbar-collapse" id="ska-navbar-collapse">
+ <ul class="nav navbar-nav">
+ <li><a href="#">介绍</a></li>
+ <li><a href="#">通知</a></li>
+ <li><a href="#">日程</a></li>
+ <li><a href="#">组委会</a></li>
+ <li><a href="#">交通/食宿</a></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">更多 <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="#">下载</a></li>
+ <li><a href="#">赞助方</a></li>
+ <li><a href="#">联系方式</a></li>
+ <li class="divider"></li>
+ <li><a href="#">关于</a></li>
+ </ul>
+ </li>
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+ <li><a href="#">English</a></li>
+ {% if user.is_authenticated %}
+ <li>
+ <a href="#" class="navbar-link">{{ user.username }}</a> |
+ <a href="#" class="navbar-link">退出</a>
+ </li>
+ {% else %}
+ <!-- wrap 'navbar-btn' within 'div' -->
+ <li><div><a href="{% url 'registration_register' %}" class="btn btn-default navbar-btn">注册</a></div></li>
+ <li><div><a href="#" class="btn btn-primary navbar-btn">登录</a></div></li>
+ {% endif %}
+ </ul>
+ </div> <!-- /.navbar-collapse -->
+ </div> <!-- /.container-->
+</nav>
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/pagination.html b/templates/pagination.html
deleted file mode 100644
index ed11d4f..0000000
--- a/templates/pagination.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends 'base.html' %}
-
-{% load bootstrap3 %}
-
-{% block title %}
- Pagination
-{% endblock %}
-
-{% block content %}
-
- <table class="table">
- {% for line in lines %}
- <tr>
- <td>{{ line }}</td>
- </tr>
- {% endfor %}
- </table>
-
- <hr>
-
- {% bootstrap_pagination lines url="/pagination?page=1&flop=flip" extra="q=foo" size="small" %}
-
- {% bootstrap_pagination lines url="/pagination?page=1" size="large" %}
-
-{% endblock %}
diff --git a/templates/registration/activate.html b/templates/registration/activate.html
new file mode 100644
index 0000000..113d1b3
--- /dev/null
+++ b/templates/registration/activate.html
@@ -0,0 +1,24 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# step 3. activating ... #}
+{% comment %}
+Note: This page is showed when activation failed.
+ Otherwise, it will be redirect to 'registration_activation_complete'
+{% endcomment %}
+
+{% block title %}
+激活失败 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h2>激活失败</h2>
+ <p class="lead">Oops, 激活您的账户时遇到一点小问题,请检查激活链接是否正确并且没有过期……</p>
+ <p>如果您还是不能激活账户,请直接与我们联系:<a href="mailto:skaschool2014@163.com"><code>skaschool2014@163.com</code></a></p>
+ </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/registration/activation_complete.html b/templates/registration/activation_complete.html
new file mode 100644
index 0000000..11ca25e
--- /dev/null
+++ b/templates/registration/activation_complete.html
@@ -0,0 +1,22 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# step 4. activation complete #}
+
+{% block title %}
+成功激活 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h2>成功激活</h2>
+ <p class="lead">您已成功激活账户。</p>
+
+ <br />
+ <p><a href="#" class="btn btn-primary">登录</a></p>
+ </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/registration/activation_email.txt b/templates/registration/activation_email.txt
index 48bee50..0667fa0 100644
--- a/templates/registration/activation_email.txt
+++ b/templates/registration/activation_email.txt
@@ -1,11 +1,11 @@
-Dear {% username %},
+Hello,
Please follow the link below to activate your account at
-"2014 SKA Summer School".
+"2014 SKA Summer School"({{ site }}).
-{% activation_key %}
-{% expiration_days %}
-{% site %}
+http://{{ site }}/accounts/activate/{{ activation_key }}
+
+Note: this link will expire in {{ expiration_days }} days.
Best regards.
diff --git a/templates/registration/activation_email_subject.txt b/templates/registration/activation_email_subject.txt
index d5fe380..215f006 100644
--- a/templates/registration/activation_email_subject.txt
+++ b/templates/registration/activation_email_subject.txt
@@ -1 +1 @@
-激活您的账号
+激活您的账户
diff --git a/templates/registration/registration_closed.html b/templates/registration/registration_closed.html
new file mode 100644
index 0000000..3501f3e
--- /dev/null
+++ b/templates/registration/registration_closed.html
@@ -0,0 +1,11 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+
+{# registration closed #}
+
+{% block title %}
+已关闭注册 | 2014 SKA Summer School
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/registration/registration_complete.html b/templates/registration/registration_complete.html
new file mode 100644
index 0000000..21cb13d
--- /dev/null
+++ b/templates/registration/registration_complete.html
@@ -0,0 +1,27 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# step 2. registration complete #}
+
+{% block title %}
+注册完成 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h2>注册完成</h2>
+ <p class="lead">
+ 您已顺利完成注册。我们已向您注册使用的邮箱发送了激活邮件,请留意查收,并使用其中的链接激活账户。
+ </p>
+
+ <br />
+ <p>
+ 还未收到激活邮件?
+ <a href="#" class="btn btn-default">重新发送激活邮件</a>
+ </p>
+ </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}
diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html
new file mode 100644
index 0000000..90144ec
--- /dev/null
+++ b/templates/registration/registration_form.html
@@ -0,0 +1,22 @@
+{% extends 'base.html' %}
+{% load staticfiles %}
+{% load url from future %}
+{% load bootstrap3 %}
+
+{# step 1. registration #}
+
+{% block title %}
+注册 | 2014 SKA Summer School
+{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <form role="form" class="form-horizontal" method="post">
+ {% csrf_token %}
+ {% bootstrap_form form layout='horizontal' %}
+ {% buttons submit='OK' reset='Cancel' layout='horizontal' %}{% endbuttons %}
+ </form>
+ </div>
+{% endblock %}
+
+{# vim: set ts=8 sw=2 tw=0 fenc=utf-8 ft=htmldjango.html: #}