gitlab-org--gitlab-foss/app/views/help/ui.html.haml

527 lines
15 KiB
Text
Raw Normal View History

2015-04-30 13:06:18 -04:00
- page_title "UI Development Kit", "Help"
2015-03-08 17:46:22 -04:00
- lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fermentum nisi sapien, non consequat lectus aliquam ultrices. Suspendisse sodales est euismod nunc condimentum, a consectetur diam ornare."
.gitlab-ui-dev-kit
%h1 GitLab UI development kit
%p.light
Use page inspector in your browser to check element classes and structure
of examples below.
%hr
%ul
%li
= link_to 'Blocks', '#blocks'
%li
= link_to 'Lists', '#lists'
%li
= link_to 'Tables', '#tables'
%li
= link_to 'Nav', '#nav'
2015-03-08 17:46:22 -04:00
%li
= link_to 'Buttons', '#buttons'
%li
= link_to 'Dropdowns', '#dropdowns'
2015-03-08 17:46:22 -04:00
%li
= link_to 'Panels', '#panels'
%li
= link_to 'Alerts', '#alerts'
%li
= link_to 'Forms', '#forms'
2015-03-13 22:20:25 -04:00
%li
= link_to 'Files', '#file'
2015-03-08 18:21:47 -04:00
%li
= link_to 'Markdown', '#markdown'
2015-03-08 17:46:22 -04:00
%h2#blocks Blocks
.lead
Content block separated with botton border
%code .content-block
.example
.content-block
%h4 Normal block inside content
= lorem
.content-block
%h4 Second block
= lorem
.lead
Gray content block with side padding using
2016-04-25 16:02:15 -04:00
%code .row-content-block
.example
2016-04-25 16:02:15 -04:00
.row-content-block
%h4 Normal block inside content
= lorem
2016-04-25 16:02:15 -04:00
.row-content-block.second-block
%h4 Second block
= lorem
2015-03-08 17:46:22 -04:00
.lead
Cover block for profile page with avatar, name and description
%code .cover-block
.example
.cover-block
.avatar-holder
= image_tag avatar_icon_for_email('admin@example.com', 90), class: "avatar s90", alt: ''
.cover-title
John Smith
.cover-desc
= lorem
.cover-controls
2018-05-07 19:25:00 -04:00
= link_to '#', class: 'btn btn-default' do
= icon('pencil')
 
2018-05-07 19:25:00 -04:00
= link_to '#', class: 'btn btn-default' do
= icon('rss')
2015-03-08 17:46:22 -04:00
%h2#lists Lists
.lead
Simple list using
%code .content-list
.example
%ul.content-list
%li
One item
%li
One item
%li
One item
.lead
List with avatar, title and description using
%code .content-list
.example
%ul.content-list
%li
= image_tag 'no_avatar.png', class: 'avatar s40'
.title Title
.description Description
%li
= image_tag 'no_avatar.png', class: 'avatar s40'
.title Title
.description Description
%li
= image_tag 'no_avatar.png', class: 'avatar s40'
.title Title
.description Description
.lead
List with hover effect
%code .hover-list
.example
%ul.hover-list
2015-03-08 17:46:22 -04:00
%li
One item
%li
One item
%li
One item
.lead
List inside panel
.example
.card
.card-header Your list
%ul.content-list
%li
One item
%li
One item
%li
One item
2015-03-08 17:46:22 -04:00
%h2#tables Tables
.example
%table.table
%thead
%tr
%th #
%th First Name
%th Last Name
%th Username
%tbody
%tr
%td 1
%td Mark
%td Otto
%td @mdo
%tr
%td 2
%td Jacob
%td Thornton
%td @fat
%tr
%td 3
%td Larry
%td the Bird
%td @twitter
%h2#navs Navigation
.lead
Holder for top page navigation. Includes navigation, search field, sorting and button
%code .top-area
.example
.top-area
2018-04-19 23:34:20 -04:00
%ul.nav-links.nav.nav-tabs
%li.active
%a Open
%li
%a Closed
.nav-controls
= text_field_tag 'sample', nil, class: 'form-control'
.dropdown
%button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
%span Sort by name
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
%ul.dropdown-menu
%li
2017-08-16 10:17:19 -04:00
= link_to 'Sort by date', '#'
= link_to 'New issue', '#', class: 'btn btn-new btn-inverted'
.lead
Only nav links without button and search
%code .nav-links
.example
%ul.nav-links
%li.active
%a Open
%li
%a Closed
2015-03-08 17:46:22 -04:00
%h2#buttons Buttons
.example
2018-05-10 15:22:56 -04:00
%button.btn.btn-default{ :type => "button" } Secondary
%button.btn.btn-primary{ :type => "button" } Primary
%button.btn.btn-success{ :type => "button" } Success
%button.btn.btn-info{ :type => "button" } Info
%button.btn.btn-warning{ :type => "button" } Warning
%button.btn.btn-danger{ :type => "button" } Danger
%button.btn.btn-link{ :type => "button" } Link
2015-03-08 17:46:22 -04:00
%h2#dropdowns Dropdowns
.example
.clearfix
2018-04-09 13:36:21 -04:00
.dropdown.inline.float-left
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
%ul.dropdown-menu
%li
%a{ href: "#" }
Dropdown option
.dropdown.inline.float-right
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
2018-04-17 13:18:41 -04:00
%ul.dropdown-menu.dropdown-menu-right
%li
%a{ href: "#" }
Dropdown option
.example
%div
.dropdown.inline
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-selectable
%li
%a.is-active{ href: "#" }
Dropdown option
.example
%div
.dropdown.inline
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable
.dropdown-title
%span Dropdown title
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Filter results" }
= icon('search')
.dropdown-content
%ul
%li
%a.is-active{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li.divider
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
.dropdown-footer
%strong Tip:
If an author is not a member of this project, you can still filter by his name while using the search field.
.dropdown.inline
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown loading
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable.is-loading
.dropdown-title
%span Dropdown title
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Filter results" }
= icon('search')
.dropdown-content
%ul
%li
%a.is-active{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li.divider
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
%li
%a{ href: "#" }
Dropdown option
.dropdown-footer
%strong Tip:
If an author is not a member of this project, you can still filter by his name while using the search field.
.dropdown-loading
= icon('spinner spin')
.example
%div
.dropdown.inline
%button.dropdown-menu-toggle{ type: 'button', data: {toggle: 'dropdown' } }
Dropdown user
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-user
.dropdown-title
%span Dropdown title
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Filter results" }
= icon('search')
.dropdown-content
%ul
%li
%a.dropdown-menu-user-link.is-active{ href: "#" }
2016-04-16 16:00:30 -04:00
= link_to_member_avatar(@user, size: 30)
%strong.dropdown-menu-user-full-name
2016-04-16 16:00:30 -04:00
= @user.name
.dropdown-menu-user-username
2016-04-16 16:00:30 -04:00
= @user.to_reference
.example
%div
2016-03-07 06:26:35 -05:00
.dropdown.inline
%button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
Dropdown page 2
2016-03-07 06:50:39 -05:00
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable.dropdown-menu-user.dropdown-menu-paging.is-page-two
.dropdown-page-one
.dropdown-title
%button.dropdown-title-button.dropdown-menu-back{ aria: { label: "Go back" } }
= icon('arrow-left')
%span Dropdown title
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Filter results" }
= icon('search')
.dropdown-content
%ul
%li
%a.dropdown-menu-user-link.is-active{ href: "#" }
2016-04-16 16:00:30 -04:00
= link_to_member_avatar(@user, size: 30)
%strong.dropdown-menu-user-full-name
2016-04-16 16:00:30 -04:00
= @user.name
.dropdown-menu-user-username
2016-04-16 16:00:30 -04:00
= @user.to_reference
.dropdown-page-two
.dropdown-title
%button.dropdown-title-button.dropdown-menu-back{ aria: { label: "Go back" } }
= icon('arrow-left')
%span Create label
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Name new label" }
.dropdown-content
%button.btn.btn-primary
Create
2016-03-07 10:37:35 -05:00
.example
%div
.dropdown.inline
%button#js-project-dropdown.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown' } }
2016-03-07 10:37:35 -05:00
Projects
= icon('chevron-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable
.dropdown-title
%span Go to project
%button.dropdown-title-button.dropdown-menu-close{ aria: { label: "Close" } }
2016-03-07 10:37:35 -05:00
= icon('times')
.dropdown-input
%input.dropdown-input-field{ type: "search", placeholder: "Filter results" }
2016-03-07 10:37:35 -05:00
= icon('search')
.dropdown-content
.dropdown-loading
= icon('spinner spin')
.example
%div
2016-03-09 05:19:41 -05:00
= dropdown_tag("Projects", options: { title: "Go to project", filter: true, placeholder: "Filter projects" })
2016-03-07 10:37:35 -05:00
2015-03-08 17:46:22 -04:00
%h2#panels Panels
.row
.col-md-6
.card.bg-success
.card-header Success
.card-body
2015-03-08 17:46:22 -04:00
= lorem
.card.bg-primary
.card-header Primary
.card-body
2015-03-08 17:46:22 -04:00
= lorem
.card.bg-info
.card-header Info
.card-body
2015-03-08 17:46:22 -04:00
= lorem
.col-md-6
.card.bg-warning
.card-header Warning
.card-body
2015-03-08 17:46:22 -04:00
= lorem
.card.bg-danger
.card-header Danger
.card-body
2015-03-08 17:46:22 -04:00
= lorem
%h2#alerts Alerts
2015-03-08 17:46:22 -04:00
.row
.col-md-6
.alert.alert-success
= lorem
.alert.alert-info
= lorem
.col-md-6
.alert.alert-warning
= lorem
.alert.alert-danger
= lorem
%h2#forms Forms
.lead
Horizontal form when label rendered inline with input
2015-03-08 17:46:22 -04:00
%code form.horizontal-form
.example
%form
.form-group.row
%label.col-sm-2.col-form-label{ :for => "inputEmail3" } Email
.col-sm-10
%input#inputEmail3.form-control{ :placeholder => "Email", :type => "email" }/
.form-group.row
%label.col-sm-2.col-form-label{ :for => "inputPassword3" } Password
.col-sm-10
%input#inputPassword3.form-control{ :placeholder => "Password", :type => "password" }/
.form-group.row
.offset-sm-2.col-sm-10
.form-check
2018-05-31 15:20:46 -04:00
%input.form-check-input{ :type => "checkbox" }/
%label.form-check-label
Remember me
.form-group.row
.offset-sm-2.col-sm-10
2018-05-10 15:22:56 -04:00
%button.btn.btn-default{ :type => "submit" } Sign in
2015-03-08 17:46:22 -04:00
.lead
Form when label rendered above input
2015-03-08 17:46:22 -04:00
%code form
.example
%form
.form-group
%label{ :for => "exampleInputEmail1" } Email address
%input#exampleInputEmail1.form-control{ :placeholder => "Enter email", :type => "email" }/
.form-group
%label{ :for => "exampleInputPassword1" } Password
%input#exampleInputPassword1.form-control{ :placeholder => "Password", :type => "password" }/
.form-check
2018-05-31 15:20:46 -04:00
%input.form-check-input{ :type => "checkbox" }/
%label.form-check-label
Remember me
2018-05-10 15:22:56 -04:00
%button.btn.btn-default{ :type => "submit" } Sign in
2015-03-08 18:21:47 -04:00
2015-03-13 22:20:25 -04:00
%h2#file File
%h4
2015-03-13 22:20:25 -04:00
%code .file-holder
2017-07-11 09:46:33 -04:00
- blob = Snippet.new(content: "Wow\nSuch\nFile").blob
2015-03-13 22:20:25 -04:00
.example
.file-holder
2017-02-05 17:28:48 -05:00
.js-file-title.file-title
2015-03-13 22:20:25 -04:00
Awesome file
.file-actions
.btn-group
%a.btn Edit
%a.btn.btn-danger Remove
2015-03-13 22:20:25 -04:00
.file-contenta.code
= render 'shared/file_highlight', blob: blob
2015-03-08 18:21:47 -04:00
%h2#markdown Markdown
%h4
2015-03-08 18:21:47 -04:00
%code .md or .wiki and others
Markdown rendering has a bit different css and presented in next UI elements:
%ul
%li comment
%li issue, merge request description
%li wiki page
%li help page
2016-08-25 10:19:14 -04:00
You can check how markdown rendered at #{link_to 'Markdown help page', help_page_path("user/markdown")}.