• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python widget.ThumbWdg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyasm.widget.ThumbWdg的典型用法代码示例。如果您正苦于以下问题:Python ThumbWdg类的具体用法?Python ThumbWdg怎么用?Python ThumbWdg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ThumbWdg类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_logins_wdg

    def get_logins_wdg(my, logins):
        logins_div = DivWdg()
        for login in logins:
            login_div = DivWdg()
            logins_div.add(login_div)
            login_div.add_style("padding: 5px")
            # login_div.add_style("height: 30px")
            login_div.add_style("margin: 0 5px 5px 0")
            login_div.add_attr("spt_login", login.get_value("login"))

            thumb_div = DivWdg()
            login_div.add(thumb_div)
            thumb_div.add_style("float: left")
            thumb_div.add_style("margin-right: 5px")
            thumb_div.add_style("padding-top: 1px")

            thumb = ThumbWdg()
            thumb.set_sobject(login)
            thumb_div.add(thumb)
            thumb.set_icon_size(15)

            login_div.add(login.get_full_name())

            login_div.add_behavior(
                {
                    "type": "click_up",
                    "sobject_display_expr": my.sobject_display_expr,
                    "tab_view": my.tab_view,
                    "cbjs_action": """
            var top = bvr.src_el.getParent(".spt_schedule_top");
            var class_name = 'tactic.ui.tools.schedule_wdg.ScheduleUserToolWdg';
            var login = bvr.src_el.getAttribute("spt_login")

            var kwargs = {
                login: login
            };
            if (bvr.sobject_display_expr)
                kwargs['sobject_display_expr'] = bvr.sobject_display_expr;
            if (bvr.tab_view)
                kwargs['tab_view'] = bvr.tab_view;

            var content = top.getElement(".spt_schedule_content");
            spt.panel.load(content, class_name, kwargs);
            """,
                }
            )
            login_div.add_hover()

        return logins_div
开发者ID:hellios78,项目名称:TACTIC,代码行数:49,代码来源:schedule_wdg.py


示例2: preprocess

 def preprocess(self):
     if self.get_option('preview') != 'false':
         self.thumb = ThumbWdg()
         self.thumb.set_sobjects(self.sobjects)
         self.thumb.set_icon_size(60)
         # passing options from this to ThumbWdg, shouldn't have conflicts
         options = self.options
         self.thumb.set_options(options)
开发者ID:mincau,项目名称:TACTIC,代码行数:8,代码来源:table_element_wdg.py


示例3: display_shot

    def display_shot(my, shot, widget, count, is_current=False):
        thumb = ThumbWdg()
        thumb.set_sobject(shot)
        thumb.set_icon_size(45)

        widget.add( " " * 5 * count + "L ")
        widget.add(thumb)
        widget.add(" ")
        span = SpanWdg()
        if is_current:
            span.add_style("background: #eee")
            span.add_style("font-weight: bold")
            span.add_style("font-size: 1.1em")
        span.add(shot.get_code())
        span.add(" ")
        span.add(shot.get_value("description"))
        widget.add(span)
        widget.add("<br/>")
开发者ID:0-T-0,项目名称:TACTIC,代码行数:18,代码来源:shot_instance_adder_wdg.py


示例4: GeneralPublishElementWdg

class GeneralPublishElementWdg(BaseTableElementWdg):
    ''' A general publish table element with the option of having a thumbnail '''
    def get_arg_keys(self):
        return {'view': 'a custom view other than publish'}

    def preprocess(self):
        if self.get_option('preview') != 'false':
            self.thumb = ThumbWdg()
            self.thumb.set_sobjects(self.sobjects)
            self.thumb.set_icon_size(60)
            # passing options from this to ThumbWdg, shouldn't have conflicts
            options = self.options
            self.thumb.set_options(options)
        # for its own preprocess and data caching

    def get_display(self):
        self.view = self.kwargs.get('view')
        if not self.view:
            self.view = 'publish'
        widget = Widget()
        sobject = self.get_current_sobject()
        search_type = sobject.get_search_type()
        search_id = sobject.get_id()

        if self.get_option('preview') != 'false': 
            self.thumb.set_current_index(self.get_current_index())
            widget.add(self.thumb)

        publish_link = PublishLinkWdg(search_type,search_id, config_base=self.view) 
        div = DivWdg(publish_link)
        div.set_style('clear: left; padding-top: 6px')
        widget.add(div)

        # build a popup link to show publish browsing
        browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
        browse_link.add_behavior({'type': 'click_up',
            'cbjs_action': 'spt.popup.get_widget(evt, bvr)',
            'options': {'popup_id' : 'publish_browser',
                        'class_name' : 'pyasm.prod.web.PublishBrowserWdg' ,
                        'title': 'Publish Browser'},
            'args' : { 'search_type': search_type,
                        'search_id' : search_id }
            })
        div.add(browse_link)
        div.set_style('padding-top: 6px')


        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:48,代码来源:table_element_wdg.py


示例5: get_title_wdg

    def get_title_wdg(my):

        if my.parent:
            code = my.parent.get_value("code", no_exception=True)
            name = my.parent.get_value("name", no_exception=True)
            search_type_obj = my.parent.get_search_type_obj()
        else:
            code = my.sobject.get_value("code", no_exception=True)
            name = my.sobject.get_value("name", no_exception=True)
            search_type_obj = my.sobject.get_search_type_obj()


        title = DivWdg()
        search = Search("sthpw/snapshot")
        search.add_filter("search_type", "sthpw/search_type")
        search.add_filter("search_code", search_type_obj.get_value("code"))
        if search.get_sobject():
            thumb = ThumbWdg()
            title.add(thumb)
            thumb.set_icon_size(30)
            thumb.set_sobject(search_type_obj)
            thumb.add_style("float: left")



        title.add_color("background", "background3")
        title.add_style("height: 20px")
        title.add_style("padding: 6px")
        title.add_style("font-weight: bold")
        title.add_style("font-size: 1.4em")
        title.add_border()


        stype_title = search_type_obj.get_value("title")
        if stype_title:
            title.add("%s: " % stype_title)

        if name:
            title.add("%s" % name)
            if code:
                title.add(" <i style='font-size: 0.8; opacity: 0.7'>(%s)</i>" % code)
        elif code:
            title.add("%s" % code)
        else:
            title.add("(No name)")


        return title
开发者ID:southpawtech,项目名称:TACTIC-DEV,代码行数:48,代码来源:sobject_wdg.py


示例6: SubmissionInfoWdg

class SubmissionInfoWdg(AssetInfoWdg):
    '''widget information about a submission in a condensed manner'''

    def preprocess(self):
        self.thumb = ThumbWdg()
        self.thumb.set_sobjects(self.sobjects)
        self.thumb.preprocess()


    def get_display(self):
        
        self.sobject = self.get_current_sobject()

        table = Table(css='embed')
        table.add_style("width: 300px")
        table.add_color('color','color')
        table.add_row()
        td = table.add_cell("<i>Code: </i> <b style='font-size: 1.2em'>%s</b>" % self.sobject.get_code() )
        td.add_style("background: #e0e0e0")
        table.add_row()

        self.thumb.set_current_index(self.get_current_index())
        table.add_cell(self.thumb)

        table2 = Table(css='embed')
        table2.add_row()
        table2.add_cell("<i>Status: </i>")
        status = self.sobject.get_value("status")
        if not status:
            table2.add_cell("<i style='color: #c0c0c0'>None</i>")
        else:
            table2.add_cell(self.sobject.get_value("status") )

        self._add_frame_range(table2)
        table.add_cell( table2 )

        table.add_row()
        td = table.add_cell( "<i>Description: </i>")

        description = self.sobject.get_value("description")
        #td.add(WikiUtil().convert(description))

        expand = ExpandableTextWdg()
        expand.set_id('asset_info_desc')
        expand.set_value( WikiUtil().convert(description) )
        expand.set_max_length(300) 
        td.add(expand)

        return table
开发者ID:mincau,项目名称:TACTIC,代码行数:49,代码来源:asset_info_wdg.py


示例7: handle_missing_instance

    def handle_missing_instance(my, table, instance, asset):

        asset_code = asset.get_code()

        table.add_row()

        table.add_blank_cell()

        # add the thumbnail
        thumb = ThumbWdg()
        thumb.set_name("images")
        thumb.set_sobject(asset)
        thumb.set_icon_size(45)
        table.add_cell(thumb)


        info_wdg = Widget()
        info_wdg.add("<b>%s</b>" % instance)
        info_wdg.add("<div style='font-size: 0.8em'>%s</div>" % asset_code )
        table.add_cell(info_wdg)

        table.add_blank_cell()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:22,代码来源:app_sobject_checkin_wdg.py


示例8: get_category_preview_wdg

    def get_category_preview_wdg(self, paths, title=None, tags={}):

        div = DivWdg()

        if not title:
            title = "Paths"
        div.add("%s (%s)<hr/>" % (title, len(paths)) )
        if not paths:
            div.add("-- None --<br/>")

        paths_div = DivWdg()
        div.add(paths_div)

        from pyasm.widget import ThumbWdg

        for path in paths:
            path_div = DivWdg()
            paths_div.add(path_div)
            path_div.add_style("float: left")
            path_div.add_style("min-height: 60px")
            path_div.add_style("margin: 15px")
            path_div.add_style("width: 60px")

            icon_link = ThumbWdg.find_icon_link(path)
            path_div.add("<div><img width='60px' src='%s'/></div>" % icon_link)
            filename = os.path.basename(path)
            #path_div.add(path)
            path_div.add(filename)

            if tags:
                path_tags = tags.get(path)
                path_div.add( "&nbsp;"*10)
                path_div.add(path_tags['sobject'])

        div.add("<br clear='all'/>")
        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:36,代码来源:ingestion_wdg.py


示例9: preprocess

 def preprocess(self):
     self.thumb = ThumbWdg()
     self.thumb.set_icon_size('60')
     self.thumb.set_sobjects(self.sobjects)
     self.thumb.preprocess()
开发者ID:mincau,项目名称:TACTIC,代码行数:5,代码来源:asset_info_wdg.py


示例10: ShotInfoWdg

class ShotInfoWdg(AssetInfoWdg):
    '''widget to display the code, name and description in one column'''


    def preprocess(self):
        self.thumb = ThumbWdg()
        self.thumb.set_icon_size('60')
        self.thumb.set_sobjects(self.sobjects)
        self.thumb.preprocess()


    def get_display(self):
        if not self.thumb:
            self.preprocess()
        
        self.sobject = self.get_current_sobject()

        table = Table(css='embed')
        table.add_color('color','color')
        table.add_style("width: 300px")
        table.add_row()

        th = table.add_header("<i>Code: </i> <b style='font-size: 1.2em'>%s</b>" % self.sobject.get_code() )
        # add status
        th.add_style('text-align','left')
        status_span = SpanWdg("", css='large')
        th.add(status_span)

        status = self.sobject.get_value("status")
        if status:
            status_span.add(self.sobject.get_value("status"))
        
        table.add_row()
        
        self.thumb.set_current_index(self.get_current_index())
        thumb_td = table.add_cell(self.thumb)
        row_span = 2
       
        if self.sobject.has_value("priority"):
            row_span = 3
            # add priority
            table.add_cell("<i>Priority: </i>")
            priority = self.sobject.get_value("priority")
            if not priority:
                table.add_cell("None")
            else:
                table.add_cell(self.sobject.get_value("priority") )
            # this row should be added only if priority is added
            table.add_row()
        
        thumb_td.set_attr('rowspan', row_span) 

        # add pipeline
        table.add_cell("<i>Pipeline: </i>")
        status = self.sobject.get_value("pipeline_code")
        if not status:
            table.add_cell("None")
        else:
            table.add_cell(self.sobject.get_value("pipeline_code") )

        self._add_frame_range(table)

        table.add_row()
        td = table.add_cell( "<i>Description: </i>")
        description = self.sobject.get_value("description")
        expand = ExpandableTextWdg()
        expand.set_id('asset_info_desc')
        expand.set_value( WikiUtil().convert(description) )
        expand.set_max_length(300) 
        td.add(expand)

        main_div = DivWdg(table)
        
        if self.get_option("publish") == "false":
            return main_div
            
        #self._add_publish_link(main_div)

        return main_div


    def get_simple_display(self):
        sobject = self.get_current_sobject()
        code = sobject.get_code()
        description = sobject.get_value("description")
        status = sobject.get_value("status")
        return "%s, %s, %s" % (code, status, description)



    def _add_frame_range(self, table):

        frame_wdg = FrameRangeWdg()
        frame_wdg.set_sobject(self.sobject)
        table.add_row()
        table.add_cell("<i>Frame Info:</i>")
        table.add_cell( frame_wdg )

    def _add_publish_link(self, main_div):
        publish_link = PublishLinkWdg(self.sobject.get_search_type(), self.sobject.get_id())
#.........这里部分代码省略.........
开发者ID:mincau,项目名称:TACTIC,代码行数:101,代码来源:asset_info_wdg.py


示例11: get_display

    def get_display(my):

        web = WebContainer.get_web()

        
        tactic_header = Table()
        tactic_header.add_row()
        tactic_header.add_color("color", "color2")


        # tactic logo and release info
        skin = web.get_skin()
        src = '/context/skins/' + skin + '/images/tactic_logo.png'
        img = HtmlElement.img(src)
        img.add_class('hand')
        img.add_attr('title', 'Go to home page')
        img.add_behavior({'type': 'click_up', 'cbjs_action': "window.location='/tactic/'"})

        rel_div = DivWdg()
        rel_div.add("&nbsp;"*3)
        rel_div.add("Release: %s" %Environment.get_release_version() )
        rel_div.add_style("font-size: 9px")
        # Need this to override the above color in add_looks
        rel_div.add_color("color", "color2")

        tactic_wdg = Table()

        tactic_wdg.add_style("width: 180px")
        tactic_wdg.add_row()
        td = tactic_wdg.add_cell( img )
        td.set_style("width:100px")
        tactic_wdg.add_row()
        td = tactic_wdg.add_cell( rel_div )
        td.set_style("text-align: left") 

        td = tactic_header.add_cell( tactic_wdg )
       
        # add the project thumb and title
        project = Project.get()

        if my.show_project:
            thumb_div = DivWdg()
            td = tactic_header.add_cell( thumb_div )
            thumb_div.add_style("height: 28px")
            thumb_div.add_style("overflow: hidden")
            thumb_div.add_border(modifier=-10)
            thumb_div.add_style("-moz-border-radius: 3px")

            thumb = ThumbWdg()
            thumb_div.add(thumb)
            thumb.set_sobject(project)
            thumb.set_icon_size("45")
            td.set_style("vertical-align: top; padding-right:14px;padding-left: 3px")

            td = tactic_header.add_cell( project.get_value("title") )
            #td.add_looks( "fnt_title_1" )
            td.add_style("font-size: 20px")
            td.add_style("white-space: nowrap")
            td.add_style("padding-left: 14px")

            # project selection 
            td = tactic_header.add_cell()
            project_div = DivWdg()
            project_div.add_style("margin-top: -5px")
            project_div.add(ProjectSelectWdg() )
            td.add( project_div )
            td.set_style("padding-left: 14px")
             

            # Global Actions Gear Menu (contains links to Documentation) ...
            action_bar_btn_dd = PageHeaderGearMenuWdg()
            action_div = DivWdg(action_bar_btn_dd)
            action_div.add_style("margin-top: -5px")
            td = tactic_header.add_cell( action_div )

            if PrefSetting.get_value_by_key('subscription_bar') == 'true':
                from message_wdg import SubscriptionBarWdg
                sub = SubscriptionBarWdg(mode='popup')
                tactic_header.add_cell(sub)

        # user login

        # user
        user = Environment.get_login()
        full_name = user.get_full_name()
        user_div = SpanWdg( HtmlElement.b( "%s&nbsp;&nbsp;" % full_name) , css='hand')       
        user_div.set_style("padding-right:10px")

        # signout
        login = Environment.get_security().get_login()
        search_key = SearchKey.get_by_sobject(login)
        span = SpanWdg()
        span.add( user_div )
        user_div.add_attr('spt_nudge_menu_vert', '20')
       
        td = tactic_header.add_cell(span)       
        td.set_style("width:100%; text-align:right; white-space: nowrap")



#.........这里部分代码省略.........
开发者ID:hellios78,项目名称:TACTIC,代码行数:101,代码来源:page_header_wdg.py


示例12: get_display

    def get_display(my):
        my.init_kwargs()
        sobject = my.get_current_sobject()

        table = Table(css='minimal')
        table.add_color("color", "color")
        table.add_style("font-size: 0.9em")

       
        
        snapshots = my.get_snapshot(my.mode)
        for snapshot in snapshots:
            table.add_row()

            value = my.get_input_value(sobject, snapshot)

            current_version = snapshot.get_value("version")
            current_context = snapshot.get_value("context")
            current_revision = snapshot.get_value("revision", no_exception=True)
            current_snapshot_type = snapshot.get_value("snapshot_type")

            # hack hard coded type translation
            if current_snapshot_type == "anim_export":
                current_snapshot_type = "anim"

            # ignore icon context completely
            if current_context == "icon":
                table.add_blank_cell()
                table.add_cell("(---)")
                return table

            checkbox = CheckboxWdg('%s_%s' %(my.search_type, my.CB_NAME))
            
            # this is added back in for now to work with 3.7 Fast table
            checkbox.add_behavior({'type': 'click_up',
            'propagate_evt': True})

            checkbox.add_class('spt_latest_%s' %my.mode)
            checkbox.set_option("value", value )
            table.add_cell( checkbox )

            load_all = False
            if load_all:
                checkbox.set_checked()


            # add the file type icon
            xml = snapshot.get_snapshot_xml()
            file_name = xml.get_value("snapshot/file/@name")
            icon_link = ThumbWdg.find_icon_link(file_name)
            image = HtmlElement.img(icon_link)
            image.add_style("width: 15px")
            table.add_cell(image)

            namespace = my.get_namespace(sobject, snapshot) 
            asset_code = my.get_asset_code()
          
            # force asset mode = True   
            my.session.set_asset_mode(asset_mode=my.get_session_asset_mode())
            node_name = my.get_node_name(snapshot, asset_code, namespace)
            # get session info
            session_context = session_version = session_revision = None
            if my.session:
                
                session_context = my.session.get_context(node_name, asset_code, current_snapshot_type)
                session_version = my.session.get_version(node_name, asset_code, current_snapshot_type)
                session_revision = my.session.get_revision(node_name, asset_code,current_snapshot_type)


                # Maya Specific: try with namespace in front of it for referencing
                referenced_name = '%s:%s' %(namespace, node_name)
                if not session_context or not session_version:
                    session_context = my.session.get_context(referenced_name, asset_code, current_snapshot_type)
                    session_version = my.session.get_version(referenced_name, asset_code, current_snapshot_type)
                    session_revision = my.session.get_revision(referenced_name, asset_code, current_snapshot_type)

            from version_wdg import CurrentVersionContextWdg, SubRefWdg

            version_wdg = CurrentVersionContextWdg()
            data = {'session_version': session_version, \
                'session_context': session_context,  \
                'session_revision': session_revision,  \
                'current_context': current_context, \
                'current_version': current_version, \
                'current_revision': current_revision }
            version_wdg.set_options(data)
            
            table.add_cell(version_wdg, "no_wrap")
            td = table.add_cell(HtmlElement.b("(%s)" %current_context))
            td.add_tip("Snapshot code: %s" % snapshot.get_code())
            #table.add_cell(snapshot.get_code() )

            #if snapshot.is_current():
            #    current = IconWdg("current", IconWdg.CURRENT)
            #    table.add_cell(current)
            #else:
            #    table.add_blank_cell()


            # handle subreferences
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:101,代码来源:loader_element_wdg.py


示例13: get_group_wdg

    def get_group_wdg(self, prev_sobj):
        if not self.is_preprocessed:
            self.preprocess()

        sobject = self.get_current_sobject()
        ref_sobj = self.get_ref_obj(sobject)
        self.current_ref_sobj = ref_sobj
        
        if not ref_sobj:
            return "Undetermined parent: [%s]" % SearchKey.get_by_sobject(sobject)

        widget = DivWdg()

        # add add button
        #from tactic.ui.widget import TextBtnWdg, TextBtnSetWdg
        #buttons_list = []
        #buttons_list.append( {
        #    'label': '+', 'tip': 'Add Another Item',
        #    'bvr': { 'cbjs_action': "spt.dg_table.add_item_cbk(evt, bvr)" }
        #} )
        #add_btn = TextBtnSetWdg( float="right", buttons=buttons_list,
        #                     spacing=6, size='small', side_padding=0 )
        #widget.add(add_btn)

        from tactic.ui.widget import ActionButtonWdg
        button = ActionButtonWdg(title='+', tip='Add Another Item', size='small')
        widget.add(button)
        button.add_style("float: right")
        button.add_behavior( {
            'type': 'click_up',
            'cbjs_action': "spt.dg_table.add_item_cbk(evt, bvr)"
        } )

 
        label = "Attach"
        label_option = self.get_option("label")
        if label_option:
            label = label_option 
       
        table = Table()
        table.add_color("color", "color")
        table.add_row()

        search_key = sobject.get_search_key()
        # add a thumbe widget
        thumb = ThumbWdg()
        thumb.set_icon_size(40)
        thumb.set_sobject(ref_sobj)
        thumb.set_option('latest_icon', 'true') 
        table.add_cell(thumb)


        # add the text description
        name_span = DivWdg(ref_sobj.get_code())
        name_span.add_style('margin-left: 20px')
        table.add_cell(name_span)


        if ref_sobj.has_value("name"):
            name_span.add( " - " )
            name_span.add( ref_sobj.get_value("name") )

        #status = ref_sobj.get_value("status", no_exception=True)
        #if status:
        #    span = SpanWdg("(status:%s)" % ref_sobj.get_value("status"))
        #    table.add_cell(span)

        
        if ref_sobj.has_value("description"):
            description_wdg = ExpandableTextWdg("description")
            description_wdg.set_max_length(200)
            description_wdg.set_sobject(ref_sobj)
            td = table.add_cell( description_wdg )
            td.add_style("padding-left: 15px")



        # FIXME: not sure about the layout here
        #if ref_sobj.has_value("pipeline_code"):
        #    pipeline_code = ref_sobj.get_value("pipeline_code")
        #    span = SpanWdg("(pipeline:%s)" % pipeline_code )
        #    td = table.add_cell(span)
        #    td.add_style("padding-left: 15px")
        
        widget.add(table)
            

        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:88,代码来源:group_element_wdg.py


示例14: get_display

    def get_display(my):

        my.search_key = my.kwargs.get("search_key")
        sobject = Search.get_by_search_key(my.search_key)

        if sobject.get_base_search_type() == "sthpw/snapshot":
            snapshot = sobject
        elif sobject.get_base_search_type() == "sthpw/file":
            # if it is a file object
            snapshot = sobject.get_parent()
        else:
            snapshots = Snapshot.get_by_sobject(sobject)
            snapshot = snapshots[0]

        #parent = snapshot.get_parent()

        top = my.top

        from tactic.ui.container import ResizableTableWdg
        table = ResizableTableWdg()
        top.add(table)
        table.add_row()
        table.add_style("width: 100%")


        from tactic.ui.widget import EmbedWdg
        td = table.add_cell()
        td.add_color("background", "background",)
        td.add_style("vertical-align: middle")
        td.add_style("height: 200px")
        td.add_style("overflow-x: auto")


        file_type = "icon"
        thumb_path = snapshot.get_web_path_by_type(file_type)

        file_type = "main"
        src = snapshot.get_web_path_by_type(file_type)


        parts = os.path.splitext(src)
        ext = parts[1]
        ext = ext.lower()

        if ext in ['.doc','.xls']:
            from pyasm.widget import ThumbWdg
            link = ThumbWdg.find_icon_link(src)
            img = HtmlElement.img(src=link)
            href = DivWdg()
            href.add_style("text-align: center")
            href.add(img)
            td.add(href)
            href.add_behavior( {
                'type': 'click_up',
                'src': src,
                'cbjs_action': '''
                window.open(bvr.src);
                '''
            } )
            href.add_class("hand")

        else:
            embed_wdg = EmbedWdg(src=src, thumb_path=thumb_path)
            td.add(embed_wdg)
            embed_wdg.add_style("margin: auto auto")
            embed_wdg.add_class("spt_resizable")
            embed_wdg.add_style("width: 100%")
            embed_wdg.add_style("height: 240px")

            embed_wdg.add_behavior( {
                'type': 'load',
                'cbjs_action': '''
                var last_height = spt.container.get_value("last_img_height");
                if (last_height) {
                    bvr.src_el.setStyle("height", last_height);
                }
                '''
            } )


            embed_wdg.add_behavior( {
                'type': 'unload',
                'cbjs_action': '''
                var last_height = bvr.src_el.getStyle("height");
                spt.container.set_value("last_img_height", last_height);
                '''
            } )



        table.add_row()
        td = table.add_cell()


        from tactic.ui.checkin import PathMetadataWdg
        from tactic.ui.checkin import SnapshotMetadataWdg


        metadata_div = DivWdg()
        td.add(metadata_div)
#.........这里部分代码省略.........
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:101,代码来源:file_detail_wdg.py


示例15: get_display


#.........这里部分代码省略.........
        tr.add_gradient("background", "background", -10)
        th = table.add_header("&nbsp;")
        th.add_style("text-align: left")
        th = table.add_header("Login")
        th.add_style("text-align: left")
        th = table.add_header("First Name")
        th.add_style("text-align: left")
        th = table.add_header("Last Name")
        th.add_style("text-align: left")
        th = table.add_header("Display Name")
        th.add_style("text-align: left")
        th = table.add_header("Activity")
        th.add_style("text-align: left")
        th = table.add_header("Groups")
        th.add_style("text-align: left")
        th = table.add_header("Security")
        th.add_style("text-align: left")
        th = table.add_header("Edit")
        th.add_style("text-align: left")





        for i, login in enumerate(logins):
            tr = table.add_row()
            tr.add_class("spt_row")

            if not i or not i%2:
                tr.add_color("background", "background3")
            else:
                tr.add_color("background", "background", -2 )

            thumb = ThumbWdg()
            thumb.set_sobject(login)
            thumb.set_icon_size(30)
            td = table.add_cell(thumb)

            td = table.add_cell(login.get_value("login"))
            td.add_style("padding: 3px")
            td = table.add_cell(login.get_value("first_name"))
            td.add_style("padding: 3px")
            td = table.add_cell(login.get_value("last_name"))
            td.add_style("padding: 3px")

            td = table.add_cell(login.get_value("display_name"))
            td.add_style("padding: 3px")           

            search_key = login.get_search_key()
            login_code = login.get_code()
            full_name = login.get_full_name()

            td = table.add_cell()
            button = IconButtonWdg(tip="Activity", icon=IconWdg.CALENDAR)
            td.add(button)
            button.add_behavior( {
                'type': 'click_up',
                'login_code': login_code,
                'full_name': full_name,
                'cbjs_action': '''

                var class_name = 'tactic.ui.tools.ScheduleUserToolWdg';
                var kwargs = {
                    login: bvr.login_code
                }
开发者ID:funic,项目名称:TACTIC,代码行数:66,代码来源:project_config_wdg.py


示例16: get_display

    def get_display(self):

        self.is_refresh = self.kwargs.get('is_refresh') =='true'
      
        if not self.is_refresh:
            top = DivWdg(css='spt_view_panel')
            self.set_as_panel(top)
        else:
            top = Widget() 

        div = DivWdg(css="filter_box")
        div.add("<b>Current Session</b>")
        top.add(div)

        # the button which initiates the introspection
        button = IntrospectWdg()
        #button.add_style("float", "right")
        top.add(button)

        top.add("<br clear='all'/>")


        session = SessionContents.get()
        if not session:
            widget.add("<h3>No contents in session</h3>")
            return widget

        table = Table()
        table.add_class("table")
        table.add_style("width: 100%")
        table.add_row()
        table.add_header("&nbsp;")
        table.add_header("Type")
        table.add_header("Asset")
        table.add_header("Node Name")
        table.add_header("Node Type")
        table.add_header("Reference")
        table.add_header("Session")
        table.add_header("Latest")

        node_names = session.get_node_names()
        for node_name in node_names:
            table.add_row()


            # snapshot_code
            snapshot_code = session.get_snapshot_code(node_name, "shot")
            if not snapshot_code:
                snapshot_code = session.get_snapshot_code(node_name, "anim")
            if not snapshot_code:
                snapshot_code = session.get_snapshot_code(node_name, "asset")

            snapshot = Snapshot.get_by_code(snapshot_code)
            sobject = None

            if snapshot:

                sobject = snapshot.get_sobject()
                base = sobject.get_search_type_obj().get_base_search_type()

                thumb = ThumbWdg()
                thumb.set_icon_size(60)

                # FIXME: make this more automatic
                if base == "prod/shot_instance":
                    thumb_sobj = sobject.get_parent("prod/asset")
                    thumb.set_sobject(thumb_sobj)
                else:
                    thumb.set_sobject(sobject)

                table.add_cell(thumb)

                title = sobject.get_search_type_obj().get_title()
                table.add_cell( title )

                # TODO: this should be more automatic!
                if base == "prod/shot_instance":
                    asset_code = sobject.get_value("asset_code")
                    shot_code = sobject.get_value("shot_code")
                    name = sobject.get_value("name")
                    table.add_cell("%s: %s in %s" % (name,asset_code,shot_code))
                else:
                    code = sobject.get_code()
                    name = sobject.get_name()
                    if code == name:
                        table.add_cell( "%s" % (code) )
                    else:
                        table.add_cell( "%s - %s" % (code, name) )

            else:
                table.add_cell("<i>No snapshot</i>")
                table.add_cell("---")
                table.add_cell("---")
                

            # display the node name
            table.add_cell(node_name)

            # display node type
            table.add_cell( session.get_node_type(node_name) )
#.........这里部分代码省略.........
开发者ID:mincau,项目名称:TACTIC,代码行数:101,代码来源:session_wdg.py


示例17: find_icon_link

 def find_icon_link(my, file_path, repo_path=None):
     from pyasm.widget import ThumbWdg
     return ThumbWdg.find_icon_link(file_path, repo_path)
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:3,代码来源:tile_layout_wdg.py


示例18: get_display


#.........这里部分代码省略.........
            items_div.add("%s item/s" % count)
            title_div.add(search_type_sobj.get_title())

            description_div = DivWdg()
            description_div.add(description)
            description_div.add_style("padding: 5px")
            if not description:
                description_div.add("<br/>(No description)")
                description_div.add_style("font-style: italic")
                description_div.add_style("opacity: 0.3")


            report_data = {
                'title': search_type_sobj.get_title(),
                'title_wdg': title_div,
                'class_name': 'tactic.ui.panel.ViewPanelWdg',
                'kwargs': {
                        'search_type': search_type,
                        'view': 'table',
                        'simple_search_view': 'simple_search'
                    },
                'description': description_div,
                'search_type': search_type_sobj
            }
            reports.append(report_data)


        # create a bunch of panels
        list_div = DivWdg()
        top.add(list_div)
        list_div.add_class("spt_reports_list")


        table = Table()
        list_div.add(table)
        table.add_color("color", "color")
        table.add_style("margin-bottom: 5px")
        table.center()

        top.add("<br clear='all'/>")


        for i, report in enumerate(reports):

            if i == 0 or i%4 == 0:
                tr = table.add_row()

            td = table.add_cell()
            td.add_style("vertical-align: top")
            td.add_style("padding: 3px")

            class_name = report.get("class_name")
            kwargs = report.get("kwargs")
            title = report.get("title")
            description = report.get("description")

            #image = "<img src='/context/images/getting_started_schema.png'/>"
            image = "<img src='/context/images/getting_started_pipeline.png'/>"


            thumb_div = DivWdg()
            image = thumb_div
            thumb_div.add_border()
            thumb_div.set_box_shadow("1px 1px 1px 1px")

            thumb = ThumbWdg()
            thumb_div.add(thumb)
            thumb.set_sobject(report.get("search_type"))
            thumb.set_icon_size(60)




            behavior = {
            'type': 'click_up',
            'title': title,
            'class_name': class_name,
            'kwargs': kwargs,
            'cbjs_action': '''

            var top = bvr.src_el.getParent(".spt_reports_top");
            //spt.tab.set_main_body_tab();
            spt.tab.set_tab_top(top);
            var kwargs = {};
            spt.tab.add_new(bvr.title, bvr.title, bvr.class_name, bvr.kwargs);
            '''
            }
            title_wdg = report.get("title_wdg")
            schema_wdg = self.get_section_wdg(title_wdg, description, image, behavior)
            td.add(schema_wdg)



        from tactic.ui.container import TabWdg
        tab = TabWdg(show_add=False)
        top.add(tab)



        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:101,代码来源:home_wdg.py


示例19: get_display


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python widget.WidgetConfig类代码示例发布时间:2022-05-25
下一篇:
Python widget.TextWdg类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap