forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes from gitlab-org/gitlab@master
- Loading branch information
GitLab Bot
committed
Jun 3, 2024
1 parent
f4794b8
commit 188b122
Showing
72 changed files
with
528 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d1b9497e8e89e8066b575e29437abc1b081bccd4 | ||
e91769b14ae7f8a62582a9763ee4e4b284f7fbdc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script> | ||
import { GlAlert } from '@gitlab/ui'; | ||
import { s__ } from '~/locale'; | ||
import WikiHeader from './components/wiki_header.vue'; | ||
import WikiContent from './components/wiki_content.vue'; | ||
export default { | ||
components: { | ||
GlAlert, | ||
WikiHeader, | ||
WikiContent, | ||
}, | ||
inject: ['contentApi', 'isPageHistorical', 'wikiUrl', 'historyUrl'], | ||
i18n: { | ||
alertText: s__('WikiHistoricalPage|This is an old version of this page.'), | ||
alertPrimaryButton: s__('WikiHistoricalPage|Go to most recent version'), | ||
alertSecondaryButton: s__('WikiHistoricalPage|Browse history'), | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<gl-alert | ||
v-if="isPageHistorical" | ||
:dismissible="false" | ||
variant="warning" | ||
class="gl-mt-5" | ||
:primary-button-text="$options.i18n.alertPrimaryButton" | ||
:primary-button-link="wikiUrl" | ||
:secondary-button-text="$options.i18n.alertSecondaryButton" | ||
:secondary-button-link="historyUrl" | ||
> | ||
{{ $options.i18n.alertText }} | ||
</gl-alert> | ||
<wiki-header /> | ||
<wiki-content v-if="contentApi" :get-wiki-content-url="contentApi" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
app/assets/javascripts/pages/shared/wikis/components/wiki_header.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<script> | ||
import { GlButton, GlLink, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; | ||
import { __, s__ } from '~/locale'; | ||
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; | ||
import WikiMoreDropdown from './wiki_more_dropdown.vue'; | ||
export default { | ||
components: { | ||
GlButton, | ||
GlLink, | ||
GlSprintf, | ||
WikiMoreDropdown, | ||
TimeAgo, | ||
}, | ||
directives: { | ||
GlTooltip: GlTooltipDirective, | ||
}, | ||
inject: [ | ||
'pageTitle', | ||
'showEditButton', | ||
'isPageTemplate', | ||
'editButtonUrl', | ||
'lastVersion', | ||
'pageVersion', | ||
'authorUrl', | ||
], | ||
computed: { | ||
editTooltipText() { | ||
return this.isPageTemplate ? this.$options.i18n.editTemplate : this.$options.i18n.editPage; | ||
}, | ||
editTooltip() { | ||
return `${this.editTooltipText} <kbd class='flat ml-1' aria-hidden=true>e</kbd>`; | ||
}, | ||
}, | ||
mounted() { | ||
if (this.editButtonUrl) { | ||
document.addEventListener('keyup', this.onKeyUp); | ||
} | ||
}, | ||
destroyed() { | ||
document.removeEventListener('keyup', this.onKeyUp); | ||
}, | ||
methods: { | ||
onKeyUp(event) { | ||
if (event.key === 'e') { | ||
window.location.href = this.editButtonUrl; | ||
} | ||
return false; | ||
}, | ||
}, | ||
i18n: { | ||
edit: __('Edit'), | ||
editPage: __('Edit page'), | ||
editTemplate: __('Edit template'), | ||
lastEdited: s__('Wiki|Last edited by %{author} %{timeago}'), | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="wiki-page-header has-sidebar-toggle detail-page-header border-bottom-0 gl-pt-5 gl-flex gl-flex-wrap" | ||
> | ||
<div class="gl-flex gl-w-full"> | ||
<h1 | ||
class="gl-heading-1 !gl-my-0 gl-inline-block gl-grow gl-break-anywhere" | ||
data-testid="wiki-page-title" | ||
> | ||
{{ pageTitle }} | ||
</h1> | ||
<div class="detail-page-header-actions gl-self-start gl-flex gl-gap-3"> | ||
<gl-button | ||
v-if="showEditButton" | ||
v-gl-tooltip.html | ||
:title="editTooltip" | ||
:href="editButtonUrl" | ||
data-testid="wiki-edit-button" | ||
> | ||
{{ $options.i18n.edit }} | ||
</gl-button> | ||
<gl-button | ||
v-gl-tooltip.html | ||
icon="chevron-double-lg-left" | ||
class="js-sidebar-wiki-toggle md:gl-hidden" | ||
/> | ||
<wiki-more-dropdown /> | ||
</div> | ||
</div> | ||
<div | ||
v-if="lastVersion" | ||
class="wiki-last-version gl-leading-20 gl-text-secondary gl-mt-3 gl-mb-5" | ||
data-testid="wiki-page-last-version" | ||
> | ||
<gl-sprintf :message="$options.i18n.lastEdited"> | ||
<template #author> | ||
<gl-link :href="authorUrl" class="gl-text-black-normal gl-font-bold">{{ | ||
pageVersion.commit.author_name | ||
}}</gl-link> | ||
</template> | ||
<template #timeago> | ||
<time-ago :time="pageVersion.commit.authored_date" target="wiki-last-version" /> | ||
</template> | ||
</gl-sprintf> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.