summaryrefslogtreecommitdiff
path: root/app/views/projects/wikis
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/wikis')
-rw-r--r--app/views/projects/wikis/_form.html.haml72
-rw-r--r--app/views/projects/wikis/_main_links.html.haml9
-rw-r--r--app/views/projects/wikis/_pages_wiki_page.html.haml6
-rw-r--r--app/views/projects/wikis/_sidebar.html.haml22
-rw-r--r--app/views/projects/wikis/_sidebar_wiki_page.html.haml3
-rw-r--r--app/views/projects/wikis/_wiki_directory.html.haml4
-rw-r--r--app/views/projects/wikis/_wiki_page.html.haml1
-rw-r--r--app/views/projects/wikis/edit.html.haml31
-rw-r--r--app/views/projects/wikis/empty.html.haml4
-rw-r--r--app/views/projects/wikis/git_access.html.haml10
-rw-r--r--app/views/projects/wikis/history.html.haml42
-rw-r--r--app/views/projects/wikis/pages.html.haml32
-rw-r--r--app/views/projects/wikis/show.html.haml32
13 files changed, 5 insertions, 263 deletions
diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml
deleted file mode 100644
index d29abfa937d..00000000000
--- a/app/views/projects/wikis/_form.html.haml
+++ /dev/null
@@ -1,72 +0,0 @@
-- form_classes = 'wiki-form common-note-form prepend-top-default js-quick-submit'
-- form_classes += ' js-new-wiki-page' unless @page.persisted?
-
-= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post,
- html: { class: form_classes },
- data: { uploads_path: uploads_path } do |f|
- = form_errors(@page, truncate: :title)
-
- - if @page.persisted?
- = f.hidden_field :last_commit_sha, value: @page.last_commit_sha
-
- .form-group.row
- .col-sm-12= f.label :title, class: 'control-label-full-width'
- .col-sm-12
- = f.text_field :title, class: 'form-control qa-wiki-title-textbox', value: @page.title, required: true, autofocus: !@page.persisted?, placeholder: s_('Wiki|Page title')
- %span.d-inline-block.mw-100.prepend-top-5
- = icon('lightbulb-o')
- - if @page.persisted?
- = s_("WikiEditPageTip|Tip: You can move this page by adding the path to the beginning of the title.")
- = link_to icon('question-circle'), help_page_path('user/project/wiki/index', anchor: 'moving-a-wiki-page'),
- target: '_blank', rel: 'noopener noreferrer'
- - else
- = s_("WikiNewPageTip|Tip: You can specify the full path for the new file. We will automatically create any missing directories.")
- = succeed '.' do
- = link_to _('Learn more'), help_page_path('user/project/wiki/index', anchor: 'creating-a-new-wiki-page'),
- target: '_blank', rel: 'noopener noreferrer'
- .form-group.row
- .col-sm-12= f.label :format, class: 'control-label-full-width'
- .col-sm-12
- .select-wrapper
- = f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control'
- = icon('chevron-down')
-
- .form-group.row
- .col-sm-12= f.label :content, class: 'control-label-full-width'
- .col-sm-12
- = render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do
- = render 'projects/zen', f: f, attr: :content, classes: 'note-textarea qa-wiki-content-textarea', placeholder: s_("WikiPage|Write your content or drag files hereā€¦")
- = render 'shared/notes/hints'
-
- .clearfix
- .error-alert
-
- .form-text.text-muted
- = succeed '.' do
- - case @page.format.to_s
- - when 'rdoc'
- - link_example = '{Link title}[link:page-slug]'
- - when 'asciidoc'
- - link_example = 'link:page-slug[Link title]'
- - when 'org'
- - link_example = '[[page-slug]]'
- - else
- - link_example = '[Link Title](page-slug)'
- = (s_('WikiMarkdownTip|To link to a (new) page, simply type <code class="js-markup-link-example">%{link_example}</code>') % { link_example: link_example }).html_safe
- = succeed '.' do
- - markdown_link = link_to s_("WikiMarkdownDocs|documentation"), help_page_path('user/markdown', anchor: 'wiki-specific-markdown')
- = (s_("WikiMarkdownDocs|More examples are in the %{docs_link}") % { docs_link: markdown_link }).html_safe
-
- .form-group.row
- .col-sm-12= f.label :commit_message, class: 'control-label-full-width'
- .col-sm-12= f.text_field :message, class: 'form-control qa-wiki-message-textbox', rows: 18, value: nil
-
- .form-actions
- - if @page && @page.persisted?
- = f.submit _("Save changes"), class: 'btn-success btn qa-save-changes-button'
- .float-right
- = link_to _("Cancel"), project_wiki_path(@project, @page), class: 'btn btn-cancel btn-grouped'
- - else
- = f.submit s_("Wiki|Create page"), class: 'btn-success btn qa-create-page-button rspec-create-page-button'
- .float-right
- = link_to _("Cancel"), project_wiki_path(@project, :home), class: 'btn btn-cancel'
diff --git a/app/views/projects/wikis/_main_links.html.haml b/app/views/projects/wikis/_main_links.html.haml
deleted file mode 100644
index 2e1e176c42a..00000000000
--- a/app/views/projects/wikis/_main_links.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- if (@page && @page.persisted?)
- - if can?(current_user, :create_wiki, @project)
- = link_to project_wikis_new_path(@project), class: "add-new-wiki btn btn-success", role: "button" do
- = s_("Wiki|New page")
- = link_to project_wiki_history_path(@project, @page), class: "btn", role: "button" do
- = s_("Wiki|Page history")
- - if can?(current_user, :create_wiki, @project) && @page.latest? && @valid_encoding
- = link_to project_wiki_edit_path(@project, @page), class: "btn js-wiki-edit", role: "button" do
- = _("Edit")
diff --git a/app/views/projects/wikis/_pages_wiki_page.html.haml b/app/views/projects/wikis/_pages_wiki_page.html.haml
deleted file mode 100644
index c156f8cbf50..00000000000
--- a/app/views/projects/wikis/_pages_wiki_page.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%li
- = link_to wiki_page.title, project_wiki_path(@project, wiki_page)
- %small (#{wiki_page.format})
- .float-right
- - if wiki_page.last_version
- %small= (s_("Last edited %{date}") % { date: time_ago_with_tooltip(wiki_page.last_version.authored_date) }).html_safe
diff --git a/app/views/projects/wikis/_sidebar.html.haml b/app/views/projects/wikis/_sidebar.html.haml
deleted file mode 100644
index 2b8da83b126..00000000000
--- a/app/views/projects/wikis/_sidebar.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-%aside.right-sidebar.right-sidebar-expanded.wiki-sidebar.js-wiki-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix" } }
- .sidebar-container
- .block.wiki-sidebar-header.append-bottom-default.w-100
- %a.gutter-toggle.float-right.d-block.d-sm-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" }
- = icon('angle-double-right')
-
- - git_access_url = project_wikis_git_access_path(@project)
- = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '' do
- = icon('cloud-download', class: 'append-right-5')
- %span= _("Clone repository")
-
- .blocks-container
- .block.block-first.w-100
- - if @sidebar_page
- = render_wiki_content(@sidebar_page)
- - else
- %ul.wiki-pages
- = render @sidebar_wiki_entries, context: 'sidebar'
- .block.w-100
- - if @sidebar_limited
- = link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
- = s_("Wiki|View All Pages")
diff --git a/app/views/projects/wikis/_sidebar_wiki_page.html.haml b/app/views/projects/wikis/_sidebar_wiki_page.html.haml
deleted file mode 100644
index 769d869bd53..00000000000
--- a/app/views/projects/wikis/_sidebar_wiki_page.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%li{ class: active_when(params[:id] == wiki_page.slug) }
- = link_to project_wiki_path(@project, wiki_page) do
- = wiki_page.human_title
diff --git a/app/views/projects/wikis/_wiki_directory.html.haml b/app/views/projects/wikis/_wiki_directory.html.haml
deleted file mode 100644
index 0e5f32ed859..00000000000
--- a/app/views/projects/wikis/_wiki_directory.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%li
- = wiki_directory.slug
- %ul
- = render wiki_directory.pages, context: context
diff --git a/app/views/projects/wikis/_wiki_page.html.haml b/app/views/projects/wikis/_wiki_page.html.haml
deleted file mode 100644
index c84d06dad02..00000000000
--- a/app/views/projects/wikis/_wiki_page.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "#{context}_wiki_page", wiki_page: wiki_page
diff --git a/app/views/projects/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml
deleted file mode 100644
index 9ccf5acfefc..00000000000
--- a/app/views/projects/wikis/edit.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-- @content_class = "limit-container-width" unless fluid_layout
-- add_to_breadcrumbs _("Wiki"), project_wiki_path(@project, @page)
-- breadcrumb_title @page.persisted? ? _("Edit") : _("New")
-- page_title @page.persisted? ? _("Edit") : _("New"), @page.human_title, _("Wiki")
-
-= wiki_page_errors(@error)
-
-.wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row
- %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
- = icon('angle-double-left')
-
- .nav-text
- %h2.wiki-page-title
- - if @page.persisted?
- = link_to @page.human_title, project_wiki_path(@project, @page)
- %span.light
- &middot;
- = s_("Wiki|Edit Page")
- - else
- = s_("Wiki|Create New Page")
-
- .nav-controls.pb-md-3.pb-lg-0
- - if @page.persisted?
- = link_to project_wiki_history_path(@project, @page), class: "btn" do
- = s_("Wiki|Page history")
- - if can?(current_user, :admin_wiki, @project)
- #delete-wiki-modal-wrapper{ data: { delete_wiki_url: project_wiki_path(@project, @page), page_title: @page.human_title } }
-
-= render 'form', uploads_path: wiki_attachment_upload_url
-
-= render 'sidebar'
diff --git a/app/views/projects/wikis/empty.html.haml b/app/views/projects/wikis/empty.html.haml
deleted file mode 100644
index 62fa6e1907b..00000000000
--- a/app/views/projects/wikis/empty.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- page_title _("Wiki")
-- @right_sidebar = false
-
-= render 'shared/empty_states/wikis'
diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml
index 72c9f45779a..208dedc988b 100644
--- a/app/views/projects/wikis/git_access.html.haml
+++ b/app/views/projects/wikis/git_access.html.haml
@@ -8,10 +8,10 @@
.git-access-header.w-100.d-flex.flex-column.justify-content-center
%span
= _("Clone repository")
- %strong= @project_wiki.full_path
+ %strong= @wiki.full_path
.pt-3.pt-lg-0.w-100
- = render "shared/clone_panel", project: @project_wiki
+ = render "shared/clone_panel", project: @wiki
.wiki-git-access
%h3= s_("WikiClone|Install Gollum")
@@ -22,8 +22,8 @@
%h3= s_("WikiClone|Clone your wiki")
%pre.dark
:preserve
- git clone #{ content_tag(:span, h(default_url_to_repo(@project_wiki)), class: 'clone')}
- cd #{h @project_wiki.path}
+ git clone #{ content_tag(:span, h(default_url_to_repo(@wiki)), class: 'clone')}
+ cd #{h @wiki.path}
%h3= s_("WikiClone|Start Gollum and edit locally")
%pre.dark
@@ -34,4 +34,4 @@
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
-= render 'sidebar'
+= render 'shared/wikis/sidebar'
diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml
deleted file mode 100644
index d3a55c53649..00000000000
--- a/app/views/projects/wikis/history.html.haml
+++ /dev/null
@@ -1,42 +0,0 @@
-- page_title _("History"), @page.human_title, _("Wiki")
-
-.wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row
- %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
- = icon('angle-double-left')
-
- .nav-text
- %h2.wiki-page-title
- = link_to @page.human_title, project_wiki_path(@project, @page)
- %span.light
- &middot;
- = _("History")
-
-.table-holder
- %table.table
- %thead
- %tr
- %th= s_("Wiki|Page version")
- %th= _("Author")
- %th= _("Commit Message")
- %th= _("Last updated")
- %th= _("Format")
- %tbody
- - @page_versions.each_with_index do |version, index|
- - commit = version
- %tr
- %td
- = link_to project_wiki_path_with_version(@project, @page,
- commit.id, index == 0) do
- = truncate_sha(commit.id)
- %td
- = commit.author_name
- %td
- = commit.message
- %td
- #{time_ago_with_tooltip(version.authored_date)}
- %td
- %strong
- = version.format
-= paginate @page_versions, theme: 'gitlab'
-
-= render 'sidebar'
diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml
deleted file mode 100644
index d9dcd8f9acd..00000000000
--- a/app/views/projects/wikis/pages.html.haml
+++ /dev/null
@@ -1,32 +0,0 @@
-- add_to_breadcrumbs "Wiki", project_wiki_path(@project, :home)
-- breadcrumb_title s_("Wiki|Pages")
-- page_title s_("Wiki|Pages"), _("Wiki")
-- sort_title = wiki_sort_title(params[:sort])
-
-.wiki-page-header.top-area.flex-column.flex-lg-row
-
- .nav-text.flex-fill
- %h2.wiki-page-title
- = s_("Wiki|Wiki Pages")
-
- .nav-controls.pb-md-3.pb-lg-0
- = link_to project_wikis_git_access_path(@project), class: 'btn' do
- = icon('cloud-download')
- = _("Clone repository")
-
- .dropdown.inline.wiki-sort-dropdown
- .btn-group{ role: 'group' }
- .btn-group{ role: 'group' }
- %button.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' }
- = sort_title
- = icon('chevron-down')
- %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
- %li
- = sortable_item(s_("Wiki|Title"), project_wikis_pages_path(@project, sort: ProjectWiki::TITLE_ORDER), sort_title)
- = sortable_item(s_("Wiki|Created date"), project_wikis_pages_path(@project, sort: ProjectWiki::CREATED_AT_ORDER), sort_title)
- = wiki_sort_controls(@project, params[:sort], params[:direction])
-
-%ul.wiki-pages-list.content-list
- = render @wiki_entries, context: 'pages'
-
-= paginate @wiki_pages, theme: 'gitlab'
diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml
deleted file mode 100644
index 74798311c2e..00000000000
--- a/app/views/projects/wikis/show.html.haml
+++ /dev/null
@@ -1,32 +0,0 @@
-- @content_class = "limit-container-width" unless fluid_layout
-- breadcrumb_title @page.human_title
-- wiki_breadcrumb_dropdown_links(@page.slug)
-- page_title @page.human_title, _("Wiki")
-- add_to_breadcrumbs _("Wiki"), project_wiki_path(@project, :home)
-
-.wiki-page-header.top-area.has-sidebar-toggle.flex-column.flex-lg-row
- %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
- = icon('angle-double-left')
-
- .nav-text.flex-fill
- %h2.wiki-page-title= @page.human_title
- %span.wiki-last-edit-by
- - if @page.last_version
- = (_("Last edited by %{name}") % { name: "<strong>#{@page.last_version.author_name}</strong>" }).html_safe
- #{time_ago_with_tooltip(@page.last_version.authored_date)}
-
- .nav-controls.pb-md-3.pb-lg-0
- = render 'main_links'
-
-- if @page.historical?
- .warning_message
- = s_("WikiHistoricalPage|This is an old version of this page.")
- - most_recent_link = link_to s_("WikiHistoricalPage|most recent version"), project_wiki_path(@project, @page)
- - history_link = link_to s_("WikiHistoricalPage|history"), project_wiki_history_path(@project, @page)
- = (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe
-
-.prepend-top-default.append-bottom-default
- .md{ data: { qa_selector: 'wiki_page_content' } }
- = render_wiki_content(@page)
-
-= render 'sidebar'