diff options
Diffstat (limited to 'app/views/shared/wikis')
-rw-r--r-- | app/views/shared/wikis/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/wikis/_sidebar.html.haml | 14 | ||||
-rw-r--r-- | app/views/shared/wikis/git_access.html.haml | 37 | ||||
-rw-r--r-- | app/views/shared/wikis/git_error.html.haml | 14 |
4 files changed, 60 insertions, 7 deletions
diff --git a/app/views/shared/wikis/_form.html.haml b/app/views/shared/wikis/_form.html.haml index dde1b3afa2d..b6504c7a17e 100644 --- a/app/views/shared/wikis/_form.html.haml +++ b/app/views/shared/wikis/_form.html.haml @@ -36,7 +36,7 @@ .col-sm-10 .select-wrapper = f.select :format, options_for_select(Wiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control select-control' - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: 'gl-absolute gl-top-3 gl-right-3 gl-text-gray-200') .form-group.row .col-sm-2.col-form-label= f.label :content, class: 'control-label-full-width' diff --git a/app/views/shared/wikis/_sidebar.html.haml b/app/views/shared/wikis/_sidebar.html.haml index c0ed7b4c6f2..a906bf7aa63 100644 --- a/app/views/shared/wikis/_sidebar.html.haml +++ b/app/views/shared/wikis/_sidebar.html.haml @@ -4,17 +4,19 @@ %a.gutter-toggle.float-right.d-block.d-md-none.js-sidebar-wiki-toggle{ href: "#" } = sprite_icon('chevron-double-lg-right', css_class: 'gl-icon') - - if @wiki.container.is_a?(Project) - - git_access_url = wiki_path(@wiki, action: :git_access) - = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do - = sprite_icon('download', css_class: 'gl-mr-2') - %span= _("Clone repository") + - git_access_url = wiki_path(@wiki, action: :git_access) + = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '', data: { qa_selector: 'clone_repository_link' } do + = sprite_icon('download', css_class: 'gl-mr-2') + %span= _("Clone repository") + + - if @sidebar_error.present? + = render 'shared/alert_info', body: s_('Wiki|The sidebar failed to load. You can reload the page to try again.') .blocks-container .block.block-first.w-100 - if @sidebar_page = render_wiki_content(@sidebar_page) - - else + - elsif @sidebar_wiki_entries %ul.wiki-pages = render @sidebar_wiki_entries, context: 'sidebar' .block.w-100 diff --git a/app/views/shared/wikis/git_access.html.haml b/app/views/shared/wikis/git_access.html.haml new file mode 100644 index 00000000000..2542860c742 --- /dev/null +++ b/app/views/shared/wikis/git_access.html.haml @@ -0,0 +1,37 @@ +- @content_class = "limit-container-width" unless fluid_layout +- page_title s_("WikiClone|Git Access"), _("Wiki") +- add_page_specific_style 'page_bundles/wiki' + +.wiki-page-header.top-area.has-sidebar-toggle.py-3.flex-column.flex-lg-row + = wiki_sidebar_toggle_button + + .git-access-header.w-100.d-flex.flex-column.justify-content-center + %span + = _("Clone repository") + %strong= @wiki.full_path + + .pt-3.pt-lg-0.w-100 + = render "shared/clone_panel", container: @wiki + +.wiki-git-access + %h3= s_("WikiClone|Install Gollum") + %pre.dark + :preserve + gem install gollum + + %h3= s_("WikiClone|Clone your wiki") + %pre.dark + :preserve + 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 + :preserve + gollum + == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin + >> Thin web server (v1.5.0 codename Knife) + >> Maximum connections set to 1024 + >> Listening on 0.0.0.0:4567, CTRL+C to stop + += render 'shared/wikis/sidebar' diff --git a/app/views/shared/wikis/git_error.html.haml b/app/views/shared/wikis/git_error.html.haml new file mode 100644 index 00000000000..dab3b940b9a --- /dev/null +++ b/app/views/shared/wikis/git_error.html.haml @@ -0,0 +1,14 @@ +- if @page + - wiki_page_title @page + +- add_page_specific_style 'page_bundles/wiki' + +- git_access_url = wiki_path(@wiki, action: :git_access) + +.wiki-page-header.top-area.gl-flex-direction-column.gl-lg-flex-direction-row + .gl-mt-5.gl-mb-3 + .gl-display-flex.gl-justify-content-space-between + %h2.gl-mt-0.gl-mb-5{ data: { qa_selector: 'wiki_page_title', testid: 'wiki_page_title' } }= @page ? @page.human_title : _('Failed to retrieve page') + .js-wiki-page-content.md.gl-pt-2{ data: { qa_selector: 'wiki_page_content', testid: 'wiki_page_content' } } + = _('The page could not be displayed because it timed out.') + = html_escape(_('You can view the source or %{linkStart}%{cloneIcon} clone the repository%{linkEnd}')) % { linkStart: "<a href=\"#{git_access_url}\">".html_safe, linkEnd: '</a>'.html_safe, cloneIcon: sprite_icon('download', css_class: 'gl-mr-2').html_safe } |