# -*- coding: utf-8 -*-
'''
Created on Jul 01, 2014

@author: tc
'''

import logging

from hdabo.views import Folders, AddOrUpdateFolder, DeleteFolder
from hdalab.models.renkan import HdalabRenkan
from hdalab.views.profile import BaseRenkanList


logger = logging.getLogger(__name__)


class ManageRenkans(BaseRenkanList):
    template_name = "editorial/manage_renkans.html"
    default_sort_field = "state"
    default_sort_order = "asc"

    
    def get_context_data(self, **kwargs):
        return self.update_context(super(ManageRenkans, self).get_context_data(**kwargs), HdalabRenkan.objects.exclude(state=HdalabRenkan.EDITION).exclude(state=HdalabRenkan.REJECTED).select_related("renkan", "renkan__owner"))


class HdalabFolders(Folders):
    template_name = "editorial/folders.html"



class HdalabAddOrUpdateFolder(AddOrUpdateFolder):
    template_name = "editorial/add_or_update_folder.html"
    redirect_view = 'hdalab_folders'


class HdalabDeleteFolder(DeleteFolder):
    redirect_view = 'hdalab_folders'