diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-13 18:01:25 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-13 18:01:25 +0800 |
commit | edc46ce3e44147d5fe1b3071ba1e020846b60b13 (patch) | |
tree | f31f887566921b6ad432dd65eec86da713cab66a /app/views/layouts | |
parent | c81db2442029417cf2836c62093b6772e35d2164 (diff) | |
parent | e69299b7090f9790ce158a99b5ab63093223d75a (diff) | |
download | gitlab-ce-edc46ce3e44147d5fe1b3071ba1e020846b60b13.tar.gz |
Merge remote-tracking branch 'upstream/master' into 33149-rename-more-builds33149-rename-more-builds
* upstream/master: (460 commits)
Center dropdown for pipeline's mini graph
Documentation bugfix of invalid JSON payload example of Create a commit with multiple files and actions
Fix filename method of GitlabUploader to return always real filename
Ignore CVE-2017-5029 in Nokogiri
Refactor atom builder by using xml.atom layout
Let PhantomJS load local images
Add a changelog entry
Only add a description change note when no tasks are updated
Doc: Add the need to upgrade to Go 1.8.3 in the 9.1->9.2 documentation as the upgrade fails with Go 1.5 (installed with Gitlab 8.1)
Use gitaly 0.11.2
Add the ability to perform background migrations
Always render warnings icon in orange
Fix a few translation for zh_TW
Improve Job detail view to make it refreshed in real-time instead of reloading
Attempts to run RSpec tests twice (1 retry)
ignore name validation on importing
Only show hover state on links and buttons
Use vue files for navigation tabs and buttons
doc: add example of scheduler when
Add test for u2f helper and changelog entry
...
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_head.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/header/_new_dropdown.haml | 45 | ||||
-rw-r--r-- | app/views/layouts/snippets.html.haml | 5 | ||||
-rw-r--r-- | app/views/layouts/xml.atom.builder | 4 |
6 files changed, 59 insertions, 10 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 9e354987401..eea33b5966f 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -28,14 +28,17 @@ = stylesheet_link_tag "application", media: "all" = stylesheet_link_tag "print", media: "print" = stylesheet_link_tag "test", media: "all" if Rails.env.test? + = stylesheet_link_tag 'peek' if peek_enabled? = Gon::Base.render_data = webpack_bundle_tag "runtime" = webpack_bundle_tag "common" + = webpack_bundle_tag "locale" = webpack_bundle_tag "main" = webpack_bundle_tag "raven" if current_application_settings.clientside_sentry_enabled = webpack_bundle_tag "test" if Rails.env.test? + = webpack_bundle_tag 'peek' if peek_enabled? - if content_for?(:page_specific_javascripts) = yield :page_specific_javascripts diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 03688e9ff21..2b07273a0a8 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -3,6 +3,7 @@ = render "layouts/head" %body{ class: @body_class, data: { page: body_data_page, project: "#{@project.path if @project}", group: "#{@group.path if @group}" } } = render "layouts/init_auto_complete" if @gfm_form + = render 'peek/bar' = render "layouts/header/default", title: header_title = render 'layouts/page', sidebar: sidebar, nav: nav diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..249253f4906 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,7 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + = render 'layouts/header/new_dropdown' - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', @@ -74,12 +71,12 @@ @#{current_user.username} %li.divider %li - = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username } + = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li - = link_to "Settings", profile_path, aria: { label: "Settings" } + = link_to "Settings", profile_path %li.divider %li - = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" } + = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" - else %li %div diff --git a/app/views/layouts/header/_new_dropdown.haml b/app/views/layouts/header/_new_dropdown.haml new file mode 100644 index 00000000000..c7302414386 --- /dev/null +++ b/app/views/layouts/header/_new_dropdown.haml @@ -0,0 +1,45 @@ +%li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + - if @group + - create_group_project = can?(current_user, :create_projects, @group) + - create_group_subgroup = can?(current_user, :create_subgroup, @group) + - if create_group_project || create_group_subgroup + %li.dropdown-bold-header This group + - if create_group_project + %li.header-new-group-project + = link_to 'New project', new_project_path(namespace_id: @group.id) + - if create_group_subgroup + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id) + %li.divider + %li.dropdown-bold-header GitLab + + - if @project && @project.persisted? + - create_project_issue = can?(current_user, :create_issue, @project) + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - create_project_snippet = can?(current_user, :create_project_snippet, @project) + - if create_project_issue || merge_project || create_project_snippet + %li.dropdown-bold-header This project + - if create_project_issue + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) + - if create_project_snippet + %li.header-new-project-snippet + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) + %li.divider + %li.dropdown-bold-header GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path + %li + = link_to 'New snippet', new_snippet_path diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml index 98b75cea03f..57971205e0e 100644 --- a/app/views/layouts/snippets.html.haml +++ b/app/views/layouts/snippets.html.haml @@ -1,9 +1,8 @@ - header_title "Snippets", snippets_path - content_for :page_specific_javascripts do - - if @snippet&.persisted? && current_user + - if @snippet && current_user :javascript - window.uploads_path = "#{upload_path('personal_snippet', @snippet)}"; - window.preview_markdown_path = "#{preview_markdown_snippet_path(@snippet)}"; + window.uploads_path = "#{upload_path('personal_snippet', id: @snippet.id)}"; = render template: "layouts/application" diff --git a/app/views/layouts/xml.atom.builder b/app/views/layouts/xml.atom.builder new file mode 100644 index 00000000000..4ee09cb87a1 --- /dev/null +++ b/app/views/layouts/xml.atom.builder @@ -0,0 +1,4 @@ +xml.instruct! +xml.feed 'xmlns' => 'http://www.w3.org/2005/Atom', 'xmlns:media' => 'http://search.yahoo.com/mrss/' do + xml << yield +end |