Module: ApplicationHelper

Includes:
ControllerHelper
Defined in:
app/helpers/application_helper.rb

Overview

rubocop:todo Metrics/ModuleLength

Instance Method Summary collapse

  • #tab_pane(name, id: nil, tab_id: nil, active: false) ⇒ Object
    yield
    .
  • #tabulated_error_messages_for(*params) ⇒ Object

    rubocop:todo Metrics/AbcSize.

  • Methods included from ControllerHelper

    #add

    Methods included from Informatics::Globals

    #application, #application=, #defaults, #defaults=, #global_searchable_classes, #search_options

    Instance Method Details

    #about(title = '') ⇒ Object

    From Pipelines

    
    
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    # File 'app/helpers/application_helper.rb', line 229
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #api_dataObject

    
    
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    # File 'app/helpers/application_helper.rb', line 110
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #apple_iconString

    Return the appropriate apple icon for the current environment

    Returns:

    • (String)

      The path to the apple icon

    
    
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    # File 'app/helpers/application_helper.rb', line 70
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #badge(status, type: 'generic-badge', style: status) ⇒ type

    Renders a badge containing the supplied text, with appropriate styling. By default the 'badge-#{status}' class is applied. These states are mapped to bootstrap colours in components.scss (grep '// State-colour extensions')

    If you can't map the text directly to a style, such as if you are displaying a number that you want to change its colours at certain thresholds, then you can override the applied style with the style: argument.

    If the string passed in is empty, no badge will be rendered

    Examples:

    Render a request state badge.

    badge(request.state, type: 'request')

    Render the size of a batch, which is red if too large.

    status = batch.size > MAX_SIZE ? 'danger' : 'success'
    badge(batch.size, type: 'batch-size', style: status )

    Parameters:

    • status (String)

      The text to display in the badge. Will also be used to set the style if not otherwise specified

    • type (String) (defaults to: 'generic-badge')

      Optional: Additional css-class applied to the badge (generic-badge by default)

    • style (String) (defaults to: status)

      Optional: Override the badge-* class otherwise set directly from the status.

    Returns:

    • (type)

      HTML to render a badge

    
    
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    # File 'app/helpers/application_helper.rb', line 151
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #counter_badge(counter, suffix = '') ⇒ String

    Used to add a counter to headers or links. Renders a blue badge containing the supplied number Only supply a suffix if it can't be worked out from the context what is being counted.

    Parameters:

    • counter (Integer)

      The value to show in the badge

    • suffix (Integer, String) (defaults to: '')

      Optional: The type of thing being counted.

    Returns:

    • (String)

      HTML to render a badge

    
    
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    # File 'app/helpers/application_helper.rb', line 164
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #custom_text(identifier, differential = nil) ⇒ Object

    Should return either the custom text or a blank string

    
    
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    # File 'app/helpers/application_helper.rb', line 7
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #display_boolean_results(result) ⇒ Object

    
    
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    # File 'app/helpers/application_helper.rb', line 279
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #display_follow(item, user, msg) ⇒ Object

    
    
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    # File 'app/helpers/application_helper.rb', line 223
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #display_user_error(display_text, link = nil) ⇒ Object

    
    
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    # File 'app/helpers/application_helper.rb', line 124
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #display_user_guide(display_text, link = nil) ⇒ type

    Renders a user guide with optional link. Applies appropriate styling

    Parameters:

    • display_text (String)

      The text of the user guide

    • link (String) (defaults to: nil)

      Optional url to link the guide to.

    Returns:

    • (type)

      [description]

    
    
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    # File 'app/helpers/application_helper.rb', line 120
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    rubocop:todo Metrics/MethodLength

    
    
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    # File 'app/helpers/application_helper.rb', line 170
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #faviconString

    Return the appropriate favicon for the current environment

    Returns:

    • (String)

      The path to the favicon

    
    
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    # File 'app/helpers/application_helper.rb', line 64
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end
    
    
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    # File 'app/helpers/application_helper.rb', line 311
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end
    
    
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    # File 'app/helpers/application_helper.rb', line 305
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #help_textObject

    
    
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    # File 'app/helpers/application_helper.rb', line 301
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #hidden_label_tag_for_testing(name, text = nil, options = {}) ⇒ Object

    Creates a label that is hidden from the view so that testing is easier

    
    
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    # File 'app/helpers/application_helper.rb', line 297
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #icon_suffixString

    Returns the appropriate icon suffix for the current environment Returns empty string for production Returns "-#environment" for training, staging Returns "-development" for any other environment

    Returns:

    • (String)

      The suffix to append to the icon name

    
    
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    # File 'app/helpers/application_helper.rb', line 44
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #legacy_javascript_tagString

    Ideally we don't want inline script tags, however there is a fair chunk of legacy code, some of which isn't trivial to migrate, as it uses erb to generate javascript, rather than using data-attributes.

    This tag:

    • Ensures we add a nonce for security
    • If the page is still loading, delays script execution until DOMContentLoaded to ensure that the modern JS has had a chance to export jQuery
    • If the page has already loaded, executes the script immediately. This is needed for use cases where the partial that renders this script is loaded after the main page has loaded e.g. the admin study edit page, within the admin study index page.

    Returns:

    • (String)

      Script tag

    
    
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    # File 'app/helpers/application_helper.rb', line 367
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #remote_error(identifier = 'remote_error') ⇒ Object

    TODO:

    Probably remove this and the references to it in app/views/studies/information/_items.html.erb Or possibly restore the intended behaviour in app/assets/javascripts/sequencescape/ajax_link_handling.js

    Renders a non-displayed error div warning of a data failure Appears to have been intended to be used to provide error feedback on the studies in app/views/studies/information/_items.html.erb but actual behaviour will result in the error payload being placed in the div, but remaining invisible.

    Parameters:

    • identifier (String) (defaults to: 'remote_error')

      The id of the element

    
    
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    # File 'app/helpers/application_helper.rb', line 26
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #render_flashesObject

    
    
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    # File 'app/helpers/application_helper.rb', line 74
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #render_in_list(messages) ⇒ Object

    
    
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    # File 'app/helpers/application_helper.rb', line 106
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #render_message(messages) ⇒ ActiveSupport::SafeBuffer

    A helper method for render_flashes. If messages is a Hash, renders them as a described list, with the keys as the description and the values as the items. If messages is an Array with multiple messages, renders them as a list. If a single message, renders as a single div.

    Parameters:

    • messages (Hash, Array<String>, String)

      The flash message or messages to be rendered

    Returns:

    • (ActiveSupport::SafeBuffer)

      HTML-safe string for rendering the messages

    
    
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    # File 'app/helpers/application_helper.rb', line 87
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #render_parsed_json(json) ⇒ String

    Handles rendering of JSON to a series of nested lists. Does the following: String: Rendered as-is Array: Unordered list (Strictly speaking arrays are ordered, but we probably don't care.) Object: Descriptive list Other: Calls to_s Processes each in turn and called recursively

    rubocop:todo Metrics/MethodLength

    Parameters:

    • json (Hash, String, Array, , #to_s)

      The Object to render

    Returns:

    • (String)

      HTML formatted for rendering

    
    
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    # File 'app/helpers/application_helper.rb', line 328
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    rubocop:enable Metrics/MethodLength

    
    
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    # File 'app/helpers/application_helper.rb', line 187
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    rubocop:todo Metrics/ParameterLists

    
    
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    # File 'app/helpers/application_helper.rb', line 205
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #request_list_path(object, request_type = nil, status = nil, options = {}) ⇒ Object

    
    
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    # File 'app/helpers/application_helper.rb', line 210
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #required_markerString

    Inserts the icon used to indicate a field is required. This will also be displayed on any

    Returns:

    • (String)

      HTML representing the required marker

    
    
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    # File 'app/helpers/application_helper.rb', line 35
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #sequencescape_logoString

    Return the appropriate Sequencescape logo for the current environment

    Returns:

    • (String)

      The path to the logo image

    
    
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    # File 'app/helpers/application_helper.rb', line 58
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #sorted_requests_for_search(requests) ⇒ Object

    
    
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    # File 'app/helpers/application_helper.rb', line 289
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #tab(name, target: nil, active: false, id: nil) ⇒ Object

    
    
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    # File 'app/helpers/application_helper.rb', line 252
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #tab_pane(name, id: nil, tab_id: nil, active: false) ⇒ Object

    yield
    
    
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    # File 'app/helpers/application_helper.rb', line 272
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end

    #tabulated_error_messages_for(*params) ⇒ Object

    rubocop:todo Metrics/AbcSize

    
    
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    # File 'app/helpers/application_helper.rb', line 233
    
     do
      # NOTE: The following attribute is not required for Microarray Genotyping.
      # I think this might be broken and suggests that there should be separate classes for project: one for
      # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
      # that doesn't.
      include ProjectManager::Associations
      include BudgetDivision::Associations
    
      custom_attribute(:project_cost_code, required: true)
      custom_attribute(:funding_comments)
      custom_attribute(:collaborators)
      custom_attribute(:external_funding_source)
      custom_attribute(:sequencing_budget_cost_centre)
      custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
      custom_attribute(:gt_committee_tracking_id)
    
      before_validation do |record|
        record.project_cost_code = nil if record.project_cost_code.blank?
        record.project_funding_model = nil if record.project_funding_model.blank?
      end
    end