diff options
Diffstat (limited to 'app')
54 files changed, 235 insertions, 229 deletions
diff --git a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js index c0c21416275..8542a6e718a 100644 --- a/app/assets/javascripts/diff_notes/components/jump_to_discussion.js +++ b/app/assets/javascripts/diff_notes/components/jump_to_discussion.js @@ -112,7 +112,7 @@ const JumpToDiscussion = Vue.extend({ if (!hasDiscussionsToJumpTo) { // If there are no discussions to jump to on the current page, - // switch to the notes tab and jump to the first disucssion there. + // switch to the notes tab and jump to the first discussion there. window.mrTabs.activateTab('show'); activeTab = 'show'; jumpToFirstDiscussion = true; diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 05e32e3c1f1..6a87b712b48 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -23,7 +23,7 @@ export const diffHasAllExpandedDiscussions = (state, getters) => diff => { }; /** - * Checks if the diff has all discussions collpased + * Checks if the diff has all discussions collapsed * @param {Object} diff * @returns {Boolean} */ diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 00b3d283570..6f8b73564d0 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -151,10 +151,16 @@ class GfmAutoComplete { // Team Members $input.atwho({ at: '@', + alias: 'users', displayTpl(value) { let tmpl = GfmAutoComplete.Loading.template; - if (value.username != null) { - tmpl = GfmAutoComplete.Members.template; + const { avatarTag, username, title } = value; + if (username != null) { + tmpl = GfmAutoComplete.Members.templateFunction({ + avatarTag, + username, + title, + }); } return tmpl; }, @@ -565,8 +571,9 @@ GfmAutoComplete.Emoji = { }; // Team Members GfmAutoComplete.Members = { - // eslint-disable-next-line no-template-curly-in-string - template: '<li>${avatarTag} ${username} <small>${title}</small></li>', + templateFunction({ avatarTag, username, title }) { + return `<li>${avatarTag} ${username} <small>${_.escape(title)}</small></li>`; + }, }; GfmAutoComplete.Labels = { template: diff --git a/app/assets/javascripts/lib/utils/text_markdown.js b/app/assets/javascripts/lib/utils/text_markdown.js index c52cfb806a2..3618c6af7e2 100644 --- a/app/assets/javascripts/lib/utils/text_markdown.js +++ b/app/assets/javascripts/lib/utils/text_markdown.js @@ -39,7 +39,7 @@ function blockTagText(text, textArea, blockTag, selected) { } } -function moveCursor({ textArea, tag, wrapped, removedLastNewLine, select }) { +function moveCursor({ textArea, tag, positionBetweenTags, removedLastNewLine, select }) { var pos; if (!textArea.setSelectionRange) { return; @@ -51,7 +51,7 @@ function moveCursor({ textArea, tag, wrapped, removedLastNewLine, select }) { return textArea.setSelectionRange(startPosition, endPosition); } if (textArea.selectionStart === textArea.selectionEnd) { - if (wrapped) { + if (positionBetweenTags) { pos = textArea.selectionStart - tag.length; } else { pos = textArea.selectionStart; @@ -67,7 +67,6 @@ function moveCursor({ textArea, tag, wrapped, removedLastNewLine, select }) { export function insertMarkdownText({ textArea, text, tag, blockTag, selected, wrap, select }) { var textToInsert, - inserted, selectedSplit, startChar, removedLastNewLine, @@ -155,7 +154,7 @@ export function insertMarkdownText({ textArea, text, tag, blockTag, selected, wr return moveCursor({ textArea, tag: tag.replace(textPlaceholder, selected), - wrap, + positionBetweenTags: wrap && selected.length === 0, removedLastNewLine, select, }); @@ -171,10 +170,6 @@ function updateText({ textArea, tag, blockTag, wrap, select }) { return insertMarkdownText({ textArea, text, tag, blockTag, selected, wrap, select }); } -function replaceRange(s, start, end, substitute) { - return s.substring(0, start) + substitute + s.substring(end); -} - export function addMarkdownListeners(form) { return $('.js-md', form) .off('click') diff --git a/app/assets/javascripts/notebook/cells/output/index.vue b/app/assets/javascripts/notebook/cells/output/index.vue index d9f8604ed10..bd0bcc0d819 100644 --- a/app/assets/javascripts/notebook/cells/output/index.vue +++ b/app/assets/javascripts/notebook/cells/output/index.vue @@ -22,7 +22,7 @@ export default { }, output: { type: Object, - requred: true, + required: true, default: () => ({}), }, }, diff --git a/app/assets/javascripts/pages/users/user_overview_block.js b/app/assets/javascripts/pages/users/user_overview_block.js index 2ed177be558..eec2b5ca8e5 100644 --- a/app/assets/javascripts/pages/users/user_overview_block.js +++ b/app/assets/javascripts/pages/users/user_overview_block.js @@ -10,6 +10,7 @@ export default class UserOverviewBlock { limit: DEFAULT_LIMIT, ...options.requestParams, }; + this.postRenderCallback = options.postRenderCallback; this.loadData(); } @@ -43,5 +44,9 @@ export default class UserOverviewBlock { } loadingEl.classList.add('hide'); + + if (this.postRenderCallback) { + this.postRenderCallback.call(this); + } } } diff --git a/app/assets/javascripts/pages/users/user_tabs.js b/app/assets/javascripts/pages/users/user_tabs.js index 04bcb16f036..aa537d4a43e 100644 --- a/app/assets/javascripts/pages/users/user_tabs.js +++ b/app/assets/javascripts/pages/users/user_tabs.js @@ -2,7 +2,8 @@ import $ from 'jquery'; import axios from '~/lib/utils/axios_utils'; import Activities from '~/activities'; import { localTimeAgo } from '~/lib/utils/datetime_utility'; -import { __, sprintf } from '~/locale'; +import AjaxCache from '~/lib/utils/ajax_cache'; +import { __ } from '~/locale'; import flash from '~/flash'; import ActivityCalendar from './activity_calendar'; import UserOverviewBlock from './user_overview_block'; @@ -62,23 +63,20 @@ import UserOverviewBlock from './user_overview_block'; * </div> */ -const CALENDAR_TEMPLATES = { - activity: ` - <div class="clearfix calendar"> - <div class="js-contrib-calendar"></div> - <div class="calendar-hint bottom-right"></div> - </div> - `, - overview: ` - <div class="clearfix calendar"> - <div class="calendar-hint"></div> - <div class="js-contrib-calendar prepend-top-20"></div> - </div> - `, -}; +const CALENDAR_TEMPLATE = ` + <div class="clearfix calendar"> + <div class="js-contrib-calendar"></div> + <div class="calendar-hint bottom-right"></div> + </div> +`; const CALENDAR_PERIOD_6_MONTHS = 6; const CALENDAR_PERIOD_12_MONTHS = 12; +/* computation based on + * width = (group + 1) * this.daySizeWithSpace + this.getExtraWidthPadding(group); + * (see activity_calendar.js) + */ +const OVERVIEW_CALENDAR_BREAKPOINT = 918; export default class UserTabs { constructor({ defaultAction, action, parentEl }) { @@ -105,6 +103,12 @@ export default class UserTabs { .off('shown.bs.tab', '.nav-links a[data-toggle="tab"]') .on('shown.bs.tab', '.nav-links a[data-toggle="tab"]', event => this.tabShown(event)) .on('click', '.gl-pagination a', event => this.changeProjectsPage(event)); + + window.addEventListener('resize', () => this.onResize()); + } + + onResize() { + this.loadActivityCalendar(); } changeProjectsPage(e) { @@ -167,8 +171,6 @@ export default class UserTabs { return; } - this.loadActivityCalendar('activity'); - // eslint-disable-next-line no-new new Activities('#activity'); @@ -180,10 +182,10 @@ export default class UserTabs { return; } - this.loadActivityCalendar('overview'); + this.loadActivityCalendar(); UserTabs.renderMostRecentBlocks('#js-overview .activities-block', { - requestParams: { limit: 5 }, + requestParams: { limit: 10 }, }); UserTabs.renderMostRecentBlocks('#js-overview .projects-block', { requestParams: { limit: 10, skip_pagination: true }, @@ -198,52 +200,39 @@ export default class UserTabs { container, url: $(`${container} .overview-content-list`).data('href'), ...options, + postRenderCallback: () => localTimeAgo($('.js-timeago', container)), }); } - loadActivityCalendar(action) { - const monthsAgo = action === 'overview' ? CALENDAR_PERIOD_6_MONTHS : CALENDAR_PERIOD_12_MONTHS; + loadActivityCalendar() { const $calendarWrap = this.$parentEl.find('.tab-pane.active .user-calendar'); const calendarPath = $calendarWrap.data('calendarPath'); + + AjaxCache.retrieve(calendarPath) + .then(data => UserTabs.renderActivityCalendar(data, $calendarWrap)) + .catch(() => flash(__('There was an error loading users activity calendar.'))); + } + + static renderActivityCalendar(data, $calendarWrap) { + const monthsAgo = UserTabs.getVisibleCalendarPeriod($calendarWrap); const calendarActivitiesPath = $calendarWrap.data('calendarActivitiesPath'); const utcOffset = $calendarWrap.data('utcOffset'); - let utcFormatted = 'UTC'; - if (utcOffset !== 0) { - utcFormatted = `UTC${utcOffset > 0 ? '+' : ''}${utcOffset / 3600}`; - } + const calendarHint = __('Issues, merge requests, pushes and comments.'); - axios - .get(calendarPath) - .then(({ data }) => { - $calendarWrap.html(CALENDAR_TEMPLATES[action]); - - let calendarHint = ''; - - if (action === 'activity') { - calendarHint = sprintf( - __( - 'Summary of issues, merge requests, push events, and comments (Timezone: %{utcFormatted})', - ), - { utcFormatted }, - ); - } else if (action === 'overview') { - calendarHint = __('Issues, merge requests, pushes and comments.'); - } - - $calendarWrap.find('.calendar-hint').text(calendarHint); - - // eslint-disable-next-line no-new - new ActivityCalendar( - '.tab-pane.active .js-contrib-calendar', - '.tab-pane.active .user-calendar-activities', - data, - calendarActivitiesPath, - utcOffset, - 0, - monthsAgo, - ); - }) - .catch(() => flash(__('There was an error loading users activity calendar.'))); + $calendarWrap.html(CALENDAR_TEMPLATE); + + $calendarWrap.find('.calendar-hint').text(calendarHint); + + // eslint-disable-next-line no-new + new ActivityCalendar( + '.tab-pane.active .js-contrib-calendar', + '.tab-pane.active .user-calendar-activities', + data, + calendarActivitiesPath, + utcOffset, + 0, + monthsAgo, + ); } toggleLoading(status) { @@ -267,4 +256,11 @@ export default class UserTabs { getCurrentAction() { return this.$parentEl.find('.nav-links a.active').data('action'); } + + static getVisibleCalendarPeriod($calendarWrap) { + const width = $calendarWrap.width(); + return width < OVERVIEW_CALENDAR_BREAKPOINT + ? CALENDAR_PERIOD_6_MONTHS + : CALENDAR_PERIOD_12_MONTHS; + } } diff --git a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue index 6f2f0f98690..05f9f960934 100644 --- a/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/content_viewer/viewers/image_viewer.vue @@ -34,14 +34,7 @@ export default { fileSizeReadable() { return numberToHumanSize(this.fileSize); }, - dimensionStyles() { - if (!this.isLoaded) return {}; - return { - width: `${this.width}px`, - height: `${this.height}px`, - }; - }, hasFileSize() { return this.fileSize > 0; }, @@ -89,7 +82,6 @@ export default { <div> <div :class="innerCssClasses" - :style="dimensionStyles" class="position-relative" > <img diff --git a/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue b/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue index c3cfe54eb4d..57f373fca21 100644 --- a/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/swipe_viewer.vue @@ -25,7 +25,7 @@ export default { swipeMaxWidth: undefined, swipeMaxHeight: undefined, swipeBarPos: 1, - swipeWrapWidth: undefined, + swipeWrapWidth: 0, }; }, computed: { @@ -63,7 +63,7 @@ export default { leftValue = clientWidth - spaceLeft; } - this.swipeWrapWidth = this.swipeMaxWidth - leftValue; + this.swipeWrapWidth = (leftValue / clientWidth) * 100; this.swipeBarPos = leftValue; }, startDrag() { @@ -81,7 +81,6 @@ export default { // Add 2 for border width this.swipeMaxWidth = Math.max(this.swipeOldImgInfo.renderedWidth, this.swipeNewImgInfo.renderedWidth) + 2; - this.swipeWrapWidth = this.swipeMaxWidth; this.swipeMaxHeight = Math.max(this.swipeOldImgInfo.renderedHeight, this.swipeNewImgInfo.renderedHeight) + 2; @@ -107,10 +106,6 @@ export default { <div class="swipe view"> <div ref="swipeFrame" - :style="{ - 'width': swipeMaxPixelWidth, - 'height': swipeMaxPixelHeight, - }" class="swipe-frame"> <image-viewer key="swipeOldImg" @@ -123,14 +118,17 @@ export default { <div ref="swipeWrap" :style="{ - 'width': swipeWrapPixelWidth, - 'height': swipeMaxPixelHeight, + width: `${swipeWrapWidth}%` }" - class="swipe-wrap"> + class="swipe-wrap" + > <image-viewer key="swipeNewImg" :render-info="false" :path="newPath" + :style="{ + width: swipeMaxPixelWidth + }" class="frame added" @imgLoaded="swipeNewImgLoaded" > diff --git a/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue b/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue index 9806d65e940..aafa88f4ff1 100644 --- a/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/diff_viewer/viewers/image_diff/two_up_viewer.vue @@ -19,18 +19,18 @@ export default { </script> <template> - <div class="two-up view"> + <div class="two-up view d-flex"> <image-viewer :path="oldPath" :render-info="true" inner-css-classes="frame deleted" - class="wrap" + class="wrap w-50" /> <image-viewer :path="newPath" :render-info="true" :inner-css-classes="['frame', 'added']" - class="wrap" + class="wrap w-50" > <slot slot="image-overlay" diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 3c7bf0b0e46..0163c795074 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -253,19 +253,6 @@ right: 7px; } - .frame { - top: 0; - right: 0; - position: absolute; - - &.deleted { - margin: 0; - display: block; - top: 13px; - right: 7px; - } - } - .swipe-bar { display: block; height: 100%; @@ -435,7 +422,7 @@ .onion-skin.view { .swipe-wrap { top: 0; - right: 0; + left: 0; } .frame.deleted { diff --git a/app/finders/events_finder.rb b/app/finders/events_finder.rb index 2e82bda8730..8df01f1dad9 100644 --- a/app/finders/events_finder.rb +++ b/app/finders/events_finder.rb @@ -58,7 +58,7 @@ class EventsFinder def by_target_type(events) return events unless Event::TARGET_TYPES[params[:target_type]] - events.where(target_type: Event::TARGET_TYPES[params[:target_type]]) + events.where(target_type: Event::TARGET_TYPES[params[:target_type]].name) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb index c96979619fd..a9ce5be13f3 100644 --- a/app/finders/group_descendants_finder.rb +++ b/app/finders/group_descendants_finder.rb @@ -178,7 +178,7 @@ class GroupDescendantsFinder end def sort - params.fetch(:sort, 'id_asc') + params.fetch(:sort, 'created_desc') end # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 9a28e245ebd..d60861dc95f 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -98,7 +98,7 @@ module Ci scope :matches_tag_ids, -> (tag_ids) do matcher = ::ActsAsTaggableOn::Tagging - .where(taggable_type: CommitStatus) + .where(taggable_type: CommitStatus.name) .where(context: 'tags') .where('taggable_id = ci_builds.id') .where.not(tag_id: tag_ids).select('1') @@ -108,7 +108,7 @@ module Ci scope :with_any_tags, -> do matcher = ::ActsAsTaggableOn::Tagging - .where(taggable_type: CommitStatus) + .where(taggable_type: CommitStatus.name) .where(context: 'tags') .where('taggable_id = ci_builds.id').select('1') diff --git a/app/models/concerns/avatarable.rb b/app/models/concerns/avatarable.rb index 0d5311a9985..b42236c1fa2 100644 --- a/app/models/concerns/avatarable.rb +++ b/app/models/concerns/avatarable.rb @@ -86,7 +86,7 @@ module Avatarable params[:model].upload_paths(params[:identifier]) end - Upload.where(uploader: AvatarUploader, path: paths).find_each do |upload| + Upload.where(uploader: AvatarUploader.name, path: paths).find_each do |upload| model = model_class.instantiate('id' => upload.model_id) loader.call({ model: model, identifier: File.basename(upload.path) }, upload) diff --git a/app/models/repository.rb b/app/models/repository.rb index 6e179f61a7b..fff6d4be275 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1049,11 +1049,19 @@ class Repository end def cache - @cache ||= Gitlab::RepositoryCache.new(self) + @cache ||= if is_wiki + Gitlab::RepositoryCache.new(self, extra_namespace: 'wiki') + else + Gitlab::RepositoryCache.new(self) + end end def request_store_cache - @request_store_cache ||= Gitlab::RepositoryCache.new(self, backend: Gitlab::SafeRequestStore) + @request_store_cache ||= if is_wiki + Gitlab::RepositoryCache.new(self, extra_namespace: 'wiki', backend: Gitlab::SafeRequestStore) + else + Gitlab::RepositoryCache.new(self, backend: Gitlab::SafeRequestStore) + end end def tags_sorted_by_committed_date diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb index fba252b0bae..a1d0cc0e568 100644 --- a/app/services/issues/update_service.rb +++ b/app/services/issues/update_service.rb @@ -11,6 +11,12 @@ module Issues move_issue_to_new_project(issue) || update(issue) end + def update(issue) + create_merge_request_from_quick_action + + super + end + def before_update(issue) spam_check(issue, current_user) end @@ -93,6 +99,13 @@ module Issues private + def create_merge_request_from_quick_action + create_merge_request_params = params.delete(:create_merge_request) + return unless create_merge_request_params + + MergeRequests::CreateFromIssueService.new(project, current_user, create_merge_request_params).execute + end + def handle_milestone_change(issue) return if skip_milestone_email diff --git a/app/services/merge_requests/create_from_issue_service.rb b/app/services/merge_requests/create_from_issue_service.rb index 020af0bb950..e69791872cc 100644 --- a/app/services/merge_requests/create_from_issue_service.rb +++ b/app/services/merge_requests/create_from_issue_service.rb @@ -19,13 +19,15 @@ module MergeRequests result = CreateBranchService.new(project, current_user).execute(branch_name, ref) return result if result[:status] == :error - SystemNoteService.new_issue_branch(issue, project, current_user, branch_name) - new_merge_request = create(merge_request) if new_merge_request.valid? + SystemNoteService.new_merge_request(issue, project, current_user, new_merge_request) + success(new_merge_request) else + SystemNoteService.new_issue_branch(issue, project, current_user, branch_name) + error(new_merge_request.errors) end end diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index 9c81de7e90e..d248b10f41e 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -635,6 +635,22 @@ module QuickActions @updates[:tag_message] = message end + desc 'Create a merge request.' + explanation do |branch_name = nil| + branch_text = branch_name ? "branch '#{branch_name}'" : 'a branch' + "Creates #{branch_text} and a merge request to resolve this issue" + end + params "<branch name>" + condition do + issuable.is_a?(Issue) && current_user.can?(:create_merge_request_in, project) && current_user.can?(:push_code, project) + end + command :create_merge_request do |branch_name = nil| + @updates[:create_merge_request] = { + branch_name: branch_name, + issue_iid: issuable.iid + } + end + # rubocop: disable CodeReuse/ActiveRecord def extract_users(params) return [] if params.nil? diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 729bc991294..ec6c306227b 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -407,11 +407,17 @@ module SystemNoteService def new_issue_branch(issue, project, author, branch) link = url_helpers.project_compare_url(project, from: project.default_branch, to: branch) - body = "created branch [`#{branch}`](#{link})" + body = "created branch [`#{branch}`](#{link}) to address this issue" create_note(NoteSummary.new(issue, project, author, body, action: 'branch')) end + def new_merge_request(issue, project, author, merge_request) + body = "created merge request #{merge_request.to_reference} to address this issue" + + create_note(NoteSummary.new(issue, project, author, body, action: 'merge')) + end + # Called when a Mentionable references a Noteable # # noteable - Noteable object being referenced diff --git a/app/services/todos/destroy/entity_leave_service.rb b/app/services/todos/destroy/entity_leave_service.rb index e8d1bcdd142..ebfb20132d0 100644 --- a/app/services/todos/destroy/entity_leave_service.rb +++ b/app/services/todos/destroy/entity_leave_service.rb @@ -45,7 +45,7 @@ module Todos # rubocop: disable CodeReuse/ActiveRecord def remove_confidential_issue_todos Todo.where( - target_id: confidential_issues.select(:id), target_type: Issue, user_id: user.id + target_id: confidential_issues.select(:id), target_type: Issue.name, user_id: user.id ).delete_all end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/services/todos/destroy/private_features_service.rb b/app/services/todos/destroy/private_features_service.rb index a8c3fe0ef5a..bd49519d694 100644 --- a/app/services/todos/destroy/private_features_service.rb +++ b/app/services/todos/destroy/private_features_service.rb @@ -14,9 +14,9 @@ module Todos def execute ProjectFeature.where(project_id: project_ids).each do |project_features| target_types = [] - target_types << Issue if private?(project_features.issues_access_level) - target_types << MergeRequest if private?(project_features.merge_requests_access_level) - target_types << Commit if private?(project_features.repository_access_level) + target_types << Issue.name if private?(project_features.issues_access_level) + target_types << MergeRequest.name if private?(project_features.merge_requests_access_level) + target_types << Commit.name if private?(project_features.repository_access_level) next if target_types.empty? diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 61ed951dea9..dcef4dd5b69 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -5,7 +5,7 @@ .project-header.d-flex.flex-row.flex-wrap.align-items-center.append-bottom-8 .project-title-row.d-flex.align-items-center .avatar-container.project-avatar.float-none - = project_icon(@project, alt: @project.name, class: 'avatar avatar-tile') + = project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s24', width: 24, height: 24) %h1.project-title.d-flex.align-items-baseline.qa-project-name = @project.name .project-metadata.d-flex.flex-row.flex-wrap.align-items-baseline diff --git a/app/views/projects/diffs/_collapsed.html.haml b/app/views/projects/diffs/_collapsed.html.haml index 9bd1255fe00..94dcda38bd6 100644 --- a/app/views/projects/diffs/_collapsed.html.haml +++ b/app/views/projects/diffs/_collapsed.html.haml @@ -1,5 +1,5 @@ - diff_file = viewer.diff_file - url = url_for(safe_params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier)) .nothing-here-block.diff-collapsed{ data: { diff_for_path: url } } - This diff is collapsed. - %button.click-to-expand.btn.btn-link Click to expand it. + = _("This diff is collapsed.") + %button.click-to-expand.btn.btn-link= _("Click to expand it.") diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 077c6c68f7e..9de3c2db6e7 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -8,7 +8,7 @@ .files-changed-inner .inline-parallel-buttons.d-none.d-sm-none.d-md-block - if !diffs_expanded? && diff_files.any? { |diff_file| diff_file.collapsed? } - = link_to 'Expand all', url_for(safe_params.merge(expanded: 1, format: nil)), class: 'btn btn-default' + = link_to _('Expand all'), url_for(safe_params.merge(expanded: 1, format: nil)), class: 'btn btn-default' - if show_whitespace_toggle - if current_controller?(:commit) = commit_diff_whitespace_link(diffs.project, @commit, class: 'd-none d-sm-inline-block') diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index b4df654c839..1f90acaabcc 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -12,7 +12,7 @@ - blob = diff_file.blob .file-actions.d-none.d-sm-block - if blob&.readable_text? - = link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip', title: "Toggle comments for this file", disabled: @diff_notes_disabled do + = link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip', title: _("Toggle comments for this file"), disabled: @diff_notes_disabled do = icon('comment') \ - if editable_diff?(diff_file) diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml index 4cb04d744dc..6a1bff8640c 100644 --- a/app/views/projects/diffs/_file_header.html.haml +++ b/app/views/projects/diffs/_file_header.html.haml @@ -28,7 +28,7 @@ = diff_file.file_path - if diff_file.deleted_file? - deleted + = _("deleted") = copy_file_path_button(diff_file.file_path) diff --git a/app/views/projects/diffs/_render_error.html.haml b/app/views/projects/diffs/_render_error.html.haml index 47a9ac3ee6b..c3dc47a56a7 100644 --- a/app/views/projects/diffs/_render_error.html.haml +++ b/app/views/projects/diffs/_render_error.html.haml @@ -1,5 +1,5 @@ .nothing-here-block - This #{viewer.switcher_title} could not be displayed because #{diff_render_error_reason(viewer)}. + = _("This %{viewer} could not be displayed because %{reason}.") % { viewer: viewer.switcher_title, reason: diff_render_error_reason(viewer) } You can = diff_render_error_options(viewer).to_sentence(two_words_connector: ' or ', last_word_connector: ', or ').html_safe diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml index 229a4574eeb..c9057f385da 100644 --- a/app/views/projects/diffs/_stats.html.haml +++ b/app/views/projects/diffs/_stats.html.haml @@ -38,4 +38,4 @@ \-#{diff_file.removed_lines} %li.dropdown-menu-empty-item.hidden %a - No files found. + = _("No files found.") diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index bc9f6c71fa8..56427a74d56 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -1,7 +1,7 @@ - too_big = diff_file.diff_lines.count > Commit::DIFF_SAFE_LINES - if too_big .suppressed-container - %a.show-suppressed-diff.js-show-suppressed-diff Changes suppressed. Click to show. + %a.show-suppressed-diff.js-show-suppressed-diff= _("Changes suppressed. Click to show.") %table.text-file.diff-wrap-lines.code.js-syntax-highlight.commit-diff{ data: diff_view_data, class: too_big ? 'hide' : '' } = render partial: "projects/diffs/line", diff --git a/app/views/projects/diffs/_warning.html.haml b/app/views/projects/diffs/_warning.html.haml index abe494f2974..2eef599cf84 100644 --- a/app/views/projects/diffs/_warning.html.haml +++ b/app/views/projects/diffs/_warning.html.haml @@ -1,14 +1,12 @@ .alert.alert-warning %h4 - Too many changes to show. + = _("Too many changes to show.") .float-right - if current_controller?(:commit) - = link_to "Plain diff", project_commit_path(@project, @commit, format: :diff), class: "btn btn-sm" - = link_to "Email patch", project_commit_path(@project, @commit, format: :patch), class: "btn btn-sm" + = link_to _("Plain diff"), project_commit_path(@project, @commit, format: :diff), class: "btn btn-sm" + = link_to _("Email patch"), project_commit_path(@project, @commit, format: :patch), class: "btn btn-sm" - elsif current_controller?('projects/merge_requests/diffs') && @merge_request&.persisted? - = link_to "Plain diff", merge_request_path(@merge_request, format: :diff), class: "btn btn-sm" - = link_to "Email patch", merge_request_path(@merge_request, format: :patch), class: "btn btn-sm" + = link_to _("Plain diff"), merge_request_path(@merge_request, format: :diff), class: "btn btn-sm" + = link_to _("Email patch"), merge_request_path(@merge_request, format: :patch), class: "btn btn-sm" %p - To preserve performance only - %strong #{diff_files.size} of #{diff_files.real_size} - files are displayed. + = _("To preserve performance only <strong>%{display_size} of ${real_size}</strong> files are displayed.").html_safe % { display_size: diff_files.size, real_size: diff_files.real_size } diff --git a/app/views/projects/diffs/viewers/_added.html.haml b/app/views/projects/diffs/viewers/_added.html.haml index 8004fe16688..f4c574a018f 100644 --- a/app/views/projects/diffs/viewers/_added.html.haml +++ b/app/views/projects/diffs/viewers/_added.html.haml @@ -1,2 +1,2 @@ .nothing-here-block - File added + = _("File added") diff --git a/app/views/projects/diffs/viewers/_deleted.html.haml b/app/views/projects/diffs/viewers/_deleted.html.haml index 0ac7b4ca8f6..b82ca4d0787 100644 --- a/app/views/projects/diffs/viewers/_deleted.html.haml +++ b/app/views/projects/diffs/viewers/_deleted.html.haml @@ -1,2 +1,2 @@ .nothing-here-block - File deleted + = _("File deleted") diff --git a/app/views/projects/diffs/viewers/_mode_changed.html.haml b/app/views/projects/diffs/viewers/_mode_changed.html.haml index 69bc96bbdad..a8d6f5fe400 100644 --- a/app/views/projects/diffs/viewers/_mode_changed.html.haml +++ b/app/views/projects/diffs/viewers/_mode_changed.html.haml @@ -1,3 +1,3 @@ - diff_file = viewer.diff_file .nothing-here-block - File mode changed from #{diff_file.a_mode} to #{diff_file.b_mode} + = _("File mode changed from %{a_mode} to %{b_mode}") % { a_mode: diff_file.a_mode, b_mode: diff_file.b_mode } diff --git a/app/views/projects/diffs/viewers/_no_preview.html.haml b/app/views/projects/diffs/viewers/_no_preview.html.haml index befe070af2b..b763ac34bf8 100644 --- a/app/views/projects/diffs/viewers/_no_preview.html.haml +++ b/app/views/projects/diffs/viewers/_no_preview.html.haml @@ -1,2 +1,2 @@ .nothing-here-block - No preview for this file type + = _("No preview for this file type") diff --git a/app/views/projects/diffs/viewers/_not_diffable.html.haml b/app/views/projects/diffs/viewers/_not_diffable.html.haml index b2c677ec59c..7c55e272f56 100644 --- a/app/views/projects/diffs/viewers/_not_diffable.html.haml +++ b/app/views/projects/diffs/viewers/_not_diffable.html.haml @@ -1,2 +1,2 @@ .nothing-here-block - This diff was suppressed by a .gitattributes entry. + = _("This diff was suppressed by a .gitattributes entry.") diff --git a/app/views/projects/diffs/viewers/_renamed.html.haml b/app/views/projects/diffs/viewers/_renamed.html.haml index ef05ee38d8d..b7336c356fe 100644 --- a/app/views/projects/diffs/viewers/_renamed.html.haml +++ b/app/views/projects/diffs/viewers/_renamed.html.haml @@ -1,2 +1,2 @@ .nothing-here-block - File moved + = _("File moved") diff --git a/app/views/projects/environments/_external_url.html.haml b/app/views/projects/environments/_external_url.html.haml index b3a82d1ef41..82567f88ccc 100644 --- a/app/views/projects/environments/_external_url.html.haml +++ b/app/views/projects/environments/_external_url.html.haml @@ -1,4 +1,4 @@ - if environment.external_url && can?(current_user, :read_environment, environment) = link_to environment.external_url, target: '_blank', rel: 'noopener noreferrer', class: 'btn external-url has-tooltip qa-view-deployment', title: s_('Environments|Open live environment') do = sprite_icon('external-link') - View deployment + = _("View deployment") diff --git a/app/views/projects/environments/_form.html.haml b/app/views/projects/environments/_form.html.haml index f942b936037..cbd5c54cecc 100644 --- a/app/views/projects/environments/_form.html.haml +++ b/app/views/projects/environments/_form.html.haml @@ -1,22 +1,21 @@ .row.prepend-top-default.append-bottom-default .col-lg-3 %h4.prepend-top-0 - Environments + = _("Environments") %p - Environments allow you to track deployments of your application - = succeed "." do - = link_to "Read more about environments", help_page_path("ci/environments") + - link_to_read_more = link_to(_("Read more about environments"), help_page_path("ci/environments")) + = _("Environments allow you to track deployments of your application %{link_to_read_more}.").html_safe % { link_to_read_more: link_to_read_more } = form_for [@project.namespace.becomes(Namespace), @project, @environment], html: { class: 'col-lg-9' } do |f| = form_errors(@environment) .form-group - = f.label :name, 'Name', class: 'label-bold' + = f.label :name, _('Name'), class: 'label-bold' = f.text_field :name, required: true, class: 'form-control' .form-group - = f.label :external_url, 'External URL', class: 'label-bold' + = f.label :external_url, _('External URL'), class: 'label-bold' = f.url_field :external_url, class: 'form-control' .form-actions - = f.submit 'Save', class: 'btn btn-success' - = link_to 'Cancel', project_environments_path(@project), class: 'btn btn-cancel' + = f.submit _('Save'), class: 'btn btn-save' + = link_to _('Cancel'), project_environments_path(@project), class: 'btn btn-cancel' diff --git a/app/views/projects/environments/_metrics_button.html.haml b/app/views/projects/environments/_metrics_button.html.haml index a4b27575095..c4f19ea79e7 100644 --- a/app/views/projects/environments/_metrics_button.html.haml +++ b/app/views/projects/environments/_metrics_button.html.haml @@ -2,6 +2,6 @@ - return unless can?(current_user, :read_environment, environment) -= link_to environment_metrics_path(environment), title: 'See metrics', class: 'btn metrics-button' do += link_to environment_metrics_path(environment), title: _('See metrics'), class: 'btn metrics-button' do = sprite_icon('chart') - Monitoring + = _("Monitoring") diff --git a/app/views/projects/environments/edit.html.haml b/app/views/projects/environments/edit.html.haml index d6ff3f729b4..d581bd3aeab 100644 --- a/app/views/projects/environments/edit.html.haml +++ b/app/views/projects/environments/edit.html.haml @@ -1,8 +1,8 @@ - @no_container = true -- page_title "Edit", @environment.name, "Environments" +- page_title _("Edit"), @environment.name, _("Environments") %div{ class: container_class } %h3.page-title - Edit environment + = _('Edit environment') %hr = render 'form' diff --git a/app/views/projects/environments/folder.html.haml b/app/views/projects/environments/folder.html.haml index 1ac7dab6775..b7e1cf85cb7 100644 --- a/app/views/projects/environments/folder.html.haml +++ b/app/views/projects/environments/folder.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Environments" +- page_title _("Environments") #environments-folder-list-view{ data: { endpoint: folder_project_environments_path(@project, @folder, format: :json), "folder-name" => @folder, diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 7ebe617766f..6c0ad34c486 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -1,6 +1,6 @@ - @no_container = true -- page_title "Environments" -- add_to_breadcrumbs("Pipelines", project_pipelines_path(@project)) +- page_title _("Environments") +- add_to_breadcrumbs(_("Pipelines"), project_pipelines_path(@project)) #environments-list-view{ data: { environments_data: environments_list_data, "can-create-deployment" => can?(current_user, :create_deployment, @project).to_s, diff --git a/app/views/projects/environments/metrics.html.haml b/app/views/projects/environments/metrics.html.haml index 4222963a754..7b847a85686 100644 --- a/app/views/projects/environments/metrics.html.haml +++ b/app/views/projects/environments/metrics.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Metrics for environment", @environment.name +- page_title _("Metrics for environment"), @environment.name .prometheus-container{ class: container_class } #prometheus-graphs{ data: metrics_data(@project, @environment) } diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index 62b08e85e22..c1067fdff78 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -1,9 +1,9 @@ - @no_container = true -- breadcrumb_title "Environments" -- page_title 'New Environment' +- breadcrumb_title _("Environments") +- page_title _("New Environment") %div{ class: container_class } %h3.page-title - New environment + = _("New environment") %hr = render 'form' diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 8c5b6e089ea..d59b2d4fb01 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -1,7 +1,7 @@ - @no_container = true -- add_to_breadcrumbs "Environments", project_environments_path(@project) +- add_to_breadcrumbs _("Environments"), project_environments_path(@project) - breadcrumb_title @environment.name -- page_title "Environments" +- page_title _("Environments") %div{ class: container_class } - if can?(current_user, :stop_environment, @environment) @@ -10,7 +10,7 @@ .modal-content .modal-header %h4.modal-title.d-flex.mw-100 - Stopping + = s_("Environments|Stopping") %span.has-tooltip.text-truncate.ml-1.mr-1.flex-fill{ title: @environment.name, data: { container: '#stop-environment-modal' } } = @environment.name ? @@ -40,7 +40,7 @@ = render 'projects/environments/external_url', environment: @environment = render 'projects/environments/metrics_button', environment: @environment - if can?(current_user, :update_environment, @environment) - = link_to 'Edit', edit_project_environment_path(@project, @environment), class: 'btn' + = link_to _('Edit'), edit_project_environment_path(@project, @environment), class: 'btn' - if can?(current_user, :stop_environment, @environment) = button_tag class: 'btn btn-danger', type: 'button', data: { toggle: 'modal', target: '#stop-environment-modal' } do @@ -52,21 +52,19 @@ .empty-state .text-content %h4.state-title - You don't have any deployments right now. + = _("You don't have any deployments right now.") %p.blank-state-text - Define environments in the deploy stage(s) in - %code .gitlab-ci.yml - to track deployments here. + = _("Define environments in the deploy stage(s) in <code>.gitlab-ci.yml</code> to track deployments here.").html_safe .text-center = link_to _("Read more"), help_page_path("ci/environments"), class: "btn btn-success" - else .table-holder .ci-table.environments{ role: 'grid' } .gl-responsive-table-row.table-row-header{ role: 'row' } - .table-section.section-10{ role: 'columnheader' } ID - .table-section.section-30{ role: 'columnheader' } Commit - .table-section.section-25{ role: 'columnheader' } Job - .table-section.section-15{ role: 'columnheader' } Created + .table-section.section-10{ role: 'columnheader' }= _('ID') + .table-section.section-30{ role: 'columnheader' }= _('Commit') + .table-section.section-25{ role: 'columnheader' }= _('Job') + .table-section.section-15{ role: 'columnheader' }= _('Created') = render @deployments diff --git a/app/views/projects/environments/terminal.html.haml b/app/views/projects/environments/terminal.html.haml index e40d631a1a1..e837d3d56ac 100644 --- a/app/views/projects/environments/terminal.html.haml +++ b/app/views/projects/environments/terminal.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Terminal for environment", @environment.name +- page_title _("Terminal for environment"), @environment.name - content_for :page_specific_javascripts do = stylesheet_link_tag "xterm.css" @@ -9,7 +9,7 @@ .row .col-sm-6 %h3.page-title - Terminal for environment + = _("Terminal for environment") = @environment.name .col-sm-6 diff --git a/app/views/projects/graphs/charts.html.haml b/app/views/projects/graphs/charts.html.haml index 3f1974d05f4..b0e22a35fe1 100644 --- a/app/views/projects/graphs/charts.html.haml +++ b/app/views/projects/graphs/charts.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Charts" +- page_title _("Contribution Charts") .repo-charts{ class: container_class } %h4.sub-header diff --git a/app/views/projects/pipelines/charts.html.haml b/app/views/projects/pipelines/charts.html.haml index a86cb14960a..ec17eddba79 100644 --- a/app/views/projects/pipelines/charts.html.haml +++ b/app/views/projects/pipelines/charts.html.haml @@ -1,6 +1,5 @@ - @no_container = true -- breadcrumb_title "CI / CD Charts" -- page_title _("Charts"), _("Pipelines") +- page_title _("CI / CD Charts") %div{ class: container_class } .sub-header-block diff --git a/app/views/shared/_labels_row.html.haml b/app/views/shared/_labels_row.html.haml deleted file mode 100644 index 21b37a7c9ae..00000000000 --- a/app/views/shared/_labels_row.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -- labels.each do |label| - %span.label-row.btn-group{ role: "group", aria: { label: label.name }, style: "color: #{text_color_for_bg(label.color)}" } - = link_to_label(label, subject: @project, css_class: 'btn btn-transparent') - %button.btn.btn-transparent.label-remove.js-label-filter-remove{ type: "button", style: "background-color: #{label.color};", data: { label: label.title } } - = icon("times") diff --git a/app/views/u2f/_authenticate.html.haml b/app/views/u2f/_authenticate.html.haml index 1c788b9a737..979f6862de3 100644 --- a/app/views/u2f/_authenticate.html.haml +++ b/app/views/u2f/_authenticate.html.haml @@ -1,18 +1,18 @@ #js-authenticate-u2f -%a.btn.btn-block.btn-info#js-login-2fa-device{ href: '#' } Sign in via 2FA code +%a.btn.btn-block.btn-info#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code") -# haml-lint:disable InlineJavaScript %script#js-authenticate-u2f-in-progress{ type: "text/template" } - %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now. + %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") %script#js-authenticate-u2f-error{ type: "text/template" } %div - %p <%= error_message %> (error code: <%= error_code %>) - %a.btn.btn-block.btn-warning#js-u2f-try-again Try again? + %p <%= error_message %> (#{_("error code:")} <%= error_code %>) + %a.btn.btn-block.btn-warning#js-u2f-try-again= _("Try again?") %script#js-authenticate-u2f-authenticated{ type: "text/template" } %div - %p We heard back from your U2F device. You have been authenticated. + %p= _("We heard back from your U2F device. You have been authenticated.") = form_tag(new_user_session_path, method: :post, id: 'js-login-u2f-form') do |f| - resource_params = params[resource_name].presence || params = hidden_field_tag 'user[remember_me]', resource_params.fetch(:remember_me, 0) diff --git a/app/views/u2f/_register.html.haml b/app/views/u2f/_register.html.haml index 39d4d82a77d..f6724f72307 100644 --- a/app/views/u2f/_register.html.haml +++ b/app/views/u2f/_register.html.haml @@ -2,39 +2,39 @@ -# haml-lint:disable InlineJavaScript %script#js-register-u2f-not-supported{ type: "text/template" } - %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer). + %p= _("Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).") %script#js-register-u2f-setup{ type: "text/template" } - if current_user.two_factor_otp_enabled? .row.append-bottom-10 .col-md-4 - %button#js-setup-u2f-device.btn.btn-info.btn-block Set up new U2F device + %button#js-setup-u2f-device.btn.btn-info.btn-block= _("Set up new U2F device") .col-md-8 - %p Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left. + %p= _("Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left.") - else .row.append-bottom-10 .col-md-4 - %button#js-setup-u2f-device.btn.btn-info.btn-block{ disabled: true } Set up new U2F device + %button#js-setup-u2f-device.btn.btn-info.btn-block{ disabled: true }= _("Set up new U2F device") .col-md-8 - %p.text-warning You need to register a two-factor authentication app before you can set up a U2F device. + %p.text-warning= _("You need to register a two-factor authentication app before you can set up a U2F device.") %script#js-register-u2f-in-progress{ type: "text/template" } - %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now. + %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") %script#js-register-u2f-error{ type: "text/template" } %div %p - %span <%= error_message %> (error code: <%= error_code %>) - %a.btn.btn-warning#js-u2f-try-again Try again? + %span <%= error_message %> (#{_("error code:")} <%= error_code %>) + %a.btn.btn-warning#js-u2f-try-again= _("Try again?") %script#js-register-u2f-registered{ type: "text/template" } .row.append-bottom-10 .col-md-12 - %p Your device was successfully set up! Give it a name and register it with the GitLab server. + %p= _("Your device was successfully set up! Give it a name and register it with the GitLab server.") = form_tag(create_u2f_profile_two_factor_auth_path, method: :post) do .row.append-bottom-10 .col-md-3 - = text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: "Pick a name" + = text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: _("Pick a name") .col-md-3 = hidden_field_tag 'u2f_registration[device_response]', nil, class: 'form-control', required: true, id: "js-device-response" - = submit_tag "Register U2F device", class: "btn btn-success" + = submit_tag _("Register U2F device"), class: "btn btn-success" diff --git a/app/views/users/_overview.html.haml b/app/views/users/_overview.html.haml index cf525f2bb2d..b5bc1180290 100644 --- a/app/views/users/_overview.html.haml +++ b/app/views/users/_overview.html.haml @@ -1,32 +1,30 @@ .row + .col-12 + .calendar-block.prepend-top-default.append-bottom-default + .user-calendar.d-none.d-sm-block{ data: { calendar_path: user_calendar_path(@user, :json), calendar_activities_path: user_calendar_activities_path, utc_offset: Time.zone.utc_offset } } + %h4.center.light + = spinner nil, true + .user-calendar-activities.d-none.d-sm-block +.row .col-md-12.col-lg-6 - .calendar-block - .content-block.hide-bottom-border - %h4 - = s_('UserProfile|Activity') - .user-calendar.d-none.d-sm-block.text-left{ data: { calendar_path: user_calendar_path(@user, :json), calendar_activities_path: user_calendar_activities_path, utc_offset: Time.zone.utc_offset } } - %h4.center.light - %i.fa.fa-spinner.fa-spin - .user-calendar-activities.d-none.d-sm-block - - if can?(current_user, :read_cross_project) .activities-block - .border-bottom.prepend-top-16 - %h5 - = s_('UserProfile|Recent contributions') + .prepend-top-16 + .d-flex.align-items-center.border-bottom + %h4.flex-grow + = s_('UserProfile|Activity') + = link_to s_('UserProfile|View all'), user_activity_path, class: "hide js-view-all" .overview-content-list{ data: { href: user_path } } .center.light.loading - %i.fa.fa-spinner.fa-spin - .prepend-top-10 - = link_to s_('UserProfile|View all'), user_activity_path, class: "hide js-view-all" + = spinner nil, true .col-md-12.col-lg-6 .projects-block - .border-bottom.prepend-top-16 - %h4 - = s_('UserProfile|Personal projects') + .prepend-top-16 + .d-flex.align-items-center.border-bottom + %h4.flex-grow + = s_('UserProfile|Personal projects') + = link_to s_('UserProfile|View all'), user_projects_path, class: "hide js-view-all" .overview-content-list{ data: { href: user_projects_path } } .center.light.loading - %i.fa.fa-spinner.fa-spin - .prepend-top-10 - = link_to s_('UserProfile|View all'), user_projects_path, class: "hide js-view-all" + = spinner nil, true diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index d6c8420b744..d11476738e4 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -124,12 +124,6 @@ - if profile_tab?(:activity) #activity.tab-pane - .row-content-block.calendar-block.white.second-block.d-none.d-sm-block - .user-calendar{ data: { calendar_path: user_calendar_path(@user, :json), calendar_activities_path: user_calendar_activities_path, utc_offset: Time.zone.utc_offset } } - %h4.center.light - %i.fa.fa-spinner.fa-spin - .user-calendar-activities - - if can?(current_user, :read_cross_project) %h4.prepend-top-20 = s_('UserProfile|Most Recent Activity') |