示例#1
0
 def get_compact(my, sobj):
     table = Table(css='embed')
     col = table.add_col()
     col.add_style("width: 80px")
     table.add_col(css='med')
     table.add_col(css='large')
     table.add_style("width: 200px")
     table.add_row()
     
     src_sobj = sobj.get_parent()
     thumb = ThumbWdg()
     thumb.set_icon_size(40)
     thumb.set_sobject(src_sobj)
     table.add_cell(thumb)
     
     table.add_cell(src_sobj.get_code())
     table.add_data(SpanWdg(HtmlElement.b(sobj.get_process()), css='small'))
     #table.add_row()
     
     expand = ExpandableTextWdg()
     expand.set_max_length(20)
     desc = sobj.get_value("description")
     if not desc:
         desc = ' '
     expand.set_value(desc)
     table.add_row_cell(expand)
     return table
示例#2
0
 def _add_desc(my, table, sobj):
     tr = table.add_row()
     #tr.set_attr('colspan', '3') 
     table.add_cell(HtmlElement.i("Desc: "))
     expand = ExpandableTextWdg()
     expand.set_max_length(40)
     desc = sobj.get_value("description")
     if not desc:
         desc = ' '
     expand.set_value(desc)
     td = table.add_cell( expand )
     td.set_attr('colspan', '2') 
示例#3
0
 def _add_description(self, table):
     table.add_row()
     table.add_cell("<i>Description:</i>")
     expand = ExpandableTextWdg()
     expand.set_id('asset_info_desc')
     description = self.sobject.get_value("description", no_exception=True)
     expand.set_value(WikiUtil().convert(description))
     expand.set_max_length(240)
     table.add_cell(expand)
示例#4
0
 def _add_description(self, table):
     table.add_row()
     table.add_cell("<i>Description:</i>")
     expand = ExpandableTextWdg()
     expand.set_id('asset_info_desc')
     description = self.sobject.get_value("description", no_exception=True)
     expand.set_value( WikiUtil().convert(description) )
     expand.set_max_length(240) 
     table.add_cell( expand )
示例#5
0
    def get_compact(my, sobj):
        table = Table(css='embed')
        col = table.add_col()
        col.add_style("width: 80px")
        table.add_col(css='med')
        table.add_col(css='large')
        table.add_style("width: 200px")
        table.add_row()

        src_sobj = sobj.get_parent()
        thumb = ThumbWdg()
        thumb.set_icon_size(40)
        thumb.set_sobject(src_sobj)
        table.add_cell(thumb)

        table.add_cell(src_sobj.get_code())
        table.add_data(SpanWdg(HtmlElement.b(sobj.get_process()), css='small'))
        #table.add_row()

        expand = ExpandableTextWdg()
        expand.set_max_length(20)
        desc = sobj.get_value("description")
        if not desc:
            desc = '&nbsp;'
        expand.set_value(desc)
        table.add_row_cell(expand)
        return table
示例#6
0
    def get_display(self):
        self.sobject = self.get_current_sobject()
        custom_css = self.get_option('css')
    
        div = DivWdg(css=custom_css)
        div.add_color('color','color')
        div.add_style('width', '18em')

        code_span = SpanWdg('%s' % (self.sobject.get_code()))
        
        expand = ExpandableTextWdg()
        expand.set_id('shot_info_desc')
        description = self.sobject.get_value("description")
        expand.set_value( WikiUtil().convert(description) )
        desc_span = SpanWdg()
        desc_span.add(expand)
        div.add(code_span)
        div.add(HtmlElement.br())
        div.add(desc_span)
        
    
        return div
示例#7
0
    def get_display(my):
        my.sobject = my.get_current_sobject()
        custom_css = my.get_option('css')
    
        div = DivWdg(css=custom_css)
        div.add_color('color','color')
        div.add_style('width', '18em')

        code_span = SpanWdg('%s <i>%s</i>' \
            %(my.sobject.get_code(), my.sobject.get_value('name')))
        
        expand = ExpandableTextWdg()
        expand.set_id('asset_info_desc')
        description = my.sobject.get_value("description")
        expand.set_value( WikiUtil().convert(description) )
        desc_span = SpanWdg('Desc: ')
        desc_span.add(expand)
        div.add(code_span)
        div.add(HtmlElement.br())
        div.add(desc_span)
        
    
        return div
示例#8
0
 def _add_desc(my, table, sobj):
     tr = table.add_row()
     #tr.set_attr('colspan', '3')
     table.add_cell(HtmlElement.i("Desc: "))
     expand = ExpandableTextWdg()
     expand.set_max_length(40)
     desc = sobj.get_value("description")
     if not desc:
         desc = '&nbsp;'
     expand.set_value(desc)
     td = table.add_cell(expand)
     td.set_attr('colspan', '2')
示例#9
0
    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
示例#10
0
    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
示例#11
0
    def get_display(self):
        self.sobject = self.get_current_sobject()
        custom_css = self.get_option('css')

        div = DivWdg(css=custom_css)
        div.add_color('color', 'color')
        div.add_style('width', '18em')

        code_span = SpanWdg('%s' % (self.sobject.get_code()))

        expand = ExpandableTextWdg()
        expand.set_id('shot_info_desc')
        description = self.sobject.get_value("description")
        expand.set_value(WikiUtil().convert(description))
        desc_span = SpanWdg()
        desc_span.add(expand)
        div.add(code_span)
        div.add(HtmlElement.br())
        div.add(desc_span)

        return div
示例#12
0
    def get_display(my):
        my.sobject = my.get_current_sobject()
        custom_css = my.get_option('css')

        div = DivWdg(css=custom_css)
        div.add_color('color', 'color')
        div.add_style('width', '18em')

        code_span = SpanWdg('%s <i>%s</i>' \
            %(my.sobject.get_code(), my.sobject.get_value('name')))

        expand = ExpandableTextWdg()
        expand.set_id('asset_info_desc')
        description = my.sobject.get_value("description")
        expand.set_value(WikiUtil().convert(description))
        desc_span = SpanWdg('Desc: ')
        desc_span.add(expand)
        div.add(code_span)
        div.add(HtmlElement.br())
        div.add(desc_span)

        return div
示例#13
0
    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
示例#14
0
    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
示例#15
0
    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
示例#16
0
    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