1868 Commits

Author SHA1 Message Date
Elrond
416b439fc8 More/better translation.
- Try to preserve some translations (somehow).
- Mark "Tagged with" again for translation.
- Do not translate the empty string
2012-03-17 13:18:43 +01:00
Jef van Schendel
7e5a5acd5a Small formatting changes to footer text. 2012-03-16 23:05:30 +01:00
Elrond
07163593ee Create function to search media by slug.
Searching media by slug is easy on mongo. But doing the
joins in sqlalchemy is not as nice. So created a function
for doing it.

Well, and create the same function for mongo, so that it
also works.
2012-03-16 21:20:14 +01:00
Elrond
d8409c26a0 Fix for mongo.
pymongo does not rewind a cursor after leaving a for loop.
So let us do it by hand. Well.
2012-03-16 21:20:14 +01:00
Elrond
1eff10fa0f More efficient first element fetching and Dot-Notation.
_get_tag_name_from_entries:
1) Replace:
     if q.count():
       elem = q[0]
   by:
     for element in q:
       ...
       break

   this doesn't do two db queries but only one.

2) And another dose of Dot-Notation as usual.
2012-03-16 21:20:14 +01:00
Elrond
1b4d9edaef Fix _get_tag_name_from_entries().
Replace == by =.
2012-03-16 21:19:25 +01:00
Elrond
497d927983 Fix uploading of images (sql: media_data, exif).
When uploading a new image the processing code wants to set
the media_data['exif'] part. As exif is not yet in sql,
there is no way to make this work now. So the workaround is
to check for "no row exists yet" and just ignore exif.
2012-03-15 12:38:09 +01:00
Elrond
729424befd Fix media display for no media_data row in sql.
If there is no media_data row for the current media (for
whatever reason, there might be good ones), let
MediaEntry.media_data not raise an exception but just
return None.

The exif display part now handles this by checking whether
.media_data.exif is defined (None has no attribute exif, so
it's undefined, all fine).
2012-03-15 12:35:58 +01:00
Christopher Allan Webber
007ac2e720 Implemented the MediaEntry .media_data type fields for SQL 2012-03-14 18:28:06 -05:00
Christopher Allan Webber
956335c839 Removing an unnecessary line of whitespace AND crediting Hugo Boyer for the ipython code!
Thanks Hugo Boyer!  I forgot to credit you in my last commit.
2012-03-14 16:03:09 -05:00
Christopher Allan Webber
d87ed21ac4 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-14 16:00:53 -05:00
Christopher Allan Webber
0e93443f59 ipython support in ./bin/gmg shell! 2012-03-14 16:00:34 -05:00
Elrond
36ccc57bea Add gps_altitude and gps_direction to image media_data. 2012-03-14 21:17:50 +01:00
Elrond
28306810c5 Convert (gps) image media_data.
Add mongo_to_sql convert part for converting the media_data
for images. This currently drops the exif data and thus
only converts gps data.
2012-03-14 21:17:07 +01:00
Elrond
ea200c32ac Change image processing to create new .gps_*.
The processing should also create .gps_* instead of the old
['gps']['x']. To ease forward porting, use the new
media.media_data_init() to set the gps data in the media.
2012-03-14 20:17:49 +01:00
Elrond
e0b2b245fe Use .gps_* in the template and add translations.
Instead of .gps.x use .gps_x and add some "is defined" and
stuff.

Also mark some strings for translation in here.
2012-03-14 20:17:49 +01:00
Elrond
ca722c3caf Migration to move gps data around
Move media_data["gps"]["*"] to media_data["gps_*"].
In preparation for media_data.gps_*
2012-03-14 20:17:49 +01:00
Christopher Allan Webber
dc84dbee7f Merge branch 'elrond-sql-convert_video_data' 2012-03-14 14:04:05 -05:00
Christopher Allan Webber
4a86335157 Fix VideoData insertion 2012-03-14 14:03:49 -05:00
Christopher Allan Webber
e5fce8a50c Preserve existing translation 2012-03-14 12:44:19 -05:00
Christopher Allan Webber
ff6933fa4c Provide a source link so we can comply with the AGPL 2012-03-14 12:38:55 -05:00
Elrond
ef7de98ad5 Convert media_data for video
This creates fresh VideoData rows for all the videos in the
mongodb.
2012-03-13 23:08:34 +01:00
Christopher Allan Webber
19e67f5955 Merge remote-tracking branch 'refs/remotes/chemhacker/bug402_nicer_skin_for_video'
Conflicts:
	mediagoblin/templates/mediagoblin/media_displays/video.html
2012-03-13 15:40:59 -05:00
Sacha De'Angeli
560e22e7d2 adding the video.js wrapper 2012-03-12 19:44:55 -05:00
Christopher Allan Webber
849cf91fc8 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-12 18:38:35 -05:00
Elrond
cc9f9a1dd3 Another .one -> .find_one
Same idea as in the previous commit.
Joar caught this one.

To reproduce
1. Create a user with an all-decimal ObjectId in mongo
2. Login using that user, while mongodb is enabled.
3. Switch instance to sql.
4. Restart.
5. Refresh any page.

This will error, because no user with that object id exists
any more.

While around, improved logging.
2012-03-13 00:19:53 +01:00
Christopher Allan Webber
1f36e6bee9 Merge remote-tracking branch 'derek-moore/bug293_non_ascii_password' 2012-03-12 18:19:03 -05:00
Derek Moore
20a3e278bc Changes for 293. Tests pass, encode UTF8 on password on registration (and also for subsequent logins once the user is created) is working. 2012-03-12 16:02:42 -07:00
Elrond
84812db59d Change user search from .one to .fine_one.
When searching for a user by username, there can either be
no result or one result. There is a unique constraint on
the db.

.one in mongokit raises an error for more than one result.
But that can't happen anyway. So no problem.

.one in sqlalchemy raises an error for more than one, but
that's not a problem anyway. It also raises an error for no
result. But no result is handled by the code anyway, so no
need to raise an exception.

.find_one doesn't raise an exception for more than one
result (no problem anyway) and just returns None for no
result. The later is handled by the code.
2012-03-12 23:46:04 +01:00
Elrond
dd0799ad0a Better media_data sql table for images.
1. Change to the current primary key = media_entry id
   layout
2. Add gps_{latitude,longitude} to the table.
2012-03-12 21:21:35 +01:00
Sacha De'Angeli
4badfd9317 adds video preload bug 375 2012-03-12 14:57:31 -05:00
Christopher Allan Webber
8bc894e82b Added m4v to list of media types and a comment stating we should
autogenerate extension list
2012-03-12 13:38:22 -05:00
Jef van Schendel
fcc0f4e81d Slight change to thumbnail gallery style 2012-03-11 00:03:50 +01:00
Elrond
193e0f5346 Improve logging of sql queries a bit.
Docs:
  http://docs.sqlalchemy.org/en/latest/core/engines.html#configuring-logging

So for an application utilizing python logging for real
(and MediaGoblin should) the rule is:
- Don't use echo=True,
- but reconfigure the appropiate loggers' level.

So replaced the echo=True by a line to reconfigure the
appropiate logger to achieve the same effect.

This still dumps whole bloats of SQL queries into the main
log, but at least they're not duped any more.
2012-03-10 22:48:24 +01:00
Elrond
3c7d451c71 Forgot to add FileKeynames to MODELS 2012-03-08 21:18:17 +01:00
Elrond
a9dac7c83d Normalize MediaFile.name (make it a foreignkey)
The name part of a MediaFile is only using a very limited
number of items. Currently things like "original" or
"thumb".

So instead of storing the string on each entry, just store
a short integer referencing the FileKeynames table and have
the appropiate string there.
2012-03-08 21:11:18 +01:00
Joar Wandborg
703d09b985 Changed from key-notation to dot-notation in edit_profile 2012-03-08 01:02:40 +01:00
Joar Wandborg
4dbf16be33 SQL: Added MediaFile and MediaAttachmentFile to MODELS 2012-03-08 01:02:06 +01:00
Elrond
814334f6eb Generic generate_slug for mongo and sql.
Using the new check_media_slug_used it is possible to have
one generic generate_slug in the mixin class instead of in
each db class.

In the sql variant self.id is not always set: If the slug
alone would create a dupe the current code decides for "no
slug at all".
2012-03-07 21:32:20 +01:00
Jef van Schendel
74743bed0a Push another half-fix for portrait thumbnails. Man, this thing is breaking all over the place. 2012-03-07 16:29:02 +01:00
Jef van Schendel
2b7b701019 Sort-of fixes so the header does not collapse anymore. Header needs redesigning. 2012-03-07 16:24:23 +01:00
Jef van Schendel
8860fd0708 Header doesn't need a height 2012-03-07 16:17:21 +01:00
Jef van Schendel
c4370069ec Actually decrease thumbnail size instead of just their containers 2012-03-07 16:11:24 +01:00
Elrond
0dedf3f2cf Translate less html.
Instead of translating <p ...>TEXT</p> just mark TEXT for
translation. That way formatting changes can be done
without affecting the translations.
2012-03-06 14:49:42 +01:00
Jef van Schendel
3d541b04a9 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-06 00:36:15 +01:00
Jef van Schendel
b01a3b9386 Revert thumbnail gallery change: switch back to tables 2012-03-06 00:35:55 +01:00
Jef van Schendel
fe53180359 Fix merge conflict in prev_next.html 2012-03-06 00:31:34 +01:00
Elrond
b62b3b982a Generic check_media_slug_used db utility.
In two cases (generating a new slug and editing the slug)
it is nice to know in advance (before the db gets angry)
that the slug is used/free. So created a db utility
function to check for this on mongo and sql:
check_media_slug_used()
2012-03-05 21:37:05 +01:00
Elrond
c65cbf9514 SQL: Tool to cleanup unused tag slugs.
The current SQL layout/sqlalchemy strucuture can't detect
whether a slug isn't needed any more and delete it. So
provide a tool function to cleanup unused slugs.

It's currently not hooked to any gmg function!
2012-03-05 21:30:39 +01:00
Jef van Schendel
1213b8260a Stop failing if there is no previous/next to go to 2012-03-05 19:27:26 +01:00