widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #00093
[Merge] lp:~timo-wingender/widelands-website/ggz-support into lp:widelands-website
Timowi has proposed merging lp:~timo-wingender/widelands-website/ggz-support into lp:widelands-website.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
#336016 Observing of forums and forum topics
https://bugs.launchpad.net/bugs/336016
#340926 [REGRESSION] missing "Just found this site", "Pry about Widelands", ...
https://bugs.launchpad.net/bugs/340926
#357960 Signatures are completly ignored
https://bugs.launchpad.net/bugs/357960
#454450 Feeds are not valid
https://bugs.launchpad.net/bugs/454450
#551500 Fix broken xhtml in donations button
https://bugs.launchpad.net/bugs/551500
#591880 there is no place to change the password
https://bugs.launchpad.net/bugs/591880
#591881 delete avatar if it's not set
https://bugs.launchpad.net/bugs/591881
#593076 quote button displayed if not logged in
https://bugs.launchpad.net/bugs/593076
Changes:
* ggz support: set ggz password in the profile, show ggz statistics in the profile and two overview pages: latest ten matches and top ten rating
* show ggz statistics in the forum
* improved navigation through profiles, messaging, notifications
* implementing forum ranking #340926
* add notifications for the forum: new topics and subscribing to topics #336016
* improved pagination in the forum #336699
* show signatures in the forum #357960
* add a form to change the password #591880
* make the feeds valid #454450
* lot of style fixes on the website
* improvement of the news archive
--
https://code.launchpad.net/~timo-wingender/widelands-website/ggz-support/+merge/27543
Your team Widelands Developers is requested to review the proposed merge of lp:~timo-wingender/widelands-website/ggz-support into lp:widelands-website.
=== modified file 'media/css/base.css'
--- media/css/base.css 2010-01-02 23:25:24 +0000
+++ media/css/base.css 2010-06-14 18:46:29 +0000
@@ -1,24 +1,24 @@
/* HEADER */
div#headerbanner {
-background: url(../img/headback.jpg);
-background-repeat: repeat-x;
-color: #FFFFFF;
-text-align: center;
-height:110px;
-border-bottom:2px solid #090909;
+ background: url(../img/headback.jpg);
+ background-repeat: repeat-x;
+ color: #FFFFFF;
+ text-align: center;
+ height:110px;
+ order-bottom:2px solid #090909;
}
/***************************************************************/
/* SIDECOLUMNS */
/***************************************************************/
#leftcolumn, #rightcolumn {
- background-color: #555555;
- background-image: url('../img/Menubackground.png');
- border-left: 1px solid #151515;
- border-right: 1px solid #090909;
- border-bottom: 1px solid #090909;
- padding-top: 4px; /* A small space */
- vertical-align: top;
+ background-color: #555555;
+ background-image: url('../img/Menubackground.png');
+ border-left: 1px solid #151515;
+ border-right: 1px solid #090909;
+ border-bottom: 1px solid #090909;
+ padding-top: 4px; /* A small space */
+ vertical-align: top;
}
/* The content is capsuled in divs, because
@@ -26,10 +26,10 @@
* for tables
*/
#leftcontent {
- min-width: 175px;
+ min-width: 175px;
}
-#rightcontent {
- min-width: 170px;
+#rightcontent {
+ min-width: 170px;
}
@@ -37,19 +37,19 @@
* Mainmenu
*/
#mainmenu {
-margin: 0px;
-padding: 0px;
+ margin: 0px;
+ padding: 0px;
}
#mainmenu li {
- list-style-image: url('../img/1.gif');
- list-style-position: inside;
- font-weight: bold;
- padding: 4px;
+ list-style-image: url('../img/1.gif');
+ list-style-position: inside;
+ font-weight: bold;
+ padding: 4px;
}
#mainmenu .sub {
-padding-left: 20px;
-color: red;
-font-weight: normal;
+ padding-left: 20px;
+ color: red;
+ font-weight: normal;
}
@@ -57,52 +57,55 @@
/* CONTENT COLUMN */
/******************/
#content {
- text-align: left;
- vertical-align: top;
- padding: 8px;
- padding-top: 0px;
- background-color: #333333;
- background: url(../img/background.png);
+ text-align: left;
+ vertical-align: top;
+ padding: 8px;
+ padding-top: 0px;
+ background-color: #000000;
+ background: url(../img/background.png);
- font-size: 12px;
- color: #D0DFFF;
- width: 100%;
+ font-size: 12px;
+ color: #D0DFFF;
+ width: 100%;
}
/****************/
/* BOTTOM TABLE */
/****************/
table#table_bottom {
- background-color: #333333;
- background: url(../img/background.png);
+ background-color: #333333;
+ background: url(../img/background.png);
- width: 100%;
+ width: 100%;
}
td#table_bottomleft {
- background: url(../img/table_bottomleft.png);
- background-repeat: no-repeat;
- background-position: left;
- height:8px;
- width:8px;
+ background: url(../img/table_bottomleft.png);
+ background-repeat: no-repeat;
+ background-position: left;
+ height:8px;
+ width:8px;
}
td#table_bottomright {
- background: url(../img/table_bottomright.png);
- background-repeat: no-repeat;
- background-position: right;
- height:8px;
- width:8px;
+ background: url(../img/table_bottomright.png);
+ background-repeat: no-repeat;
+ background-position: right;
+ height:8px;
+ width:8px;
}
/**********/
/* FOOTER */
/**********/
#footer {
- width: 100%;
- height: 8px;
- background: url(../img/background.png);
+ width: 100%;
+ height: 8px;
+ background: url(../img/background.png);
}
-/* Menu Blocks */
+
+/*
+ * Menu Blocks
+ */
h3.box_title {
color: #D0DFFF;
font-weight: bold;
@@ -117,96 +120,100 @@
padding-bottom: 6px;
margin: 0px;
}
+
div.box_content {
- font-size:12px;
- line-height: 120%;
- border-left: 0px solid #999999;
- border-right: 0px solid #999999;
- padding: 6px;
- padding-top: 0px;
- padding-bottom: 20px;
- background-color: #555555;
- background-image: url('../img/Menubackground.png');
+ font-size:12px;
+ line-height: 120%;
+ border-left: 0px solid #999999;
+ border-right: 0px solid #999999;
+ padding: 6px;
+ padding-top: 0px;
+ padding-bottom: 20px;
+ background-color: #555555;
+ background-image: url('../img/Menubackground.png');
}
+
.box_content p {
- margin: 0px;
- padding: 0px;
- padding-bottom: 4px;
+ margin: 0px;
+ padding: 0px;
+ padding-bottom: 4px;
}
+.block_center {
+ text-align: center;
+}
/***************************************************************/
/* GENERAL STYLE ELEMENTS */
/***************************************************************/
body {
- color: #D0DFFF;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
- background-color: #000000;
- margin: 0;
- padding: 0;
+ color: #D0DFFF;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ background-color: #000000;
+ margin: 0;
+ padding: 0;
}
img {
- border: 0px;
+ border: 0px;
}
a {
- color: #D0DFFF;
- text-decoration: none;
- font-weight: bold;
- background-color: transparent;
+ color: #D0DFFF;
+ text-decoration: none;
+ font-weight: bold;
+ background-color: transparent;
}
a.external:before {
padding-right: 2px;
- /* Must be an absolute reference, otherwise some browsers give errors */
- content: url(/wlmedia/img/external_link.gif);
+ /* Must be an absolute reference, otherwise some browsers give errors */
+ content: url(/wlmedia/img/external_link.gif);
}
a.missing {
- color: rgb(255, 85, 0);
+ color: rgb(255, 85, 0);
}
a:hover {
- color: #A0AAFF;
- text-decoration: underline;
+ color: #A0AAFF;
+ text-decoration: underline;
}
-
-
+
/*
* Default table layout
*/
th {
- font-weight: bold;
- background-position: left;
- text-align: left;
- padding-left: 4px;
- background-image: url('../img/Navbar.png');
- background-repeat: repeat-x;
- height: 20px;
+ font-weight: bold;
+ background-position: left;
+ text-align: left;
+ padding-left: 4px;
+ background-image: url('../img/Navbar.png');
+ background-repeat: repeat-x;
+ height: 20px;
}
/*
* Odd Even Tags (mainly for tables)
*/
.even {
- background-color: #444444;
- background: url(../img/background-444.png);
- padding: 5px;
+ background-color: #444444;
+ background: url(../img/background-444.png);
+ padding: 5px;
}
.odd {
- background-color: #4f4f4f;
- background: url(../img/background-4F4F4F.png);
- padding: 5px;
-}
-
-.legend {
-}
-
+ background-color: #4f4f4f;
+ background: url(../img/background-4F4F4F.png);
+ padding: 5px;
+}
+
+/*
+ * Error Handling
+ */
.errormessage {
- color: #ff0000;
- font-size: 13px;
+ color: #ff0000;
+ font-size: 13px;
}
/*
@@ -215,3 +222,95 @@
#id_search {
width: 150px;
}
+
+/*
+ * Box Item Model
+ */
+.box_item_model {
+ border: 1px solid rgb(9, 9, 9);
+}
+
+.full_site {
+ width: 100%;
+}
+
+.fixed_site {
+ width: 540px;
+}
+
+.box_item_model img.news {
+ float: right;
+ padding: 0px;
+ width: 20px;
+}
+
+.box_item_model .border_top {
+ border-top: 1px solid rgb(9, 9, );
+}
+
+.box_item_model h3.title {
+ font-weight: bold;
+ font-size: 12px;
+ padding-left: 12px;
+ background-image: url('../img/Navbar.png');
+ background-repeat: repeat-x;
+ border-left: 0px solid #999999;
+ bolder-right: 0px solid #999999;
+ border-top: 0px solid #999999;
+ padding-top: 2px;
+ padding-bottom: 0px;
+ margin: 0px;
+}
+
+.box_item_model .content {
+ line-height: 120%;
+ border: 0px;
+ padding: 2px;
+ padding-top: 5px;
+ padding-left: 15px;
+ background-color: #3F3F3F;
+ background: url('../img/background-3F3F3F.png');
+}
+
+.box_item_model .info_line {
+ text-align: right;
+ padding: 3px;
+ margin: 0px;
+ background-color: #222222;
+ background: url('../img/background-222.png');
+}
+
+.box_item_model .text {
+ vertical-align: baseline;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ margin: 0px;
+ line-height: 130%;
+}
+
+.box_item_model .text:first-letter {
+ color: #7070FF;
+ font-size: 180%;
+ font-family: Cretino, "Bitstream Vera Serif", serif;
+ font-weight: bold;
+}
+
+.box_item_model .show_right {
+ text-align: right;
+ vertical-align: top;
+}
+
+.box_item_model .show_left {
+ text-align: left;
+ vertical-align: top;
+}
+
+.box_item_model .show_center {
+ text-align: center;
+ vertical-align: top;
+}
+
+.show_center {
+ text-align: center;
+ vertical-align: top;
+}
=== modified file 'media/css/comments.css'
--- media/css/comments.css 2010-01-03 18:38:36 +0000
+++ media/css/comments.css 2010-06-14 18:46:29 +0000
@@ -1,14 +1,14 @@
-
-
/*
* Comment
*/
.comment {
- margin: 0px;
- padding-bottom: 2px;
-/* border: 1px solid rgb(20%,20%,20%); */
- border-top: 0px;
- width: 100%;
+ margin: 0px;
+ padding-bottom: 2px;
+ /*
+ * border: 1px solid rgb(20%,20%,20%);
+ */
+ border-top: 0px;
+ width: 100%;
}
.comment p {
margin: 0px;
@@ -26,4 +26,4 @@
}
.text textarea {
width: 100%;
-}
\ No newline at end of file
+}
=== modified file 'media/css/forum.css'
--- media/css/forum.css 2010-01-03 00:07:10 +0000
+++ media/css/forum.css 2010-06-14 18:46:29 +0000
@@ -1,6 +1,17 @@
.index_category, .index_forum {
margin-bottom: 20px;
+ border-left: 0px;
+ border-right: 0px;
+}
+
+.list_overview {
+ display: block;
+ font-weight: bold;
+ padding: 0px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ background: url('../img/background-444.png');
}
.title {
@@ -16,7 +27,6 @@
text-align: center;
}
-
/*
* POSTS
*/
@@ -30,6 +40,14 @@
height: auto;
}
+.post .top {
+ vertical-align: top;
+}
+.post .top .signature .line {
+ color: #D0DFFF;
+ font-weight: bolder;
+}
+
/*
* Post
*/
@@ -87,93 +105,6 @@
width: 40%;
}
.post-form #id_body {
- width: 100%;
- height: 400px;
-}
-
-/*
- * Post and Edit field
- */
-
-.forum_poster { font-size: 90%;}
-.forum_post_date { font-size: 90%;}
-
-
-.forum_item .forum_image img {
- float: right;
- padding: 0px;
- margin-left: 20px;
-}
-
-.forum_item {
- border: 1px solid rgb(9, 9, 9);
- width: 100%;
-}
-
-.forum_item p {
- margin-bottom: 5px;
-}
-
-.forum_item h3.title {
- font-weight: bold;
- font-size: 12px;
- padding-left: 12px;
- background-image: url('../img/Navbar.png');
- background-repeat: repeat-x;
- border-left: 0px solid #999999;
- border-right: 0px solid #999999;
- border-bottom: 0px solid #999999;
- padding-top: 2px;
- padding-bottom: 0px;
- margin: 0px;
-}
-.forum_item .content {
- line-height: 120%;
- border: 0px;
- padding: 2px;
- padding-top: 5px;
- padding-left: 15px;
- background-color: #3F3F3F;
- background: url(../img/background-3F3F3F.png);
-}
-
-.forum_item .info_line {
- text-align: right;
- padding: 3px;
- margin: 0px;
- background-color: #222222;
- background: url(../img/background-222.png);
-}
-
-.forum_item .text {
- vertical-align: baseline;;
- margin-top: 5px;
- margin-bottom: 5px;
- margin: 0px;
- line-height: 130%;
-}
-
-.forum_item .text:first-letter {
- vertical-align: baseline;
- color: #7070FF;
- font-size: 180%;
- font-family: Cretino, "Bitstream Vera Serif", serif;
- font-weight: bold;
- }
-
-.forum_item .bottom_line {
- background-color: #222222;
- background: url(../img/background-222.png);
- table-layout: fixed;
-}
-.forum_item .tags {
- text-align: right;
-}
-.forum_item .comments {
- text-align: left;
-}
-.forum_item .admin {
- text-align: center;
-}
-
-
+ width: 98%;
+ height: 150px;
+}
=== added file 'media/css/ggz.css'
--- media/css/ggz.css 1970-01-01 00:00:00 +0000
+++ media/css/ggz.css 2010-06-14 18:46:29 +0000
@@ -0,0 +1,12 @@
+.ggz_stats {
+ width: 120px;
+}
+.ggz_date {
+ width: 150px;
+}
+.ggz_winner {
+ width: 100px;
+}
+.ggz_vs {
+ width: 290px;
+}
=== modified file 'media/css/messages.css'
--- media/css/messages.css 2010-01-03 15:47:15 +0000
+++ media/css/messages.css 2010-06-14 18:46:29 +0000
@@ -60,89 +60,16 @@
width: 40%;
}
#id_body {
- width: 100%;
- height: 400px;
+ width: 98%;
+ height: 200px;
}
/*
* MessageBox style
*/
-.message_item .message_image img {
+.message_image img {
float: right;
padding: 0px;
margin-left: 20px;
}
-
-.message_item {
- border: 1px solid rgb(9, 9, 9);
- width: 100%;
-}
-
-.message_item p {
- margin-bottom: 5px;
-}
-
-.message_item h3.title {
- font-weight: bold;
- font-size: 12px;
- padding-left: 12px;
- background-image: url('../img/Navbar.png');
- background-repeat: repeat-x;
- border-left: 0px solid #999999;
- border-right: 0px solid #999999;
- border-bottom: 0px solid #999999;
- padding-top: 2px;
- padding-bottom: 0px;
- margin: 0px;
-}
-.message_item .content {
- line-height: 120%;
- border: 0px;
- padding: 2px;
- padding-top: 5px;
- padding-left: 15px;
- background-color: #3F3F3F;
- background: url(../img/background-3F3F3F.png);
-}
-
-.message_item .info_line {
- text-align: right;
- padding: 3px;
- margin: 0px;
- background-color: #222222;
- background: url(../img/background-222.png);
-}
-
-.message_item .text {
- vertical-align: baseline;;
- margin-top: 5px;
- margin-bottom: 5px;
- margin: 0px;
- line-height: 130%;
-}
-
-.message_item .text:first-letter {
- vertical-align: baseline;
- color: #7070FF;
- font-size: 180%;
- font-family: Cretino, "Bitstream Vera Serif", serif;
- font-weight: bold;
- }
-
-.message_item .bottom_line {
- background-color: #222222;
- background: url(../img/background-222.png);
- table-layout: fixed;
-}
-.message_item .tags {
- text-align: right;
-}
-.message_item .comments {
- text-align: left;
-}
-.message_item .admin {
- text-align: center;
-}
-
-
=== modified file 'media/css/news.css'
--- media/css/news.css 2009-02-27 15:36:38 +0000
+++ media/css/news.css 2010-06-14 18:46:29 +0000
@@ -1,83 +1,11 @@
-
-.news_poster { font-size: 90%;}
-.news_post_date { font-size: 90%;}
-
-
-.news_item .news_image img {
- float: right;
- padding: 0px;
- margin-left: 20px;
-}
-
-.news_item {
- border: 1px solid rgb(9, 9, 9);
- width: 100%;
-}
-
-.news_item p {
- margin-bottom: 5px;
-}
-
-.news_item h3.title {
- font-weight: bold;
- font-size: 12px;
- padding-left: 12px;
- background-image: url('../img/Navbar.png');
- background-repeat: repeat-x;
- border-left: 0px solid #999999;
- border-right: 0px solid #999999;
- border-bottom: 0px solid #999999;
- padding-top: 2px;
- padding-bottom: 0px;
- margin: 0px;
-}
-.news_item .content {
- line-height: 120%;
- border: 0px;
- padding: 2px;
- padding-top: 5px;
- padding-left: 15px;
- background-color: #3F3F3F;
- background: url(../img/background-3F3F3F.png);
-}
-
-.news_item .info_line {
- text-align: right;
- padding: 3px;
- margin: 0px;
- background-color: #222222;
- background: url(../img/background-222.png);
-}
-
-.news_item .text {
- vertical-align: baseline;;
- margin-top: 5px;
- margin-bottom: 5px;
- margin: 0px;
- line-height: 130%;
-}
-
-.news_item .text:first-letter {
- vertical-align: baseline;
- color: #7070FF;
- font-size: 180%;
- font-family: Cretino, "Bitstream Vera Serif", serif;
- font-weight: bold;
- }
-
-.news_item .bottom_line {
- background-color: #222222;
- background: url(../img/background-222.png);
- table-layout: fixed;
-}
-.news_item .tags {
- text-align: right;
-}
-.news_item .comments {
- text-align: left;
-}
-.news_item .admin {
- text-align: center;
-}
-
-
+.news_poster {
+ font-size: 90%;
+}
+.news_post_date {
+ font-size: 90%;
+}
+.news_image img {
+ float:right;
+ margin-left:20px;
+ padding:0;
+}
=== added file 'media/css/notice.css'
--- media/css/notice.css 1970-01-01 00:00:00 +0000
+++ media/css/notice.css 2010-06-14 18:46:29 +0000
@@ -0,0 +1,12 @@
+.notice_poster {
+ font-size: 90%;
+}
+.notice_post_date {
+ font-size: 90%;
+}
+.notice_unseen_notice {
+ font-style: italic;
+}
+.notice_type {
+ font-weight: bold;
+}
=== modified file 'media/css/profile.css'
--- media/css/profile.css 2010-01-02 19:08:16 +0000
+++ media/css/profile.css 2010-06-14 18:46:29 +0000
@@ -1,83 +1,11 @@
-
-.profile_poster { font-size: 90%;}
-.profile_post_date { font-size: 90%;}
-
-
-.profile_item .profile_image img {
+.profile_poster {
+ font-size: 90%;
+}
+.profile_post_date {
+ font-size: 90%;
+}
+.profile_image img {
float: right;
padding: 0px;
margin-left: 20px;
}
-
-.profile_item {
- border: 1px solid rgb(9, 9, 9);
- width: 540px;
-}
-
-.profile_item p {
- margin-bottom: 5px;
-}
-
-.profile_item h3.title {
- font-weight: bold;
- font-size: 12px;
- padding-left: 12px;
- background-image: url('../img/Navbar.png');
- background-repeat: repeat-x;
- border-left: 0px solid #999999;
- border-right: 0px solid #999999;
- border-bottom: 0px solid #999999;
- padding-top: 2px;
- padding-bottom: 0px;
- margin: 0px;
-}
-.profile_item .content {
- line-height: 120%;
- border: 0px;
- padding: 2px;
- padding-top: 5px;
- padding-left: 15px;
- background-color: #3F3F3F;
- background: url(../img/background-3F3F3F.png);
-}
-
-.profile_item .info_line {
- text-align: right;
- padding: 3px;
- margin: 0px;
- background-color: #222222;
- background: url(../img/background-222.png);
-}
-
-.profile_item .text {
- vertical-align: baseline;;
- margin-top: 5px;
- margin-bottom: 5px;
- margin: 0px;
- line-height: 130%;
-}
-
-.profile_item .text:first-letter {
- vertical-align: baseline;
- color: #7070FF;
- font-size: 180%;
- font-family: Cretino, "Bitstream Vera Serif", serif;
- font-weight: bold;
- }
-
-.profile_item .bottom_line {
- background-color: #222222;
- background: url(../img/background-222.png);
- table-layout: fixed;
-}
-.profile_item .tags {
- text-align: right;
-}
-.profile_item .comments {
- text-align: left;
-}
-.profile_item .admin {
- text-align: center;
-}
-
-
=== added file 'media/css/register.css'
=== added file 'media/img/sterne_0.png'
Binary files media/img/sterne_0.png 1970-01-01 00:00:00 +0000 and media/img/sterne_0.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_1.png'
Binary files media/img/sterne_1.png 1970-01-01 00:00:00 +0000 and media/img/sterne_1.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_2.png'
Binary files media/img/sterne_2.png 1970-01-01 00:00:00 +0000 and media/img/sterne_2.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_3.png'
Binary files media/img/sterne_3.png 1970-01-01 00:00:00 +0000 and media/img/sterne_3.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_4.png'
Binary files media/img/sterne_4.png 1970-01-01 00:00:00 +0000 and media/img/sterne_4.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_5.png'
Binary files media/img/sterne_5.png 1970-01-01 00:00:00 +0000 and media/img/sterne_5.png 2010-06-14 18:46:29 +0000 differ
=== added file 'media/img/sterne_6.png'
Binary files media/img/sterne_6.png 1970-01-01 00:00:00 +0000 and media/img/sterne_6.png 2010-06-14 18:46:29 +0000 differ
=== modified file 'news/templatetags/news.py'
--- news/templatetags/news.py 2009-02-24 12:53:54 +0000
+++ news/templatetags/news.py 2010-06-14 18:46:29 +0000
@@ -47,6 +47,37 @@
format_string, var_name = m.groups()
return LatestPosts(format_string, var_name)
+class NewsYears(template.Node):
+ def __init__(self, var_name):
+ self.var_name = var_name
+
+ def render(self, context):
+ years = Post.objects.all().dates('publish', 'year')
+ context[self.var_name] = years
+ return ''
+
+@register.tag
+def get_news_years(parser, token):
+ """
+ Gets any number of latest posts and stores them in a varable.
+
+ Syntax::
+
+ {% get_latest_posts [limit] as [var_name] %}
+
+ Example usage::
+
+ {% get_latest_posts 10 as latest_post_list %}
+ """
+ try:
+ tag_name, arg = token.contents.split(None, 1)
+ except ValueError:
+ raise template.TemplateSyntaxError, "%s tag requires arguments" % token.contents.split()[0]
+ m = re.search(r'as (\w+)', arg)
+ if not m:
+ raise template.TemplateSyntaxError, "%s tag had invalid arguments" % tag_name
+ (var_name, ) = m.groups()
+ return NewsYears(var_name)
class NewsCategories(template.Node):
def __init__(self, var_name):
=== modified file 'news/urls.py'
--- news/urls.py 2009-03-23 20:34:20 +0000
+++ news/urls.py 2010-06-14 18:46:29 +0000
@@ -6,18 +6,18 @@
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/$',
view=news_views.post_detail,
name='news_detail'),
- #
- # url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
- # view=news_views.post_archive_day,
- # name='news_archive_day'),
- #
- # url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
- # view=news_views.post_archive_month,
- # name='news_archive_month'),
- #
- # url(r'^(?P<year>\d{4})/$',
- # view=news_views.post_archive_year,
- # name='news_archive_year'),
+
+ url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
+ view=news_views.post_archive_day,
+ name='news_archive_day'),
+
+ url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
+ view=news_views.post_archive_month,
+ name='news_archive_month'),
+
+ url(r'^(?P<year>\d{4})/$',
+ view=news_views.post_archive_year,
+ name='news_archive_year'),
# url(r'^categories/(?P<slug>[-\w]+)/$',
# view=news_views.category_detail,
=== modified file 'news/views.py'
--- news/views.py 2009-03-23 20:34:20 +0000
+++ news/views.py 2010-06-14 18:46:29 +0000
@@ -13,7 +13,6 @@
return list_detail.object_list(
request,
queryset = Post.objects.published(),
- paginate_by = 20,
page = page,
**kwargs
)
=== modified file 'pybb/feeds.py'
--- pybb/feeds.py 2009-04-08 18:21:36 +0000
+++ pybb/feeds.py 2010-06-14 18:46:29 +0000
@@ -1,8 +1,8 @@
from django.contrib.syndication.feeds import Feed
-from django.utils.feedgenerator import Atom1Feed
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ObjectDoesNotExist
+from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
from pybb.models import Post, Topic, Forum
@@ -27,10 +27,10 @@
else:
return self.items_for_object(obj)
- def link(self,obj):
+ def link(self, obj):
if obj == self.all_objects:
return reverse('pybb_index')
- return reverse('pybb_forum', args=(obj.pk,))
+ return "/ewfwevw%s" % reverse('pybb_forum', args=(obj.pk,))
def get_object(self,bits):
"""
@@ -46,12 +46,15 @@
##########################
# Individual items below #
##########################
- def item_guid(self, obj):
+ def item_id(self, obj):
return str(obj.id)
def item_pubdate(self, obj):
return obj.created
-
+
+ def item_links(self, item):
+ return [{'href': item.get_absolute_url()}, ]
+
class LastPosts(PybbFeed):
all_title = _('Latest posts on all forums')
@@ -66,6 +69,13 @@
def items_for_object(self,obj):
return Post.objects.filter( topic__forum = obj ).order_by('-created')[:15]
+ def item_author_name(self, item):
+ """
+ Takes the object returned by get_object and returns the feeds's
+ auhor's name as a Python string
+ """
+ return item.user.username
+
class LastTopics(PybbFeed):
all_title = _('Latest topics on all forums')
@@ -80,3 +90,10 @@
def items_for_object(self,obj):
return Topic.objects.filter( forum = obj ).order_by('-created')[:15]
+ def item_author_name(self, item):
+ """
+ Takes the object returned by get_object and returns the feeds's
+ auhor's name as a Python string
+ """
+ return item.user.username
+
=== modified file 'pybb/forms.py'
--- pybb/forms.py 2009-04-10 11:35:06 +0000
+++ pybb/forms.py 2010-06-14 18:46:29 +0000
@@ -10,6 +10,8 @@
from pybb.models import Topic, Post, PrivateMessage, Attachment
from pybb import settings as pybb_settings
+from notification import models as notification
+
class AddPostForm(forms.ModelForm):
name = forms.CharField(label=_('Subject'))
attachment = forms.FileField(label=_('Attachment'), required=False)
@@ -47,11 +49,13 @@
def save(self):
if self.forum:
+ topic_is_new = True
topic = Topic(forum=self.forum,
user=self.user,
name=self.cleaned_data['name'])
topic.save()
else:
+ topic_is_new = False
topic = self.topic
post = Post(topic=topic, user=self.user, user_ip=self.ip,
@@ -61,6 +65,13 @@
if pybb_settings.ATTACHMENT_ENABLE:
self.save_attachment(post, self.cleaned_data['attachment'])
+
+ if topic_is_new:
+ notification.send(User.objects.all(), "forum_new_topic",
+ {'topic': topic, 'post':post, 'user':topic.user})
+ else:
+ notification.send(self.topic.subscribers.all(), "forum_new_post",
+ {'post':post, 'topic':topic, 'user':post.user})
return post
=== modified file 'pybb/management/__init__.py'
--- pybb/management/__init__.py 2009-02-25 16:55:36 +0000
+++ pybb/management/__init__.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,1 @@
+import pybb_notifications
=== added file 'pybb/management/pybb_notifications.py'
--- pybb/management/pybb_notifications.py 1970-01-01 00:00:00 +0000
+++ pybb/management/pybb_notifications.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,20 @@
+from django.db.models import signals
+
+from django.utils.translation import ugettext_noop as _
+
+try:
+ from notification import models as notification
+
+ def create_notice_types(app, created_models, verbosity, **kwargs):
+ notification.create_notice_type("forum_new_topic",
+ _("Forum New Topic"),
+ _("a new topic has been added to the forum"),
+ default=1)
+ notification.create_notice_type("forum_new_post",
+ _("Forum New Post"),
+ _("a new comment has been posted to a topic you observe"))
+
+ signals.post_syncdb.connect(create_notice_types,
+ sender=notification)
+except ImportError:
+ print "Skipping creation of NoticeTypes as notification app not found"
=== modified file 'pybb/models.py'
--- pybb/models.py 2010-01-02 23:11:47 +0000
+++ pybb/models.py 2010-06-14 18:46:29 +0000
@@ -18,6 +18,12 @@
if settings.USE_SPHINX:
from djangosphinx import SphinxSearch
+try:
+ from notification import models as notification
+ from django.db.models import signals
+except ImportError:
+ notification = None
+
MARKUP_CHOICES = (
('markdown', 'markdown'),
# ('bbcode', 'bbcode'),
@@ -127,10 +133,12 @@
return reverse('pybb_topic', args=[self.id])
def save(self, *args, **kwargs):
- if self.id is None:
+ new = self.id is None
+ if new:
self.created = datetime.now()
super(Topic, self).save(*args, **kwargs)
+
def update_read(self, user):
read, new = Read.objects.get_or_create(user=user, topic=self)
if not new:
@@ -207,6 +215,7 @@
def save(self, *args, **kwargs):
if self.created is None:
self.created = datetime.now()
+
self.render()
new = self.id is None
@@ -339,5 +348,8 @@
self.path)
+#if notification is not None:
+# signals.post_save.connect(notification.handle_observations, sender=Post)
+
from pybb import signals
signals.setup_signals()
=== modified file 'pybb/urls.py'
--- pybb/urls.py 2009-03-17 15:02:13 +0000
+++ pybb/urls.py 2010-06-14 18:46:29 +0000
@@ -37,4 +37,8 @@
# API
url('^api/post_ajax_preview/$', views.post_ajax_preview, name='pybb_post_ajax_preview'),
+
+ # Subsciption
+ url('^topic/(?P<topic_id>\d+)/subscribe/$', views.add_subscription, name='pybb_add_subscription'),
+ url('^topic/(?P<topic_id>\d+)/unsubscribe/$', views.delete_subscription, name='pybb_delete_subscription'),
)
=== modified file 'pybb/views.py'
--- pybb/views.py 2009-06-08 13:26:43 +0000
+++ pybb/views.py 2010-06-14 18:46:29 +0000
@@ -18,6 +18,11 @@
from pybb import settings as pybb_settings
from pybb.orm import load_related
+try:
+ from notification import models as notification
+except ImportError:
+ notification = None
+
def index_ctx(request):
quick = {'posts': Post.objects.count(),
'topics': Topic.objects.count(),
@@ -165,6 +170,8 @@
if form.is_valid():
post = form.save();
+ if not topic:
+ post.topic.subscribers.add(request.user)
return HttpResponseRedirect(post.get_absolute_url())
if topic:
=== modified file 'settings.py'
--- settings.py 2010-03-14 14:13:24 +0000
+++ settings.py 2010-06-14 18:46:29 +0000
@@ -198,6 +198,7 @@
'widelands.wlpoll',
'widelands.wlmaps',
'widelands.wlscreens',
+ 'widelands.wlggz',
# Modified 3rd party apps
'widelands.wiki', # This is based on wikiapp, but has some local modifications
=== modified file 'templates/django_messages/compose.html'
--- templates/django_messages/compose.html 2010-03-14 14:13:24 +0000
+++ templates/django_messages/compose.html 2010-06-14 18:46:29 +0000
@@ -10,28 +10,23 @@
{% include "django_messages/inlines/navigation.html" %}
<br />
<br />
-<div class="message_item">
+<div class="box_item_model fixed_site">
<h3 class="title">{% trans "Compose Message"%}</h3>
- <div class="content">
- <form action="" method="post">
- <table class="text" width="100%" cellspacing="1">
- {% for field in form %}
- <tr>
- <td {% ifequal field.name "body" %}valign="top" {% endifequal %}width="80" class="{% cycle "odd" "even" %}">{{ field.label_tag }}:</td>
- <td class="{% cycle "odd" "even" %}">{{ field }}</td>
- <td width="1%" class="{% cycle "odd" "even" %}"></td>
- </tr>
- {% endfor %}
- </table>
- </div>
- <table class="bottom_line" width="100%">
- <tr>
- <td class="admin">
- <input type="submit" value="{% trans "Send" %} »"/>
- </td>
- <tr>
- </table>
- </form>
+ <form action="" method="post">
+ <div class="content">
+ <table class="text full_site" cellspacing="1">
+ {% for field in form %}
+ <tr>
+ <td width="80" class="{% cycle "odd" "even" %}{% ifequal field.name "body" %} show_left{% endifequal %}">{{ field.label_tag }}:</td>
+ <td class="{% cycle "odd" "even" %}">{{ field }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="info_line show_center">
+ <input type="submit" value="{% trans "Send" %} »"/>
+ </div>
+ </form>
</div>
{% endblock %}
=== modified file 'templates/django_messages/inbox.html'
--- templates/django_messages/inbox.html 2010-03-14 14:13:24 +0000
+++ templates/django_messages/inbox.html 2010-06-14 18:46:29 +0000
@@ -7,15 +7,17 @@
{% block content %}
{% include "django_messages/inlines/navigation.html" %}
-
- <h1>{% trans "Inbox" %}</h1>
+ <br />
+ <br />
+ <div class="box_item_model">
+ <h3 class="title">{% trans "Inbox" %}</h3>
<table class="messages" cellspacing="1">
<thead>
<tr>
- <th>{% trans "Sender" %}</th>
- <th>{% trans "Subject" %}</th>
- <th>{% trans "Received" %}</th>
- <th>{% trans "Action" %}</th>
+ <td>{% trans "Sender" %}</td>
+ <td>{% trans "Subject" %}</td>
+ <td>{% trans "Received" %}</td>
+ <td>{% trans "Action" %}</td>
</tr>
</thead>
<tbody>
@@ -24,4 +26,5 @@
{% endfor %}
</tbody>
</table>
+ </div>
{% endblock %}
=== modified file 'templates/django_messages/inlines/navigation.html'
--- templates/django_messages/inlines/navigation.html 2009-03-15 20:26:08 +0000
+++ templates/django_messages/inlines/navigation.html 2010-06-14 18:46:29 +0000
@@ -1,19 +1,59 @@
{% load i18n %}
<div>
- <table width="100%">
- <tr>
- <td align="left">
- <a href="{% url profile_view %} ">{% trans "Profile" %}</a>
- | <a href="{% url notification_notices %} ">{% trans "Notifications" %}</a>
- </td>
- <td align="right" style="table-layout: fixed;">
- <a href="{% url messages_inbox %} ">{% trans "Inbox" %}</a>
- | <a href="{% url messages_outbox %} ">{% trans "Sent Messages" %}</a>
- | <a href="{% url messages_compose %} ">{% trans "New Message" %}</a>
- | <a href="{% url messages_trash %} ">{% trans "Message Trash" %}</a>
- </td>
- </tr>
- </table>
+ <table width="100%">
+ <tr>
+ <td align="left">
+
+ {% if user.is_authenticated %}
+ {% ifequal user profile.user %}
+ <a href="{% url profile_view %} ">{{ profile.user }}'s {% trans "Profile" %}</a>
+ | <a href="{% url profile_edit %}">Edit Profile</a>
+ | <a href="{% url wlggz_userstats profile.user %} ">{% trans "GGZ Stats" %}</a>
+ {% else %}
+ {% if profile.user %}
+ <a href="{% url profile_view profile.user %} ">{{ profile.user }}'s {% trans "Profile" %}</a>
+ | <a href="{% url messages_compose_to profile.user %} ">{% trans "Send a PM" %}</a>
+ | <a href="{% url wlggz_userstats profile.user %} ">{% trans "GGZ Stats" %}</a>
+ {% else %}
+ <a href="{% url profile_view %} ">{{ user }}'s {% trans "Profile" %}</a>
+ | <a href="{% url profile_edit %}">Edit Profile</a>
+ | <a href="{% url wlggz_userstats profile.user %} ">{% trans "GGZ Stats" %}</a>
+ {% endif %}
+ {% endifequal %}
+ {% else %}
+ <a href="/accounts/login/">{% trans "Login" %}</a>
+ {% endif %}
+ | <a href="{% url wlggz_ranking %}">{% trans "GGZ Ranking" %}</a>
+ | <a href="{% url wlggz_matches %}">{% trans "GGZ Matches" %}</a>
+ {% if user.is_authenticated %}
+ {% if not profile.user %}
+ | <a href="{% url notification_notices %} ">{% trans "Notifications" %}</a>
+ </td>
+ <td align="right" style="table-layout: fixed;">
+ <a href="{% url messages_inbox %} ">{% trans "Inbox" %}</a>
+ | <a href="{% url messages_outbox %} ">{% trans "Sent Messages" %}</a>
+ | <a href="{% url messages_compose %} ">{% trans "New Message" %}</a>
+ | <a href="{% url messages_trash %} ">{% trans "Message Trash" %}</a>
+ </td>
+ {% else %}
+ {% ifequal user profile.user %}
+ | <a href="{% url notification_notices %} ">{% trans "Notifications" %}</a>
+ </td>
+ <td align="right" style="table-layout: fixed;">
+ <a href="{% url messages_inbox %} ">{% trans "Inbox" %}</a>
+ | <a href="{% url messages_outbox %} ">{% trans "Sent Messages" %}</a>
+ | <a href="{% url messages_compose %} ">{% trans "New Message" %}</a>
+ | <a href="{% url messages_trash %} ">{% trans "Message Trash" %}</a>
+ </td>
+ {% else %}
+ </td>
+ {% endifequal %}
+ {% endif %}
+ {% else %}
+ </td>
+ {% endif %}
+ </tr>
+ </table>
</div>
=== modified file 'templates/django_messages/outbox.html'
--- templates/django_messages/outbox.html 2010-03-14 14:13:24 +0000
+++ templates/django_messages/outbox.html 2010-06-14 18:46:29 +0000
@@ -7,14 +7,17 @@
{% block content %}
{% include "django_messages/inlines/navigation.html" %}
-<h1>{% trans "Sent Messages" %}</h1>
+<br />
+<br />
+<div class="box_item_model">
+<h3 class="title">{% trans "Sent Messages" %}</h3>
<table class="messages" cellspacing="1">
<thead>
<tr>
- <th>{% trans "Recipient" %}</th>
- <th>{% trans "Subject" %}</th>
- <th>{% trans "Sent" %}</th>
- <th>{% trans "Action" %}</th>
+ <td>{% trans "Recipient" %}</td>
+ <td>{% trans "Subject" %}</td>
+ <td>{% trans "Sent" %}</td>
+ <td>{% trans "Action" %}</td>
</tr>
</thead>
<tbody>
@@ -23,4 +26,5 @@
{% endfor %}
</tbody>
</table>
+</div>
{% endblock %}
=== modified file 'templates/django_messages/trash.html'
--- templates/django_messages/trash.html 2010-03-14 14:13:24 +0000
+++ templates/django_messages/trash.html 2010-06-14 18:46:29 +0000
@@ -7,22 +7,33 @@
{% block content %}
{% include "django_messages/inlines/navigation.html" %}
-<h1>{% trans "Deleted Messages" %}</h1>
-<table class="messages" cellspacing="1">
- <thead>
- <tr>
- <th>{% trans "Sender" %}</th>
- <th>{% trans "Subject" %}</th>
- <th>{% trans "Date" %}</th>
- <th>{% trans "Action" %}</th>
- </tr>
- </thead>
- <tbody>
+<br />
+<br />
+<div class="box_item_model">
+ <h3 class="title">{% trans "Deleted Messages" %}</h3>
+ <table class="messages" cellspacing="1">
+ <thead>
+ <tr>
+ <td>{% trans "Sender" %}</td>
+ <td>{% trans "Subject" %}</td>
+ <td>{% trans "Date" %}</td>
+ <td>{% trans "Action" %}</td>
+ </tr>
+ </thead>
+ <tbody>
{% for message in message_list %}
{% include "django_messages/inlines/message_row.html" %}
{% endfor %}
- </tbody>
-</table>
+ </tbody>
+ </table>
+</div>
<br />
-<p>{% trans "Deleted Messages are removed from the trash at unregular intervals, don't rely on this feature for long-time storage." %}</p>
+<div class="box_item_model">
+ <div class="info_line show_center errormessage">
+ <br />
+ {% trans "Deleted Messages are removed from the trash at unregular intervals, don't rely on this feature for long-time storage." %}
+ <br />
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/mainpage.html'
--- templates/mainpage.html 2009-05-25 10:47:04 +0000
+++ templates/mainpage.html 2010-06-14 18:46:29 +0000
@@ -16,58 +16,54 @@
{{ block.super}}{% endblock %}
{% block content %}
-
-<div class="blockContent">
- <center>
- <h1>Welcome to Widelands.org</h1>
- <h3>Home of the free realtime strategy game and its community</h3>
- <p>
- <br/>
- <img src='{{ MEDIA_URL }}/img/HomepageSplash.jpg' title='Widelands' alt='Widelands-Screenshot' />
- <br/><br/>
- </p>
- </center>
+<div class="block_center">
+ <h1>Welcome to Widelands.org</h1>
+ <h3>Home of the free realtime strategy game and its community</h3>
+ <br/>
+ <img src='{{ MEDIA_URL }}/img/HomepageSplash.jpg' title='Widelands' alt='Widelands-Screenshot' />
+ <br/>
+ <br/>
</div>
<!-- Begin of text -->
<div class="itemText">
- <p>
- Widelands is an open source (GPLed) real-time strategy
- game. It is built upon the <a
- href='http://www.libsdl.org'>SDL</a> and other open
- source libraries and is (and will always be) under heavy development. If
- you knew Settlers I & II™ (© Bluebyte), then you
- already have a rough idea what Widelands is all about because
- widelands is heavily inspired by those two games.
- </p>
- <p>
- You can find detailed information on the game in our <a
- href="/wiki">Wiki</a>. I you want to get a quick Overview, go to
- the <a title="General Info" href="{% url wiki_article "GeneralInfo" %}">General Info</a> page.
- </p>
-
- <p>
- You can download the game on the <a href="{% url wiki_article "DownloadPage" %}">DownloadPage</a>. You can also find
- installation instructions and various troubleshooting hints
- there.
- </p>
-
- <p>
- You are also invited to visit the <a
- href="{% url pybb_index %}">Forums</a>:
- chat with the community about the game, find playing mates for multiplayer,
- help translating, discuss graphics, music and much more.
- </p>
+ <p>
+ Widelands is an open source (GPLed) real-time strategy game.
+ It is built upon the <a href='http://www.libsdl.org'>SDL</a> and other
+ open source libraries and is (and will always be) under heavy
+ development. If you knew Settlers I & II™ (© Bluebyte), then
+ you already have a rough idea what Widelands is all about because
+ widelands is heavily inspired by those two games.
+ </p>
+ <p>
+ You can find detailed information on the game in our
+ <a href="/wiki">Wiki</a>. I you want to get a quick Overview, go to the
+ <a title="General Info" href="{% url wiki_article "GeneralInfo" %}">General Info</a>
+ page.
+ </p>
+ <p>
+ You can download the game on the
+ <a href="{% url wiki_article "DownloadPage" %}">DownloadPage</a>. You
+ can also find installation instructions and various troubleshooting
+ hints there.
+ </p>
+ <p>
+ You are also invited to visit the <a href="{% url pybb_index %}">Forums</a>:
+ chat with the community about the game, find playing mates for
+ multiplayer, help translating, discuss graphics, music and much more.
+ </p>
</div>
{% get_latest_posts 3 as latest_posts_list %}
{% if latest_posts_list %}
- <h2><a href="{% url news_index %}">Latest news:</a></h2>
- {% for object in latest_posts_list %}
- {% include "news/inlines/post_detail.html" %}
- <br />
- {% endfor %}
- <a href="{% url news_index %}">News archive</a>
+<h2>
+ <a href="{% url news_index %}">Latest news:</a>
+</h2>
+ {% for object in latest_posts_list %}
+ {% include "news/inlines/post_detail.html" %}
+ <br />
+ {% endfor %}
+ <a href="{% url news_index %}">News archive</a>
{% endif %}
{% endblock %}
=== modified file 'templates/navigation.html'
--- templates/navigation.html 2010-05-13 09:45:42 +0000
+++ templates/navigation.html 2010-06-14 18:46:29 +0000
@@ -38,7 +38,9 @@
<li><a href="{% url pybb_forum 12 %}">Translations & Internationalization</a></li>
</ul>
</li>
-<li><a href="{% url webchat_index %}">IRC Chat</a></li>
+<li>
+ <a href="{% url webchat_index %}">IRC Chat</a>
+</li>
<li>
<a href="{% url wiki_article "DevelopmentPage" %}">Development</a>
<ul>
@@ -50,4 +52,14 @@
<li><a href="https://bugs.launchpad.net/widelands-website">Website Bugtracker</a></li>
</ul>
</li>
-
+<li>
+ <a href="{% url wlggz_main %}">Online Gaming</a>
+ <ul>
+ <li><a href="{% url wlggz_ranking %}">GGZ Ranking</a></li>
+ <li><a href="{% url wlggz_matches %}">GGZ Matches</a></li>
+ {% if user.is_authenticated %}
+ <li><a href="{% url wlggz_userstats %}">GGZ Status</a></li>
+ {% endif %}
+ <li><a href="{% url wiki_article "InternetGaming" %}">HowTo</a></li>
+ </ul>
+</li>
=== modified file 'templates/news/inlines/post_detail.html'
--- templates/news/inlines/post_detail.html 2010-01-02 15:32:46 +0000
+++ templates/news/inlines/post_detail.html 2010-06-14 18:46:29 +0000
@@ -6,50 +6,52 @@
{% endcomment %}
{% load threadedcommentstags %}
{% load news wl_markdown tagging_tags wlprofile custom_date %}
-
-
- <div class="news_item">
- <h3 class="title">{# TODO: categories! #} {{ object.title }}</h3>
- <div class="info_line">
- <span class="news_poster">Posted by {{object.author|user_link}}</span>
- <span class="news_post_date">on {{ object.publish|custom_date:user }}</span>
- </div>
- <div class="content">
- {% if object.has_image %}
- <span class="news_image"><img src='{{MEDIA_URL}}{{ object.image }}' alt='{{ object.image_alt }}' /></span>
- <div class="text" style='min-height: {{ object.image.height }}px;'>
- {% else %}
- <div class="text">
- {% endif %}
- {{ object.body|wl_markdown:"safe" }}
- </div>
- </div>
-
- <table class="bottom_line" width="100%">
- <tr>
- {% get_comment_count for object as ccount %}
- <td class="comments">
- <a href="{{ object.get_absolute_url }}">{{ ccount }} comments</a>
- </td>
-
- <td class="admin">
- {% if perms.news %}
- {% if perms.news.post_can_add %}<a href="/admin/news/post/add/">Add New Post</a>{% endif %}
- {% if perms.news.post_can_edit %}| <a href="/admin/news/post/{{object.id}}/">Edit</a>{% endif %}
- {% if perms.news.post_can_delete %}| <a href="/admin/news/post/{{object.id}}/delete/">Delete</a>{% endif %}
- {% endif %}
- </td>
-
- {% tags_for_object object as tag_list %}
- <td class="tags">
- {% if tag_list %}
- <strong>Tags:</strong>
- {% for tag in tag_list %}
- {{ tag }}{% if not forloop.last %}, {% endif %}
- {% endfor %}
- {% endif %}
- </td>
- </tr>
-
- </table>
- </div>
+ <div class="box_item_model">
+ <h3 class="title">{# TODO: categories! #} {{ object.title }}</h3>
+ <div class="info_line">
+ <span class="news_poster">Posted by {{object.author|user_link}}</span>
+ <span class="news_post_date">on {{ object.publish|custom_date:user }}</span>
+ </div>
+ <div class="content">
+{% if object.has_image %}
+ <span class="news_image"><img src='{{MEDIA_URL}}{{ object.image }}' alt='{{ object.image_alt }}' /></span>
+ <div class="text" style='min-height: {{ object.image.height }}px;'>
+{% else %}
+ <div class="text">
+{% endif %}
+{{ object.body|wl_markdown:"safe" }}
+ </div>
+ </div>
+
+ <table class="info_line full_site">
+ <tr>
+{% get_comment_count for object as ccount %}
+ <td class="comments show_left">
+ <a href="{{ object.get_absolute_url }}">{{ ccount }} comments</a>
+ </td>
+ <td class="show_center">
+{% if perms.news %}
+ {% if perms.news.post_can_add %}
+ <a href="/admin/news/post/add/">Add New Post</a>
+ {% endif %}
+ {% if perms.news.post_can_edit %}
+ | <a href="/admin/news/post/{{object.id}}/">Edit</a>
+ {% endif %}
+ {% if perms.news.post_can_delete %}
+ | <a href="/admin/news/post/{{object.id}}/delete/">Delete</a>
+ {% endif %}
+{% endif %}
+ </td>
+{% tags_for_object object as tag_list %}
+ <td class="show_right">
+{% if tag_list %}
+ <strong>Tags:</strong>
+ {% for tag in tag_list %}
+ {{ tag }}
+ {% if not forloop.last %}, {% endif %}
+ {% endfor %}
+{% endif %}
+ </td>
+ </tr>
+ </table>
+ </div>
=== modified file 'templates/news/post_archive_day.html'
--- templates/news/post_archive_day.html 2009-03-19 06:46:41 +0000
+++ templates/news/post_archive_day.html 2010-06-14 18:46:29 +0000
@@ -1,23 +1,29 @@
{% extends "news/base_news.html" %}
{% load custom_date %}
-
+{% load pagination_tags %}
{% block title %}Post archive for {{ day|date:"d F Y" }}{% endblock %}
{% block body_class %}{{ block.super }} post_archive_day{% endblock %}
-
-{% block content_title %}
- <h2>Post archive for {{ day|date:"d F Y" }}</h2>
-{% endblock %}
-
-
{% block content %}
- <div class="post_list">
- {% for post in object_list %}
- <div>
- <h3 class="title"><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
- <p class="date">{{ post.publish|custom_date:user }}</p>
- <p class="tease">{{ post.tease }}</p>
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="muttis_liebling">
+ <div class="box_item_model even show_center">
+ <a href="{% url news_index %}{{ day|date:"Y" }}/{{ day|date:"m" }}">Archiv {{ day|date:"F" }}</a>
+ {% autopaginate object_list 10 %}
+ {% paginate %}
</div>
+ <br />
+ {% for object in object_list %}
+ {% include "news/inlines/post_detail.html" %}
+ <br />
{% endfor %}
- </div>
+ <br />
+ {% if page_obj.has_other_pages %}
+ <div class="box_item_model even show_center">
+ {% paginate %}
+ </div>
+ {% endif %}
+</div>
{% endblock %}
=== modified file 'templates/news/post_archive_month.html'
--- templates/news/post_archive_month.html 2009-03-23 17:44:44 +0000
+++ templates/news/post_archive_month.html 2010-06-14 18:46:29 +0000
@@ -1,22 +1,33 @@
{% extends "news/base_news.html" %}
{% load custom_date %}
-
+{% load news %}
+{% load pagination_tags %}
{% block title %}Post archive for {{ month|date:"F Y" }}{% endblock %}
{% block body_class %}{{ block.super }} post_archive_month{% endblock %}
-
-{% block content_title %}
- <h2>Post archive for {{ month|date:"F Y" }}</h2>
-{% endblock %}
-
-
{% block content %}
- <div class="post_list">
+{% load markup %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="muttis_liebling">
+ <div class="box_item_model even show_center">
+ <a href="{% url news_index %}{{ month|date:"Y" }}">Archiv {{ month|date:"Y" }}</a>
+ {% for day in object_list %}
+ {% endfor %}
+ {% autopaginate object_list 10 %}
+ {% paginate %}
+ </div>
<br />
{% for object in object_list %}
- {% include "news/inlines/post_detail.html" %}
+ {% include "news/inlines/post_detail.html" %}
<br />
{% endfor %}
- </div>
+ {% if page_obj.has_other_pages %}
+ <div class="box_item_model even show_center">
+ {% paginate %}
+ </div>
+ {% endif %}
+</div>
{% endblock %}
=== modified file 'templates/news/post_archive_year.html'
--- templates/news/post_archive_year.html 2009-03-23 17:44:44 +0000
+++ templates/news/post_archive_year.html 2010-06-14 18:46:29 +0000
@@ -1,22 +1,37 @@
{% extends "news/base_news.html" %}
{% load custom_date %}
+{% load news %}
+{% load pagination_tags %}
{% block title %}Post archive for {{ year }}{% endblock %}
{% block body_class %}{{ block.super }} post_archive_year{% endblock %}
-
-{% block content_title %}
- <h2>Post archive for {{ year }}</h2>
-{% endblock %}
-
-
{% block content %}
{% load markup %}
-
- <ul class="link_list">
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="muttis_liebling">
+ <div class="box_item_model even show_center">
+ <a href="/news/">News Archiv</a>
{% for month in date_list %}
- <li><a href="{% url news_index %}{{ year }}/{{ month|date:"m" }}/">{{ month|date:"F" }}</a></li>
- {% endfor %}
- </ul>
+ | <a href="{% url news_index %}{{ year }}/{{ month|date:"m" }}/">{{ month|date:"F" }}</a>
+ {% endfor %}
+ <br />
+ {% autopaginate object_list 10 %}
+ {% paginate %}
+ </div>
+ <br />
+ {% for object in object_list %}
+ {% include "news/inlines/post_detail.html" %}
+ <br />
+ {% endfor %}
+ {% if page_obj.has_other_pages %}
+ <div class="box_item_model even show_center">
+ {% paginate %}
+ </div>
+ {% endif %}
+
+</div>
{% endblock %}
=== modified file 'templates/news/post_list.html'
--- templates/news/post_list.html 2009-03-23 17:44:44 +0000
+++ templates/news/post_list.html 2010-06-14 18:46:29 +0000
@@ -1,40 +1,34 @@
{% extends "news/base_news.html" %}
{% load news %}
-
+{% load custom_date %}
+{% load pagination_tags %}
{% block title %}Post archive - {{ block.super }}{% endblock %}
{% block body_class %}{{ block.super }} post_list{% endblock %}
-{% block content_title %}
- <h2>Post archive</h2>
-{% endblock %}
-
-
{% block content %}
- <div class="post_list">
- <br />
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="">
+ {% get_news_years as news_years %}
+ <div class="box_item_model even show_center">
+ {% for muh in news_years %}
+ <a href="{% url news_index %}{{ muh.year }}" >{{ muh.year }}</a>
+ {% endfor %}
+ {% autopaginate object_list 10 %}
+ {% paginate %}
+ </div>
+ <br />
{% for object in object_list %}
- {% include "news/inlines/post_detail.html" %}
- <br />
- {% comment %}
- <div>
- <h3 class="title"><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
- <p class="date">{{ post.publish|date:"Y F d" }}</p>
- <p class="tease">{{ post.tease }}</p>
+ {% include "news/inlines/post_detail.html" %}
+ <br />
+ {% endfor %}
+ <br />
+ {% if page_obj.has_other_pages %}
+ <div class="box_item_model even show_center">
+ {% paginate %}
</div>
- {%endcomment%}
- {% endfor %}
- </div>
-
- {% if is_paginated %}
- <p class="pagination">
- {% if has_next %}
- <a class="older" href="?page={{ next }}">Older</a>
- {% endif %}
- {% if has_next and has_previous %} | {% endif %}
- {% if has_previous %}
- <a class="newer" href="?page={{ previous }}">Newer</a>
- {% endif %}
- </p>
- {% endif %}
+ {% endif %}
+</div>
{% endblock %}
=== added directory 'templates/notification/forum_new_post'
=== added file 'templates/notification/forum_new_post/full.txt'
--- templates/notification/forum_new_post/full.txt 1970-01-01 00:00:00 +0000
+++ templates/notification/forum_new_post/full.txt 2010-06-14 18:46:29 +0000
@@ -0,0 +1,7 @@
+{% load i18n %}{% blocktrans with topic.get_absolute_url as topic_url %} A new forum post was added under topic "{{ topic }}" by "{{ user }}".
+
+http://{{ current_site }}{{ topic_url }}
+{% endblocktrans %}
+{{ topic }}:
+
+{{ post.body_text }}
=== added file 'templates/notification/forum_new_post/notice.html'
--- templates/notification/forum_new_post/notice.html 1970-01-01 00:00:00 +0000
+++ templates/notification/forum_new_post/notice.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,2 @@
+{% load i18n %}{% url profile_view user.username as user_url %}
+{% blocktrans with topic.get_absolute_url as topic_url %}A new forum post has be created in forum under topic <a href="{{ topic_url }}">{{ topic }}</a> by <a href="{{ user_url }}">{{ user }}</a>.{% endblocktrans %}
=== added directory 'templates/notification/forum_new_topic'
=== added file 'templates/notification/forum_new_topic/full.txt'
--- templates/notification/forum_new_topic/full.txt 1970-01-01 00:00:00 +0000
+++ templates/notification/forum_new_topic/full.txt 2010-06-14 18:46:29 +0000
@@ -0,0 +1,7 @@
+{% load i18n %}{% blocktrans with topic.get_absolute_url as topic_url %}The Forum topic {{ topic }} has been created by {{ user }}.
+
+http://{{ current_site }}{{ topic_url }}
+{% endblocktrans %}
+{{ topic }}:
+
+{{ post.body_text }}
=== added file 'templates/notification/forum_new_topic/notice.html'
--- templates/notification/forum_new_topic/notice.html 1970-01-01 00:00:00 +0000
+++ templates/notification/forum_new_topic/notice.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,2 @@
+{% load i18n %}{% url profile_view user.username as user_url %}
+{% blocktrans with topic.get_absolute_url as topic_url %}A new forum topic has be created under <a href="{{ topic_url }}">{{ topic }}</a> by <a href="{{ user_url }}">{{ user }}</a>.{% endblocktrans %}
=== modified file 'templates/notification/notices.html'
--- templates/notification/notices.html 2010-01-02 19:55:10 +0000
+++ templates/notification/notices.html 2010-06-14 18:46:29 +0000
@@ -10,64 +10,82 @@
{% block extra_head %}
<link rel="alternate" type="application/atom+xml" title="Notices Feed" href="{% url notification_feed_for_user %}" />
+ <link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}/css/notice.css" />{{ block.super}}
{% endblock %}
{% block content %}
- {% include "messages/inlines/navigation.html" %}
-
- <h1>{% trans "Notices" %}</h1>
+ {% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model full_site" width="100%">
+ <h3 class="title">{% trans "Notices" %}</h3>
{% autopaginate notices %}
-
+
{% if notices %}
- <a href="{% url notification_mark_all_seen %}">{% trans "Mark all unseen notices seen" %}</a>
-
+ <div class="info_line show_center">
+ <br />
+ <a href="{% url notification_mark_all_seen %}">{% trans "Mark all unseen notices seen" %}</a>
+ <br />
+ <br />
+ </div>
{# TODO: get timezone support working with regroup #}
{% regroup notices by added.date as notices_by_date %}
{% for date in notices_by_date %}
- <h2 class="notice_date">{{ date.grouper|naturalday:_("MONTH_DAY_FORMAT")|capfirst }}</h2>
-
+ <h3 class="title notice_date">{{ date.grouper|naturalday:_("MONTH_DAY_FORMAT")|capfirst }}</h3>
{% for notice in date.list %}
{% if notice.is_unseen %}
- <div class="unseen_notice">
+ <div class="{% cycle "odd" "even" %} notice_unseen_notice border_top">
{% else %}
- <div class="notice">
+ <div class="{% cycle "odd" "even" %} border_top">
{% endif %}
- <span class="notice_type">[{% trans notice.notice_type.display %}]</span>
+ <span class="notice_type"><a href="{% url notification_notice notice.pk %} ">[{% trans notice.notice_type.display %}]</a></span>
<span class="notice_message">{{ notice.message|safe }}</span>
<span class="notice_time">{{ notice.added }}</span>
</div>
{% endfor %}
{% endfor %}
-
- {% paginate %}
-
+ <div class="info_line show_center">
+ {% paginate %}
+ </div>
{% else %}
- <p>{% trans "No notices." %}</p>
+ <div class="info_line show_center">
+ <br />
+ {% trans "No notices." %}
+ <br />
+ <br />
+ </div>
{% endif %}
-
-
- <div class="notice_settings">
- <h2>{% trans "Settings" %}</h2>
+ </div>
+ <br />
+ <br />
+ <div class="box_item_model full_site">
+ <h3 class="title">{% trans "Settings" %}</h2>
{% url acct_email as email_url %}
{% if user.email %}
- <p>
+ <div class="info_line show_center">
+ <br />
{% trans "Primary email" %}:<br />
<b>{{ user.email }}</b><br />
- (change under <a href="{% url profile_view %}">Account</a>)
- </p>
+ (change under <a href="{% url profile_view user %}">Account</a>)
+ <br />
+ <br />
+ </div>
{% else %}
- <p>
+ <div class="info_line show_center">
+ <br />
<span class="warning">{% trans "Note" %}</span>:
- {% blocktrans %}You do not have a verified email address to which notices can be sent. You can add one by going to <a href="{{ email_url }}">Account</a>.{% endblocktrans %}
- </p>
+ You do not have a verified email address to which notices can be sent. You can add one by going to <a href="{% url profile_edit %}">Account</a>.
+ <br />
+ <br />
+ </div>
{% endif %}
<form method="POST" action=""> {# doubt this easy to do in uni-form #}
- <table class="notice_settings" cellspacing="1">
- <tr>
+ <table width="100%" class="notice_settings" cellspacing="1">
+ <tr>
<th>{% trans "Notification Type" %}</th>
{% for header in notice_settings.column_headers %}
<th>{{ header }}</th>
@@ -86,7 +104,7 @@
</tr>
{% endfor %}
<tr>
- <td><input type="submit" value="{% trans "Change" %}" /></td>
+ <td class="info_line show_center" colspan="2"><input type="submit" value="{% trans "Change" %}" /></td>
</tr>
</table>
</form>
=== added file 'templates/notification/single.html'
--- templates/notification/single.html 1970-01-01 00:00:00 +0000
+++ templates/notification/single.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,50 @@
+{% extends "notification/base.html" %}
+
+{% load humanize i18n %}
+{% load pagination_tags %}
+{% load custom_date %}
+
+{% block title %}
+{% trans "Notices "%} - Account - {{ block.super }}
+{% endblock %}
+
+{% block extra_head %}
+ <link rel="alternate" type="application/atom+xml" title="Notices Feed" href="{% url notification_feed_for_user %}" />
+ <link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}/css/notice.css" />{{ block.super}}
+{% endblock %}
+
+{% block content %}
+ {% include "django_messages/inlines/navigation.html" %}
+ <br />
+ <br />
+ <div class="box_item_model fixed_site">
+ <h3 class="title">{% trans "Notice" %}</h3>
+ <table width="100%">
+ <tr>
+ <td class="odd">Notice:</td>
+ <td class="odd">{{ notice.message|safe }}</td>
+ </tr>
+ <tr>
+ <td class="even">Notice Type:</td>
+ <td class="even">{{ notice.notice_type }}</td>
+ </tr>
+ <tr>
+ <td class="odd">Date of Notice:</td>
+ <td class="odd">{{ notice.added }}</td>
+ </tr>
+ <tr>
+ <td class="even">Notice Unseen:</td>
+ <td class="even">{{ notice.unseen }}</td>
+ </tr>
+ <tr>
+ <td class="odd">Notice Archiv:</td>
+ <td class="odd">{{ notice.archived }}</td>
+ </tr>
+ <tr>
+ <td class="even">Notice Site:</td>
+ <td class="even">{{ notice.on_site }}</td>
+ </tr>
+ </table>
+ </div>
+{% endblock %}
+
=== modified file 'templates/notification/wiki_article_edited/notice.html'
--- templates/notification/wiki_article_edited/notice.html 2009-02-20 10:11:49 +0000
+++ templates/notification/wiki_article_edited/notice.html 2010-06-14 18:46:29 +0000
@@ -1,2 +1,2 @@
-{% load i18n %}{% url profile_detail username=user.username as user_url %}
+{% load i18n %}{% url profile_view user.username as user_url %}
{% blocktrans with article.get_absolute_url as article_url %}The wiki article <a href="{{ article_url }}">{{ article }}</a> has been edited by <a href="{{ user_url }}">{{ user }}</a>.{% endblocktrans %}
=== modified file 'templates/pybb/add_post.html'
--- templates/pybb/add_post.html 2010-01-03 00:07:10 +0000
+++ templates/pybb/add_post.html 2010-06-14 18:46:29 +0000
@@ -3,9 +3,10 @@
{% load i18n %}
{% block content %}
-<br />
-<br />
-<div class="forum_item">
-{% include "pybb/inlines/add_post_form.html" %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model">
+ {% include "pybb/inlines/add_post_form.html" %}
</div>
{% endblock %}
=== modified file 'templates/pybb/delete_post.html'
--- templates/pybb/delete_post.html 2009-03-17 15:02:13 +0000
+++ templates/pybb/delete_post.html 2010-06-14 18:46:29 +0000
@@ -6,11 +6,20 @@
{% endblock %}
{% block content %}
-<h1>{% trans "Are you sure you want to delete this message?" %}</h1>
-<p class="post-preview">
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">{% trans "Are you sure you want to delete this message?" %}</h3>
+ <div class="even">
+ <p class="post-preview">
{{ post.body_html|safe }}
-</p>
-<form method="post">
- <p><input type="submit" value="{% trans "Yes, I am sure." %}" /></p>
-</form>
+ </p>
+ </div>
+ <form method="post">
+ <div class="info_line">
+ <input type="submit" value="{% trans "Yes, I am sure." %}" />
+ </div>
+ </form>
+</div>
{% endblock %}
=== modified file 'templates/pybb/edit_post.html'
--- templates/pybb/edit_post.html 2010-01-03 00:07:10 +0000
+++ templates/pybb/edit_post.html 2010-06-14 18:46:29 +0000
@@ -7,9 +7,10 @@
{% endblock %}
{% block content %}
-<br />
-<br />
-<div class="forum_item">
-{% include "pybb/inlines/add_post_form.html" %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model">
+ {% include "pybb/inlines/add_post_form.html" %}
</div>
{% endblock %}
=== modified file 'templates/pybb/forum.html'
--- templates/pybb/forum.html 2010-01-02 18:28:31 +0000
+++ templates/pybb/forum.html 2010-06-14 18:46:29 +0000
@@ -13,52 +13,58 @@
{% endblock %}
{% block content %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model">
<div class="forum-list">
- <span class="title">{{ forum }}</span>
+ <h3 class="title">{{ forum }}</h3>
<div class="index_forum">
- {% pybb_pagination _('Topics') %}
- <div class="controls">
- <a href="{% url pybb_add_topic forum.id %}">{% trans "New topic" %}</a>
- </div>
-
- <table cellspacing="1" width="100%">
- <tr align="center">
- <th width="5%"> </th>
- <th width="40%" nowrap="nowrap" align="left">Topic</th>
- <th nowrap="nowrap">Creator</th>
- <th nowrap="nowrap">At</th>
- <th nowrap="nowrap">Posts</th>
- <th nowrap="nowrap">Views</th>
- <th width="20%" nowrap="nowrap">Last Post</th>
- </tr>
-
- {# List all forums #}
- {% for topic in topics %}
- {% include "pybb/inlines/topic_row.html" %}
- {% endfor %}
+ {% pybb_pagination _('Topics') %}
+ <div class="controls">
+ <a href="{% url pybb_add_topic forum.id %}">{% trans "New topic" %}</a>
+ </div>
+
+ <table cellspacing="1" width="100%">
+ <tr align="center">
+ <th width="5%"> </th>
+ <th width="40%" nowrap="nowrap" align="left">Topic</th>
+ <th nowrap="nowrap">Creator</th>
+ <th nowrap="nowrap">At</th>
+ <th nowrap="nowrap">Posts</th>
+ <th nowrap="nowrap">Views</th>
+ <th width="20%" nowrap="nowrap">Last Post</th>
+ </tr>
+
+ {# List all forums #}
+ {% for topic in topics %}
+ {% include "pybb/inlines/topic_row.html" %}
+ {% endfor %}
</table>
- {% pybb_pagination _('Topics') %}
- <div class="controls">
- <a href="{% url pybb_add_topic forum.id %}">{% trans "New topic" %}</a>
- </div>
+ {% pybb_pagination _('Topics') %}
+ <div class="controls">
+ <a href="{% url pybb_add_topic forum.id %}">{% trans "New topic" %}</a>
+ </div>
</div>
<table class="legend">
- <tr>
- <td>
- <img src="{{MEDIA_URL}}/forum/img/folder_new.png" style=":" alt="" align="middle" />
- </td><td>= Unread posts</td>
- <td>
- <img src="{{MEDIA_URL}}/forum/img/folder.png" style="" alt="" align="middle" />
- </td><td>= No unread posts</td>
- <td>
- </tr>
+ <tr>
+ <td>
+ <img src="{{MEDIA_URL}}/forum/img/folder_new.png" style=":" alt="" align="middle" />
+ </td>
+ <td>= Unread posts</td>
+ <td>
+ <img src="{{MEDIA_URL}}/forum/img/folder.png" style="" alt="" align="middle" />
+ </td>
+ <td>= No unread posts</td>
+ <td>
+ </tr>
</table>
</div>
-
+</div>
{% endblock %}
{% comment %}
=== modified file 'templates/pybb/index.html'
--- templates/pybb/index.html 2009-03-23 20:34:20 +0000
+++ templates/pybb/index.html 2010-06-14 18:46:29 +0000
@@ -2,9 +2,13 @@
{% load pybb_extras %}
{% block content %}
- {% for category in cats %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model list_overview">
+{% for category in cats %}
{% include 'pybb/inlines/display_category.html' %}
- {% endfor %}
+{% endfor %}
<table class="legend">
<tr>
@@ -27,6 +31,6 @@
</tr>
{% endcomment %}
</table>
-
+<div>
{% endblock %}
=== modified file 'templates/pybb/inlines/add_post_form.html'
--- templates/pybb/inlines/add_post_form.html 2010-01-03 00:07:10 +0000
+++ templates/pybb/inlines/add_post_form.html 2010-06-14 18:46:29 +0000
@@ -1,5 +1,4 @@
{% load i18n %}
-
{% block extra_head %}
<script type="text/javascript" src="/wlmedia/js/disableOnSubmit.js"></script>
<script type="text/javascript">
@@ -7,42 +6,35 @@
$('form').disableOnSubmit();
});
</script>
-
{{ block.super }}
{% endblock %}
- <form class="post-form" action="{{ form_url }}" method="post" enctype="multipart/form-data">
- <div class="preview-box" style="display: none">
- <div class="header"><h3 class="title">{% trans "Preview" %}</h3></div>
- <div class="content"></div>
- </div>
- <h3 class="title">{% if forum %}
- {% trans "New topic" %}
- {% else %}
- {%if post %}
- {% trans "Edit reply" %}
- {% else %}
- {% trans "New reply" %}
- {% endif %}
- {% endif %}</h3>
- <div class="content">
- <table width="100%" colspan="1" class="text">
- <tr>
- <td width="99%">
- {{ form.as_p }}
- </td>
- <td width="1%"> </td>
- </tr>
- </table>
- </div>
- <table class="bottom_line" width="100%">
- <tr>
- <td>
- <input type="submit" value="{% trans "Submit" %}" />
- <input class="preview-button" type="button" value="{% trans "Preview" %}" />
- </td>
- </tr>
- </table>
- </form>
+ <form class="post-form" action="{{ form_url }}" method="post" enctype="multipart/form-data">
+ <div class="preview-box" style="display: none">
+ <div class="header">
+ <h3 class="title">{% trans "Preview" %}</h3>
+ </div>
+ <div class="content">
+ </div>
+ </div>
+ <h3 class="title">
+ {% if forum %}
+ {% trans "New topic" %}
+ {% else %}
+ {%if post %}
+ {% trans "Edit reply" %}
+ {% else %}
+ {% trans "New reply" %}
+ {% endif %}
+ {% endif %}
+ </h3>
+ <div class="content">
+ {{ form.as_p }}
+ </div>
+ <div class="info_line show_left">
+ <input type="submit" value="{% trans "Submit" %}" />
+ <input class="preview-button" type="button" value="{% trans "Preview" %}" />
+ </div>
+ </form>
<script type="text/javascript">
$(function() {
$('.post-form .preview-button').click(function() {
=== modified file 'templates/pybb/inlines/display_category.html'
--- templates/pybb/inlines/display_category.html 2009-03-01 09:47:33 +0000
+++ templates/pybb/inlines/display_category.html 2010-06-14 18:46:29 +0000
@@ -3,26 +3,20 @@
How to display a Forum list in the index page
{% endcomment %}
-
-<div class="index_category">
-
- <span class="title"> {{category.cat}} </span>
-
- <table cellspacing="1" width="100%">
- <tr align="center">
- <th width="5%"> </th>
- <th width="57%" nowrap="nowrap" align="left">Forum</th>
- <th width="9%" nowrap="nowrap">Topics</th>
- <th width="9%" nowrap="nowrap">Posts</th>
- <th width="20%" nowrap="nowrap">Last Post</th>
+<div class="box_item_model index_category">
+ <h3 class="title">{{category.cat}} </h3>
+ <table class="full_site" cellspacing="1">
+ <tr class="show_center" cellspacing="0">
+ <td width="5%" class="info_line show_left"> </td>
+ <td width="57%" nowrap="nowrap" class="info_line show_left">Forum</td>
+ <td width="9%" nowrap="nowrap" class="info_line show_left">Topics</td>
+ <td width="9%" nowrap="nowrap" class="info_line show_left">Posts</td>
+ <td width="20%" nowrap="nowrap" class="info_line show_left">Last Post</td>
</tr>
-
{# List all forums #}
{% for forum in category.forums %}
{% include 'pybb/inlines/forum_row.html' %}
{% endfor %}
-
</table>
-
</div>
=== modified file 'templates/pybb/inlines/forum_row.html'
--- templates/pybb/inlines/forum_row.html 2009-03-16 17:28:02 +0000
+++ templates/pybb/inlines/forum_row.html 2010-06-14 18:46:29 +0000
@@ -1,12 +1,10 @@
{% comment %}
vim:ft=htmldjango:
{% endcomment %}
-
{% load humanize %}
{% load pybb_extras %}
{% load wlprofile %}
{% load custom_date %}
-
<tr>
<td class="even" align="center" valign="middle">
{% if forum|pybb_has_unreads:user %}
=== modified file 'templates/pybb/inlines/post.html'
--- templates/pybb/inlines/post.html 2009-05-26 15:50:12 +0000
+++ templates/pybb/inlines/post.html 2010-06-14 18:46:29 +0000
@@ -8,7 +8,6 @@
{% load wiki %}
{% load wlprofile %}
{% load custom_date %}
-
<a name="post-{{ post.id }}"></a>
<table class="{% cycle "odd" "even" %}" width="100%">
<tr>
@@ -36,21 +35,40 @@
</a>
</div>
{% endif %}
- <strong>Joined:</strong> {{ post.user.date_joined|custom_date:user|title }}<br />
- <strong>Posts:</strong> {{ post.user.wlprofile.post_count }}<br />
- {% if post.user.wlprofile.location %}
- <strong>Location:</strong> {{ post.user.wlprofile.location }}<br />
- {% endif %}
+ <strong>Joined:</strong> {{ post.user.date_joined|custom_date:user|title }}<br />
+ <strong>Posts:</strong> {{ post.user.wlprofile.post_count }}<br />
+ <img src="{{ MEDIA_URL }}img/{{ post.user.wlprofile.user_status.image }}" alt="Ranking" />
+ <br />
+ <strong>{{ post.user.wlprofile.user_status.text }}</strong><br />
+ {% if post.user.wlprofile.location %}
+ <strong>Location:</strong> {{ post.user.wlprofile.location }}<br />
+ {% endif %}
+ {% if post.user.wlprofile.get_ggzstats and post.user.wlprofile.get_ggzstats.ranking %}
+ <strong>GGZ ranking:</strong> {{ post.user.wlprofile.get_ggzstats.ranking|floatformat }}<br />
+ <strong>GGZ rating:</strong> {{ post.user.wlprofile.get_ggzstats.rating|floatformat }}<br />
+ <strong>GGZ win:</strong> {{ post.user.wlprofile.get_ggzstats.wins|floatformat }}<br />
+ <strong>GGZ loses:</strong> {{ post.user.wlprofile.get_ggzstats.losses|floatformat }}<br />
+ {% endif %}
</div>
</td>
- <td width="85%" class="content">
- {{ post.body_html|safe }}
- {% if not user.is_authenticated or user.pybb_profile.show_signatures %}
- {% if post.user.pybb_profile.signature %}
- <div class="signature">
- {{ post.user.pybb_profile.signature|urlize|linebreaks }}
- </div>
- {% endif %}
+ <td width="85%" class="content top">
+ {{ post.body_html|safe|linebreaks }}
+ {% if user.is_authenticated %}
+ {% ifequal user.wlprofile.show_signatures 1 %}
+ {% if post.user.wlprofile.signature %}
+ <div class="signature">
+ <span class="line">__________________</span>
+ {{ post.user.wlprofile.signature|urlize|linebreaks }}
+ </div>
+ {% endif %}
+ {% endifequal %}
+ {% else %}
+ {% if post.user.wlprofile.signature %}
+ <div class="signature">
+ <span class="line">__________________</span>
+ {{ post.user.wlprofile.signature|urlize|linebreaks }}
+ </div>
+ {% endif %}
{% endif %}
{% if post.updated %}
<div class="updated-message"><strong>{% trans "Edited" %}:</strong> {{ post.updated|custom_date:user|title}}</div>
@@ -88,17 +106,16 @@
<img src="{{MEDIA_URL}}/forum/img/en/p_delete.png" height="26" alt ="{% trans "Delete" %}" />
</a>
{% endif %}
- {% endif %}
</div>
<div class="tools" style="float: right;">
<a href="{% url pybb_add_post topic.id %}?quote_id={{ post.id }}">
<img src="{{MEDIA_URL}}/forum/img/en/p_quote.png" height="26" alt ="{% trans "Quote" %}" />
</a>
+ {% endif %}
</div>
</td>
</tr>
</table>
-
{% comment %}
{% if post.user.pybb_profile.avatar %}
<div class="avatar">
=== modified file 'templates/pybb/inlines/topic_row.html'
--- templates/pybb/inlines/topic_row.html 2009-03-16 17:28:02 +0000
+++ templates/pybb/inlines/topic_row.html 2010-06-14 18:46:29 +0000
@@ -1,12 +1,10 @@
{% comment %}
vim:ft=htmldjango:
{% endcomment %}
-
{% load humanize %}
{% load pybb_extras %}
{% load wlprofile %}
{% load custom_date %}
-
<tr class="topic_description {% cycle "odd" "even" %}">
<td align="center" valign="middle">
{% if topic|pybb_has_unreads:user %}
=== modified file 'templates/pybb/pagination.html'
--- templates/pybb/pagination.html 2010-01-02 18:24:49 +0000
+++ templates/pybb/pagination.html 2010-06-14 18:46:29 +0000
@@ -1,20 +1,41 @@
{% load i18n %}
<div class="pagination">
-
+ <span class="summary">{{ label }} <strong>{{ page.start_index }}</strong>—<strong>{{ page.end_index }}</strong> {% trans "of" %} <strong>{{ paginator.count }}</strong> {{ label }} </span>
{% if page.has_previous %}
- <a href="{{ page.previous_link }}"><{% trans "Back" %}</a>
+ {% ifequal page.previous_page_number 1 %}
+ <a href="?page={{ page.previous_page_number }}" class="prev">‹‹ </a>
+ {% else %}
+ <a href="?page=1" class="prev">‹‹‹‹ </a>
+ <a href="?page={{ page.previous_page_number }}" class="prev">‹‹ </a>
+ {% endifequal %}
+ {% else %}
+ {% ifnotequal paginator.num_pages 1 %}
+ <span class="disabled prev">‹‹ </span>
+ {% endifnotequal %}
{% endif %}
-
-<span class="summary">{{ label }} <strong>{{ page.start_index }}</strong>—<strong>{{ page.end_index }}</strong> {% trans "of" %} <strong>{{ paginator.count }}</strong> {{ label }}
- {% if page.has_other_pages %}
- {% trans "in" %} <strong>{{ paginator.num_pages }}</strong>
- {% trans "pages" %}
- {% endif %}
- </span>
-
+ {% for pages in paginator.page_range %}
+ {% if pages %}
+ {% ifequal paginator.num_pages 1 %}
+ ...
+ {% else %}
+ {% ifequal pages page.number %}
+ <span class="current page">| {{ page.number }} |</span>
+ {% else %}
+ <a href="?page={{ pages }}" class="page">{{ pages }}</a>
+ {% endifequal %}
+ {% endifequal %}
+ {% endif %}
+ {% endfor %}
{% if page.has_next %}
- <a href="{{ page.next_link }}">{% trans "Forward" %}></a>
+ {% ifequal page.next_page_number paginator.num_pages %}
+ <a href="?page={{ page.next_page_number }}" class="next"> ››</a>
+ {% else %}
+ <a href="?page={{ page.next_page_number }}" class="next"> ››</a>
+ <a href="?page={{ paginator.num_pages }}" class="next"> ››››</a>
+ {% endifequal %}
+ {% else %}
+ {% ifnotequal paginator.num_pages 1 %}
+ <span class="disabled next"> ››</span>
+ {% endifnotequal %}
{% endif %}
-
-
</div>
=== modified file 'templates/pybb/topic.html'
--- templates/pybb/topic.html 2010-01-03 00:07:10 +0000
+++ templates/pybb/topic.html 2010-06-14 18:46:29 +0000
@@ -13,70 +13,71 @@
{% endblock %}
{% block content %}
-
-{% pybb_pagination _('Posts') %}
-
-<div class="posts">
- <a name="top" id="top"></a>
- <table cellspacing="1" width="100%">
- <tr align="center">
- <th>Author</th>
- <th width="85%" nowrap="nowrap">Message</th>
- </tr>
- </table>
-
- {% if first_post %}
- {% ifnotequal first_post posts.0 %}
- {% with first_post as post %}
- <div class="post first_post">
- {% include "pybb/inlines/post.html" %}
- </div>
- {% endwith %}
- {% endifnotequal %}
- {% endif %}
- {% for post in posts %}
- <div class="post">
- {% include "pybb/inlines/post.html" %}
- </div>
- {% endfor %}
-</div>
-
-{% pybb_pagination _('Posts') %}
-<div class="controls">
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+{% pybb_pagination _('Posts') %}
+<div class="box_item_model">
+ <div class="posts">
+ <a name="top" id="top"></a>
+ <table cellspacing="1" width="100%">
+ <tr align="center">
+ <th>Author</th>
+ <th width="85%" nowrap="nowrap">Message</th>
+ </tr>
+ </table>
+
+ {% if first_post %}
+ {% ifnotequal first_post posts.0 %}
+ {% with first_post as post %}
+ <div class="post first_post">
+ {% include "pybb/inlines/post.html" %}
+ </div>
+ {% endwith %}
+ {% endifnotequal %}
+ {% endif %}
+ {% for post in posts %}
+ <div class="post">
+ {% include "pybb/inlines/post.html" %}
+ </div>
+ {% endfor %}
+ </div>
+{% pybb_pagination _('Posts') %}
+ <div class="controls">
{% if moderator %}
- {% if topic.sticky %}
+ {% if topic.sticky %}
<a href="{% url pybb_unstick_topic topic.id %}">{% trans "Unstick topic" %}</a>
- {% else %}
+ {% else %}
<a href="{% url pybb_stick_topic topic.id %}">{% trans "Stick topic" %}</a>
- {% endif %}
+ {% endif %}
|
- {% if topic.closed %}
+ {% if topic.closed %}
<a href="{% url pybb_open_topic topic.id %}">{% trans "Open topic" %}</a>
- {% else %}
+ {% else %}
<a href="{% url pybb_close_topic topic.id %}">{% trans "Close topic" %}</a>
- {% endif %}
+ {% endif %}
|
{% endif %}
- {% comment %}
- TODO: subscribe
+
+
{% if user.is_authenticated %}
- {% if subscribed %}
+ {% if subscribed %}
<a href="{% url pybb_delete_subscription topic.id %}?from_topic">{% trans "Unsubscribe" %}</a>
- {% else %}
+ {% else %}
<a href="{% url pybb_add_subscription topic.id %}">{% trans "Subscribe" %}</a>
- {% endif %}
- {% endif %}
- {% endcomment %}
+ {% endif %}
+ {% endif %}
+
+ </div>
</div>
-
{% if user.is_authenticated %}
-{% if not topic.closed %}
-<br />
-<br />
-<div class="forum_item">
-{% include "pybb/inlines/add_post_form.html" %}
+ {% if not topic.closed %}
+<br />
+<br />
+<div class="box_item_model">
+ {% include "pybb/inlines/add_post_form.html" %}
</div>
-{% endif %}
+ {% endif %}
{% endif %}
{% endblock %}
=== added file 'templates/registration/base.html'
--- templates/registration/base.html 1970-01-01 00:00:00 +0000
+++ templates/registration/base.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+{% comment %}
+ vim:ft=htmldjango
+{% endcomment %}
+
+{% block extra_head %}
+<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}/css/register.css" />{{ block.super}}
+{% endblock %}
=== modified file 'templates/registration/login.html'
--- templates/registration/login.html 2009-02-20 11:19:12 +0000
+++ templates/registration/login.html 2010-06-14 18:46:29 +0000
@@ -1,26 +1,55 @@
+{% extends "registration/base.html" %}
-{% extends "base.html" %}
+{% block title %}
+{{ block.super }} - Login
+{% endblock %}
{% block content %}
-
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Login</h3>
{% if form.errors %}
-<p>Your username and password didn't match. Please try again.</p>
+ <div class="info_line show_center errormessage">
+ <br />
+ Your username and password didn't match.
+ <br />
+ Please try again.
+ <br />
+ <br />
+ </div>
{% endif %}
-
-<form method="post" action=".">
-<table>
-<tr>
- <td>{{ form.username.label_tag }}</td>
- <td>{{ form.username }}</td>
-</tr>
-<tr>
- <td>{{ form.password.label_tag }}</td>
- <td>{{ form.password }}</td>
-</tr>
-</table>
-
-<input type="submit" value="login" />
-<input type="hidden" name="next" value="{{ next }}" />
-</form>
-
+ <div class="info_line show_center">
+ <br />
+ <form method="post" action=".">
+ <table>
+ <tr>
+ <td>
+ {{ form.username.label_tag }}:
+ </td>
+ <td>
+ {{ form.username }}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {{ form.password.label_tag }}:
+ </td>
+ <td>
+ {{ form.password }}
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="show_right">
+ <input type="submit" value="login" />
+ <input type="hidden" name="next" value="{{ next }}" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_change_done.html'
--- templates/registration/password_change_done.html 2009-02-20 11:19:12 +0000
+++ templates/registration/password_change_done.html 2010-06-14 18:46:29 +0000
@@ -1,12 +1,27 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Change Password
+{% endblock %}
+
{% load i18n %}
-{% block title %}{% trans 'Password change successful' %} - {{ block.super }}{% endblock %}
-
{% block content %}
-
-<h1>{% trans 'Password change successful' %}</h1>
-
-<p>{% trans 'Your password was changed.' %}</p>
-
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password change successful </h3>
+ <div class="info_line">
+ <br />
+ <div class="show_center errormessage">
+ Your password was changed.
+ </div>
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_change_form.html'
--- templates/registration/password_change_form.html 2009-02-20 11:19:12 +0000
+++ templates/registration/password_change_form.html 2010-06-14 18:46:29 +0000
@@ -1,24 +1,69 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Change Password
+{% endblock %}
+
{% load i18n %}
-{% block title %}{% trans 'Password change' %} - {{block.super}}{% endblock %}
-
{% block content %}
-
-<h1>{% trans 'Password change' %}</h1>
-
-<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<form action="" method="post">
-
-{{ form.old_password.errors }}
-<p class="aligned wide"><label for="id_old_password">{% trans 'Old password:' %}</label>{{ form.old_password }}</p>
-{{ form.new_password1.errors }}
-<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
-{{ form.new_password2.errors }}
-<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
-
-<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
-</form>
-
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password change</h3>
+ <div class="info_line">
+ <br />
+ <div class="show_center errormessage">
+ Please enter your old password,
+ <br />
+ for security's sake, and then enter your new password twice so we can verify you typed it in correctly.
+ </div>
+ <div >
+ <br />
+ <form action="" method="post">
+ <table>
+ <tr>
+ <td class="show_right" width="120">
+ <label for="id_old_password">{% trans 'Old password:' %}</label>
+ </td>
+ <td>
+ {{ form.old_password }}
+ <span class="errormessage">{{ form.old_password.errors }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">
+ <label for="id_new_password1">{% trans 'New password:' %}</label>
+ </td>
+ <td>
+ {{ form.new_password1 }}
+ <span class="errormessage">{{ form.new_password1.errors }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">
+ <label for="id_new_password2">{% trans 'Confirm password:' %}</label>
+ </td>
+ <td>
+ {{ form.new_password2 }}
+ <span class="errormessage">{{ form.new_password2.errors }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td>
+ <input type="submit" value="{% trans 'Change my password' %}" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ <br />
+ </div>
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_reset_complete.html'
--- templates/registration/password_reset_complete.html 2009-02-20 11:25:20 +0000
+++ templates/registration/password_reset_complete.html 2010-06-14 18:46:29 +0000
@@ -1,12 +1,27 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Change Password
+{% endblock %}
+
{% load i18n %}
-{% block title %}{% trans 'Password reset complete' %}{% endblock %}
-
{% block content %}
-
-<h1>{% trans 'Password reset complete' %}</h1>
-
-<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
-
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password reset complete</h3>
+ <div class="info_line">
+ <br />
+ <div>
+ Your password has been set. You may go ahead and log in now.
+ </div>
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_reset_confirm.html'
--- templates/registration/password_reset_confirm.html 2009-02-20 11:23:56 +0000
+++ templates/registration/password_reset_confirm.html 2010-06-14 18:46:29 +0000
@@ -1,30 +1,44 @@
{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Reset Password
+{% endblock %}
+
{% load i18n %}
-{% block title %}{% trans 'Password reset' %}{% endblock %}
-
{% block content %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password reset</h3>
+ <div class="info_line">
+ <br />
{% if validlink %}
-
-<h1>{% trans 'Enter new password' %}</h1>
-
-<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<form action="" method="post">
-{{ form.new_password1.errors }}
-<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
-{{ form.new_password2.errors }}
-<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
-<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
-</form>
-
+ <div class="show_center errormessage">
+ Please enter your new password twice so we can verify you typed it in correctly.
+ </div>
+ <div>
+ <br />
+ <form action="" method="post">
+ {{ form.new_password1.errors }}
+ <p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
+ {{ form.new_password2.errors }}
+ <p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
+ <p><input type="submit" value="{% trans 'Change my password' %}" /></p>
+ </form>
+ <br />
+ </div>
{% else %}
-
-<h1>{% trans 'Password reset unsuccessful' %}</h1>
-
-<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
-
+ <div class="show_center errormessage">
+ The password reset link was invalid, possibly because it has already been used. Please request a new password reset.
+ </div>
{% endif %}
-
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_reset_done.html'
--- templates/registration/password_reset_done.html 2009-02-20 11:19:12 +0000
+++ templates/registration/password_reset_done.html 2010-06-14 18:46:29 +0000
@@ -1,12 +1,27 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Reset Password
+{% endblock %}
+
{% load i18n %}
-{% block title %}{% trans 'Password reset successful' %}{% endblock %}
-
{% block content %}
-
-<h1>{% trans 'Password reset successful' %}</h1>
-
-<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
-
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password reset successful</h3>
+ <div class="info_line">
+ <br />
+ <div class="show_center errormessage">
+ We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly.
+ </div>
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/password_reset_form.html'
--- templates/registration/password_reset_form.html 2009-02-20 11:19:12 +0000
+++ templates/registration/password_reset_form.html 2010-06-14 18:46:29 +0000
@@ -1,19 +1,40 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
+
+{% block title %}
+{{ block.super }} - Register
+{% endblock %}
+
{% load i18n %}
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset' %}</div>{% endblock %}
-
-{% block title %}{% trans "Password reset" %}{% endblock %}
-
{% block content %}
-
-<h1>{% trans "Password reset" %}</h1>
-
-<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
-
-<form action="" method="post">
-{{ form.email.errors }}
-<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
-</form>
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Password reset</h3>
+ <div class="info_line">
+ <br />
+ <div class="show_center errormessage">
+ Forgotten your password?
+ <br />
+ Enter your e-mail address below,
+ <br />
+ and we'll e-mail instructions for setting a new one.
+ </div>
+ <div class="show_right">
+ <br />
+ <form action="" method="post">
+ {{ form.email.errors }}
+ <label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }}
+ <input type="submit" value="{% trans 'Reset my password' %}" />
+ </form>
+ <br />
+ </div>
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/registration/registration_complete.html'
--- templates/registration/registration_complete.html 2009-02-20 10:11:49 +0000
+++ templates/registration/registration_complete.html 2010-06-14 18:46:29 +0000
@@ -1,13 +1,24 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
+{% comment %}
+vim:ft=htmldjango:
+{% endcomment %}
{% block title %}
-registration_complete.html | {{ block.super }}
-{% endblock %}
-
-{% block header %}
-<h1>registration_complete.html</h1>
+{{ block.super }} - Registration complete
{% endblock %}
{% block content %}
-Thank you for signing up. An email with the activation code has been send to your inbox.
-{% endblock %}
\ No newline at end of file
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Registration</h3>
+ <div class="info_line">
+ <br />
+ <div class="show_center errormessage">
+ Thank you for signing up. An email with the activation code has been send to your inbox.
+ </div>
+ </div>
+</div>
+{% endblock %}
=== modified file 'templates/registration/registration_form.html'
--- templates/registration/registration_form.html 2009-03-03 13:46:05 +0000
+++ templates/registration/registration_form.html 2010-06-14 18:46:29 +0000
@@ -1,4 +1,4 @@
-{% extends "base.html" %}
+{% extends "registration/base.html" %}
{% comment %}
vim:ft=htmldjango:
{% endcomment %}
@@ -8,57 +8,85 @@
{% endblock %}
{% block content %}
-<form action="{% url registration_register %}" method="POST">
-<table>
-<tr>
- <td align="right" valign="top">Username:</td>
- <td>
- {{ registration_form.username }} <br/>
- {% for error in registration_form.username.errors %}
- <span class="errormessage">{{ error }}</span>
- {% endfor %}
- </td>
-</tr>
-<tr>
- <td align="right" valign="top">Email:</td>
- <td>
- {{ registration_form.email }} <br/>
- {% for error in registration_form.email.errors %}
- <span class="errormessage">{{ error }}</span>
- {% endfor %}
- </td>
-</tr>
-<tr>
- <td align="right" valign="top">Password:</td>
- <td>
- {{ registration_form.password1 }} <br/>
- {% for error in registration_form.password1.errors %}
- <span class="errormessage">{{ error }}</span>
- {% endfor %}
- </td>
-</tr>
-<tr>
- <td align="right" valign="top">Password (again):</td>
- <td>
- {{ registration_form.password2 }} <br/>
- {% for error in registration_form.password2.errors %}
- <span class="errormessage">{{ error }}</span>
- {% endfor %}
- </td>
-</tr>
-<tr align="right">
- <td align="right" valign="top">Prove that you're no spambot:</td>
- <td>
- {{ registration_form.captcha|safe }} <br/>
- {% for error in registration_form.captcha.errors %}
- <span class="errormessage">{{ error }}</span>
- {% endfor %}
- </td>
-</tr>
-<tr>
- <td> </td>
- <td><input type="submit" value="Register" /></td>
-</tr>
-</table>
-</form>
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Registration</h3>
+ <div class="info_line">
+ <br />
+ <form action="{% url registration_register %}" method="POST">
+ <table>
+ <tr>
+ <td class="show_right">Username:</td>
+ <td class="show_left">
+ {{ registration_form.username }}
+ <br/>
+ {% for error in registration_form.username.errors %}
+ <span class="errormessage">
+ {{ error }}
+ </span>
+ {% endfor %}
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">Email:</td>
+ <td class="show_left">
+ {{ registration_form.email }}
+ <br/>
+ {% for error in registration_form.email.errors %}
+ <span class="errormessage">
+ {{ error }}
+ </span>
+ {% endfor %}
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">Password:</td>
+ <td class="show_left">
+ {{ registration_form.password1 }}
+ <br/>
+ {% for error in registration_form.password1.errors %}
+ <span class="errormessage">
+ {{ error }}
+ </span>
+ {% endfor %}
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">Password (again):</td>
+ <td class="show_left">
+ {{ registration_form.password2 }}
+ <br/>
+ {% for error in registration_form.password2.errors %}
+ <span class="errormessage">
+ {{ error }}
+ </span>
+ {% endfor %}
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right">Prove that you're no spambot:</td>
+ <td class="show_left">
+ {{ registration_form.captcha|safe }}
+ <br/>
+ {% for error in registration_form.captcha.errors %}
+ <span class="errormessage">
+ {{ error }}
+ </span>
+ {% endfor %}
+ </td>
+ </tr>
+ <tr>
+ <td class="show_right"> </td>
+ <td class="show_left">
+ <input type="submit" value="Register" />
+ </td>
+ </tr>
+ </table>
+ </form>
+ <br />
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/right_boxes.html'
--- templates/right_boxes.html 2010-04-17 09:18:27 +0000
+++ templates/right_boxes.html 2010-06-14 18:46:29 +0000
@@ -3,7 +3,6 @@
This file is included by mainpage and contains all the left menu boxes
on the site
-
{% endcomment %}
{% load inbox %}
{% load i18n %}
@@ -29,10 +28,10 @@
Help us to pay our Server!<br/>(: Consider a donation :) <br/><br/>
<div>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
- <input type="hidden" name="cmd" value="_s-xclick">
- <input type="hidden" name="hosted_button_id" value="JH5R7YHSVRMRG">
- <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
- <img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1">
+ <input type="hidden" name="cmd" value="_s-xclick" />
+ <input type="hidden" name="hosted_button_id" value="JH5R7YHSVRMRG" />
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" />
+ <img alt="" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
</div>
@@ -51,7 +50,7 @@
</p>
<p>
- <a href="/accounts/logout/next={{request.path}}">Logout</a>
+ <a href="/accounts/logout/next={{ request.path }}">Logout</a>
</p>
</div>
@@ -107,6 +106,4 @@
<div class="box_content">
{% online_users 10 %}
</div>
-
-
=== modified file 'templates/threadedcomments/inlines/comments.html'
--- templates/threadedcomments/inlines/comments.html 2010-04-17 09:17:23 +0000
+++ templates/threadedcomments/inlines/comments.html 2010-06-14 18:46:29 +0000
@@ -27,36 +27,42 @@
{% endif %}
</div>
{% endfor %}
- {% if user.is_authenticated %}
<br />
<br />
- <div class="news_item">
- <h3 class="title">Reply to Original:</h3>
- <form method="POST" action="{% get_comment_url object %}?next={{object.get_absolute_url}}">
- <div class="content">
- <table class="text" width="100%">
- <tr>
- <td width="99%">
- <span class=errorclass">{{ form.comment.errors }}</span>
- {{ form.comment }}
- </td>
- <td width="1%"></td>
- </tr>
- </table>
- </div>
- <table class="bottom_line" width="100%">
- <tr>
- <td class="admin">
- <input type="hidden" name="markup" value="1" />
- <input type="hidden" value="next" value="{{ object.get_absolute_url }}" />
- <input type="submit" value="Submit Comment" />
- </td>
- </tr>
- </table>
- </form>
- </div>
+ <div class="box_item_model fixed_site">
+ {% if user.is_authenticated %}
+ <h3 class="title">Reply to Original:</h3>
+ <form method="POST" action="{% get_comment_url object %}?next={{object.get_absolute_url}}">
+ <div class="content">
+ <table class="text full_site">
+ <tr>
+ <td width="99%">
+ <span class="errormessage">{{ form.comment.errors }}</span>
+ {{ form.comment }}
+ </td>
+ <td width="1%"></td>
+ </tr>
+ </table>
+ </div>
+ <table class="info_line full_site">
+ <tr>
+ <td class="show_center">
+ <input type="hidden" name="markup" value="1" />
+ <input type="hidden" value="next" value="{{ object.get_absolute_url }}" />
+ <input type="submit" value="Submit Comment" />
+ </td>
+ </tr>
+ </table>
+ </form>
{% else %}
- <p>Log in to post comments</p>
+ <h3 class="title">Comments</h3>
+ <div class="info_line errormessage show_center">
+ <br />
+ !!! Log in to post comments !!!
+ <br />
+ <br />
+ </div>
{% endif %}
+ </div>
=== modified file 'templates/threadedcomments/preview_comment.html'
--- templates/threadedcomments/preview_comment.html 2010-01-04 21:48:27 +0000
+++ templates/threadedcomments/preview_comment.html 2010-06-14 18:46:29 +0000
@@ -7,24 +7,22 @@
<div id="comment_preview">{% auto_transform_markup comment %}</div>
{% endif %}
<form method="POST" action="">
- <div class="content">
+ <div class="content">
<table class="text" width="100%">
- <tr>
- <td width="99%">
- <span class=errorclass">{{ form.comment.errors }}</span>
- {{ form.comment }}
- </td>
- <td width="1%"></td>
- </tr>
+ <tr>
+ <td width="99%">
+ <span class="errormessage">{{ form.comment.errors }}</span>
+ {{ form.comment }}
+ </td>
+ <td width="1%"></td>
+ </tr>
+ <tr>
+ <td class="bottom_line show_center">
+ <input type="hidden" name="markup" value="1" />
+ <input type="submit" value="Submit Comment" />
+ </td>
+ </tr>
</table>
- </div>
- <table class="bottom_line" width="100%">
- <tr>
- <td class="admin">
- <input type="hidden" name="markup" value="1" />
- <input type="submit" value="Submit Comment" />
- </td>
- </tr>
- </table>
- </form>
+ </div>
+ </form>
{% endblock %}
=== added directory 'templates/wlggz'
=== added file 'templates/wlggz/base.html'
--- templates/wlggz/base.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/base.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,12 @@
+{% extends "base.html" %}
+{% comment %}
+ vim:ft=htmldjango
+{% endcomment %}
+
+{% block title %}
+GGZ statistics - {{ block.super }}
+{% endblock %}
+
+{% block extra_head %}
+<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}/css/ggz.css" />{{ block.super}}
+{% endblock %}
=== added file 'templates/wlggz/edit_ggz.html'
--- templates/wlggz/edit_ggz.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/edit_ggz.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,43 @@
+{% extends "wlggz/base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">{% trans "Set GGZ password" %}</h3>
+ <form method="post" enctype="multipart/form-data">
+ <div class="content">
+ <table cellspacing="1" class="text full_site">
+ {% if profile_form.errors %}
+ <tr>
+ <td class="even" colspan="2">{{ profile_form.errors }}</td>
+ </tr>
+ {% endif %}
+ {% for field in ggz_form %}
+ <tr>
+ {% if field.errors %}
+ <td colspan="2" class="{% cycle "odd" "even" %}">
+ <div class="errormessage">{{ field.errors }}</div>
+ </td>
+ </tr>
+ <tr>
+ {% endif %}
+ <td class="{% cycle "odd" "even" %}">{{ field.label_tag }}:</td>
+ <td class="{% cycle "odd" "even" %}">{{ field }}
+ {% ifequal field.name "time_display" %}
+ <a href="/wiki/HomepageDocuTimeDisplay">Documented here</a>
+ {% endifequal %}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="info_line">
+ <input type="submit" value="{% trans "Save" %}" />
+ </div>
+ </form>
+</div>
+{% endblock %}
=== added file 'templates/wlggz/view_ggz_highscore.html'
--- templates/wlggz/view_ggz_highscore.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/view_ggz_highscore.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,43 @@
+{% extends "wlggz/base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% load custom_date %}
+{% load wlprofile %}
+
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Top ten widelands players</h3>
+ <table cellspacing="1" class="text full_site">
+ <tr>
+ <td>User</td>
+ <td>ranking</td>
+ <td>rating</td>
+ <td>wins</td>
+ <td>losses</td>
+ </tr>
+ {% for userstat in ggzstats %}
+ <tr>
+ <td class="{% cycle "odd" "even" %}"><a href="{% url wlggz_userstats userstat.handle %}">{{ userstat.handle }}</a></td>
+ <td class="{% cycle "odd" "even" %}"> {{ userstat.ranking|floatformat }} </td>
+ <td class="{% cycle "odd" "even" %}"> {{ userstat.rating|floatformat }} </td>
+ <td class="{% cycle "odd" "even" %}"> {{ userstat.wins|floatformat }} </td>
+ <td class="{% cycle "odd" "even" %}"> {{ userstat.losses|floatformat }} </td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td class="even show_center" colspan="5">
+ <br />
+ <b>Sorry, no ranking yet</b>
+ <br />
+ <br />
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+</div>
+{% endblock %}
=== added file 'templates/wlggz/view_ggz_matches.html'
--- templates/wlggz/view_ggz_matches.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/view_ggz_matches.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,47 @@
+{% extends "wlggz/base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% load custom_date %}
+{% load wlprofile %}
+
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">Last 10 matches</h3>
+ <table cellspacing="1" class="text full_site">
+ <tr>
+ <td class="ggz_date">Date</td>
+ <td class="ggz_winner">Winner</td>
+ <td class="ggz_vs">Participants</td>
+ </tr>
+ {% for match in ggzmatches %}
+ <tr>
+ <td class="{% cycle "odd" "even" %}">{{ match.date_date }}</td>
+ <td class="{% cycle "odd" "even" %}">
+ {% if match.winner %}
+ {{ match.winner|user_link_ggz }}
+ {% endif %}
+ </td>
+ <td class="{% cycle "odd" "even" %}">
+ {% for player in match.wlggz_matchplayers.all %}
+ {{ player.handle|user_link_ggz }}
+ {% endfor %}
+ </td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td class="even show_center" colspan="3">
+ <br />
+ <b>Sorry, no matches yet</b>
+ <br />
+ <br />
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+</div>
+{% endblock %}
=== added file 'templates/wlggz/view_ggz_overview.html'
--- templates/wlggz/view_ggz_overview.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/view_ggz_overview.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,27 @@
+{% extends "wlggz/base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% load custom_date %}
+
+{% include "django_messages/inlines/navigation.html" %}
+<br />
+<br />
+<div class="box_item_model fixed_site">
+ <h3 class="title">{% trans "Available Links" %}</h3>
+ <div class="info_line show_left">
+ <br />
+ <a href="{% url wlggz_matches %}">Last matches</a><br />
+ <a href="{% url wlggz_ranking %}">GGZ ranking</a><br />
+ <br />
+ {% if user.is_authenticated %}
+ <a href="{% url wlggz_userstats %}">View your ggz statistics</a><br />
+ <a href="{% url wlggz_userinfo %}">About your ggz account</a><br />
+ <a href="{% url wlggz_changepw %}">Change your ggz password</a><br />
+ <br />
+ {% endif %}
+ </div>
+</div>
+
+{% endblock %}
=== added file 'templates/wlggz/view_ggz_test.html'
--- templates/wlggz/view_ggz_test.html 1970-01-01 00:00:00 +0000
+++ templates/wlggz/view_ggz_test.html 2010-06-14 18:46:29 +0000
@@ -0,0 +1,106 @@
+{% extends "wlggz/base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% load custom_date %}
+{% load wlprofile %}
+
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+
+{% if ggzauth.user %}
+ <div class="box_item_model fixed_site">
+ <h3 class="title">{% trans "GGZ results for" %} {{ ggzauth.user.username }}</h3>
+ <table class="info_line full_site">
+ <tr><td class="ggz_stats">Last ggz login:</td><td class="show_left"> {{ ggzauth.lastlogin }}</td></tr>
+ <tr><td class="ggz_stats">Ranking:</td><td class="show_left"> {{ ggzstats.ranking }}</td></tr>
+ <tr><td class="ggz_stats">Rating:</td><td class="show_left"> {{ ggzstats.rating|floatformat }}</td></tr>
+ <tr><td class="ggz_stats">wins:</td><td class="show_left"> {{ ggzstats.wins }}</td></tr>
+ <tr><td class="ggz_stats">losses:</td><td class="show_left"> {{ ggzstats.losses }}</td></tr>
+ </table>
+ </div>
+ <br />
+ <br />
+
+ <div class="box_item_model fixed_site">
+ <h3 class="title">Last 10 matches of {{ ggzauth.user.username }}</h3>
+ {% if ggzmatches %}
+ <table width="100%" cellspacing="1" class="text">
+ <tr>
+ <td class="ggz_date">Date</td>
+ <td class="ggz_winner">Winner</td>
+ <td class="ggz_vs">Participants</td>
+ </tr>
+ {% for match in ggzmatches %}
+ <tr>
+ <td class="{% cycle "odd" "even" %}">{{ match.match.date_date }}</td>
+ <td class="{% cycle "odd" "even" %}">
+ {% if match.match.winner %}
+ {{ match.match.winner|user_link_ggz }}
+ {% endif %}
+ </td>
+ <td class="{% cycle "odd" "even" %}">
+ {% for player in match.match.wlggz_matchplayers.all %}
+ {{ player.handle|user_link_ggz }}
+ {% endfor %}
+ </td class="{% cycle "odd" "even" %}">
+ </tr>
+ {% endfor %}
+ </table>
+ {% else %}
+ <div class="info_line show_center">
+ <br />
+ <b>User has not participated in any matches</b>
+ <br />
+ <br />
+ </div>
+ {% endif %}
+ </div>
+ <br />
+ <br />
+ <div class="box_item_model fixed_site">
+ <h3 class="title">Last 10 matches {{ ggzauth.user.username }} won</h3>
+ {% if ggzwonmatches %}
+ <table cellspacing="1" class="text full_site">
+ <tr>
+ <td class="ggz_date">Date</td>
+ <td class="ggz_winner">Winner</td>
+ <td class="ggz_vs">Participants</td>
+ </tr>
+ {% for match in ggzwonmatches %}
+ <tr>
+ <td class="{% cycle "odd" "even" %}">{{ match.date_date }}</td>
+ <td class="{% cycle "odd" "even" %}">{{ match.winner|user_link_ggz }}</td>
+ <td class="{% cycle "odd" "even" %}">
+ {% for player in match.wlggz_matchplayers.all %}
+ {{ player.handle|user_link_ggz }}
+ {% endfor %}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% else %}
+ <div class="info_line show_center">
+ <br />
+ <b>User has won no matches</b>
+ <br />
+ <br />
+ </div>
+ {% endif %}
+ </div>
+{% else %}
+ <div class="box_item_model">
+ <h3 class="title">{% trans "GGZ results for" %} {{ ggzauth.user.username }}</h3>
+ <div class="info_line show_center">
+ <br />
+ <b class="errormessage">User does not exist or has no ggz account
+ <br />
+ <br />
+ </table>
+ </div>
+{% endif %}
+
+{% endblock %}
=== modified file 'templates/wlprofile/edit_profile.html'
--- templates/wlprofile/edit_profile.html 2010-01-02 21:19:28 +0000
+++ templates/wlprofile/edit_profile.html 2010-06-14 18:46:29 +0000
@@ -4,11 +4,11 @@
{% block content %}
{% ifequal user profile.user %}
- {% include "messages/inlines/navigation.html" %}
+ {% include "django_messages/inlines/navigation.html" %}
{% endifequal %}
<br />
<br />
-<div class="profile_item">
+<div class="box_item_model fixed_site">
<h3 class="title">{% trans "Profile editing" %}</h3>
<div class="content">
{% if profile.avatar %}
@@ -25,29 +25,54 @@
{% endif %}
{% for field in profile_form %}
+ {% if field.errors %}
<tr>
- {% if field.errors %}
<td colspan="2" class="{% cycle "odd" "even" %}">
<div class="errormessage">{{ field.errors }}</div>
</td>
</tr>
+ {% endif %}
+ {% ifequal field.name "delete_avatar" %}
+ {% if profile.avatar %}
<tr>
+ <td class="{% cycle "odd" "even" %}">{{ field.label_tag }}:</td>
+ <td class="{% cycle "odd" "even" %}">{{ field }}
+ </tr>
{% endif %}
- <td {% ifequal field.name "signature" %} valign="top" {% endifequal %}class="{% cycle "odd" "even" %}">{{ field.label_tag }}:</td>
- <td class="{% cycle "odd" "even" %}">{{ field }}
+ {% else %}
+ <tr>
+ <td class="{% cycle "odd" "even" %} {%ifequal field.name "signature" %}show_left{% endifequal %}">{{ field.label_tag }}:</td>
+ <td class="{% cycle "odd" "even" %}">{{ field }}
{% ifequal field.name "time_display" %}
<a href="/wiki/HomepageDocuTimeDisplay">Documented here</a>
{% endifequal %}
</td>
</tr>
+ {% endifequal %}
{% endfor %}
</table>
- </div>
- <table class="bottom_line" width="100%">
- <tr>
- <td><input type="submit" value="{% trans "Save" %}" /></td>
- </tr>
- </table>
+ </div>
+ <div class="info_line">
+ <input type="submit" value="{% trans "Save" %}" />
+ </div>
</form>
</div>
+<br />
+<div class="box_item_model fixed_site">
+ <div class="info_line show_left">
+ <a href="{% url auth_change_password %}">Change website password</a>
+ <br />
+ <br />
+ <b class="errormessage">WARNING: Passwords are transmitted in cleartext.</b>
+ </div>
+</div>
+<br />
+<div class="box_item_model fixed_site">
+ <div class="info_line show_left">
+ <a href="{% url wlggz_changepw %}">Change online lobby password</a>
+ <br />
+ <br />
+ <b class="errormessage">WARNING: GGZ transmitts the password in cleartext. Choose a different password for online gaming.</b>
+ </div>
+</div>
{% endblock %}
=== modified file 'templates/wlprofile/view_profile.html'
--- templates/wlprofile/view_profile.html 2010-01-03 14:37:49 +0000
+++ templates/wlprofile/view_profile.html 2010-06-14 18:46:29 +0000
@@ -5,18 +5,17 @@
{% block content %}
{% load custom_date %}
-{% ifequal user profile.user %}
-{% include "messages/inlines/navigation.html" %}
-{%endifequal%}
-<br />
-<br />
-<div class="profile_item">
+{% include "django_messages/inlines/navigation.html" %}
+
+<br />
+<br />
+<div class="box_item_model fixed_site">
<h3 class="title">{% trans "View Profile" %}</h3>
<div class="content">
{% if profile.avatar %}
<img src="{{ profile.avatar.url }}" />
{% endif %}
- <table width="100%" cellspacing="1" class="text">
+ <table cellspacing="1" class="text full_site">
<tr>
<td class="odd">User:</td>
<td class="odd">{{ profile.user.username }}</td>
@@ -57,14 +56,19 @@
<td class="even">Yahoo:</td>
<td class="even">{{ profile.yahoo }}</td>
</tr>
+ <tr>
+ <td class="odd show_left">Signature:</td>
+ <td class="odd show_left">{{ profile.signature|urlize|linebreaks }}</td>
+ </tr>
{% ifequal user profile.user %}
<tr>
- <td class="odd">Email:</td>
- <td class="odd">{{ profile.user.email }}</td>
+ <td class="even">Email:</td>
+ <td class="even">{{ profile.user.email }}</td>
</tr>
{% endifequal %}
</table>
</div>
+{% comment %}
<table class="bottom_line" width="100%">
<tr>
<td>
@@ -76,5 +80,13 @@
</td>
</tr>
</table>
+<table class="bottom_line" width="100%">
+ <tr>
+ <td>
+ <a href="{% url wlggz_userstats profile.user %}">View GGZ Statistics of this user</a>
+ </td>
+ </tr>
+</table>
+{% endcomment %}
</div>
{% endblock %}
=== modified file 'urls.py'
--- urls.py 2010-03-14 14:13:24 +0000
+++ urls.py 2010-06-14 18:46:29 +0000
@@ -22,6 +22,7 @@
# Django builtin / Registration
(r'^accounts/logout/(next=(?P<next_page>.*))?$', 'django.contrib.auth.views.logout'),
url (r'^accounts/register/$', 'mainpage.views.register', name='registration_register'),
+ url(r'^accounts/changepw/$', 'django.contrib.auth.views.password_change', name="auth_change_password"),
(r'^accounts/', include('registration.backends.default.urls')),
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
@@ -49,6 +50,7 @@
url(r'^poll/', include("wlpoll.urls")),
url(r'^maps/', include("wlmaps.urls")),
url(r'^screenshots/', include("wlscreens.urls")),
+ url(r'^ggz/', include("wlggz.urls")),
)
try:
=== modified file 'wiki/feeds.py'
--- wiki/feeds.py 2010-01-01 21:35:23 +0000
+++ wiki/feeds.py 2010-06-14 18:46:29 +0000
@@ -9,15 +9,16 @@
from django.template.loader import get_template
from wiki.models import ChangeSet, Article
from wiki.utils import get_ct
-import notification.atomformat as atom
+from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
ALL_ARTICLES = Article.objects.all()
ALL_CHANGES = ChangeSet.objects.all()
class RssHistoryFeed(Feed):
+ feed_type = Rss201rev2Feed
title = 'History for all articles'
- link = '/wiki/'
+ link = '/wiki/feeds/rss'
description = 'Recent changes in wiki'
def __init__(self, request,
@@ -49,37 +50,21 @@
"""
return item.modified
-
-class AtomHistoryFeed(atom.Feed):
-
- feed_title = 'History for all articles'
+ def item_author_name(self, item):
+ """
+ Takes the object returned by get_object and returns the feeds's
+ auhor's name as a Python string
+ """
+ if item.is_anonymous_change():
+ return _("Anonymous")
+ return item.editor.username
+
+
+class AtomHistoryFeed(RssHistoryFeed):
+
+ feed_type = Atom1Feed
feed_subtitle = 'Recent changes in wiki'
-
- def __init__(self, request,
- group_slug=None, group_slug_field=None, group_qs=None,
- article_qs=ALL_ARTICLES, changes_qs=ALL_CHANGES,
- extra_context=None,
- title_template = u'feeds/history_title.html',
- description_template = u'feeds/history_description.html',
- *args, **kw):
-
- if group_slug is not None:
- group = get_object_or_404(group_qs,
- **{group_slug_field : group_slug})
- self.changes_qs = changes_qs.filter(article__content_type=get_ct(group),
- article__object_id=group.id)
- else:
- self.changes_qs = changes_qs
-
- self.title_template = get_template(title_template)
- self.description_template = get_template(description_template)
- super(AtomHistoryFeed, self).__init__('', request)
-
- def feed_id(self):
- return "feed_id"
-
- def items(self):
- return self.changes_qs.order_by('-modified')[:30]
+ link = '/wiki/feeds/atom'
def item_id(self, item):
return "%s" % item.id
@@ -103,9 +88,19 @@
c = Context({'obj' : item,})
return ({'type': 'html'}, self.description_template.render(c))
+ def item_author_name(self, item):
+ """
+ Takes the object returned by get_object and returns the feeds's
+ auhor's name as a Python string
+ """
+ if item.is_anonymous_change():
+ return _("Anonymous")
+ return item.editor.username
+
class RssArticleHistoryFeed(Feed):
+ feed_type = Rss201rev2Feed
def __init__(self, title, request,
group_slug=None, group_slug_field=None, group_qs=None,
article_qs=ALL_ARTICLES, changes_qs=ALL_CHANGES,
@@ -150,27 +145,8 @@
return item.modified
-class AtomArticleHistoryFeed(atom.Feed):
-
- def __init__(self, title, request,
- group_slug=None, group_slug_field=None, group_qs=None,
- article_qs=ALL_ARTICLES, changes_qs=ALL_CHANGES,
- extra_context=None,
- title_template = u'feeds/history_title.html',
- description_template = u'feeds/history_description.html',
- *args, **kw):
-
- if group_slug is not None:
- group = get_object_or_404(group_qs,
- **{group_slug_field : group_slug})
- self.article_qs = article_qs.filter(content_type=get_ct(group),
- object_id=group.id)
- else:
- self.article_qs = article_qs
-
- self.title_template = get_template(title_template)
- self.description_template = get_template(description_template)
- super(AtomArticleHistoryFeed, self).__init__('', request)
+class AtomArticleHistoryFeed(RssArticleHistoryFeed):
+ feed_type = Atom1Feed
def get_object(self, bits):
# We work around a bug here which is likely in atomformat.py;
@@ -190,9 +166,6 @@
def feed_id(self):
return "feed_id"
- def items(self, obj):
- return ChangeSet.objects.filter(article__id__exact=obj.id).order_by('-modified')[:30]
-
def item_id(self, item):
return "%s" % item.id
=== added directory 'wlggz'
=== added file 'wlggz/__init__.py'
=== added file 'wlggz/admin.py'
--- wlggz/admin.py 1970-01-01 00:00:00 +0000
+++ wlggz/admin.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,27 @@
+#!/usr/bin/env python -tt
+# encoding: utf-8
+#
+# File: wlggz/admin.py
+#
+# Created 2010-06-03 by Timo Wingender <timo.wingender@xxxxxx>
+#
+# Last Modified: $Date$
+#
+
+from django.utils.translation import ugettext_lazy as _
+from django.contrib import admin
+from models import GGZAuth
+
+class GGZAdmin(admin.ModelAdmin):
+ list_display = ['user', 'password', 'permissions', 'lastlogin']
+ list_per_page = 20
+ ordering = ['-user']
+ search_fields = ['user__username', 'user__first_name', 'user__last_name']
+ fieldsets = (
+ (None, {
+ 'fields': ('user', 'password', 'permissions')
+ }
+ ),
+ )
+
+admin.site.register(GGZAuth, GGZAdmin)
=== added file 'wlggz/fields.py'
--- wlggz/fields.py 1970-01-01 00:00:00 +0000
+++ wlggz/fields.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,85 @@
+"""
+Details about AutoOneToOneField:
+ http://softwaremaniacs.org/blog/2007/03/07/auto-one-to-one-field/
+"""
+
+from StringIO import StringIO
+import logging
+
+from django.db.models import OneToOneField
+from django.db.models.fields.related import SingleRelatedObjectDescriptor
+from django.db import models
+from django.core.files.uploadedfile import SimpleUploadedFile
+
+
+class AutoSingleRelatedObjectDescriptor(SingleRelatedObjectDescriptor):
+ def __get__(self, instance, instance_type=None):
+ try:
+ return super(AutoSingleRelatedObjectDescriptor, self).__get__(instance, instance_type)
+ except self.related.model.DoesNotExist:
+ obj = self.related.model(**{self.related.field.name: instance})
+ obj.save()
+ return obj
+
+
+class AutoOneToOneField(OneToOneField):
+ """
+ OneToOneField creates dependent object on first request from parent object
+ if dependent oject has not created yet.
+ """
+
+ def contribute_to_related_class(self, cls, related):
+ setattr(cls, related.get_accessor_name(), AutoSingleRelatedObjectDescriptor(related))
+ #if not cls._meta.one_to_one_field:
+ #cls._meta.one_to_one_field = self
+
+
+class ExtendedImageField(models.ImageField):
+ """
+ Extended ImageField that can resize image before saving it.
+ """
+ def __init__(self, *args, **kwargs):
+ self.width = kwargs.pop('width', None)
+ self.height = kwargs.pop('height', None)
+ super(ExtendedImageField, self).__init__(*args, **kwargs)
+
+
+ def save_form_data(self, instance, data):
+ if data and self.width and self.height:
+ if instance.avatar:
+ instance.avatar.delete()
+
+ content = self.resize_image(data.read(), width=self.width, height=self.height)
+ data = SimpleUploadedFile(instance.user.username + ".png", content, data.content_type)
+ super(ExtendedImageField, self).save_form_data(instance, data)
+
+
+ def resize_image(self, rawdata, width, height):
+ """
+ Resize image to fit it into (width, height) box.
+ """
+
+ try:
+ import Image
+ except ImportError:
+ from PIL import Image
+
+ image = Image.open(StringIO(rawdata))
+ try:
+ oldw, oldh = image.size
+
+ if oldw > width or oldh > height:
+ if oldw >= oldh:
+ x = int(round((oldw - oldh) / 2.0))
+ image = image.crop((x, 0, (x + oldh) - 1, oldh - 1))
+ else:
+ y = int(round((oldh - oldw) / 2.0))
+ image = image.crop((0, y, oldw - 1, (y + oldw) - 1))
+ image = image.resize((width, height), resample=Image.ANTIALIAS)
+ except Exception, err:
+ logging.error(err)
+ return ''
+
+ string = StringIO()
+ image.save(string, format='PNG')
+ return string.getvalue()
=== added file 'wlggz/forms.py'
--- wlggz/forms.py 1970-01-01 00:00:00 +0000
+++ wlggz/forms.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,43 @@
+#!/usr/bin/env python -tt
+# encoding: utf-8
+#
+# Created by Timo Wingender <timo.wingender@xxxxxx> on 2010-06-02.
+#
+# Last Modified: $Date$
+#
+
+from django import forms
+from models import GGZAuth
+from django.utils.translation import ugettext_lazy as _
+
+import hashlib
+import base64
+import settings
+import re
+
+class EditGGZForm(forms.ModelForm):
+ password = forms.CharField(label=_(u'GGZ password'), widget = forms.PasswordInput(render_value = False), required=True)
+
+ class Meta:
+ model = GGZAuth
+ fields = [ 'password', ]
+
+ def __init__(self, *args, **kwargs):
+ instance = kwargs.pop("instance")
+
+ print "instance: %s, kwargs: %s" % (instance, kwargs)
+ super(EditGGZForm, self).__init__(instance=instance, *args,**kwargs)
+
+ def clean_password(self):
+ pw = self.cleaned_data['password']
+ print "pw: %s" % (pw)
+ pw_hash = hashlib.sha1(pw).digest()
+ pw_base64 = base64.standard_b64encode(pw_hash)
+ print "sha1: %s" % (pw_hash)
+ print "base: %s" % (pw_base64)
+ return pw_base64
+
+
+ def save(self):
+ super(EditGGZForm, self).save()
+
=== added file 'wlggz/ggz_models.py'
--- wlggz/ggz_models.py 1970-01-01 00:00:00 +0000
+++ wlggz/ggz_models.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,154 @@
+#!/usr/bin/env python -tt
+# encoding: utf-8
+#
+# Created by Timo Wingender <timo.wingender@xxxxxx> on 2010-06-03.
+#
+# Last Modified: $Date$
+#
+
+
+# This is an auto-generated and eddited representation for the ggzd tables.
+#
+
+from django.db import models
+from django.db.models import OneToOneField, ForeignKey
+from django.contrib.auth.models import User
+
+import datetime
+
+class GGZMatches(models.Model):
+ id = models.IntegerField(primary_key=True)
+ date = models.IntegerField()
+ game = models.TextField()
+ winner = ForeignKey(User, to_field='username', db_column='winner', related_name='wlggz_matchwins')
+ savegame = models.TextField(blank=True)
+ class Meta:
+ db_table = u'wlggz_matches'
+
+ def date_date(self):
+ return datetime.datetime.fromtimestamp(self.date)
+
+class GGZMatchplayers(models.Model):
+ id = models.IntegerField(primary_key=True)
+ match = ForeignKey(GGZMatches, to_field='id', db_column='match', related_name='wlggz_matchplayers')
+ handle = ForeignKey(User, to_field='username', db_column='handle', related_name='wlggz_matches')
+ playertype = models.CharField(max_length=768)
+ class Meta:
+ db_table = u'wlggz_matchplayers'
+
+class GGZPermissions(models.Model):
+ handle = models.CharField(max_length=768, blank=True)
+ join_table = models.IntegerField(null=True, blank=True)
+ launch_table = models.IntegerField(null=True, blank=True)
+ rooms_login = models.IntegerField(null=True, blank=True)
+ rooms_admin = models.IntegerField(null=True, blank=True)
+ chat_announce = models.IntegerField(null=True, blank=True)
+ chat_bot = models.IntegerField(null=True, blank=True)
+ no_stats = models.IntegerField(null=True, blank=True)
+ edit_tables = models.IntegerField(null=True, blank=True)
+ table_privmsg = models.IntegerField(null=True, blank=True)
+ class Meta:
+ db_table = u'wlggz_permissions'
+
+
+#class Savegameplayers(models.Model):
+# id = models.IntegerField(primary_key=True)
+# tableid = models.IntegerField()
+# stamp = models.IntegerField()
+# seat = models.IntegerField()
+# handle = models.CharField(max_length=768, blank=True)
+# seattype = models.CharField(max_length=768)
+# class Meta:
+# db_table = u'savegameplayers'
+
+#class Savegames(models.Model):
+# id = models.IntegerField(primary_key=True)
+# date = models.IntegerField()
+# game = models.CharField(max_length=768)
+# owner = models.CharField(max_length=768)
+# savegame = models.CharField(max_length=768)
+# tableid = models.IntegerField()
+# stamp = models.IntegerField()
+# class Meta:
+# db_table = u'savegames'
+
+class GGZStats(models.Model):
+ id = models.IntegerField(primary_key=True)
+ handle = OneToOneField(User, to_field='username', related_name='wlggzstats', db_column='handle')
+ #handle = models.CharField(max_length=768, blank=True)
+ game = models.TextField()
+ wins = models.IntegerField()
+ losses = models.IntegerField()
+ ties = models.IntegerField()
+ forfeits = models.IntegerField()
+ rating = models.FloatField()
+ ranking = models.IntegerField()
+ highscore = models.IntegerField()
+ class Meta:
+ db_table = u'wlggz_stats'
+
+#class GGZTeammembers(models.Model):
+# id = models.IntegerField(primary_key=True)
+# teamname = models.TextField()
+# username = models.TextField()
+# role = models.TextField()
+# entrydate = models.IntegerField()
+# class Meta:
+# db_table = u'ggz_db.teammembers'
+
+#class Teams(models.Model):
+# id = models.IntegerField(primary_key=True)
+# teamname = models.TextField()
+# fullname = models.TextField()
+# icon = models.TextField()
+# foundingdate = models.IntegerField()
+# founder = models.TextField()
+# homepage = models.TextField()
+# class Meta:
+# db_table = u'ggz_db.teams'
+
+#class Tournamentplayers(models.Model):
+# id = models.IntegerField(primary_key=True)
+# tid = models.IntegerField()
+# number = models.IntegerField()
+# name = models.TextField()
+# playertype = models.TextField()
+# class Meta:
+# db_table = u'tournamentplayers'
+
+#class Tournaments(models.Model):
+# id = models.IntegerField(primary_key=True)
+# name = models.TextField()
+# game = models.TextField()
+# date = models.IntegerField()
+# organizer = models.TextField()
+# class Meta:
+# db_table = u'tournaments'
+
+#class Userinfo(models.Model):
+# id = models.IntegerField(primary_key=True)
+# handle = models.CharField(max_length=768)
+# photo = models.TextField()
+# gender = models.TextField()
+# country = models.TextField()
+# pubkey = models.TextField()
+# blogfeed = models.TextField()
+# longitude = models.FloatField()
+# latitude = models.FloatField()
+# alterpass = models.TextField()
+# class Meta:
+# db_table = u'userinfo'
+
+#class Users(models.Model):
+# id = models.IntegerField()
+# handle = models.CharField(max_length=90)
+# password = models.CharField(max_length=240, blank=True)
+# name = models.CharField(max_length=183)
+# email = models.CharField(max_length=225)
+# firstlogin = models.DateTimeField()
+# lastlogin = models.DateTimeField(null=True, blank=True)
+# permissions = models.IntegerField(null=True, blank=True)
+# confirmed = models.IntegerField(null=True, blank=True)
+# class Meta:
+# db_table = u'users'
+
=== added file 'wlggz/models.py'
--- wlggz/models.py 1970-01-01 00:00:00 +0000
+++ wlggz/models.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,27 @@
+
+#!/usr/bin/env python -tt
+# encoding: utf-8
+#
+# Created by Timo Wingender <timo.wingender@xxxxxx> on 2010-06-02.
+#
+# Last Modified: $Date$
+#
+
+from django.db import models
+from django.contrib.auth.models import User
+from fields import AutoOneToOneField, ExtendedImageField
+from django.utils.translation import ugettext_lazy as _
+from pybb.models import Post
+
+import settings
+
+class GGZAuth(models.Model):
+ user = AutoOneToOneField(User, related_name='wlggz', verbose_name=_('User'))
+ password = models.CharField(_('ggz password'), max_length=80, blank=True, default='')
+ lastlogin = models.DateTimeField(_('ggz lastlogin'), null=True)
+ permissions = models.IntegerField(_('ggz permissions'), default=7)
+ confirmed = models.IntegerField(_('confirmed'), default=1, editable=False)
+
+ class Meta:
+ verbose_name = _('ggz')
+ verbose_name_plural = _('ggz')
=== added file 'wlggz/urls.py'
--- wlggz/urls.py 1970-01-01 00:00:00 +0000
+++ wlggz/urls.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,25 @@
+#!/usr/bin/env python -tt
+# encoding: utf-8
+#
+# File: wlggz/urls.py
+#
+# Created by Timo Wingender on 2010-06-02.
+# Copyright (c) 2010 timo.wingender@xxxxxx. All rights reserved.
+#
+# Last Modified: $Date$
+#
+
+from django.conf.urls.defaults import *
+import views
+
+urlpatterns = patterns('',
+ url(r'^$', views.view_overview, name='wlggz_main'),
+ url(r'^stats/?$', views.view, name='wlggz_userstats'),
+ url(r'^info/?$', views.view, name='wlggz_userinfo'),
+ url(r'^stats/(?P<user>.*)', views.view, name='wlggz_userstats'),
+ url(r'^info/(?P<user>.*)', views.view, name='wlggz_userinfo'),
+ url(r'^changepw$', views.change_password, name='wlggz_changepw'),
+ url(r'^ranking$', views.view_ranking, name='wlggz_ranking'),
+ url(r'^matches$', views.view_matches, name='wlggz_matches'),
+)
+
=== added file 'wlggz/views.py'
--- wlggz/views.py 1970-01-01 00:00:00 +0000
+++ wlggz/views.py 2010-06-14 18:46:29 +0000
@@ -0,0 +1,117 @@
+# Create your views here.
+
+
+from django.core.urlresolvers import reverse
+from django.contrib.auth.decorators import login_required
+from django.contrib.auth.models import User
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+from django.http import HttpResponseRedirect
+
+from django.db import models
+
+from forms import EditGGZForm
+
+import settings
+import ggz_models
+
+def view_overview(request):
+ return render_to_response("wlggz/view_ggz_overview.html",
+ context_instance=RequestContext(request))
+
+def view_matches(request):
+
+ try:
+ matches = ggz_models.GGZMatches.objects.order_by('-date')[:10]
+ except ggz_models.GGZMatches.DoesNotExist:
+ matches = None
+
+ template_params = {
+ "ggzmatches": matches,
+ }
+
+ return render_to_response("wlggz/view_ggz_matches.html",
+ template_params,
+ context_instance=RequestContext(request))
+
+# Settings
+@login_required
+def view(request, user = None):
+ """
+ empty text
+ """
+
+ template_params = {}
+
+ try:
+ if user is None:
+ u = request.user
+ else:
+ u = User.objects.get( username = user )
+
+ template_params["profile"] = u.wlprofile
+ except User.DoesNotExist:
+ u = None
+
+ if u:
+ try:
+ template_params["ggzauth"] = u.wlggz
+ except ggz_models.GGZauth.DoesNotExist:
+ pass
+ try:
+ wlggzstats = u.wlggzstats
+ matches = u.wlggz_matches.order_by('-id')[:10]
+ wonmatches = u.wlggz_matchwins.order_by('-id')[:10]
+ template_params["ggzstats"] = wlggzstats
+ template_params["ggzmatches"] = matches
+ template_params["ggzwonmatches"] = wonmatches
+ except (ggz_models.GGZStats.DoesNotExist):
+ pass
+
+ return render_to_response("wlggz/view_ggz_test.html",
+ template_params,
+ context_instance=RequestContext(request))
+
+def view_ranking(request):
+ """
+ empty text
+ """
+
+ try:
+ stats = ggz_models.GGZStats.objects.order_by('-rating')[:10]
+ except (ggz_models.GGZStats.DoesNotExist):
+ stats = None
+
+ template_params = {
+ "ggzstats": stats,
+ }
+
+ return render_to_response("wlggz/view_ggz_highscore.html",
+ template_params,
+ context_instance=RequestContext(request))
+
+@login_required
+def change_password(request):
+ """
+ empty text
+ """
+ instance = request.user.wlggz
+
+ if request.method == 'POST':
+ form = EditGGZForm(request.POST,
+ instance=instance, files = request.FILES)
+ if form.is_valid():
+ form.save()
+
+ return HttpResponseRedirect(reverse(view))
+ else:
+ form = EditGGZForm(instance=instance)
+
+ template_params = {
+ "wlggz": instance,
+ "ggz_form": form,
+ }
+
+ return render_to_response("wlggz/edit_ggz.html",
+ template_params,
+ context_instance=RequestContext(request))
=== modified file 'wlprofile/models.py'
--- wlprofile/models.py 2009-04-10 12:23:32 +0000
+++ wlprofile/models.py 2010-06-14 18:46:29 +0000
@@ -57,4 +57,27 @@
database grows to not be always calculated.
"""
return Post.objects.filter(user=self.user).count()
+
+ def user_status(self):
+ nump = self.post_count()
+
+ if nump < 6:
+ return { "text":"Just found this site", "image":"sterne_0.png" }
+ elif nump < 16:
+ return { "text":"Pry about Widelands", "image":"sterne_1.png" }
+ elif nump < 30:
+ return { "text":"Likes to be here", "image":"sterne_2.png" }
+ elif nump < 80:
+ return { "text":"At home in WL-forums", "image":"sterne_3.png" }
+ elif nump < 150:
+ return { "text":"Widelands-Forum-Junkie", "image":"sterne_4.png" }
+ elif nump < 250:
+ return { "text":"Tribe Member", "image":"sterne_5.png" }
+ else:
+ return { "text":"One Elder of Players", "image":"sterne_6.png" }
+ def get_ggzstats(self):
+ try:
+ return self.user.wlggzstats
+ except:
+ return None
=== modified file 'wlprofile/templatetags/wlprofile.py'
--- wlprofile/templatetags/wlprofile.py 2009-03-15 17:19:34 +0000
+++ wlprofile/templatetags/wlprofile.py 2010-06-14 18:46:29 +0000
@@ -21,5 +21,11 @@
reverse('profile_view', args=[user.username]), user.username)
return mark_safe(data)
+@register.filter
+def user_link_ggz(user):
+ data = u'<a href="%s">%s</a>' % (\
+ reverse('wlggz_userstats', args=[user.username]), user.username)
+ return mark_safe(data)
+
Follow ups