2387 Commits

Author SHA1 Message Date
Sebastian Spaeth
cacb6feae4 Release note 0.3.2 blurb
On MongoDB...
2012-12-15 21:00:41 +01:00
Christopher Allan Webber
9d5cd0b924 Adding info to the docs about running dbupdate
Both adding info to run it when adding new media types, and adding
info that you might need to stop mediagoblin before you run these
commands.
2012-12-14 18:29:00 -06:00
Christopher Allan Webber
00da119ec3 Switching both gettext calls to _() so babel can find/extract them.
Babel looks for _() and gettext() so this is necessary.
2012-12-14 10:49:05 -06:00
Christopher Allan Webber
cc81b5e55e Add comments explaining how translitcodec *is* used 2012-12-14 09:29:46 -06:00
Sebastian Spaeth
c843de8a57 Add example to the lazy gettext version to make clear when it's appropriate
I needed an example to really get when lazy_gettext would be good...
2012-12-14 15:16:49 +01:00
Sebastian Spaeth
18a52dacca Use the correct translation mechanism
We accidentally used the fake translation mechanism here which will not
actually translate anything.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-14 15:13:31 +01:00
Sebastian Spaeth
2f5926a65d Fiy python2.7'ism (#566)
The oauth plugin used timedelta.total_seconds which was introduced
in python 2.7 only. To preserve backwards compatability, we simply
calculate the time difference in seconds manually.

I considered monkeypatching total_seconds to the timedelta object,
but it is a built-in type written in C (I believe) and modifying
attributes failed horribly. Switch this to use total_seconds once we
require python 2.7 as minimum version.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-14 11:52:53 +01:00
Jef van Schendel
a04cd2e596 Small styling edits to thumbnails 2012-12-13 23:39:19 +01:00
Elrond
d2fad5c9c3 Make "add media to collection" a normal <img/>
This button used to be a css style <a href=...> </a> (note:
No contents for the <a>). Using this approach has various
drawbacks. Most notably:
- Not clickable in text mode browsers
- Possibly getting marked as a hidden (spam) link
- No alt attribute

So replaced with a real <img/>.

I have no idea what to put in the alt attribute.
2012-12-13 21:19:37 +01:00
Elrond
42fe4f9965 Migrate some fixes from base.html to airy/base.html.
When fixing our templates, we should always take a look at
the other themes and fix those too.
2012-12-13 15:39:22 +01:00
Elrond
248b7ba346 Do not translate just a variable expansion.
No point in translating <p>{{ var }}</p>. Really.

This does not hurt the string freeze, as it removes a
translateable string.  So any translations of this string
are just well ...  usefuless afterwards.
2012-12-12 21:51:19 +01:00
Elrond
13ab48a7c4 Fix spacing in links to attachment files.
We had """<a href="abc.dat"> abc.dat</a>""" (note the
apace).  And this space is being rendered as a link by
browsers.  This looks strange, really.

So fix the spacing.
2012-12-12 21:49:51 +01:00
Christopher Allan Webber
6af6bc05bb We don't need to save entries during processing... also adding comments explaining such 2012-12-12 10:14:24 -06:00
Sebastian Spaeth
af6a43d140 More unicode fixes in the test suite
Pass in unicode not (binary) strings where sqlite expects unicode
values to prevent the test suite from (correctly) complaining about
errors.

I now pass the full suite without any complaints.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-12 12:35:26 +01:00
Christopher Allan Webber
8ba4380ff7 Setting the user profile back to 3 columns wide!
Previously this was set to two when the spacing between thumbs got borkified.
2012-12-11 20:00:08 -06:00
Sebastian Spaeth
fc7b1b17eb Make sqlalchemy stop complaining about non-unicode input
These tests output noisy sql complaints about receiving non-unicode
for an unicode field. This was ... well ... because we were handing
in non-unicode usernames and passwords.

Prefixing usernames/passwords with u'' makes the testsuite less noisy
and verbose.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-11 16:55:11 +01:00
Sebastian Spaeth
d24a82970e Fix CSRF tests with webtest 1.4.0
CSRF tests apparently passed with earlier versions of webtest, but
failed with the latest webtest (1.4.0) package. It choked on passing
a "key=value; " cookie as it split at the semicolon and failed to
find additional values or something like that. Removing the semicolon
makes this test pass.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-11 15:38:28 +01:00
Christopher Allan Webber
78fd5581a9 Remove print statments from this migration.
The reason for wanting to give extra information to the user (this is
a very special case migration) is good, but we don't have a nice
"official" way to capture and present that information during tests,
so removing this.
2012-12-10 16:17:24 -06:00
Elrond
a64abbb10a Fix typo, disable debugging. 2012-12-10 16:17:24 -06:00
Elrond
ea91c183ff UniqueConstraing migration: Adding the explaining comments.
Add a lengthy comment explaining all the variants.
2012-12-10 16:17:24 -06:00
Elrond
0f14c362c3 Fixing our broken CollectionItem unique constraint.
This one seems to work nicely in all relevant situations.
See comments inside the source.
2012-12-10 16:17:24 -06:00
Nathan Yergler
afe0afdb88 Ensure query_dict is a dict after the contents have been modified.
_fix_query_dict modifies its argument in place. Ensure that the
argument passed in has a local name and will be passed into the
subsequent filter_by call.
2012-12-10 12:30:04 +01:00
Christopher Allan Webber
41fc4698c5 Eeek! Set the migration number to the current migration number being run! 2012-12-09 12:20:06 -06:00
Christopher Allan Webber
a4eef7fe91 Elrond's suggestion: have set_current_migration execute after each migration run. 2012-12-09 12:12:07 -06:00
Christopher Allan Webber
a589201714 Committing extracted and compiled translations 2012-12-07 12:46:37 -06:00
Christopher Allan Webber
9b25ad59d3 Committing present MediaGoblin translations before pushing extracted messages 2012-12-07 12:45:47 -06:00
Christopher Allan Webber
52539acad2 Add a UniqueConstraint add test in test_sql_migrations
We should have this anyway, and Elrond needs it to help fix current
broken migration thingies.
2012-12-05 16:14:50 -06:00
Sebastian Spaeth
e2ae0f5920 Fix user collection gallery
We were fetching the user collection gallery by slug only, so if two users
had the same collection slug, we would not have been sure which one we'd get.

Fix this by explicitly only fetching the specific user's collections. Also
switch over the view function to make use of the new active_user_from_url
decorator that fetches the User() object for us.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-05 13:55:31 +01:00
Sebastian Spaeth
64c2a4002c Switch over the user gallery to the active_user_from_url decorator
This switches the user gallery page over to use the new decorator, and
cleans up the queries to be in proper sqlalchemy format rather than the
old mongo format.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-05 13:55:30 +01:00
Sebastian Spaeth
ad7420281c Create a active_user_from_url decorator
This can be used for URL patterns containing a <user> element. It will look
up the corresponding user among all active users and return a 404 NOT FOUND
page if there is no such active user. It then passes the User() instance as
url_user keyword argument to the decorated view function.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-05 13:37:19 +01:00
Sebastian Spaeth
2222278dcd Remove gridify_*
We injected a gridify_list and gridify_cursor function into each jinja2
template that we render. This was used to split the list of media_entries
into batches of 5 for nicer table columns. However, jinja2 has a nice |batch
filter built in that does the job for us just as well with less code (on our side)

Less code=good

so let's merge this one.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-04 17:31:12 +01:00
Christopher Allan Webber
1244ffc8f5 We arean't using header_dropdown.js anymore because the dropdown is gone! 2012-12-04 09:35:07 -06:00
Sebastian Spaeth
5f8b4ae895 make media_manager a property of MediaEntry in mixin.py
In all cases where get_media_manager(_media_type_as_string) was called in
our code base we ultimately passed in a "MediaEntry().media_type" to get
the matching MEDIA_MANAGER. It so makes sense to make this a function of
the MediaEntry rather than a global function in mediagoblin.media_types and
passing around media_entry.media_type as arguments all the time.

It saves a few import statements and arguments. I also made it so the
Media_manager property is cached for subsequent calls, although I am not too
sure that this is needed (there are other cases for which this would make
more sense)

Also add a get_media_manager test to the media submission tests. It submits
an image and checks that both media.media_type and media.media_manager
return the right thing. Not sure if these tests could not be merged with an
existing submission test, but it can't hurt to have things explicit.

TODO: Right now we iterate through all existing media_managers to find the
right one based on the string of its module name. This should be made a simple
dict lookup to avoid all the extra work.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-04 15:15:41 +01:00
Sebastian Spaeth
c39b9afc83 Fallback to "en_US" if browser does not send preferred languages
E.g. in our test suite we don't send an "accepted languages" header, which
caused the language matching to fail. So we need to explicitely fallback to
en_US, in case request.accepted_languages is None. This fixes the tests and
all cases where user browsers don't send preferred languages.

This also fixes issue #562, the AVAILABLE_LOCALES are already case-normalized
and we don't need to fudge the preferred language through the lower_upper_locale
thing for each and every request.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-04 09:44:07 +01:00
Christopher Allan Webber
78d932e792 Moving thingiview.js into extlib/ 2012-12-03 14:57:52 -06:00
Christopher Allan Webber
e7e435342a Switch stl processing over to using the workbench
Previously this was writing directly to the public store... that won't
work with cloudfiles backend, for example :)
2012-12-03 14:40:49 -06:00
Christopher Allan Webber
c31a501066 Correcting minor typo in exception string: Empyt->Empty 2012-12-03 14:40:49 -06:00
Christopher Allan Webber
7b8af389a9 Removing unused conversions subdir 2012-12-03 14:40:49 -06:00
Christopher Allan Webber
39c340f280 Moving blender render files to be accessed via pkg_resources
Previously the .blend and .py files had to be in the same directory
mediagoblin/celery launched from.  This is now fixed so it pulls them
out of the package proper.
2012-12-03 14:40:48 -06:00
Christopher Allan Webber
8bef424f24 Removing render_test.py, which isn't used 2012-12-03 14:40:48 -06:00
Aeva Ntsc
6fbde77313 Removed debug info from the sidebar. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
ee3f876867 tweaking the template 2012-12-03 14:40:48 -06:00
Aeva Ntsc
de69f43aab Fixed the binary stl loader. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
d93eac36fc Disabled thingiview for obj models, since thingiview's support for them seems to be broken. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
d25ed5dd4c Added a table to store the file extension of a model. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
418d1b149b Updated the template for viewing stl models. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
12a104671d Added preview rendering for a bunch of different shots. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
ecee8d62c1 Catching ValueError when trying to use ObjModel on binary stl files. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
8f496712d0 Added script for manually testing the blender renderer. 2012-12-03 14:40:48 -06:00
Aeva Ntsc
1695bdf63e Added blender renderer 2012-12-03 14:40:47 -06:00