from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1287725326.8172879
_template_filename=u'templates/base_panels.mako'
_template_uri=u'/base_panels.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding=None
_exports = ['message_box_content', 'overlay', 'late_javascripts', 'stylesheets', 'init', 'masthead', 'javascripts']


def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 2
        __M_writer(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n\n')
        # SOURCE LINE 4

        self.has_left_panel=True
        self.has_right_panel=True
        self.message_box_visible=False
        self.overlay_visible=False
        self.message_box_class=""
        self.active_view=None
        self.body_class=""
        
        
        # SOURCE LINE 12
        __M_writer(u'\n    \n')
        # SOURCE LINE 16
        __M_writer(u'\n\n')
        # SOURCE LINE 37
        __M_writer(u'\n\n')
        # SOURCE LINE 48
        __M_writer(u'\n\n')
        # SOURCE LINE 151
        __M_writer(u'\n\n')
        # SOURCE LINE 156
        __M_writer(u'\n\n')
        # SOURCE LINE 191
        __M_writer(u'\n\n')
        # SOURCE LINE 195
        __M_writer(u'\n\n')
        # SOURCE LINE 198
        __M_writer(u'<html>\n    ')
        # SOURCE LINE 199
        __M_writer(unicode(self.init()))
        __M_writer(u'    \n    <head>\n    <title>')
        # SOURCE LINE 201
        __M_writer(unicode(self.title()))
        __M_writer(u'</title>\n    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n    ')
        # SOURCE LINE 203
        __M_writer(unicode(self.stylesheets()))
        __M_writer(u'\n    ')
        # SOURCE LINE 204
        __M_writer(unicode(self.javascripts()))
        __M_writer(u'\n    </head>\n    \n    <body scroll="no" class="')
        # SOURCE LINE 207
        __M_writer(unicode(self.body_class))
        __M_writer(u'">\n\t<div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; min-width: 600px;">\n')
        # SOURCE LINE 210
        __M_writer(u'        <div id="background"></div>\n')
        # SOURCE LINE 212
        __M_writer(u'        <div id="masthead">\n            ')
        # SOURCE LINE 213
        __M_writer(unicode(self.masthead()))
        __M_writer(u'\n        </div>\n        <div id="messagebox" class="panel-')
        # SOURCE LINE 215
        __M_writer(unicode(self.message_box_class))
        __M_writer(u'-message">\n')
        # SOURCE LINE 216
        if self.message_box_visible:
            # SOURCE LINE 217
            __M_writer(u'                ')
            __M_writer(unicode(self.message_box_content()))
            __M_writer(u'\n')
        # SOURCE LINE 219
        __M_writer(u'        </div>\n    ')
        # SOURCE LINE 220
        __M_writer(unicode(self.overlay()))
        __M_writer(u'\n')
        # SOURCE LINE 221
        if self.has_left_panel:
            # SOURCE LINE 222
            __M_writer(u'            <div id="left">\n                ')
            # SOURCE LINE 223
            __M_writer(unicode(self.left_panel()))
            __M_writer(u'\n            </div>\n            <div id="left-border">\n                <div id="left-border-inner" style="display: none;"></div>\n            </div>\n')
        # SOURCE LINE 229
        __M_writer(u'        <div id="center">\n            ')
        # SOURCE LINE 230
        __M_writer(unicode(self.center_panel()))
        __M_writer(u'\n        </div>\n')
        # SOURCE LINE 232
        if self.has_right_panel:
            # SOURCE LINE 233
            __M_writer(u'            <div id="right-border"><div id="right-border-inner" style="display: none;"></div></div>\n            <div id="right">\n                ')
            # SOURCE LINE 235
            __M_writer(unicode(self.right_panel()))
            __M_writer(u'\n            </div>\n')
        # SOURCE LINE 238
        __M_writer(u'\t</div>\n')
        # SOURCE LINE 240
        __M_writer(u'    </body>\n')
        # SOURCE LINE 243
        __M_writer(u'    ')
        __M_writer(unicode(self.late_javascripts()))
        __M_writer(u'\n</html>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_message_box_content(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 194
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_overlay(context,title='',content=''):
    context.caller_stack._push_frame()
    try:
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 158
        __M_writer(u'\n    ')
        # SOURCE LINE 159
        __M_writer(u'\n    ')
        # SOURCE LINE 160
        __M_writer(u'\n\n    <div id="overlay"\n')
        # SOURCE LINE 163
        if not self.overlay_visible:
            # SOURCE LINE 164
            __M_writer(u'    style="display: none;"\n')
        # SOURCE LINE 166
        __M_writer(u'    >\n')
        # SOURCE LINE 168
        __M_writer(u'    <div id="overlay-background" style="position: absolute; width: 100%; height: 100%;"></div>\n    \n')
        # SOURCE LINE 171
        __M_writer(u'    <table class="dialog-box-container" border="0" cellpadding="0" cellspacing="0"\n')
        # SOURCE LINE 172
        if not self.overlay_visible:
            # SOURCE LINE 173
            __M_writer(u'        style="display: none;"\n')
        # SOURCE LINE 175
        __M_writer(u'    ><tr><td>\n    <div class="dialog-box-wrapper">\n        <div class="dialog-box">\n        <div class="unified-panel-header">\n            <div class="unified-panel-header-inner"><span class=\'title\'>')
        # SOURCE LINE 179
        __M_writer(unicode(title))
        __M_writer(u'</span></div>\n        </div>\n        <div class="body">')
        # SOURCE LINE 181
        __M_writer(unicode(content))
        __M_writer(u'</div>\n        <div>\n            <div class="buttons" style="display: none; float: right;"></div>\n            <div class="extra_buttons" style="display: none; padding: 5px;"></div>\n            <div style="clear: both;"></div>\n        </div>\n        </div>\n    </div>\n    </td></tr></table>\n    </div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_late_javascripts(context):
    context.caller_stack._push_frame()
    try:
        h = context.get('h', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 51
        __M_writer(u'\n')
        # SOURCE LINE 54
        __M_writer(u'    ')
        __M_writer(unicode(h.js( 'jquery.event.drag', 'jquery.event.hover', 'jquery.form', 'jquery.rating', 'galaxy.base', 'galaxy.panels' )))
        __M_writer(u'\n    <script type="text/javascript">\n        \n    ensure_dd_helper();\n        \n')
        # SOURCE LINE 59
        if self.has_left_panel:
            # SOURCE LINE 60
            __M_writer(u'            var lp = make_left_panel( $("#left"), $("#center"), $("#left-border" ) );\n            force_left_panel = lp.force_panel;\n')
        # SOURCE LINE 63
        __M_writer(u'        \n')
        # SOURCE LINE 64
        if self.has_right_panel:
            # SOURCE LINE 65
            __M_writer(u'            var rp = make_right_panel( $("#right"), $("#center"), $("#right-border" ) );\n            handle_minwidth_hint = rp.handle_minwidth_hint;\n            force_right_panel = rp.force_panel;\n')
        # SOURCE LINE 69
        __M_writer(u'    \n    </script>\n')
        # SOURCE LINE 72
        __M_writer(u'    <![if !IE]>\n    <script type="text/javascript">\n        var upload_form_error = function( msg ) {\n            if ( ! $("iframe#galaxy_main").contents().find("body").find("div[class=\'errormessage\']").size() ) {\n                $("iframe#galaxy_main").contents().find("body").prepend( \'<div class="errormessage" name="upload_error">\' + msg + \'</div><p/>\' );\n            } else {\n                $("iframe#galaxy_main").contents().find("body").find("div[class=\'errormessage\']").text( msg );\n            }\n        }\n        jQuery( function() {\n            $("iframe#galaxy_main").load( function() {\n                $(this).contents().find("form").each( function() { \n                    if ( $(this).find("input[galaxy-ajax-upload]").length > 0 ){\n                        $(this).submit( function() {\n                            // Only bother using a hidden iframe if there\'s a file (e.g. big data) upload\n                            var file_upload = false;\n                            $(this).find("input[galaxy-ajax-upload]").each( function() {\n                                if ( $(this).val() != \'\' ) {\n                                    file_upload = true;\n                                }\n                            });\n                            if ( ! file_upload ) {\n                                return true;\n                            }\n                            // Make a synchronous request to create the datasets first\n                            var async_datasets;\n                            var upload_error = false;\n                            $.ajax( {\n                                async:      false,\n                                type:       "POST",\n                                url:        "')
        # SOURCE LINE 102
        __M_writer(unicode(h.url_for(controller='/tool_runner', action='upload_async_create')))
        __M_writer(u'",\n                                data:       $(this).formSerialize(),\n                                dataType:   "json",\n                                success:    function(array_obj, status) {\n                                                if (array_obj.length > 0) {\n                                                    if (array_obj[0] == \'error\') {\n                                                        upload_error = true;\n                                                        upload_form_error(array_obj[1]);\n                                                    } else {\n                                                        async_datasets = array_obj.join();\n                                                    }\n                                                } else {\n                                                    // ( gvk 1/22/10 ) FIXME: this block is never entered, so there may be a bug somewhere\n                                                    // I\'ve done some debugging like checking to see if array_obj is undefined, but have not\n                                                    // tracked down the behavior that will result in this block being entered.  I believe the\n                                                    // intent was to have this block entered if the upload button is clicked on the upload\n                                                    // form but no file was selected.\n                                                    upload_error = true;\n                                                    upload_form_error( \'No data was entered in the upload form.  You may choose to upload a file, paste some data directly in the data box, or enter URL(s) to fetch data.\' );\n                                                }\n                                            }\n                            } );\n                            if (upload_error == true) {\n                                return false;\n                            } else {\n                                $(this).find("input[name=async_datasets]").val( async_datasets );\n                                $(this).append("<input type=\'hidden\' name=\'ajax_upload\' value=\'true\'>");\n                            }\n                            // iframe submit is required for nginx (otherwise the encoding is wrong)\n                            $(this).ajaxSubmit( { iframe: true } );\n                            if ( $(this).find("input[name=\'folder_id\']").val() != undefined ) {\n                                var library_id = $(this).find("input[name=\'library_id\']").val();\n                                var show_deleted = $(this).find("input[name=\'show_deleted\']").val();\n                                if ( location.pathname.indexOf( \'admin\' ) != -1 ) {\n                                    $("iframe#galaxy_main").attr("src","')
        # SOURCE LINE 136
        __M_writer(unicode(h.url_for( controller='library_common', action='browse_library' )))
        __M_writer(u'?cntrller=library_admin&id=" + library_id + "&created_ldda_ids=" + async_datasets + "&show_deleted=" + show_deleted);\n                                } else {\n                                    $("iframe#galaxy_main").attr("src","')
        # SOURCE LINE 138
        __M_writer(unicode(h.url_for( controller='library_common', action='browse_library' )))
        __M_writer(u'?cntrller=library&id=" + library_id + "&created_ldda_ids=" + async_datasets + "&show_deleted=" + show_deleted);\n                                }\n                            } else {\n                                $("iframe#galaxy_main").attr("src","')
        # SOURCE LINE 141
        __M_writer(unicode(h.url_for(controller='tool_runner', action='upload_async_message')))
        __M_writer(u'");\n                            }\n                            return false;\n                        });\n                    }\n                });\n            });\n        });\n    </script>\n    <![endif]>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_stylesheets(context):
    context.caller_stack._push_frame()
    try:
        h = context.get('h', UNDEFINED)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 19
        __M_writer(u'\n    ')
        # SOURCE LINE 20
        __M_writer(unicode(h.css('base','panel_layout','jquery.rating')))
        __M_writer(u'\n    <style type="text/css">\n    #center {\n')
        # SOURCE LINE 23
        if not self.has_left_panel:
            # SOURCE LINE 24
            __M_writer(u'            left: 0;\n')
        # SOURCE LINE 26
        if not self.has_right_panel:
            # SOURCE LINE 27
            __M_writer(u'            right: 0;\n')
        # SOURCE LINE 29
        __M_writer(u'    }\n')
        # SOURCE LINE 30
        if self.message_box_visible:
            # SOURCE LINE 31
            __M_writer(u'        #left, #left-border, #center, #right-border, #right\n        {\n            top: 64px;\n        }\n')
        # SOURCE LINE 36
        __M_writer(u'    </style>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_init(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 14
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_masthead(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 154
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_javascripts(context):
    context.caller_stack._push_frame()
    try:
        h = context.get('h', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 40
        __M_writer(u'\n    <!--[if lt IE 7]>\n    ')
        # SOURCE LINE 42
        __M_writer(unicode(h.js( 'IE7', 'ie7-recalc' )))
        __M_writer(u'\n    <![endif]-->\n    <script type="text/javascript">\n        var image_path = \'')
        # SOURCE LINE 45
        __M_writer(unicode(h.url_for("/static/images")))
        __M_writer(u"';\n    </script>\n    ")
        # SOURCE LINE 47
        __M_writer(unicode(h.js( 'jquery' )))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


