summaryrefslogtreecommitdiff
path: root/app/views/admin/appearances/_form.html.haml
blob: a5f34d0dab2c1f679f3b70513069f05570e706ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
= form_for @appearance, url: admin_appearances_path, html: { class: 'prepend-top-default' } do |f|
  = form_errors(@appearance)


  .row
    .col-lg-4.profile-settings-sidebar
      %h4.prepend-top-0 Navigation bar

    .col-lg-8
      .form-group
        = f.label :header_logo, 'Header logo', class: 'col-form-label label-bold pt-0'
        %p
          - if @appearance.header_logo?
            = image_tag @appearance.header_logo_path, class: 'appearance-light-logo-preview'
            - if @appearance.persisted?
              %br
              = link_to 'Remove header logo', header_logos_admin_appearances_path, data: { confirm: "Header logo will be removed. Are you sure?"}, method: :delete, class: "btn btn-inverted btn-remove btn-sm remove-logo"
            %hr
          = f.hidden_field :header_logo_cache
          = f.file_field :header_logo, class: ""
          .hint
            Maximum file size is 1MB. Pages are optimized for a 28px tall header logo
  %hr
  .row
    .col-lg-4.profile-settings-sidebar
      %h4.prepend-top-0 Favicon

    .col-lg-8
      .form-group
        = f.label :favicon, 'Favicon', class: 'col-form-label label-bold pt-0'
        %p
          - if @appearance.favicon?
            = image_tag @appearance.favicon_path, class: 'appearance-light-logo-preview'
            - if @appearance.persisted?
              %br
              = link_to 'Remove favicon', favicon_admin_appearances_path, data: { confirm: "Favicon will be removed. Are you sure?"}, method: :delete, class: "btn btn-inverted btn-remove btn-sm remove-logo"
            %hr
          = f.hidden_field :favicon_cache
          = f.file_field :favicon, class: ''
          .hint
            Maximum file size is 1MB. Image size must be 32x32px. Allowed image formats are #{favicon_extension_whitelist}.
            %br
            Images with incorrect dimensions are not resized automatically, and may result in unexpected behavior.

  = render partial: 'admin/appearances/system_header_footer_form', locals: { form: f }

  %hr
  .row
    .col-lg-4.profile-settings-sidebar
      %h4.prepend-top-0 Sign in/Sign up pages

    .col-lg-8
      .form-group
        = f.label :title, class: 'col-form-label label-bold'
        = f.text_field :title, class: "form-control"
      .form-group
        = f.label :description, class: 'col-form-label label-bold'
        = f.text_area :description, class: "form-control", rows: 10
        .hint
          Description parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.
      .form-group
        = f.label :logo, class: 'col-form-label label-bold pt-0'
        %p
          - if @appearance.logo?
            = image_tag @appearance.logo_path, class: 'appearance-logo-preview'
            - if @appearance.persisted?
              %br
              = link_to 'Remove logo', logo_admin_appearances_path, data: { confirm: "Logo will be removed. Are you sure?"}, method: :delete, class: "btn btn-inverted btn-remove btn-sm remove-logo"
            %hr
          = f.hidden_field :logo_cache
          = f.file_field :logo, class: ""
          .hint
            Maximum file size is 1MB. Pages are optimized for a 640x360 px logo.

  %hr
  .row
    .col-lg-4.profile-settings-sidebar
      %h4.prepend-top-0 New project pages

    .col-lg-8
      .form-group
        = f.label :new_project_guidelines, class: 'col-form-label label-bold'
        %p
          = f.text_area :new_project_guidelines, class: "form-control", rows: 10
          .hint
            Guidelines parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.

      .prepend-top-default.append-bottom-default
        = f.submit 'Update appearance settings', class: 'btn btn-success'
        - if @appearance.persisted?
          Preview last save:
          = link_to 'Sign-in page', preview_sign_in_admin_appearances_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer'
          = link_to 'New project page', new_project_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer'

        - if @appearance.updated_at
          %span.float-right
            Last edit #{time_ago_with_tooltip(@appearance.updated_at)}