|
|
@ -74,26 +74,27 @@ def lp_media_for_type(db, type, tag=None, max_items=MAX_HOME_ITEMS_DEFAULT): |
|
|
|
|
|
|
|
|
|
|
|
@user_not_banned |
|
|
|
@user_not_banned |
|
|
|
def frontpage_view(request): |
|
|
|
def frontpage_view(request): |
|
|
|
|
|
|
|
config = get_config('mediagoblin.plugins.mediagoblin-oyd') |
|
|
|
|
|
|
|
categories = config.items() |
|
|
|
|
|
|
|
|
|
|
|
images = lp_media_for_type(request.db, u'mediagoblin.media_types.image', None, MAX_HOME_ALL_PHOTO_ITEMS) |
|
|
|
images = lp_media_for_type(request.db, u'mediagoblin.media_types.image', None, MAX_HOME_ALL_PHOTO_ITEMS) |
|
|
|
videos = lp_media_for_type(request.db, u'mediagoblin.media_types.video', None, MAX_HOME_ALL_VIDEO_ITEMS) |
|
|
|
videos = lp_media_for_type(request.db, u'mediagoblin.media_types.video', None, MAX_HOME_ALL_VIDEO_ITEMS) |
|
|
|
|
|
|
|
names = [] |
|
|
|
logolar = lp_media_for_type(request.db, u'mediagoblin.media_types.image', "logo", MAX_HOME_LP_ITEMS) |
|
|
|
for name, (type, tag) in categories: |
|
|
|
bultenler = lp_media_for_type(request.db, u'mediagoblin.media_types.pdf', "bulten", MAX_HOME_LP_ITEMS) |
|
|
|
globals()[name] = lp_media_for_type(request.db, u'mediagoblin.media_types.{}'.format(type), tag, MAX_HOME_FEATURED_ITEMS) |
|
|
|
yayinlar = lp_media_for_type(request.db, u'mediagoblin.media_types.pdf', "yayin", MAX_HOME_LP_ITEMS) |
|
|
|
names.append(name) |
|
|
|
|
|
|
|
# logolar = lp_media_for_type(request.db, u'mediagoblin.media_types.image', "logo", MAX_HOME_LP_ITEMS) |
|
|
|
|
|
|
|
# bultenler = lp_media_for_type(request.db, u'mediagoblin.media_types.pdf', "bulten", MAX_HOME_LP_ITEMS) |
|
|
|
|
|
|
|
# yayinlar = lp_media_for_type(request.db, u'mediagoblin.media_types.pdf', "yayin", MAX_HOME_LP_ITEMS) |
|
|
|
|
|
|
|
|
|
|
|
featured_images = lp_media_for_type(request.db, u'mediagoblin.media_types.image', FEATURED_TAG, MAX_HOME_FEATURED_ITEMS) |
|
|
|
featured_images = lp_media_for_type(request.db, u'mediagoblin.media_types.image', FEATURED_TAG, MAX_HOME_FEATURED_ITEMS) |
|
|
|
featured_videos = lp_media_for_type(request.db, u'mediagoblin.media_types.video', FEATURED_TAG, MAX_HOME_FEATURED_ITEMS) |
|
|
|
featured_videos = lp_media_for_type(request.db, u'mediagoblin.media_types.video', FEATURED_TAG, MAX_HOME_FEATURED_ITEMS) |
|
|
|
|
|
|
|
send_dict = {'images': images, 'videos': videos, 'featured_videos': featured_videos, 'allow_registration': mg_globals.app_config["allow_registration"]} |
|
|
|
|
|
|
|
for item in names: |
|
|
|
|
|
|
|
send_dict[item] = item |
|
|
|
return render_to_response( |
|
|
|
return render_to_response( |
|
|
|
request, 'oyd/root.html', |
|
|
|
request, 'oyd/root.html', |
|
|
|
{'images': images, |
|
|
|
send_dict) |
|
|
|
'videos': videos, |
|
|
|
|
|
|
|
'logolar': logolar, |
|
|
|
|
|
|
|
'bultenler': bultenler, |
|
|
|
|
|
|
|
'yayinlar': yayinlar, |
|
|
|
|
|
|
|
'featured_images': featured_images, |
|
|
|
|
|
|
|
'featured_videos': featured_videos, |
|
|
|
|
|
|
|
'allow_registration': mg_globals.app_config["allow_registration"]}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def frontpage_view_hook(): |
|
|
|
def frontpage_view_hook(): |
|
|
|
return frontpage_view |
|
|
|
return frontpage_view |
|
|
|