예제 #1
0
파일: tables.py 프로젝트: crowmurk/locker
class OrderTable(DurationColumnMixin, tables.Table):
    id = tables.LinkColumn(verbose_name=_('Estimate'))
    author = tables.Column(
        accessor='author.get_full_name',
        order_by=(
            'author.first_name',
            'author.last_name',
        ),
    )
    client = tables.Column(
        linkify=(
            'client:detail',
            {
                'slug': tables.A('client.slug'),
            },
        ),
        accessor='client.name',
        verbose_name=_('Client'),
    )
    branch = tables.Column(
        linkify=(
            'client:branch:detail',
            {
                'client_slug': tables.A('client.slug'),
                'pk': tables.A('branch.pk'),
            },
        ),
        accessor='branch.name',
        verbose_name=_('Branch'),
    )
    address = tables.Column(
        accessor='branch.address',
        verbose_name=_('Address'),
    )
    price = tables.Column(verbose_name=_("Total price"))
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Order
        sequence = (
            'id',
            'author',
            'client',
            'branch',
            'address',
            'created',
            'modified',
            'price',
        )
        exclude = (
            'settlement',
            'factor',
        )
        empty_text = _("There are no records available")

    def render_address(self, record, value):
        return "{settlement}, {address}".format(
            settlement=record.branch.settlement,
            address=value,
        )
예제 #2
0
class AlbumTable(LoginRequiredMixin, tables.Table):
    actions = tables.TemplateColumn(TEMPLATE, orderable=False)
    upload = tables.TemplateColumn(UPLOAD_BUTTON, orderable=False)
    test = tables.TemplateColumn(TEST_MODEL, orderable=False)
    selection = tables.CheckBoxColumn(
        accessor='pk',
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)

    def __init__(self, *args, _overriden_value="", **kwargs):
        super().__init__(*args, **kwargs)

    class Meta:
        model = Album
        template_name = 'django_tables2/bootstrap.html'
        sequence = ('selection', 'name', 'description', 'pin', 'status',
                    'model_status', 'upload', 'actions', 'test')
        exclude = (
            'id',
            'organization',
        )
        row_attrs = {
            'id': lambda record: "row" + str(record.pk),
            'data-model-status': lambda record: record.model_status,
        }
        attrs = {
            'id': 'albumTable',
            'class': 'table table-hover',
            'style': 'border-collapse:collapse;'
        }
예제 #3
0
class ModelTable(tables.Table):
    selection = tables.CheckBoxColumn(accessor='pk', orderable=False)
    edit = tables.Column(empty_values=(), orderable=False)
    delete = tables.Column(empty_values=(), orderable=False)

    def edit_url(self, record):
        return ''

    def delete_url(self, record):
        return ''

    def render_edit(self, record):
        return format_html('<a href="{}"><img src="{}" alt="" /></a>',
                           self.edit_url(record), static('kroadmin/edit.png'))

    def render_delete(self, record):
        return format_html('<a href="{}"><img src="{}" alt="" /></a>',
                           self.delete_url(record),
                           static('kroadmin/trash-can.png'))

    class Meta:
        sequence = ('selection', '...', 'edit', 'delete')
        abstract = True
        attrs = {'id': 'table-1', 'cellspacing': "0", 'cellpadding': "2"}
        row_attrs = {'id': lambda record: record.pk, 'class': 'myDragClass'}
예제 #4
0
파일: tables.py 프로젝트: zamb124/SBW
class DeliveryPosTable(tables.Table):
    #count =  DeliveryPosition.objects.filter(pk=кусщкв)
    selection = tables.CheckBoxColumn(accessor='pk', orderable=False)
    открыть = tables.TemplateColumn(
        '<a class="btn btn-primary" href="/delivery/{{ record.id }}" role="button">Посмотреть\изменить</a>'
    )
    values = tables.TemplateColumn(
        '<a href= #> <span class="badge bg-primary">5</span> </a>',
        template_name='Колво')

    #positions = tables.TemplateColumn('<a href= #> <span class="badge bg-primary">5</span> </a>', template_name='Колво')

    class Meta:
        model = DeliveryPosition
        sequence = (
            'id',
            'selection',
            'открыть',
            '...',
        )
        template_name = 'django_tables2/bootstrap.html'
        exclude_columns = ('positions', )
        row_attrs = {
            'data-id': lambda record: record.pk,
            'name': lambda record: record.pk,
        }
예제 #5
0
class GovernmentProjectTable(tables.Table):
    selected = tables.CheckBoxColumn(accessor="id", exclude_from_export=True)
    title = tables.Column("Project")
    # description = tables.Column(orderable=False)
    implementing_agency = tables.TemplateColumn(
        '{% if value %}<a href="{{ value.list_url }}" title="See projects of {{value}}">{{ value }}</a>{% else %}—{% endif%}'
    )
    total_project_cost = tables.Column()
    funding_source = tables.Column("Source of funding", orderable=False)
    implementation_time_info = tables.Column("Implementation Period",
                                             orderable=False)
    # administrative_area = tables.Column(empty_values=())

    export_formats = ("csv", "json", "xlsx")

    def render_title(self, record, value):
        return mark_safe(
            '<a href="{0.url}"><span class="status status-{0.status}" title="{0.status}"></span>&nbsp;{0.title}</a>'
            .format(record))

    def render_total_project_cost(self, record, value):
        return mark_safe(intcomma(value))

    def render_administrative_area(self, record, value):
        return mark_safe(",".join(record.administrative_area.all().values_list(
            "name", flat=True)))

    class Meta:
        attrs = {"id": "government-table"}
        empty_text = _("No projects match")
예제 #6
0
class PeopleTable(tables.Table):
    selection = tables.CheckBoxColumn(accessor='pk', verbose_name=('Delete'))

    #    detail = tables.LinkColumn('item_detail', args=[('pk')],orderable=False,empty_values=[''])
    #    detail1 = tables.LinkColumn('item_detail1', args=[('pk')], orderable=False, empty_values=[''])
    #    amend = tables.CheckBoxColumn(verbose_name=('Amend'), accessor='pk')
    class Meta:
        model = People
        row_attrs = {'data-id': lambda record: record.pk}
        attrs = {'class': 'paleblue'}
        exclude = [
            'id', 'ispatient', 'isdoctor', 'canlogin', 'accessonlyhisfile',
            'notes'
        ]
        sequence = ['selection', 'name', 'surname', 'phone', '...']

    def render_detail(self, record):
        return mark_safe(
            '<a href=/MedMOHApp/detail/' + str(record.pk) +
            '/><span style="color:green">Λεπτομέριες</span></a></a>')

    def render_detail1(self, record):
        aaa = '<input type="checkbox" name=' + str(
            record.pk) + ' value=' + str(record.pk) + ' > '
        return mark_safe(aaa)
예제 #7
0
파일: tables.py 프로젝트: xiaohlu05/sh00t
class Sh0tTable(tables.Table):
    selection = tables.CheckBoxColumn(
        accessor='pk',
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)
    severity = tables.TemplateColumn(
        '<span class="bc-badge bc-badge--p{{ record.severity }}">P{{ record.severity }}</span>'
    )
    title = tables.TemplateColumn(
        '<a href="/app/sh0t/{{ record.pk }}">{{ record.title }}</a>')
    project = tables.TemplateColumn(
        '<a href="/app/project/{{ record.assessment.project.pk}}">{{ record.assessment.project }}</a>'
    )
    assessment = tables.TemplateColumn(
        '<a href="/app/assessment/{{ record.assessment.pk}}">{{ record.assessment }}</a>'
    )

    class Meta:
        model = Sh0t
        template_name = "django_tables2/bootstrap-responsive.html"
        sequence = ('selection', 'severity', 'title', 'project', 'assessment',
                    'added')
        fields = ('severity', 'title', 'project', 'assessment', 'added')
예제 #8
0
class DescriptiveMetadataTable(tables.Table):
    """ The table used in the descriptive metadata list. """

    # We use the metadata's id as a link to the corresponding collection
    # detail.
    id = tables.LinkColumn(
        'ingest:descriptive_metadata_detail',
        verbose_name="",
        args=[A('pk')],
        text=format_html(
            '<button type="button" class="btn btn-primary">Detail</button>')
        #text=format_html('<span class="glyphicon glyphicon-cog"></span>'),
        #attrs={'a': {'class': "btn btn-info", 'role': "button"}}
    )
    project_description = tables.Column()

    def render_locked(self, value):
        if value:
            value = format_html('<i class="fa fa-lock"></i>')
        else:
            value = format_html('<i class="fa fa-unlock"></i>')
        return value

    class Meta:
        model = DescriptiveMetadata
        template_name = 'ingest/bootstrap_ingest.html'
        # XXX: we should store this information in field_list
        exclude = []
        # the order of "sequence" determines the ordering of the columns
        sequence = [
            'id',
            'collection',
            'date_created',
            'last_edited',
            'locked',
            'sample_id',
            'organism_type',
            'organism_ncbi_taxonomy_id',
            'transgenetic_line_information',
            'modality',
            'method',
            'technique',
            'anatomical_structure',
            'total_processed_cells',
            'organization',
            'lab',
            'investigator',
            'grant_number',
            'r24_name',
            'r24_directory',
        ]

    # This gives us a checkbox for every piece of metadata, thereby allowing
    # the user to select and delete them (assuming they're unlocked).
    selection = tables.CheckBoxColumn(
        accessor="pk",
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)
예제 #9
0
class BranchTable(tables.Table):
    name = tables.LinkColumn()
    client = tables.Column(
        linkify=(
            'client:detail',
            {'slug': tables.A('client.slug'), },
        ),
        accessor='client.name',
        verbose_name=_("Client"),
    )
    number_of_orders = tables.Column(
        verbose_name=_("Number of estimates"),
    )
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Branch
        sequence = (
            'name',
            'settlement',
            'address',
            'client',
            'number_of_orders',
        )
        exclude = ('id', )
        empty_text = _("There are no records available")
예제 #10
0
파일: tables.py 프로젝트: chestnut3108/POS
class IngredientTable(tables.Table):
    selection = tables.CheckBoxColumn(accessor='pk')
    class Meta:
        model = Ingredients
        template_name = "django_tables2/semantic.html"
        exclude = ("friendly", )
        fields = ("id","product_name","company_name","quantity_per_unit","quantity","description","type_of_product")
예제 #11
0
class BookingVouchersTable(tables.Table):
    class Meta:
        model = BaseBookingService
        template_name = 'booking/bookingservice_list.html'
        fields = [
            'pk', 'name', 'datetime_from', 'datetime_to', 'status',
            'conf_number', 'provider'
        ]

    pk = tables.CheckBoxColumn(accessor='pk',
                               attrs={
                                   'th__input': {
                                       'id': 'action-toggle'
                                   },
                                   'td__input': {
                                       'class': 'action-select'
                                   },
                               })

    def __init__(self, *args, **kwargs):
        super(BookingVouchersTable, self).__init__(*args, **kwargs)

    def render_name(self, value, record):
        obj_url = reverse('common:booking_%s_change' %
                          (BOOKINGSERVICE_TYPES[record.base_category]),
                          args=(quote(record.pk), ))
        return format_html('<a href="%s">%s</a>' % (obj_url, value))
예제 #12
0
class TrailerTable_esp(tables.Table):
    select = tables.CheckBoxColumn(
        accessor='economic_no',
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)
    no_económico = tables.TemplateColumn(
        '<a href=/view_trailer/1/{{record.economic_no}}/>{{record.economic_no}}</a>'
    )
    perfil = tables.TemplateColumn(
        '<center><img style="width:100px; height:100px; border-radius:100px;" src=/static/{{record.profile_img}} %}\' ></center>'
    )
    placas = tables.TemplateColumn('{{record.plate_no}}')
    país = tables.TemplateColumn('{{record.country}}')
    estado = tables.TemplateColumn('{{record.state}}')
    año = tables.TemplateColumn('{{record.year}}')
    capacidad = tables.TemplateColumn('{{record.capacity}}')

    class Meta:
        model = Trailer
        sequence = ('perfil', 'no_económico', 'placas', 'país', 'estado',
                    'año', 'capacidad')
        exclude = ('user_id', 'profile_img', 'economic_no', 'plate_no',
                   'country', 'state', 'year', 'capacity', 'type',
                   'client_name', 'client_last_name', 'use', 'status',
                   'active', 'rent_date', 'deliver_date', 'start_service_date',
                   'end_service_date', 'id')
예제 #13
0
class DiseaseTable(tables.Table):
    disease = tables.CheckBoxColumn(
        checked=True,
        accessor='name',
        attrs={'th__input': {
            'checked': 'checked',
            'id': 'selectAll'
        }})
    functionals = tables.TemplateColumn(
        '{{ record.functionals.count }} functional(s)',
        verbose_name='Functionals')
    evidences = tables.TemplateColumn(
        '{{ record.evidences.count }} evidence(s)', verbose_name='Evidences')

    class Meta:
        model = Disease
        orderable = False
        sequence = ('disease', 'name', 'functionals', 'evidences')
        exclude = ('id', 'report', 'variant', 'curation_notes',
                   'reviewed_date', 'meta_reviewed_date', 'approved_date')
        attrs = {
            'class': 'nowrap table table-striped table-hover',
            'style': 'display: block; overflow: auto;'
        }

    @staticmethod
    def class_type():
        return 'Disease'
예제 #14
0
class SelMixin(tables.Table):
    selection = tables.CheckBoxColumn(
        accessor="pk",
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)
예제 #15
0
class TdaysTable_short(TdaysTable):
    # filename = tables.URLColumn()
    selection = tables.CheckBoxColumn(accessor='pk', orderable=False)

    # download_link = tables.LinkColumn('fits_link', args=[A("pk")], empty_values=(), verbose_name='Download')

    # def render_filename(self, value):
    #    return '<a href="{path}">Download</a>'.format(path = value)

    # def render_download_link(self, record, value, column, bound_column, bound_row):
    #    return mark_safe('<a href="{path}">Download</a>'.format(path = record.pk))

    class Meta:
        # add class="paleblue" to <table> tag
        attrs = {"class": "paleblue"}
        exclude = (
            "id",
            "filename",
            "idtdays",
            "telescope",
            "project_dir",
            "schedulename",
            "mjd_start",
            "mjd_stop",
        )
        sequence = ('selection', "date", "source", "project_name", "frequency",
                    "bandwidth", "localoscillator", "samplerate", "receiver",
                    "backend", "source_ra", "source_dec")
예제 #16
0
class ApprovalTable(tables.Table):
    amendment = tables.CheckBoxColumn(
        accessor='id',
        attrs={"th__input": {
            "id": "toggle-all"
        }},
        orderable=False,
    )
    amount = PoundsColumn()
    student = tables.Column('Student',
                            accessor='enrolment__qa__student',
                            linkify=True)
    module = tables.Column('Module',
                           accessor='enrolment__module',
                           linkify=True)
    requested_by = tables.Column(accessor='requested_by__get_full_name')
    edit = EditLinkColumn(verbose_name='',
                          linkify=lambda record: record.get_edit_url() +
                          f'?next={reverse("amendment:approve")}')

    class Meta:
        model = models.Amendment
        fields = (
            'amendment',
            'type',
            'student',
            'module',
            'amount',
            'requested_by',
            'requested_on',
            'edit',
        )
        per_page = 20
        order_by = ('pk', )
예제 #17
0
class CompoundsTable(tables.Table):
    selection = tables.CheckBoxColumn(accessor='pk')
    zinc_id = tables.Column(accessor='zinc_id', linkify=True, attrs={'a':{"target":"_blank"}})
    
    class Meta:
        model=Compound  
        template_name = 'django_tables2/bootstrap-responsive.html'
예제 #18
0
class StaffingTable(tables.Table):
    department = tables.Column(
        linkify=(
            'staffing:department:detail',
            {
                'slug': tables.A('department.slug'),
            },
        ),
        accessor='department',
        verbose_name=_('Department'),
    )
    count = tables.Column(footer=lambda table: _('Total: {}').format(
        sum(x.count for x in table.data)))
    staff_units_held = tables.Column(
        verbose_name=_("Staff units held"),
        footer=lambda table: _('Total: {}').format(
            sum(x.staff_units_held for x in table.data)))
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Staffing
        fields = (
            'department',
            'position',
            'count',
            'staff_units_held',
        )
        empty_text = _("There are no records available")
예제 #19
0
class SendReimbursementTable(tables.Table):
    detail = tables.TemplateColumn(
        "<a href='{% url 'reimbursement_detail' record.pk %}' target='_blank'>Open</a> ",
        verbose_name='Actions',
        orderable=False)

    selected = tables.CheckBoxColumn(accessor="pk", verbose_name='Select')
    assigned_money = tables.TemplateColumn(
        "<input type='number' min='0' name='am_{{record.pk}}' value='{{record.assigned_money}}'/> ",
        verbose_name='Assigned money',
        orderable=False)

    class Meta:
        model = Reimbursement
        attrs = {'class': 'table table-hover'}
        template = 'django_tables2/bootstrap-responsive.html'
        fields = [
            'selected',
            'assigned_money',
            'hacker.name',
            'hacker.email',
            'origin',
        ]

        empty_text = 'No reimbursement match criteria'
예제 #20
0
class SpacesTable(tables.Table):
    selection = tables.CheckBoxColumn(
        accessor="Id",
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False,
        empty_values=(),
        footer='Total:')
    Campus = tables.Column(orderable=True)
    Building = tables.Column(orderable=True)
    Floor = tables.Column(orderable=True)
    Id = tables.Column(orderable=True)
    Free_Private = tables.Column(orderable=True,
                                 attrs={'cell': {
                                     'class': 'free_private'
                                 }})
    Free_Shared = tables.Column(orderable=True,
                                attrs={'cell': {
                                    'class': 'free_shared'
                                }})
    Near_Low_Density_Lab = tables.BooleanColumn(
        orderable=True, attrs={'cell': {
            'class': 'low_density'
        }})
    Near_High_Density_Lab = tables.BooleanColumn(
        orderable=True, attrs={'cell': {
            'class': 'high_density'
        }})
    Groups_Nearby = tables.Column(attrs={'cell': {'class': 'business_groups'}})
예제 #21
0
파일: tables.py 프로젝트: zamb124/SBW
class DeliveryTable(tables.Table):
    selection = tables.CheckBoxColumn(accessor='pk', orderable=False)
    открыть = tables.TemplateColumn(
        '<a class="btn-sm btn-primary" href="/delivery/{{ record.id }}/view" role="button">Открыть</a>'
    )
    #positions = tables.Column(orderable=False)
    values = tables.TemplateColumn(
        '<a href= #> <span class="badge bg-primary">{{ record.positions }}</span> </a>',
        template_name='Колво',
        accessor='Кол=во')

    class Meta:
        model = DeliveryHead
        exclude = (
            'positions',
            'date_update',
            'updater',
        )
        sequence = (
            'id',
            'selection',
            'открыть',
            '...',
        )
        template_name = 'django_tables2/bootstrap.html'
class ISAFileSelectTableWithCheckBox(ISAFileSelectTable):

    check = tables.CheckBoxColumn(accessor="pk",
                                  attrs={
                                      "th__input": {
                                          "onclick": "toggle(this)"
                                      },
                                      "td__input": {
                                          "onclick": "addfile(this)"
                                      }
                                  },
                                  orderable=False)

    class Meta:
        model = GenericFile

        attrs = {"class": TABLE_CLASS}
        fields = ('id', )

    def get_column_default_show(self):
        self.column_default_show = [
            'id', 'user', 'original_filename', 'sample_name',
            'technical_replicate', 'investigation', 'study', 'assay', 'check'
        ]
        return super(ISAFileSelectTableWithCheckBox,
                     self).get_column_default_show()
예제 #23
0
파일: tables.py 프로젝트: amudhark/task1
class UpdateTable(tables.Table):
    export_formats = ['csv', 'xls', 'xlsx', 'json']
    id = tables.Column()
    id = tables.LinkColumn('updates:update_view',
                           args=[A('pk')],
                           empty_values=())
    editable = tables.LinkColumn('updates:modify',
                                 args=[A('pk')],
                                 empty_values=(),
                                 verbose_name='')
    #selection = tables.CheckBoxColumn(accessor='pk', attrs = { "th__input":{"onclick": "toggle(this)"}},orderable=False)
    selection = tables.CheckBoxColumn(
        accessor='pk', attrs={"th__input": {
            "onclick": "toggle(this)"
        }})

    def render_editable(self):
        #return 'Edit'
        return mark_safe('<center><p style="color:blue;">&#9997;</p></center>')

    class Meta:
        model = models.Update
        template_name = 'django_tables2/semantic.html'
        sequence = ('selection', 'editable', 'id', '...')
        #attrs = {'class': 'table table-bordered', 'tbody': {'id': 'value'}}
        attrs = {'tbody': {'id': 'myTable'}}
예제 #24
0
파일: tables.py 프로젝트: crowmurk/mallenom
class EmploymentTable(tables.Table):
    employee = tables.LinkColumn()
    department = tables.Column(
        linkify=(
            'staffing:department:detail',
            {
                'slug': tables.A('staffing.department.slug'),
            },
        ),
        accessor='staffing.department',
        verbose_name=_('Department'),
    )
    position = tables.Column(
        accessor='staffing.position',
        verbose_name=_('Position'),
    )
    count = tables.Column(footer=lambda table: _('Total: {}').format(
        sum(x.count for x in table.data)))
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Employment
        fields = (
            'number',
            'employee',
            'department',
            'position',
            'count',
        )
        empty_text = _("There are no records available")
예제 #25
0
class FlowMeterTable(tables.Table):
    selected = tables.CheckBoxColumn(accessor="pid")
    btn_del = tables.Column(accessor="pid")  #empty_values=()

    class Meta:
        model = FlowShareDayTax
        template_name = 'django_tables2/bootstrap.html'
        attrs = {
            'id': 'tb_flowmeter',
            'class': 'table',
        }

    def render_selected(self, record):
        # return format_html('<input class="nameCheckBox" name="name[]" type="checkbox" checked/>')
        if record.pid:
            return mark_safe(
                '<input class="nameCheckBox" name="name[]" type="checkbox" checked/>'
            )
        else:
            return mark_safe(
                '<input class="nameCheckBox" name="name[]" type="checkbox"/>')

    def render_btn_del(self, value):
        return format_html(
            '<button type = "button" value="{}" class = "btnAlter" data-toggle = "modal" data-target = "#myModal">Alter</button><button type = "button" class = "btnDelete">Delete</button>',
            value)
예제 #26
0
파일: tables.py 프로젝트: crowmurk/mallenom
class AbsenceTable(tables.Table):
    employee = tables.Column(
        linkify=(
            'employee:employee:detail',
            {'slug': tables.A('employment.employee.slug'), },
        ),
        accessor="employment.employee",
    )
    employment = tables.Column(
        verbose_name=_("Position held"),
    )
    hours = tables.LinkColumn(
        footer=lambda table: _('Total: {}').format(
            sum(x.hours for x in table.data)
        )
    )
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Absence
        fields = (
            'employee',
            'employment',
            'start',
            'end',
            'hours',
        )
        empty_text = _("There are no records available")
예제 #27
0
class ContactTable(tables.Table):

    select = tables.CheckBoxColumn(accessor='pk')
    phone = tables.Column(verbose_name='Number')
    first_name = tables.LinkColumn(verbose_name="First Name",
                                   text=lambda t: t.first_name,
                                   args=[A('pk')])
    last_name = tables.Column(verbose_name="Last Name")
    active = tables.BooleanColumn(verbose_name="Active?")
    email = tables.EmailColumn(verbose_name="Email",
                               text=lambda row: "%s..." % row.email[:10]
                               if len(row.email) > 10 else row.email)
    nickname = tables.Column(verbose_name="Nickname")
    action = tables.Column(verbose_name="", accessor='pk', orderable=False)

    def render_phone(self, record):
        return mark_safe("<span>{}</span>".format(record.phone))

    def render_action(self, record):
        return mark_safe('<div style="width:6rem;"><a class="call-btn" href="#"><i style="font-size: 16pt;" class="fi-telephone"></i></a>'+\
                         '<a class="sms-btn" href="#"><i style="font-size: 16pt;" class="fi-mail"></i></a></div>'
                         )

    class Meta:
        model = Contact
        fields = ('select', 'first_name', 'last_name', 'nickname', 'email',
                  'phone', 'active', 'action')
        empty_text = "Sorry, No Contact Found"
        attrs = {'style': 'width: 100%'}
예제 #28
0
파일: tables.py 프로젝트: crowmurk/mallenom
class ProjectTable(tables.Table):
    name = tables.LinkColumn()
    assignments_count = tables.Column(
        verbose_name=_("Assignments count"),
        footer=lambda table: _('Total: {}').format(
            sum(x.assignments_count for x in table.data)
        )
    )
    hours = tables.Column(
        verbose_name=_("Hours"),
        footer=lambda table: _('Total: {}').format(
            sum(x.hours for x in table.data)
        )
    )
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = Project
        fields = (
            'name',
            'status',
            'assignments_count',
            'hours',
        )
        empty_text = _("There are no records available")
예제 #29
0
class VehicleTable_esp(tables.Table):
    select = tables.CheckBoxColumn(
        accessor='economic_no',
        attrs={"th__input": {
            "onclick": "toggle(this)"
        }},
        orderable=False)
    no_económico = tables.TemplateColumn(
        '<a href=/view_vehicle/1/{{record.economic_no}}/>{{record.economic_no}}</a>'
    )
    perfil = tables.TemplateColumn(
        '<center><img style="width:100px; height:100px; border-radius:100px;" src=/static/{{record.profile_img}} %}\' ></center>'
    )
    vin = tables.TemplateColumn('{{record.vin}}')
    placas = tables.TemplateColumn('{{record.plate_no}}')
    país = tables.TemplateColumn('{{record.country}}')
    estado = tables.TemplateColumn('{{record.state}}')
    año = tables.TemplateColumn('{{record.year}}')
    modelo = tables.TemplateColumn('{{record.model}}')
    marca = tables.TemplateColumn('{{record.brand}}')
    tipo = tables.TemplateColumn('{{record.type}}')
    condición = tables.TemplateColumn('{{record.status}}')

    class Meta:
        model = Vehicle
        sequence = ('perfil', 'no_económico', 'vin', 'placas', 'país',
                    'estado', 'año', 'modelo', 'marca', 'tipo', 'condición')
        exclude = ('user_id', 'economic_no', 'plate_no', 'country', 'state',
                   'year', 'model', 'brand', 'type', 'active', 'profile_img',
                   'status', 'id')
예제 #30
0
파일: tables.py 프로젝트: crowmurk/locker
class OrderOptionTable(DurationColumnMixin, tables.Table):
    order = tables.Column(
        linkify=(
            'calc:order:detail',
            {
                'pk': tables.A('order.pk'),
            },
        ),
        accessor='order.pk',
        verbose_name=_('Estimate'),
    )
    service = tables.Column(
        linkify=(
            'calc:service:detail',
            {
                'pk': tables.A('service.pk'),
            },
        ),
        accessor='service.equipment',
        verbose_name=_('Equipment'),
    )
    delete = tables.CheckBoxColumn(accessor="pk")

    class Meta:
        model = OrderOption
        sequence = (
            'order',
            'service',
            'equipment_price',
            'work_price',
            'quantity',
            'price',
        )
        exclude = ('id', )
        empty_text = _("There are no records available")