From 3f9d93407be1f719532ba2d1740ae38a6578449a Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 30 Jun 2011 23:26:02 +0200 Subject: [PATCH 01/70] Document the db submodule a bit Document the ideas behind the db submodule. And document what that actually means. --- mediagoblin/db/__init__.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mediagoblin/db/__init__.py b/mediagoblin/db/__init__.py index c129cbf8..f0116083 100644 --- a/mediagoblin/db/__init__.py +++ b/mediagoblin/db/__init__.py @@ -13,3 +13,37 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +""" +Database Abstraction/Wrapper Layer +================================== + +This submodule is for most of the db specific stuff. + +There are two main ideas here: + +1. Open up a small possibility to replace mongo by another + db. This means, that all direct mongo accesses should + happen in the db submodule. While all the rest uses an + API defined by this submodule. + + Currently this API happens to be basicly mongo. + Which means, that the abstraction/wrapper layer is + extremely thin. + +2. Give the rest of the app a simple and easy way to get most of + their db needs. Which often means some simple import + from db.util. + +What does that mean? + +* Never import mongo directly outside of this submodule. + +* Inside this submodule you can do whatever is needed. The + API border is exactly at the submodule layer. Nowhere + else. + +* helper functions can be moved in here. They become part + of the db.* API + +""" From 0e3400357d55caf9099f4288ce8aef90eff7867c Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Fri, 1 Jul 2011 06:24:34 -0400 Subject: [PATCH 02/70] Removes spurious file Matt added this file ages ago, but it's just an empty file, so I'm removing it. --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index e69de29b..00000000 From 6f59a3a32470b4d83ab94fe7c4dae83943500329 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Fri, 1 Jul 2011 15:26:29 +0200 Subject: [PATCH 03/70] Issue #362 - Simple comments - Changes based on feedback recieved from #mediagoblin * `db.models` - Removed `MediaEntry.get_comments()` and replaced it with a helper which just returns a cursor for the comments query * `media.html` - Added `{% set comment_author = comment.author() %}` * `user_pages.views` - media_home() now passes `MediaEntry.get_comments()` directly to `Pagination`, handles pagination for comments. * Added `MEDIA_COMMENTS_PER_PAGE` to define the number of comments per page in the `media_home()` view. --- mediagoblin/db/models.py | 22 +++++-------------- .../mediagoblin/user_pages/media.html | 5 +++-- mediagoblin/user_pages/views.py | 8 ++++--- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index bf825a23..1d91a14b 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -23,7 +23,6 @@ from mediagoblin.auth import lib as auth_lib from mediagoblin import mg_globals from mediagoblin.db import migrations from mediagoblin.db.util import DESCENDING, ObjectId -from mediagoblin.util import Pagination ################### # Custom validators @@ -109,24 +108,13 @@ class MediaEntry(Document): migration_handler = migrations.MediaEntryMigration + def get_comments(self): + return self.db.MediaComment.find({ + 'media_entry': self['_id']}).sort('created', DESCENDING) + def main_mediafile(self): pass - - def get_comments(self, page): - cursor = self.db.MediaComment.find({ - 'media_entry': self['_id']}).sort('created', DESCENDING) - - pagination = Pagination(page, cursor) - comments = pagination() - - data = list() - for comment in comments: - comment['author'] = self.db.User.find_one({ - '_id': comment['author']}) - data.append(comment) - - return (data, pagination) - + def generate_slug(self): self['slug'] = util.slugify(self['title']) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index cd0bb764..4ed1bd02 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -63,11 +63,12 @@ {% if comments %}

Comments

{% for comment in comments %} + {% set comment_author = comment.author() %}
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 399d2020..012d27a3 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -82,17 +82,19 @@ def user_gallery(request, page): 'media_entries': media_entries, 'pagination': pagination}) +MEDIA_COMMENTS_PER_PAGE = 50 @get_user_media_entry @uses_pagination -def media_home(request, media, **kwargs): +def media_home(request, media, page, **kwargs): """ 'Homepage' of a MediaEntry() """ - comment_form = user_forms.MediaCommentForm(request.POST) + pagination = Pagination(page, media.get_comments(), MEDIA_COMMENTS_PER_PAGE) + comments = pagination() - (comments, pagination) = media.get_comments(kwargs.get('page')) + comment_form = user_forms.MediaCommentForm(request.POST) return render_to_response( request, From 270dca58af07aaa7548f341e166b56493d9eae30 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 15:41:44 +0200 Subject: [PATCH 04/70] Style comments (first draft only) --- mediagoblin/static/css/base.css | 14 +++++++++++++ .../mediagoblin/user_pages/media.html | 20 +++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 31573820..537cc35c 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -223,6 +223,20 @@ a.mediagoblin_logo:hover { width:280px; } +/* comments */ + +.comment_author { + margin-bottom:40px; + font-size:14px; + text-align:right; + border-top:1px solid #393939; + padding-top:4px; +} + +.comment_content p { + margin-bottom:4px; +} + /* media galleries */ ul.media_thumbnail { diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 3cebe2f9..0a88921a 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -68,13 +68,18 @@

Comments

{% for comment in comments %}
-
By: + +
+ {% autoescape False %} + {{ comment.content_html }} + {% endautoescape %} +
+ - -
- {% autoescape False %} - {{ comment.content_html }} - {% endautoescape %} -
{% endfor %} {% include "mediagoblin/utils/pagination.html" %} From 68c6521e0441775c116f4240631103425367aa06 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 15:43:05 +0200 Subject: [PATCH 05/70] Add feed icon --- mediagoblin/static/images/iconFeed.png | Bin 0 -> 522 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mediagoblin/static/images/iconFeed.png diff --git a/mediagoblin/static/images/iconFeed.png b/mediagoblin/static/images/iconFeed.png new file mode 100644 index 0000000000000000000000000000000000000000..11e5b1e76b8e0e6c357a58e8ff018b170b5cec68 GIT binary patch literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Q6s zP-xZKRG%tiFY)wsWxvhN$g9A2BsBdz(3CDu7sn8b(@Q6B z>^kHi(6*mN#3iSOwOg@CK$}%tdv!@xdUE1KyFau3|Ic!E!N7UXS88Ld5PH=cdg zV39`9w%o_N^je)9)msufUhm>zYmWCkQ}KDLgu?8zm)@31^0n{Ry2zEaRqAJr-04jl zbh>@i7EjLGF1<8}^RPjHm#yXnmi4Re=3RbS;-MlWReknztvt|BrA2r5#^_~P&D9bN zR9ZCc^in(S!vT*Adw*7K&YTsZCHm~M<=3jYX`4L-SQwTBtuzldJy>C*#=#`l&(83& zWLDhz_Qw_`QoQfJTQeL@ni#hF>q&v_A56=3&z)9lHFrwKin{&lHy(btAo>E!_1B?m z!?b-j-G5(tFvSRH*}3PNkKMB|;AxK0JD#+W;Xt9x+D$Qf%o+OozABgrB$!As7TCx! zdZ Date: Fri, 1 Jul 2011 15:47:37 +0200 Subject: [PATCH 06/70] Fix first part of issue 402 - small images are no longer enlarged to 640px --- mediagoblin/templates/mediagoblin/user_pages/media.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 0a88921a..fd079378 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -26,7 +26,7 @@

{{media.title}}

-

Uploaded on From 6ef36a15f2e0dcab276f8ac0a97d2890d0d1c050 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 17:20:22 +0200 Subject: [PATCH 07/70] Add delete and edit icons --- mediagoblin/static/css/base.css | 26 +++++++++++++++++++++++ mediagoblin/static/images/iconDelete.png | Bin 0 -> 472 bytes mediagoblin/static/images/iconEdit.png | Bin 0 -> 297 bytes 3 files changed, 26 insertions(+) create mode 100644 mediagoblin/static/images/iconDelete.png create mode 100644 mediagoblin/static/images/iconEdit.png diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 537cc35c..0d594169 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -254,3 +254,29 @@ li.media_thumbnail { zoom:1; . *display:inline; } + +/* icons */ + +.iconFeed{ + width:16px; + height:16px; + background-image:url('../images/iconFeed.png'); + float:left; + margin-right:5px; +} + +.iconEdit{ + width:16px; + height:16px; + background-image:url('../images/iconEdit.png'); + float:left; + margin-right:5px; +} + +.iconDelete{ + width:16px; + height:16px; + background-image:url('../images/iconDelete.png'); + float:left; + margin-right:5px; +} diff --git a/mediagoblin/static/images/iconDelete.png b/mediagoblin/static/images/iconDelete.png new file mode 100644 index 0000000000000000000000000000000000000000..9d76a5db0080cadb4f8bdf11da279efe1de5b604 GIT binary patch literal 472 zcmV;}0Vn>6P)Px#24YJ`L;xoMCjciBs;y-J000SaNLh0L01ejw01ejxLMWSf00007bV*G`2ipe$ z4-p<5JEV6200CG@L_t(I%dL|?s=`1J#((CS8(2=iENqe9E2Py57}S?n`34q-`SZ=pH#;MxROC&pwHRYC#sJ{G$9vCiw|fs| z^Z-bbgvDY(S(c<}N(h0bX#mh#BO+X{SE{OFzu$Aa-R=lVsi?J%&bioiU3AVxrPSbi zj?r32rBwWyOeWvU<&yb)&UU+Hy2$hx(6((~x$C;vb=|M( z&vxfrY}+;}rD9^OB~4SxvV5sl*Y%(d^gLN>85?5=A@t5H%ld@F;qa1}Wm&I>5HQA& z7-M?2p94b(hzKG=2;n6eplO;r03XWOdym$7aQ??=B0^o)FI{M@@!peo?-7wf!ty*P z&+|c_h~T~de2rs(s;XG6Ruo0?i>&tz6h*;wI%Tuj{LfeZ_?SkYp7RfY@htYek(Q7E O0000%tiFY)wsWxvhN$S14(QsrzcP-vy6i(`nz>8X=9 z^0q37F!&$l>-i8><(?qowxNv0eN#G1wE6(()78&qol`;+0Jqp}XaE2J literal 0 HcmV?d00001 From 13b4cbf01436ba2b734358743ad82c466a9110b8 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 17:25:15 +0200 Subject: [PATCH 08/70] Put comment author/date on the left --- mediagoblin/static/css/base.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 0d594169..924d68b2 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -227,9 +227,6 @@ a.mediagoblin_logo:hover { .comment_author { margin-bottom:40px; - font-size:14px; - text-align:right; - border-top:1px solid #393939; padding-top:4px; } From c13ce79abbff3a93f1d940d2578f1e80adeb70f3 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 17:28:55 +0200 Subject: [PATCH 09/70] Reorganize media.html, comment part --- .../mediagoblin/user_pages/media.html | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index fd079378..175e5c60 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -58,42 +58,38 @@

{% endif %} - {# {{ wtforms_util.render_textarea_div(submit_form.description) }} {{ wtforms_util.render_field_div(submit_form.file) }} #} - {% if comments %}

Comments

{% for comment in comments %} +
+ +
{% endfor %} {% include "mediagoblin/utils/pagination.html" %} {% endif %} -

This is a sidebar! Yay!

From b611476c94c8a44d93a4488152fe729793e6b594 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 18:59:07 +0200 Subject: [PATCH 10/70] Reorder media.html (comments, icons, links, layout) --- mediagoblin/static/css/base.css | 25 ++---------- .../mediagoblin/user_pages/media.html | 39 ++++++++++--------- 2 files changed, 23 insertions(+), 41 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 924d68b2..2dd276b0 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -254,26 +254,7 @@ li.media_thumbnail { /* icons */ -.iconFeed{ - width:16px; - height:16px; - background-image:url('../images/iconFeed.png'); - float:left; - margin-right:5px; -} - -.iconEdit{ - width:16px; - height:16px; - background-image:url('../images/iconEdit.png'); - float:left; - margin-right:5px; -} - -.iconDelete{ - width:16px; - height:16px; - background-image:url('../images/iconDelete.png'); - float:left; - margin-right:5px; +img.media_icon{ + margin:0 4px; + vertical-align:sub; } diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 175e5c60..8ed25f9d 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -23,38 +23,32 @@ {# temporarily, an "image gallery" that isn't one really ;) #} {% if media %}
-

- {{media.title}} -

+

+ {{media.title}} +

+ {% autoescape False %} +

{{ media.description_html }}

+ {% endautoescape %}

- Uploaded on + — uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, media.created.month, media.created.day) }} by {{- media.uploader().username }} -

- - {% autoescape False %} -

{{ media.description_html }}

- {% endautoescape %} - - {% if media['uploader'] == request.user['_id'] %} -

Edit

- {% endif %} +

+

+

Comments

{% if request.user %}
-

Post a comment!

{{ wtforms_util.render_field_div(comment_form.comment) }}
- +
{% endif %} @@ -63,7 +57,6 @@ {{ wtforms_util.render_field_div(submit_form.file) }} #} {% if comments %} -

Comments

{% for comment in comments %}
@@ -91,7 +84,15 @@
{% endif %}
-

This is a sidebar! Yay!

+

Sidebar content here!

+

+ {% if media['uploader'] == request.user['_id'] %} +

edit

+

delete

+ {% endif %} +

{% else %}

Sorry, no such media found.

From eed7e0587cc84a3e0261e77f34abac49aa0e9245 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 19:57:23 +0200 Subject: [PATCH 11/70] Remove strong style from pagination --- mediagoblin/templates/mediagoblin/utils/pagination.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index 2be0b92e..bdf40496 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -29,7 +29,7 @@ {% if page != pagination.page %} {{ page }} {% else %} - {{ page }} + {{ page }} {% endif %} {% else %} From f188463b4684c6f9cccb07364a5f3e098c832b4f Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 1 Jul 2011 20:08:12 +0200 Subject: [PATCH 12/70] Fix tiny pagination error: missing end tag --- mediagoblin/templates/mediagoblin/utils/pagination.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index bdf40496..016ae986 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -21,13 +21,13 @@

From ab6fffedf8d9471b1999eb947716a81797b30e64 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 14:28:57 -0500 Subject: [PATCH 21/70] Cleaning up some indentation in media.html --- .../mediagoblin/user_pages/media.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index aa44ed9c..42d1b930 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -86,11 +86,19 @@

Sidebar content here!

- {% if media['uploader'] == request.user['_id'] %} -

edit

-

delete

+ {% if media['uploader'] == request.user['_id'] %} +

+ edit +

+

+ + delete +

{% endif %}

From f6c49c5e623d9914e9d906138fb9532a0181e623 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 14:29:47 -0500 Subject: [PATCH 22/70] Not sure what these fields are here commented out for... removing --- mediagoblin/templates/mediagoblin/user_pages/media.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 42d1b930..e2fee170 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -52,10 +52,7 @@
{% endif %} - {# - {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.file) }} - #} + {% if comments %} {% for comment in comments %}
From 6f65e9eb907e690f02fe2e339e28fb306b293fd4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 14:30:33 -0500 Subject: [PATCH 23/70] More spacing / newline changes to media.html --- .../templates/mediagoblin/user_pages/media.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index e2fee170..39770f39 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -28,9 +28,11 @@

{{media.title}}

+ {% autoescape False %}

{{ media.description_html }}

{% endautoescape %} +

— uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, @@ -41,6 +43,7 @@ {{- media.uploader().username }}



+

Comments

{% if request.user %}
{{ comment['author']['username'] }} at - + {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, comment.created.month, @@ -75,8 +78,9 @@ comment.created.minute) }}
-
+ {% endfor %} + {% include "mediagoblin/utils/pagination.html" %} {% endif %} @@ -100,6 +104,6 @@

{% else %} -

Sorry, no such media found.

+

Sorry, no such media found.

{% endif %} {% endblock %} From 082a675fcdf2d2b222040f9ccfdf5dd90d06ae93 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 14:32:54 -0500 Subject: [PATCH 24/70] the delete text should be flush against the image since the edit text is --- mediagoblin/templates/mediagoblin/user_pages/media.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 39770f39..72569133 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -97,8 +97,7 @@

- delete + class="media_icon" />delete

{% endif %}

From 29f9df7b27a443b8e7de793c99bc7606ebcf36cb Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 14:34:39 -0500 Subject: [PATCH 25/70] Removing that 'temporarily, an "image gallery" that isn't one really ;)' text --- mediagoblin/templates/mediagoblin/user_pages/media.html | 1 - 1 file changed, 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 72569133..55c8f145 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -20,7 +20,6 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} {% if media %}
- -

Media details for {{media.title}}

-

-
Uploaded: {{ media.created}} -
Description: {{media.description}} -

-
- - {% else %} -

Sorry, no such media found.

- {% endif %} -{% endblock %} From 93214d8e0287150aef3f4370237303bc73ec448c Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sun, 3 Jul 2011 01:30:07 +0200 Subject: [PATCH 29/70] Feature #400 - Resize images to fit on page * `mediagoblin.process_media.__init__` * Added `medium` size image conversion * Updated `thumbnail` conversion to use `queued_filename` instead of `queued_file` * `media.html` * If there exists a `medium` size for the `MediaEntry`, it will display instead of the original `main` image. --- mediagoblin/process_media/__init__.py | 36 +++++++++++++------ .../mediagoblin/user_pages/media.html | 9 +++-- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/mediagoblin/process_media/__init__.py b/mediagoblin/process_media/__init__.py index 0dce1418..0d1abcb3 100644 --- a/mediagoblin/process_media/__init__.py +++ b/mediagoblin/process_media/__init__.py @@ -22,6 +22,7 @@ from mediagoblin import mg_globals as mgg THUMB_SIZE = 200, 200 +MEDIUM_SIZE = 640, 640 def create_pub_filepath(entry, filename): @@ -43,20 +44,32 @@ def process_media_initial(media_id): mgg.queue_store, queued_filepath, 'source') - queued_file = file(queued_filename, 'r') + thumb = Image.open(queued_filename) + thumb.thumbnail(THUMB_SIZE, Image.ANTIALIAS) + # ensure color mode is compatible with jpg + if thumb.mode != "RGB": + thumb = thumb.convert("RGB") - with queued_file: - thumb = Image.open(queued_file) - thumb.thumbnail(THUMB_SIZE, Image.ANTIALIAS) - # ensure color mode is compatible with jpg - if thumb.mode != "RGB": - thumb = thumb.convert("RGB") + thumb_filepath = create_pub_filepath(entry, 'thumbnail.jpg') - thumb_filepath = create_pub_filepath(entry, 'thumbnail.jpg') + thumb_file = mgg.public_store.get_file(thumb_filepath, 'w') + with thumb_file: + thumb.save(thumb_file, "JPEG") - thumb_file = mgg.public_store.get_file(thumb_filepath, 'w') - with thumb_file: - thumb.save(thumb_file, "JPEG") + """ + Create medium file, used in `media.html` + """ + medium = Image.open(queued_filename) + medium.thumbnail(MEDIUM_SIZE, Image.ANTIALIAS) + + if medium.mode != "RGB": + medium = medium.convert("RGB") + + medium_filepath = create_pub_filepath(entry, 'medium.jpg') + + medium_file = mgg.public_store.get_file(medium_filepath, 'w') + with medium_file: + medium.save(medium_file, "JPEG") # we have to re-read because unlike PIL, not everything reads # things in string representation :) @@ -73,6 +86,7 @@ def process_media_initial(media_id): media_files_dict = entry.setdefault('media_files', {}) media_files_dict['thumb'] = thumb_filepath media_files_dict['main'] = main_filepath + media_files_dict['medium'] = medium_filepath entry['state'] = u'processed' entry.save() diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 3cebe2f9..e16f1e00 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -26,8 +26,13 @@

{{media.title}}

- + {% if media.media_files.medium %} + + {% else %} + + {% endif %}

Uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, From 841110a75d56f3e120691c43f85b3dd4b5fa1e56 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Jul 2011 18:31:02 -0500 Subject: [PATCH 30/70] Only show pagination if we have pages to show --- mediagoblin/templates/mediagoblin/utils/pagination.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index 2423d08d..7b55b81d 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -17,9 +17,9 @@ {# only display if {{pagination}} is defined #} -{% if pagination %} +{% if pagination and pagination.pages > 1 %}

{% endfor %} - {% include "mediagoblin/utils/pagination.html" %} + {{ render_pagination(request, pagination) }} {% endif %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 3148043b..b884a1f5 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -30,14 +30,14 @@ {% include "mediagoblin/utils/profile.html" %} + {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} -

View all of {{ user.username }}'s media

+

View all of {{ user.username }}'s media

atom feed + user=user.username) }}>atom feed {% else %} {# This *should* not occur as the view makes sure we pass in a user. #}

Sorry, no such user found.

diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 8c88c174..4e2886f8 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -16,6 +16,8 @@ # along with this program. If not, see . #} +{% from "mediagoblin/utils/pagination.html" import render_pagination %} + {% block object_gallery_content -%}

{% if media_entries %} @@ -28,8 +30,12 @@ {% endfor %} - {% include "mediagoblin/utils/pagination.html" %} - {% endif %} - + {% if pagination_base_url %} + {# different url, so set that and don't keep the get params #} + {{ render_pagination(request, pagination, pagination_base_url, False) }} + {% else %} + {{ render_pagination(request, pagination) }} + {% endif %} + {% endif %}
{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index 7b55b81d..aae50d22 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -15,31 +15,48 @@ # along with this program. If not, see . #} -{# only display if {{pagination}} is defined #} +{% macro render_pagination(request, pagination, + base_url=None, preserve_get_params=True) %} + {# only display if {{pagination}} is defined #} + {% if pagination and pagination.pages > 1 %} + {% if not base_url %} + {% set base_url = request.path_info %} + {% endif %} -{% if pagination and pagination.pages > 1 %} - + {% endif %} +{% endmacro %} diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 012d27a3..3a8684d3 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -48,10 +48,15 @@ def user_home(request, page): if media_entries == None: return exc.HTTPNotFound() + user_gallery_url = request.urlgen( + 'mediagoblin.user_pages.user_gallery', + user=user['username']) + return render_to_response( request, 'mediagoblin/user_pages/user.html', {'user': user, + 'user_gallery_url': user_gallery_url, 'media_entries': media_entries, 'pagination': pagination}) From 4dc7444119f81d1858a2f31457f3a86af1f6a72d Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sun, 3 Jul 2011 07:50:35 +0200 Subject: [PATCH 36/70] Feature #409 - Submitting an image should redirect you back to user's page w/ a message * Successful submission redirects to the logged in user's page (your own, presumably). * "Woohoo! Submitted!" is launched into the tube of session messages to appear on next pageload. If you're not aborting in the window of 210ms it takes for the client to respond to the 302 and load the logged in user's/your page that is, YMMV. --- mediagoblin/submit/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 6139614e..4c7476b0 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -24,6 +24,7 @@ from mediagoblin.util import ( from mediagoblin.decorators import require_active_login from mediagoblin.submit import forms as submit_forms, security from mediagoblin.process_media import process_media_initial +from mediagoblin.messages import add_message, SUCCESS @require_active_login @@ -85,7 +86,10 @@ def submit_start(request): # queue it for processing process_media_initial.delay(unicode(entry['_id'])) - return redirect(request, "mediagoblin.submit.success") + add_message(request, SUCCESS, 'Woohoo! Submitted!') + + return redirect(request, "mediagoblin.user_pages.user_home", + user = request.user['username']) return render_to_response( request, From 42de4c5379cd313d470e09aa71b009e731ee2264 Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Sun, 3 Jul 2011 02:37:19 -0500 Subject: [PATCH 37/70] moves edit profile link to user page --- mediagoblin/templates/mediagoblin/root.html | 1 - mediagoblin/templates/mediagoblin/user_pages/user.html | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index e29abd51..5b744999 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -23,7 +23,6 @@ {% if request.user %}

Submit an item - Edit profile

{% else %}

diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 99e46a72..22defcbd 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -27,6 +27,10 @@ {% block mediagoblin_content -%} {% if user %}

{{ user.username }}'s profile

+ {% if request.user == user.username or request.user['is_admin'] %} + Edit + {% endif %} {% include "mediagoblin/utils/profile.html" %} From e192d7b7a55efdfd2f50f5d068a0dfa484e152fa Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Sun, 3 Jul 2011 02:41:39 -0500 Subject: [PATCH 38/70] allows admins to edit user media --- mediagoblin/templates/mediagoblin/user_pages/media.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 21506ee4..4dec0641 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -94,7 +94,8 @@ {% include "mediagoblin/utils/prev_next.html" %}

Sidebar content here!

- {% if media['uploader'] == request.user['_id'] %} + {% if media['uploader'] == request.user['_id'] or + request.user['is_admin'] %}

Editing {{ user['username'] }}'s profile

From 7a44bb16db549797e721433c240dfaa89020156d Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 09:21:24 -0500 Subject: [PATCH 40/70] user_gallery_url -> {{ user_gallery_url }} ... How embarassing. --- mediagoblin/templates/mediagoblin/user_pages/user.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index da8db261..d23daccd 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -37,7 +37,7 @@ {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} -

View all of {{ user.username }}'s media

+

View all of {{ user.username }}'s media

Date: Sun, 3 Jul 2011 09:26:40 -0500 Subject: [PATCH 41/70] Caution an admin when they're editing someone else's media. --- mediagoblin/edit/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 64fa0eab..f069d8e7 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -64,6 +64,14 @@ def edit_media(request, media): return redirect(request, "mediagoblin.user_pages.media_home", user=media.uploader()['username'], media=media['slug']) + if request.user['is_admin'] \ + and media['uploader'] != request.user['_id'] \ + and request.method != 'POST': + messages.add_message( + request, messages.WARNING, + 'You are editing another user\'s media. Proceed with caution.') + + return render_to_response( request, 'mediagoblin/edit/edit.html', From b86bedf9eac62ed41715de1a17bb49c672dfba93 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 09:29:09 -0500 Subject: [PATCH 42/70] Switching single-quoted strings to double-quote to avoid escaping the apostrophe.. :) --- mediagoblin/edit/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index f069d8e7..e064a9c3 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -69,7 +69,7 @@ def edit_media(request, media): and request.method != 'POST': messages.add_message( request, messages.WARNING, - 'You are editing another user\'s media. Proceed with caution.') + "You are editing another user's media. Proceed with caution.") return render_to_response( @@ -90,7 +90,7 @@ def edit_profile(request): if request.method != 'POST': messages.add_message( request, messages.WARNING, - 'You are editing a user\'s profile. Proceed with caution.') + "You are editing a user's profile. Proceed with caution.") else: user = request.user From 7c42cdf739df17c37b328957a10c2d11b058be84 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 09:42:45 -0500 Subject: [PATCH 43/70] class="media_image" accidentally added back during 400 merge. Fixing. --- mediagoblin/templates/mediagoblin/user_pages/media.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 85ba985c..ca2ec5d6 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -24,11 +24,11 @@ {% if media %}
{% if media.media_files.medium %} - + {% else %} - + {% endif %}

From 0b69a78f73aced3a0c2a010dec75ac372a613c85 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 3 Jul 2011 21:12:22 +0200 Subject: [PATCH 44/70] Put file input form at the top of submission form --- mediagoblin/templates/mediagoblin/submit/start.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html index f34bf2af..387c2743 100644 --- a/mediagoblin/templates/mediagoblin/submit/start.html +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -20,17 +20,16 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} -

Submit yer media

+ {{ wtforms_util.render_field_div(submit_form.file) }} {{ wtforms_util.render_field_div(submit_form.title) }} {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.file) }}
-{% endblock %} +{% endblock %} From 1344821daf935c348eaa46c27e17fc3186c59b19 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 3 Jul 2011 21:20:09 +0200 Subject: [PATCH 45/70] Added reset.css and text.css from 960.gs. This might shake up a few styles! --- mediagoblin/contrib/reset.css | 202 ++++++++++++++++++++ mediagoblin/contrib/text.css | 86 +++++++++ mediagoblin/static/css/contrib/reset.css | 1 + mediagoblin/static/css/contrib/text.css | 1 + mediagoblin/templates/mediagoblin/base.html | 4 + 5 files changed, 294 insertions(+) create mode 100644 mediagoblin/contrib/reset.css create mode 100644 mediagoblin/contrib/text.css create mode 120000 mediagoblin/static/css/contrib/reset.css create mode 120000 mediagoblin/static/css/contrib/text.css diff --git a/mediagoblin/contrib/reset.css b/mediagoblin/contrib/reset.css new file mode 100644 index 00000000..87b7f368 --- /dev/null +++ b/mediagoblin/contrib/reset.css @@ -0,0 +1,202 @@ +/* `XHTML, HTML4, HTML5 Reset +----------------------------------------------------------------------------------------------------*/ + +a, +abbr, +acronym, +address, +applet, +article, +aside, +audio, +b, +big, +blockquote, +body, +canvas, +caption, +center, +cite, +code, +dd, +del, +details, +dfn, +dialog, +div, +dl, +dt, +em, +embed, +fieldset, +figcaption, +figure, +font, +footer, +form, +h1, +h2, +h3, +h4, +h5, +h6, +header, +hgroup, +hr, +html, +i, +iframe, +img, +ins, +kbd, +label, +legend, +li, +mark, +menu, +meter, +nav, +object, +ol, +output, +p, +pre, +progress, +q, +rp, +rt, +ruby, +s, +samp, +section, +small, +span, +strike, +strong, +sub, +summary, +sup, +table, +tbody, +td, +tfoot, +th, +thead, +time, +tr, +tt, +u, +ul, +var, +video, +xmp { + border: 0; + margin: 0; + padding: 0; + font-size: 100%; +} + +html, +body { + height: 100%; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { +/* + Override the default (display: inline) for + browsers that do not recognize HTML5 tags. + + IE8 (and lower) requires a shiv: + http://ejohn.org/blog/html5-shiv +*/ + display: block; +} + +b, +strong { +/* + Makes browsers agree. + IE + Opera = font-weight: bold. + Gecko + WebKit = font-weight: bolder. +*/ + font-weight: bold; +} + +img { + color: transparent; + font-size: 0; + vertical-align: middle; +/* + For IE. + http://css-tricks.com/ie-fix-bicubic-scaling-for-images +*/ + -ms-interpolation-mode: bicubic; +} + +li { +/* + For IE6 + IE7. +*/ + display: list-item; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +th, +td, +caption { + font-weight: normal; + vertical-align: top; + text-align: left; +} + +q { + quotes: none; +} + +q:before, +q:after { + content: ''; + content: none; +} + +sub, +sup, +small { + font-size: 75%; +} + +sub, +sup { + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +svg { +/* + For IE9. +*/ + overflow: hidden; +} \ No newline at end of file diff --git a/mediagoblin/contrib/text.css b/mediagoblin/contrib/text.css new file mode 100644 index 00000000..1a6b302f --- /dev/null +++ b/mediagoblin/contrib/text.css @@ -0,0 +1,86 @@ +/* + 960 Grid System ~ Text CSS. + Learn more ~ http://960.gs/ + + Licensed under GPL and MIT. +*/ + +/* `Basic HTML +----------------------------------------------------------------------------------------------------*/ + +body { + font: 13px/1.5 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif; +} + +pre, +code { + font-family: 'DejaVu Sans Mono', Monaco, Consolas, monospace; +} + +hr { + border: 0 #ccc solid; + border-top-width: 1px; + clear: both; + height: 0; +} + +/* `Headings +----------------------------------------------------------------------------------------------------*/ + +h1 { + font-size: 25px; +} + +h2 { + font-size: 23px; +} + +h3 { + font-size: 21px; +} + +h4 { + font-size: 19px; +} + +h5 { + font-size: 17px; +} + +h6 { + font-size: 15px; +} + +/* `Spacing +----------------------------------------------------------------------------------------------------*/ + +ol { + list-style: decimal; +} + +ul { + list-style: disc; +} + +li { + margin-left: 30px; +} + +p, +dl, +hr, +h1, +h2, +h3, +h4, +h5, +h6, +ol, +ul, +pre, +table, +address, +fieldset, +figure { + margin-bottom: 20px; +} \ No newline at end of file diff --git a/mediagoblin/static/css/contrib/reset.css b/mediagoblin/static/css/contrib/reset.css new file mode 120000 index 00000000..e6796fdc --- /dev/null +++ b/mediagoblin/static/css/contrib/reset.css @@ -0,0 +1 @@ +/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/reset.css \ No newline at end of file diff --git a/mediagoblin/static/css/contrib/text.css b/mediagoblin/static/css/contrib/text.css new file mode 120000 index 00000000..f54ea50c --- /dev/null +++ b/mediagoblin/static/css/contrib/text.css @@ -0,0 +1 @@ +/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/text.css \ No newline at end of file diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index fbb52803..87adfabb 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -18,6 +18,10 @@ {% block title %}GNU MediaGoblin{% endblock title %} + + Date: Sun, 3 Jul 2011 21:37:21 +0200 Subject: [PATCH 46/70] Switched over to 960_16_col. This may break a bunch of stuff. If you find something that is broken, slap me. --- mediagoblin/contrib/960_12_col.css | 357 -------------- mediagoblin/contrib/960_16_col.css | 447 ++++++++++++++++++ mediagoblin/static/css/base.css | 10 - mediagoblin/static/css/contrib/960_12_col.css | 1 - mediagoblin/static/css/contrib/960_16_col.css | 1 + .../templates/mediagoblin/auth/login.html | 3 +- .../templates/mediagoblin/auth/register.html | 2 +- mediagoblin/templates/mediagoblin/base.html | 14 +- .../templates/mediagoblin/edit/edit.html | 2 +- .../mediagoblin/edit/edit_profile.html | 2 +- .../templates/mediagoblin/submit/start.html | 2 +- .../mediagoblin/user_pages/media.html | 4 +- 12 files changed, 462 insertions(+), 383 deletions(-) delete mode 100644 mediagoblin/contrib/960_12_col.css create mode 100644 mediagoblin/contrib/960_16_col.css delete mode 120000 mediagoblin/static/css/contrib/960_12_col.css create mode 120000 mediagoblin/static/css/contrib/960_16_col.css diff --git a/mediagoblin/contrib/960_12_col.css b/mediagoblin/contrib/960_12_col.css deleted file mode 100644 index 48e86ee8..00000000 --- a/mediagoblin/contrib/960_12_col.css +++ /dev/null @@ -1,357 +0,0 @@ -/* - 960 Grid System ~ Core CSS. - Learn more ~ http://960.gs/ - - Licensed under GPL and MIT. -*/ - -/* - Forces backgrounds to span full width, - even if there is horizontal scrolling. - Increase this if your layout is wider. - - Note: IE6 works fine without this fix. -*/ - -body { - min-width: 960px; -} - -/* `Container -----------------------------------------------------------------------------------------------------*/ - -.container_12 { - margin-left: auto; - margin-right: auto; - width: 960px; -} - -/* `Grid >> Global -----------------------------------------------------------------------------------------------------*/ - -.grid_1, -.grid_2, -.grid_3, -.grid_4, -.grid_5, -.grid_6, -.grid_7, -.grid_8, -.grid_9, -.grid_10, -.grid_11, -.grid_12 { - display: inline; - float: left; - margin-left: 10px; - margin-right: 10px; -} - -.push_1, .pull_1, -.push_2, .pull_2, -.push_3, .pull_3, -.push_4, .pull_4, -.push_5, .pull_5, -.push_6, .pull_6, -.push_7, .pull_7, -.push_8, .pull_8, -.push_9, .pull_9, -.push_10, .pull_10, -.push_11, .pull_11 { - position: relative; -} - -/* `Grid >> Children (Alpha ~ First, Omega ~ Last) -----------------------------------------------------------------------------------------------------*/ - -.alpha { - margin-left: 0; -} - -.omega { - margin-right: 0; -} - -/* `Grid >> 12 Columns -----------------------------------------------------------------------------------------------------*/ - -.container_12 .grid_1 { - width: 60px; -} - -.container_12 .grid_2 { - width: 140px; -} - -.container_12 .grid_3 { - width: 220px; -} - -.container_12 .grid_4 { - width: 300px; -} - -.container_12 .grid_5 { - width: 380px; -} - -.container_12 .grid_6 { - width: 460px; -} - -.container_12 .grid_7 { - width: 540px; -} - -.container_12 .grid_8 { - width: 620px; -} - -.container_12 .grid_9 { - width: 700px; -} - -.container_12 .grid_10 { - width: 780px; -} - -.container_12 .grid_11 { - width: 860px; -} - -.container_12 .grid_12 { - width: 940px; -} - -/* `Prefix Extra Space >> 12 Columns -----------------------------------------------------------------------------------------------------*/ - -.container_12 .prefix_1 { - padding-left: 80px; -} - -.container_12 .prefix_2 { - padding-left: 160px; -} - -.container_12 .prefix_3 { - padding-left: 240px; -} - -.container_12 .prefix_4 { - padding-left: 320px; -} - -.container_12 .prefix_5 { - padding-left: 400px; -} - -.container_12 .prefix_6 { - padding-left: 480px; -} - -.container_12 .prefix_7 { - padding-left: 560px; -} - -.container_12 .prefix_8 { - padding-left: 640px; -} - -.container_12 .prefix_9 { - padding-left: 720px; -} - -.container_12 .prefix_10 { - padding-left: 800px; -} - -.container_12 .prefix_11 { - padding-left: 880px; -} - -/* `Suffix Extra Space >> 12 Columns -----------------------------------------------------------------------------------------------------*/ - -.container_12 .suffix_1 { - padding-right: 80px; -} - -.container_12 .suffix_2 { - padding-right: 160px; -} - -.container_12 .suffix_3 { - padding-right: 240px; -} - -.container_12 .suffix_4 { - padding-right: 320px; -} - -.container_12 .suffix_5 { - padding-right: 400px; -} - -.container_12 .suffix_6 { - padding-right: 480px; -} - -.container_12 .suffix_7 { - padding-right: 560px; -} - -.container_12 .suffix_8 { - padding-right: 640px; -} - -.container_12 .suffix_9 { - padding-right: 720px; -} - -.container_12 .suffix_10 { - padding-right: 800px; -} - -.container_12 .suffix_11 { - padding-right: 880px; -} - -/* `Push Space >> 12 Columns -----------------------------------------------------------------------------------------------------*/ - -.container_12 .push_1 { - left: 80px; -} - -.container_12 .push_2 { - left: 160px; -} - -.container_12 .push_3 { - left: 240px; -} - -.container_12 .push_4 { - left: 320px; -} - -.container_12 .push_5 { - left: 400px; -} - -.container_12 .push_6 { - left: 480px; -} - -.container_12 .push_7 { - left: 560px; -} - -.container_12 .push_8 { - left: 640px; -} - -.container_12 .push_9 { - left: 720px; -} - -.container_12 .push_10 { - left: 800px; -} - -.container_12 .push_11 { - left: 880px; -} - -/* `Pull Space >> 12 Columns -----------------------------------------------------------------------------------------------------*/ - -.container_12 .pull_1 { - left: -80px; -} - -.container_12 .pull_2 { - left: -160px; -} - -.container_12 .pull_3 { - left: -240px; -} - -.container_12 .pull_4 { - left: -320px; -} - -.container_12 .pull_5 { - left: -400px; -} - -.container_12 .pull_6 { - left: -480px; -} - -.container_12 .pull_7 { - left: -560px; -} - -.container_12 .pull_8 { - left: -640px; -} - -.container_12 .pull_9 { - left: -720px; -} - -.container_12 .pull_10 { - left: -800px; -} - -.container_12 .pull_11 { - left: -880px; -} - -/* `Clear Floated Elements -----------------------------------------------------------------------------------------------------*/ - -/* http://sonspring.com/journal/clearing-floats */ - -.clear { - clear: both; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; -} - -/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */ - -.clearfix:before, -.clearfix:after, -.container_12:before, -.container_12:after { - content: '.'; - display: block; - overflow: hidden; - visibility: hidden; - font-size: 0; - line-height: 0; - width: 0; - height: 0; -} - -.clearfix:after, -.container_12:after { - clear: both; -} - -/* - The following zoom:1 rule is specifically for IE6 + IE7. - Move to separate stylesheet if invalid CSS is a problem. -*/ - -.clearfix, -.container_12 { - zoom: 1; -} \ No newline at end of file diff --git a/mediagoblin/contrib/960_16_col.css b/mediagoblin/contrib/960_16_col.css new file mode 100644 index 00000000..faa6d8b2 --- /dev/null +++ b/mediagoblin/contrib/960_16_col.css @@ -0,0 +1,447 @@ +/* + 960 Grid System ~ Core CSS. + Learn more ~ http://960.gs/ + + Licensed under GPL and MIT. +*/ + +/* + Forces backgrounds to span full width, + even if there is horizontal scrolling. + Increase this if your layout is wider. + + Note: IE6 works fine without this fix. +*/ + +body { + min-width: 960px; +} + +/* Container +----------------------------------------------------------------------------------------------------*/ + +.container_16 { + margin-left: auto; + margin-right: auto; + width: 960px; +} + +/* Grid >> Global +----------------------------------------------------------------------------------------------------*/ + +.grid_1, +.grid_2, +.grid_3, +.grid_4, +.grid_5, +.grid_6, +.grid_7, +.grid_8, +.grid_9, +.grid_10, +.grid_11, +.grid_12, +.grid_13, +.grid_14, +.grid_15, +.grid_16 { + display: inline; + float: left; + position: relative; + margin-left: 10px; + margin-right: 10px; +} + +.push_1, .pull_1, +.push_2, .pull_2, +.push_3, .pull_3, +.push_4, .pull_4, +.push_5, .pull_5, +.push_6, .pull_6, +.push_7, .pull_7, +.push_8, .pull_8, +.push_9, .pull_9, +.push_10, .pull_10, +.push_11, .pull_11, +.push_12, .pull_12, +.push_13, .pull_13, +.push_14, .pull_14, +.push_15, .pull_15, +.push_16, .pull_16 { + position: relative; +} + +/* Grid >> Children (Alpha ~ First, Omega ~ Last) +----------------------------------------------------------------------------------------------------*/ + +.alpha { + margin-left: 0; +} + +.omega { + margin-right: 0; +} + +/* Grid >> 16 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_16 .grid_1 { + width: 40px; +} + +.container_16 .grid_2 { + width: 100px; +} + +.container_16 .grid_3 { + width: 160px; +} + +.container_16 .grid_4 { + width: 220px; +} + +.container_16 .grid_5 { + width: 280px; +} + +.container_16 .grid_6 { + width: 340px; +} + +.container_16 .grid_7 { + width: 400px; +} + +.container_16 .grid_8 { + width: 460px; +} + +.container_16 .grid_9 { + width: 520px; +} + +.container_16 .grid_10 { + width: 580px; +} + +.container_16 .grid_11 { + width: 640px; +} + +.container_16 .grid_12 { + width: 700px; +} + +.container_16 .grid_13 { + width: 760px; +} + +.container_16 .grid_14 { + width: 820px; +} + +.container_16 .grid_15 { + width: 880px; +} + +.container_16 .grid_16 { + width: 940px; +} + +/* Prefix Extra Space >> 16 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_16 .prefix_1 { + padding-left: 60px; +} + +.container_16 .prefix_2 { + padding-left: 120px; +} + +.container_16 .prefix_3 { + padding-left: 180px; +} + +.container_16 .prefix_4 { + padding-left: 240px; +} + +.container_16 .prefix_5 { + padding-left: 300px; +} + +.container_16 .prefix_6 { + padding-left: 360px; +} + +.container_16 .prefix_7 { + padding-left: 420px; +} + +.container_16 .prefix_8 { + padding-left: 480px; +} + +.container_16 .prefix_9 { + padding-left: 540px; +} + +.container_16 .prefix_10 { + padding-left: 600px; +} + +.container_16 .prefix_11 { + padding-left: 660px; +} + +.container_16 .prefix_12 { + padding-left: 720px; +} + +.container_16 .prefix_13 { + padding-left: 780px; +} + +.container_16 .prefix_14 { + padding-left: 840px; +} + +.container_16 .prefix_15 { + padding-left: 900px; +} + +/* Suffix Extra Space >> 16 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_16 .suffix_1 { + padding-right: 60px; +} + +.container_16 .suffix_2 { + padding-right: 120px; +} + +.container_16 .suffix_3 { + padding-right: 180px; +} + +.container_16 .suffix_4 { + padding-right: 240px; +} + +.container_16 .suffix_5 { + padding-right: 300px; +} + +.container_16 .suffix_6 { + padding-right: 360px; +} + +.container_16 .suffix_7 { + padding-right: 420px; +} + +.container_16 .suffix_8 { + padding-right: 480px; +} + +.container_16 .suffix_9 { + padding-right: 540px; +} + +.container_16 .suffix_10 { + padding-right: 600px; +} + +.container_16 .suffix_11 { + padding-right: 660px; +} + +.container_16 .suffix_12 { + padding-right: 720px; +} + +.container_16 .suffix_13 { + padding-right: 780px; +} + +.container_16 .suffix_14 { + padding-right: 840px; +} + +.container_16 .suffix_15 { + padding-right: 900px; +} + +/* Push Space >> 16 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_16 .push_1 { + left: 60px; +} + +.container_16 .push_2 { + left: 120px; +} + +.container_16 .push_3 { + left: 180px; +} + +.container_16 .push_4 { + left: 240px; +} + +.container_16 .push_5 { + left: 300px; +} + +.container_16 .push_6 { + left: 360px; +} + +.container_16 .push_7 { + left: 420px; +} + +.container_16 .push_8 { + left: 480px; +} + +.container_16 .push_9 { + left: 540px; +} + +.container_16 .push_10 { + left: 600px; +} + +.container_16 .push_11 { + left: 660px; +} + +.container_16 .push_12 { + left: 720px; +} + +.container_16 .push_13 { + left: 780px; +} + +.container_16 .push_14 { + left: 840px; +} + +.container_16 .push_15 { + left: 900px; +} + +/* Pull Space >> 16 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_16 .pull_1 { + left: -60px; +} + +.container_16 .pull_2 { + left: -120px; +} + +.container_16 .pull_3 { + left: -180px; +} + +.container_16 .pull_4 { + left: -240px; +} + +.container_16 .pull_5 { + left: -300px; +} + +.container_16 .pull_6 { + left: -360px; +} + +.container_16 .pull_7 { + left: -420px; +} + +.container_16 .pull_8 { + left: -480px; +} + +.container_16 .pull_9 { + left: -540px; +} + +.container_16 .pull_10 { + left: -600px; +} + +.container_16 .pull_11 { + left: -660px; +} + +.container_16 .pull_12 { + left: -720px; +} + +.container_16 .pull_13 { + left: -780px; +} + +.container_16 .pull_14 { + left: -840px; +} + +.container_16 .pull_15 { + left: -900px; +} + +/* `Clear Floated Elements +----------------------------------------------------------------------------------------------------*/ + +/* http://sonspring.com/journal/clearing-floats */ + +.clear { + clear: both; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; +} + +/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */ + +.clearfix:before, +.clearfix:after, +.container_16:before, +.container_16:after { + content: '.'; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; +} + +.clearfix:after, +.container_16:after { + clear: both; +} + +/* + The following zoom:1 rule is specifically for IE6 + IE7. + Move to separate stylesheet if invalid CSS is a problem. +*/ + +.clearfix, +.container_16 { + zoom: 1; +} \ No newline at end of file diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 3b2a9a50..2574683e 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -208,16 +208,6 @@ text-align:center; text-align:right; } -/* media pages */ - -.media_image{ - width:640px; -} - -.media_sidebar{ - width:280px; -} - /* comments */ .comment_author { diff --git a/mediagoblin/static/css/contrib/960_12_col.css b/mediagoblin/static/css/contrib/960_12_col.css deleted file mode 120000 index 15c360e4..00000000 --- a/mediagoblin/static/css/contrib/960_12_col.css +++ /dev/null @@ -1 +0,0 @@ -../../../contrib/960_12_col.css \ No newline at end of file diff --git a/mediagoblin/static/css/contrib/960_16_col.css b/mediagoblin/static/css/contrib/960_16_col.css new file mode 120000 index 00000000..a8e89d29 --- /dev/null +++ b/mediagoblin/static/css/contrib/960_16_col.css @@ -0,0 +1 @@ +/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/960_16_col.css \ No newline at end of file diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html index f6ee7166..2303ce5c 100644 --- a/mediagoblin/templates/mediagoblin/auth/login.html +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -20,10 +20,9 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} -
-
+

Log in

{% if login_failed %}
Login failed!
diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html index 7e18ca58..f77b3782 100644 --- a/mediagoblin/templates/mediagoblin/auth/register.html +++ b/mediagoblin/templates/mediagoblin/auth/register.html @@ -23,7 +23,7 @@ -
+

Create an account!

{{ wtforms_util.render_divs(register_form) }}
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 87adfabb..b71fca24 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -23,7 +23,7 @@ + href="{{ request.staticdirect('/css/contrib/960_16_col.css') }}"/> {% block mediagoblin_head %} @@ -35,8 +35,8 @@
{% block mediagoblin_header %}
-
-
+
+
{% block mediagoblin_logo %} {% endblock %}{% block mediagoblin_header_title %}{% endblock %} @@ -55,8 +55,8 @@
{% endblock %} -
-
+
+
{% include "mediagoblin/utils/messages.html" %} {% block mediagoblin_content %} {% endblock mediagoblin_content %} @@ -64,8 +64,8 @@
{% block mediagoblin_footer %}

- {% include "mediagoblin/utils/object_gallery.html" %} +
+ + + {% endfor %} {% if pagination_base_url %} {# different url, so set that and don't keep the get params #} {{ render_pagination(request, pagination, pagination_base_url, False) }} @@ -37,5 +34,4 @@ {{ render_pagination(request, pagination) }} {% endif %} {% endif %} -
-{% endblock %} +{% endblock %} From 8dc4381032ad754397a1ef5415e664fffee40c37 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 3 Jul 2011 23:04:09 +0200 Subject: [PATCH 48/70] Style navigation buttons --- mediagoblin/static/css/base.css | 23 +++++++++++++++++++ .../mediagoblin/utils/prev_next.html | 14 +++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 997d25c7..74f283a6 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -237,3 +237,26 @@ img.media_icon{ margin:0 4px; vertical-align:sub; } + +/* navigation */ + +.navigation_button{ + width: 139px; + display:block; + float:left; + text-align: center; + background-color: #393939; + text-decoration: none; + padding: 6px 0pt; + font-family: 'Carter One', arial, serif; + font-size:2em; + margin:0; +} + +p.navigation_button{ + color:#272727; +} + +.navigation_left{ + margin-right:2px; +} diff --git a/mediagoblin/templates/mediagoblin/utils/prev_next.html b/mediagoblin/templates/mediagoblin/utils/prev_next.html index e054ed23..8908c298 100644 --- a/mediagoblin/templates/mediagoblin/utils/prev_next.html +++ b/mediagoblin/templates/mediagoblin/utils/prev_next.html @@ -23,23 +23,21 @@
{# There are no previous entries for the very first media entry #} {% if prev_entry_url %} - - {# TODO - insert 'Previous' and 'X' image sources #} - Previous + + < {% else %} {# This is the first entry. display greyed-out 'previous' image #} - X + {% endif %} {# Likewise, this could be the very last media entry #} {% if next_entry_url %} - - {# TODO - insert 'Next' and 'X' image sources #} - Next + + > {% else %} {# This is the last entry. display greyed-out 'next' image #} - X + {% endif %}
From 38f71d47925eea76c34cd36a82600add6a7d0c7a Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 3 Jul 2011 23:13:54 +0200 Subject: [PATCH 49/70] Tiny margin changes --- mediagoblin/static/css/base.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 74f283a6..70b568ba 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -23,12 +23,16 @@ form { /* text styles */ -h1 { +h1{ font-family: 'Carter One', arial, serif; margin-bottom: 20px; margin-top:40px; } +h2{ + margin-top:20px; +} + p { font-family: sans-serif; font-size:16px; @@ -250,7 +254,7 @@ img.media_icon{ padding: 6px 0pt; font-family: 'Carter One', arial, serif; font-size:2em; - margin:0; + margin:0 0 20px } p.navigation_button{ From 62e2f458fbaf9b85a9939fe475338de955c85a87 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 3 Jul 2011 23:32:39 +0200 Subject: [PATCH 50/70] Style changes to messages. Tell me if I changed too much... --- mediagoblin/static/css/base.css | 74 +++++++++++++++------------------ 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 70b568ba..b23bc3cb 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -77,47 +77,6 @@ label { padding-bottom:74px; } -ul.mediagoblin_messages { - list-style:none inside; - color:#393932; - margin:2px; - padding:2px; -} - -ul.mediagoblin_messages li { - background-color:#d4d4d4; - border-style:solid; - border-width:3px; - border-color:#959595; - margin:5px; - padding:8px; -} - -ul.mediagoblin_messages li.message_success { - background-color: #88d486; - border-color: #5bba59; -} - -ul.mediagoblin_messages li.message_warning { - background-color: #d4c686; - border-color: #baa959; -} - -ul.mediagoblin_messages li.message_error { - background-color: #d48686; - border-color: #ba5959; -} - -ul.mediagoblin_messages li.message_info { - background-color: #86b9d4; - border-color: #5998ba; -} - -ul.mediagoblin_messages li.message_debug { - background-color: #aa86d4; - border-color: #8659ba; -} - a.mediagoblin_logo { width:34px; height:25px; @@ -264,3 +223,36 @@ p.navigation_button{ .navigation_left{ margin-right:2px; } + +/* messages */ + +ul.mediagoblin_messages { + list-style:none inside; + color:#f7f7f7; +} + +.mediagoblin_messages li { + margin:5px 0; + padding:8px; + text-align:center; +} + +.message_success { + background-color: #378566; +} + +.message_warning { + background-color: #87453b; +} + +.message_error { + background-color: #87453b; +} + +.message_info { + background-color: #378566; + +.message_debug { + background-color: #f7f7f7; + color:#272727; +} From 18ec9ff324d9bf1af33a7e5c11694d4ee0a83df4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 17:37:41 -0500 Subject: [PATCH 51/70] New thumbnail size is apparently 180x135. We don't know if that's permanent but if it isn't it seems "Mostly Harmless" --- mediagoblin/process_media/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/process_media/__init__.py b/mediagoblin/process_media/__init__.py index 0d1abcb3..a65c3ddc 100644 --- a/mediagoblin/process_media/__init__.py +++ b/mediagoblin/process_media/__init__.py @@ -21,7 +21,7 @@ from celery.task import task from mediagoblin import mg_globals as mgg -THUMB_SIZE = 200, 200 +THUMB_SIZE = 180, 135 MEDIUM_SIZE = 640, 640 From 9fedf30b3548ae58f091248c1ad318c16427b4c5 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 17:38:28 -0500 Subject: [PATCH 52/70] Fixing the symlinks for these CSS files Not everyone runs mediagoblin out of /home/jef/env/mediagoblin/src/schendjes-mediagoblin/ ;) --- mediagoblin/static/css/contrib/960_16_col.css | 2 +- mediagoblin/static/css/contrib/reset.css | 2 +- mediagoblin/static/css/contrib/text.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mediagoblin/static/css/contrib/960_16_col.css b/mediagoblin/static/css/contrib/960_16_col.css index a8e89d29..bc1a430c 120000 --- a/mediagoblin/static/css/contrib/960_16_col.css +++ b/mediagoblin/static/css/contrib/960_16_col.css @@ -1 +1 @@ -/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/960_16_col.css \ No newline at end of file +../../../contrib/960_16_col.css \ No newline at end of file diff --git a/mediagoblin/static/css/contrib/reset.css b/mediagoblin/static/css/contrib/reset.css index e6796fdc..87ae5592 120000 --- a/mediagoblin/static/css/contrib/reset.css +++ b/mediagoblin/static/css/contrib/reset.css @@ -1 +1 @@ -/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/reset.css \ No newline at end of file +../../../contrib/reset.css \ No newline at end of file diff --git a/mediagoblin/static/css/contrib/text.css b/mediagoblin/static/css/contrib/text.css index f54ea50c..d75ce48b 120000 --- a/mediagoblin/static/css/contrib/text.css +++ b/mediagoblin/static/css/contrib/text.css @@ -1 +1 @@ -/home/jef/env/mediagoblin/src/schendjes-mediagoblin/mediagoblin/contrib/text.css \ No newline at end of file +../../../contrib/text.css \ No newline at end of file From 0aa58285c39d7f00f460ac391d4e724dcb42c1f3 Mon Sep 17 00:00:00 2001 From: Caleb Forbes Davis V Date: Sun, 3 Jul 2011 23:59:11 -0500 Subject: [PATCH 53/70] bug#422_user_can_not_edit_own_profile_unless_admin user != username..... --- mediagoblin/templates/mediagoblin/user_pages/user.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index d23daccd..96b6b9d1 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -27,7 +27,7 @@ {% block mediagoblin_content -%} {% if user %}

{{ user.username }}'s profile

- {% if request.user == user.username or request.user['is_admin'] %} + {% if request.user.username == user.username or request.user['is_admin'] %} Edit {% endif %} From 9973c0580fa1b9ce3a75b37d06c645b3f9829fb8 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 08:47:02 -0500 Subject: [PATCH 54/70] Check user['_id'] instead of username, which is slightly more guaranteed --- mediagoblin/templates/mediagoblin/user_pages/user.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 96b6b9d1..ba61e52f 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -27,9 +27,9 @@ {% block mediagoblin_content -%} {% if user %}

{{ user.username }}'s profile

- {% if request.user.username == user.username or request.user['is_admin'] %} + {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} Edit + user.username }}">Edit profile {% endif %} {% include "mediagoblin/utils/profile.html" %} From afa760743147724e6af8666fba17dcdf1e5288a8 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 08:47:28 -0500 Subject: [PATCH 55/70] Just removing some trailing whitespace --- mediagoblin/templates/mediagoblin/user_pages/user.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index ba61e52f..71978373 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -28,16 +28,16 @@ {% if user %}

{{ user.username }}'s profile

{% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} - Edit profile {% endif %} - + {% include "mediagoblin/utils/profile.html" %} {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} -

View all of {{ user.username }}'s media

+

View all of {{ user.username }}'s media

Sorry, no such user found.

{% endif %} -{% endblock %} +{% endblock %} From ae50c14f0fcce247922af3fa889687dabd466b52 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 08:47:46 -0500 Subject: [PATCH 56/70] Removing a tab... hate mixed tabs and spaces :) --- mediagoblin/templates/mediagoblin/user_pages/user.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 71978373..63e66fa5 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -20,7 +20,7 @@ {% block mediagoblin_head %} {% endblock mediagoblin_head %} From a3a17d10683aac3ac503731ecd69b363f81a2d51 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 08:49:52 -0500 Subject: [PATCH 57/70] Put link to edit profile slightly after the profile --- mediagoblin/templates/mediagoblin/user_pages/user.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 63e66fa5..98394684 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -27,13 +27,14 @@ {% block mediagoblin_content -%} {% if user %}

{{ user.username }}'s profile

- {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} -
Edit profile - {% endif %} {% include "mediagoblin/utils/profile.html" %} + {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} + Edit profile + {% endif %} + {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} From 51ca54a8356cb6c628a565693702616067af0bda Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 09:04:37 -0500 Subject: [PATCH 58/70] Adjusting indentation of object_gallery.html --- .../mediagoblin/utils/object_gallery.html | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 96600c33..2c7a7129 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -19,19 +19,19 @@ {% from "mediagoblin/utils/pagination.html" import render_pagination %} {% block object_gallery_content -%} - {% if media_entries %} - {% for entry in media_entries %} -
- - -
- {% endfor %} - {% if pagination_base_url %} - {# different url, so set that and don't keep the get params #} - {{ render_pagination(request, pagination, pagination_base_url, False) }} - {% else %} - {{ render_pagination(request, pagination) }} - {% endif %} + {% if media_entries %} + {% for entry in media_entries %} +
+ + +
+ {% endfor %} + {% if pagination_base_url %} + {# different url, so set that and don't keep the get params #} + {{ render_pagination(request, pagination, pagination_base_url, False) }} + {% else %} + {{ render_pagination(request, pagination) }} {% endif %} + {% endif %} {% endblock %} From b51c574188af117f557c8e871bd53fdcbd9d7692 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 09:08:57 -0500 Subject: [PATCH 59/70] .message_info was missing closing } --- mediagoblin/static/css/base.css | 1 + 1 file changed, 1 insertion(+) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index b23bc3cb..5073c3b4 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -251,6 +251,7 @@ ul.mediagoblin_messages { .message_info { background-color: #378566; +} .message_debug { background-color: #f7f7f7; From 5c72d31d36bad3aee04e2ec46259ba797a352c2b Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 09:11:13 -0500 Subject: [PATCH 60/70] Put the profile stuff in p's instead of
    's --- mediagoblin/static/css/base.css | 7 +++++ .../templates/mediagoblin/utils/profile.html | 26 +++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 5073c3b4..da04e1c4 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -257,3 +257,10 @@ ul.mediagoblin_messages { background-color: #f7f7f7; color:#272727; } + +/* profile stuff */ + +.profile_content p, .profile_bio { + padding: 6px; + background-color: #393939; +} diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html index 21468033..72a285d2 100644 --- a/mediagoblin/templates/mediagoblin/utils/profile.html +++ b/mediagoblin/templates/mediagoblin/utils/profile.html @@ -17,19 +17,17 @@ #} {% block profile_content -%} -
    -
      - {% if user.url %} -
    • - homepage -
    • - {% endif %} - - {% if user.bio %} -
    • - {{ user.bio }} -
    • - {% endif %} -
    +
    + {% if user.url %} +

    + homepage +

    + {% endif %} + + {% if user.bio %} +

    + {{ user.bio }} +

    + {% endif %}
    {% endblock %} From 6178aa0814f8c9f7d6f073c3c0ed2f94e4990500 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 09:41:43 -0500 Subject: [PATCH 61/70] Move submit an item to the user page. --- mediagoblin/templates/mediagoblin/user_pages/user.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 98394684..7f8a3cec 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -35,6 +35,12 @@ user.username }}">Edit profile {% endif %} + {% if request.user['_id'] == user['_id'] %} +

    + Submit an item +

    + {% endif %} + {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} From 24eaf0fd6bd6529ac59bc3963e0013e34c2c01a4 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 09:41:57 -0500 Subject: [PATCH 62/70] Not happy with 180x135, switching back to 180x180 --- mediagoblin/process_media/__init__.py | 2 +- mediagoblin/static/css/base.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/process_media/__init__.py b/mediagoblin/process_media/__init__.py index a65c3ddc..27f72b65 100644 --- a/mediagoblin/process_media/__init__.py +++ b/mediagoblin/process_media/__init__.py @@ -21,7 +21,7 @@ from celery.task import task from mediagoblin import mg_globals as mgg -THUMB_SIZE = 180, 135 +THUMB_SIZE = 180, 180 MEDIUM_SIZE = 640, 640 diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index da04e1c4..10dbc98b 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -187,7 +187,7 @@ text-align:center; .media_thumbnail { padding:0px; width:180px; - height:135px; + height:180px; overflow:hidden; float:left; margin:0px 10px 10px 0px; From 0dd0a71f5eb631052aaa2d542454fc3ce3ddbd59 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 11:17:51 -0500 Subject: [PATCH 63/70] Put some space between the gallery and the rest of the page content --- mediagoblin/templates/mediagoblin/user_pages/user.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 7f8a3cec..aed330c8 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -44,6 +44,8 @@ {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} +
    +

    View all of {{ user.username }}'s media

    Date: Mon, 4 Jul 2011 15:40:05 -0500 Subject: [PATCH 64/70] Set the jpeg quality at 90 for now... --- mediagoblin/process_media/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/process_media/__init__.py b/mediagoblin/process_media/__init__.py index 27f72b65..da3e887e 100644 --- a/mediagoblin/process_media/__init__.py +++ b/mediagoblin/process_media/__init__.py @@ -54,7 +54,7 @@ def process_media_initial(media_id): thumb_file = mgg.public_store.get_file(thumb_filepath, 'w') with thumb_file: - thumb.save(thumb_file, "JPEG") + thumb.save(thumb_file, "JPEG", quality=90) """ Create medium file, used in `media.html` @@ -69,7 +69,7 @@ def process_media_initial(media_id): medium_file = mgg.public_store.get_file(medium_filepath, 'w') with medium_file: - medium.save(medium_file, "JPEG") + medium.save(medium_file, "JPEG", quality=90) # we have to re-read because unlike PIL, not everything reads # things in string representation :) From 1a837cf7c8d61bb4bc1c7b4629ff2bcbbf255a97 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 16:54:06 -0500 Subject: [PATCH 65/70] Don't even show the profile box if no profile exists --- .../templates/mediagoblin/utils/profile.html | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html index 72a285d2..cd60bbfc 100644 --- a/mediagoblin/templates/mediagoblin/utils/profile.html +++ b/mediagoblin/templates/mediagoblin/utils/profile.html @@ -17,17 +17,19 @@ #} {% block profile_content -%} -
    - {% if user.url %} -

    - homepage -

    - {% endif %} + {% if user.url or user.bio %} +
    + {% if user.url %} + + {% endif %} - {% if user.bio %} -

    - {{ user.bio }} -

    - {% endif %} -
    + {% if user.bio %} +
    + {{ user.bio }} +
    + {% endif %} +
    + {% endif %} {% endblock %} From 0b6c3ef14a98f567dd1c29004e58833a5418501b Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 16:58:07 -0500 Subject: [PATCH 66/70] A few media thumbnail changes pre-release - adjust padding so 5 media thumbs can appear per row - lowering the h1 margins - adding a profile content bottom margin --- mediagoblin/static/css/base.css | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 10dbc98b..53e019f6 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -25,8 +25,8 @@ form { h1{ font-family: 'Carter One', arial, serif; - margin-bottom: 20px; - margin-top:40px; + margin-bottom: 15px; + margin-top:15px; } h2{ @@ -190,7 +190,7 @@ text-align:center; height:180px; overflow:hidden; float:left; - margin:0px 10px 10px 0px; + margin:0px 4px 10px 4px; text-align:center; } @@ -260,7 +260,8 @@ ul.mediagoblin_messages { /* profile stuff */ -.profile_content p, .profile_bio { +.profile_content { padding: 6px; background-color: #393939; + margin-bottom: 10px; } From 24df76fa1e4ee4902d882b8e75b5db981d27e08f Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 4 Jul 2011 17:08:10 -0500 Subject: [PATCH 67/70] This extra
    is maybe a bit too much space... --- mediagoblin/templates/mediagoblin/user_pages/media.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 0383277b..1484cc73 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -48,7 +48,7 @@ user= media.uploader().username) }}"> {{- media.uploader().username }}

    -

    +

    Comments

    {% if request.user %} From 7c6dffe34d2f0eccf6805eba452e219778a3109c Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 5 Jul 2011 09:23:20 -0400 Subject: [PATCH 68/70] Adds tarball generation script This just makes it easier to generate tarballs of master and tarballs of releases. --- maketarball.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 maketarball.sh diff --git a/maketarball.sh b/maketarball.sh new file mode 100755 index 00000000..ef34da5b --- /dev/null +++ b/maketarball.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# usage: maketarball +# maketarball +# +# With no arguments, this creates a source tarball from git master with a +# filename based on today's date. +# +# With a argument, this creates a tarball of the tag. +# +# Examples: +# +# ./maketarball +# ./maketarball v0.0.2 + +NOWDATE=`date "+%Y-%m-%d"` + +if [ -z "$1" ] +then + REVISH=master + PREFIX="$NOWDATE-$REVISH" +else + REVISH=$1 + PREFIX="$REVISH" +fi + +# convert PREFIX to all lowercase. +# nix the v from tag names. +PREFIX=`echo "$PREFIX" | tr '[A-Z]' '[a-z]' | sed s/v//` + +echo "== REVISH $REVISH" +echo "== PREFIX $PREFIX" + +echo "" + +echo "generating archive...." +git archive \ + --format=tar \ + --prefix=mediagoblin-$PREFIX/ \ + $REVISH > mediagoblin-$PREFIX.tar + +echo "compressing...." +gzip mediagoblin-$PREFIX.tar + +echo "archive at mediagoblin-$PREFIX.tar.gz" + +echo "done." \ No newline at end of file From 132773ae083ee137d6667ccdfc858c7a6865be5a Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 5 Jul 2011 09:26:45 -0400 Subject: [PATCH 69/70] Updates version to 0.0.3. --- docs/conf.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 0e75a617..6c64cdda 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2011, Free Software Foundation, Inc and contributors' # built documents. # # The short X.Y version. -version = '0.0.2' +version = '0.0.3' # The full version, including alpha/beta/rc tags. -release = '0.0.2' +release = '0.0.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 2a007f4e..799f00d8 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ from setuptools import setup, find_packages setup( name = "mediagoblin", - version = "0.0.2", + version = "0.0.3", packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), zip_safe=False, # scripts and dependencies From 5ed4722de8106a512a4faacfedaae7b8eda7260b Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 5 Jul 2011 09:36:07 -0400 Subject: [PATCH 70/70] Makes maketarball more resilient to errors --- maketarball.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maketarball.sh b/maketarball.sh index ef34da5b..2ee78016 100755 --- a/maketarball.sh +++ b/maketarball.sh @@ -39,6 +39,16 @@ git archive \ --prefix=mediagoblin-$PREFIX/ \ $REVISH > mediagoblin-$PREFIX.tar +if [[ $? -ne 0 ]] +then + echo "git archive command failed. See above text for reason." + if [[ -e mediagoblin-$PREFIX.tar ]] + then + rm mediagoblin-$PREFIX.tar + fi + exit 1; +fi + echo "compressing...." gzip mediagoblin-$PREFIX.tar