Skip to content
Snippets Groups Projects

Add Fieldset Support to Project Services Views

Merged gitlab-qa-bot requested to merge github/fork/ikappas/project-services-extend-ui into master

Created by: ikappas

Adds support for fieldset in project services views and admin services views in order to group related settings.

  • Split original _form.html.haml field logic to seperate template _field.html.haml
  • Renamed f variable to form for clarity

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: ikappas

    I am developing a composer service that requires a few settings so having fieldsets to group related settings is far more user friendly.

    settings with no fieldsets: gitlab-no-fieldset-settings

    settings with fieldsets: gitlab-with-fieldset-settings

    basic usage:

    { type: 'fieldset', legend: 'Branches:', fields:
       [
          { type: 'checkbox',
             name: 'export_branches',
             label: 'Branch Listing'
          },
          { type: 'text',
            name: 'branch_filters',
            label: 'Branch Filters',
            placeholder: 'branches you wish to export comma seperated.',
            hint: 'Separate branches with commas. '\
                   'Leave blank to export all branches.'
          }
       ]
    }

    By Administrator on 2015-04-02T09:22:46 (imported from GitLab project)

    By Administrator on 2015-04-02T09:22:46 (imported from GitLab)

  • gitlab-qa-bot
  • gitlab-qa-bot
  • gitlab-qa-bot
  • gitlab-qa-bot
  • gitlab-qa-bot
  • gitlab-qa-bot
    gitlab-qa-bot @gitlab-qa-bot started a thread on commit 3196c529
  • 84 - elsif type == 'checkbox'
    85 = f.check_box name
    86 - elsif type == 'select'
    87 = f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
    88 - elsif type == 'password'
    89 = f.password_field name, class: 'form-control'
    90 - if help
    91 %span.help-block= help
    70 - if type == 'fieldset'
    71 - fields = field[:fields]
    72 - legend = field[:legend]
    73
    74 %fieldset
    75 %legend= legend
    76 - fields.each do |subfield|
    77 = render 'shared/field', form: form, field: subfield
  • gitlab-qa-bot
    gitlab-qa-bot @gitlab-qa-bot started a thread on commit 3196c529
  • 84 - elsif type == 'checkbox'
    85 = f.check_box name
    86 - elsif type == 'select'
    87 = f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
    88 - elsif type == 'password'
    89 = f.password_field name, class: 'form-control'
    90 - if help
    91 %span.help-block= help
    70 - if type == 'fieldset'
    71 - fields = field[:fields]
    72 - legend = field[:legend]
    73
    74 %fieldset
    75 %legend= legend
    76 - fields.each do |subfield|
    77 = render 'shared/field', form: form, field: subfield
    • Created by: ikappas

      Done

      By Administrator on 2015-04-22T17:36:07 (imported from GitLab project)

      By Administrator on 2015-04-22T17:36:07 (imported from GitLab)

    Please register or sign in to reply
    Loading