예제 #1
0
 def display_state(self, ticket):
     """ State colored for change_form """
     return colored('state', STATE_COLORS, bold=False, verbose=True)(ticket)
예제 #2
0
 def colored_priority(self, instance):
     return colored('priority', PRIORITY_COLORS, bold=False)(instance)
예제 #3
0
 def display_priority(self, ticket):
     """ State colored for change_form """
     return colored('priority', PRIORITY_COLORS, bold=False, verbose=True)(ticket)
예제 #4
0
파일: admin.py 프로젝트: m00dy/controller
def colored_state(instance):
    color = colored('state', STATE_COLORS)
    return mark_safe(color(instance))
예제 #5
0
 def colored_state(self, instance):
     return colored('state', STATE_COLORS, bold=False)(instance)
예제 #6
0
파일: admin.py 프로젝트: m00dy/controller
 def display_set_state(self, node):
     return colored('set_state', STATES_COLORS, verbose=True, bold=False)(node)
예제 #7
0
                      log_sliver_history, remove_slice_id, state_value,
                      wrap_action)
from .models import (Slice, SliceProp, Sliver, SliverDefaults, SliverProp,
                     SliverIface, Template)

# List of ifaces displayed in SliverInline (and subclasses)
SLIVER_IFACES = ['public6', 'public4', 'management', 'isolated', 'debug']

STATE_COLORS = {
    Slice.REGISTER: 'grey',
    Slice.DEPLOY: 'darkorange',
    Slice.START: 'green'
}

colored_set_state = colored('set_state',
                            STATE_COLORS,
                            verbose=True,
                            bold=False)


def num_slivers(instance):
    """ return num slivers as a link to slivers changelist view """
    num = instance.slivers.count()
    url = reverse('admin:slices_sliver_changelist')
    url += '?my_slivers=False&%s=%s' % (instance._meta.model_name, instance.pk)
    return mark_safe('<a href="%s">%d</a>' % (url, num))


num_slivers.short_description = 'Slivers'
num_slivers.admin_order_field = 'slivers__count'

예제 #8
0
    log_sliver_history, remove_slice_id, state_value, wrap_action)
from .models import (Slice, SliceProp, Sliver, SliverDefaults, SliverProp,
    SliverIface, Template)


# List of ifaces displayed in SliverInline (and subclasses)
SLIVER_IFACES = ['public6', 'public4', 'management', 'isolated', 'debug']

STATE_COLORS = {
    Slice.REGISTER: 'grey',
    Slice.DEPLOY: 'darkorange',
    Slice.START: 'green'
}


colored_set_state = colored('set_state', STATE_COLORS, verbose=True, bold=False)

def num_slivers(instance):
    """ return num slivers as a link to slivers changelist view """
    num = instance.slivers.count()
    url = reverse('admin:slices_sliver_changelist')
    url += '?my_slivers=False&%s=%s' % (instance._meta.model_name, instance.pk)
    return mark_safe('<a href="%s">%d</a>' % (url, num))
num_slivers.short_description = 'Slivers'
num_slivers.admin_order_field = 'slivers__count'


def computed_sliver_set_state(sliver):
    title = ''

    # compute if state is overridden...
예제 #9
0
 def display_value(self, instance):
     value = colored('value', STATES_COLORS, verbose=True)(instance)
     url = reverse('admin:state_history_data', args=[instance.pk])
     return mark_safe('<a class="show-popup" href="#" url="%s">%s</a>' %
                      (url, value))
예제 #10
0
 def display_set_state(self, node):
     return colored('set_state', STATES_COLORS, verbose=True,
                    bold=False)(node)
예제 #11
0
파일: admin.py 프로젝트: m00dy/controller
 def display_value(self, instance):
     value = colored('value', STATES_COLORS, verbose=True)(instance)
     url = reverse('admin:state_history_data', args=[instance.pk])
     return mark_safe('<a class="show-popup" href="#" url="%s">%s</a>' % (url, value))
예제 #12
0
def colored_state(instance):
    color = colored('state', STATE_COLORS)
    return mark_safe(color(instance))
예제 #13
0
 def colored_state(self, build):
     return colored('state', STATE_COLORS)(build)
예제 #14
0
 def colored_state(self, build):
     return colored('state', STATE_COLORS)(build)