#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# if ( 'domain' not in kwargs ) : #NEWLINE# #INDENT# raise Exception ( 'Expected domain in kwargs' ) #NEWLINE# #UNINDENT# self . domain = kwargs . pop ( 'domain' ) #NEWLINE# super ( AddAutomaticCaseUpdateRuleForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# self . fields [ 'update_property_name' ] . label = ( _ ( 'Property' ) + '<span class="asteriskField">*</span>' ) #NEWLINE# self . fields [ 'update_property_value' ] . label = ( _ ( 'Value' ) + '<span class="asteriskField">*</span>' ) #NEWLINE# if AUTO_CASE_UPDATES . enabled ( self . domain ) : #NEWLINE# #INDENT# self . allow_updates_without_closing ( ) #NEWLINE# #UNINDENT# self . set_case_type_choices ( self . initial . get ( 'case_type' ) ) #NEWLINE# self . helper = FormHelper ( ) #NEWLINE# self . helper . form_class = 'form form-horizontal' #NEWLINE# self . helper . label_class = 'col-sm-3 col-md-2' #NEWLINE# self . helper . field_class = 'col-sm-4 col-md-3' #NEWLINE# self . helper . form_method = 'POST' #NEWLINE# self . helper . form_action = '#' #NEWLINE# self . helper . layout = Layout ( Fieldset ( _ ( 'Basic Information' ) , Field ( 'name' , ng_model = 'name' ) , Field ( 'case_type' , ng_model = 'case_type' ) , hqcrispy . B3MultiField ( ( _ ( 'Close Case' ) + '<span class="asteriskField">*</span>' ) , Div ( hqcrispy . MultiInlineField ( 'server_modified_boundary' , ng_model = 'server_modified_boundary' ) , css_class = 'col-sm-6' ) , Div ( HTML ( ( '<label class="control-label">%s</label>' % _ ( 'days after the case was last modified.' ) ) ) , css_class = 'col-sm-6' ) , help_bubble_text = _ ( 'This will close the case if it has been more than the chosen number of days since the case was last modified. Cases are checked against this rule weekly.' ) , css_id = 'server_modified_boundary_multifield' , label_class = self . helper . label_class , field_class = 'col-sm-8 col-md-6' ) , Field ( 'action' , ng_model = 'action' ) , Div ( Field ( 'update_property_name' , ng_model = 'update_property_name' , css_class = 'case-property-typeahead' ) , Field ( 'update_property_value' , ng_model = 'update_property_value' ) , ng_show = 'showUpdateProperty()' ) ) , Fieldset ( _ ( 'Filter Cases to Close (Optional)' ) , Field ( 'conditions' , type = 'hidden' , ng_value = 'conditions' ) , Div ( ng_include = '' , src = "'conditions.tpl'" ) ) , FormActions ( StrictButton ( _ ( 'Save' ) , type = 'submit' , css_class = 'btn btn-primary col-sm-offset-1' ) ) )