Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit a7b0fe2

Browse files
committed
Merge branch 'hotfix-0.36.1'
Hotfix v0.36.1: Add layout for contribution discussion page **Fixes:** - Add page layout for contribution discussion page to have the project and contribution navigation rendered
2 parents 870ca0d + 14ba809 commit a7b0fe2

File tree

5 files changed

+46
-34
lines changed

5 files changed

+46
-34
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## v0.36.1 (Feb 18, 2019)
4+
5+
**Fixes:**
6+
- Add page layout for contribution discussion page to have the project
7+
and contribution navigation rendered
8+
39
## v0.36 (Feb 18, 2019)
410

511
**Features:**

app/views/contributions/_head.slim

+30-31
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
.page-subheading.gray.lighten-3.no-padding-bottom.no-margin-bottom
2-
.container
3-
.row.no-margin-bottom
4-
.col.s12
5-
p.flow-text.no-margin
6-
b = contribution.title
7-
p.no-margin
8-
' proposed by
9-
=> link_to profile_path(contribution.creator)
10-
= contribution.creator.name
11-
| ·
12-
=<> time_ago_in_words(contribution.created_at)
13-
| ago
14-
- if contribution.accepted?
15-
= ' '
16-
| &middot; accepted
2+
.container
3+
.row.no-margin-bottom
4+
.col.s12
5+
p.flow-text.no-margin
6+
b = contribution.title
7+
p.no-margin
8+
' proposed by
9+
=> link_to profile_path(contribution.creator)
10+
= contribution.creator.name
11+
| &middot;
12+
=<> time_ago_in_words(contribution.created_at)
13+
| ago
14+
- if contribution.accepted?
15+
= ' '
16+
| &middot; accepted
1717

18-
div.tabs.static.no-margin-top
19-
div.tab
20-
= link_to 'Discussion', profile_project_contribution_path(project.owner, project, contribution),
21-
class: ('active' if active_tab == :discussion)
22-
div.tab
23-
= link_to 'Files', profile_project_contribution_root_folder_path(project.owner, project, contribution),
24-
class: ('active' if active_tab == :files)
25-
div.tab
26-
= link_to 'Review', profile_project_contribution_review_path(project.owner, project, contribution),
27-
class: ('active' if active_tab == :review)
28-
- if contribution.files.root&.link_to_remote.present?
18+
div.tabs.static.no-margin-top
2919
div.tab
30-
= link_to contribution.files.root.link_to_remote, target: '_blank' do
31-
svg style="width:24px;height:24px" viewBox="0 0 24 24" class="left"
32-
path fill="currentColor" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"
33-
| Open in Drive
34-
end
20+
= link_to 'Discussion', profile_project_contribution_path(project.owner, project, contribution),
21+
class: ('active' if active_tab == :discussion)
22+
div.tab
23+
= link_to 'Files', profile_project_contribution_root_folder_path(project.owner, project, contribution),
24+
class: ('active' if active_tab == :files)
25+
div.tab
26+
= link_to 'Review', profile_project_contribution_review_path(project.owner, project, contribution),
27+
class: ('active' if active_tab == :review)
28+
- if contribution.files.root&.link_to_remote.present?
29+
div.tab
30+
= link_to contribution.files.root.link_to_remote, target: '_blank' do
31+
svg style="width:24px;height:24px" viewBox="0 0 24 24" class="left"
32+
path fill="currentColor" d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"
33+
| Open in Drive

app/views/contributions/replies/index.slim

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
= render partial: '/contributions/head', object: @contribution, as: :contribution,
2-
locals: { project: @project, active_tab: :discussion }
3-
41
.spacing.v32px
52

63
.container
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
= render partial: 'contributions/head', object: @contribution, as: :contribution,
2+
locals: { project: @project, active_tab: :discussion }
3+
4+
= yield
5+
6+
= parent_layout 'contribution'

spec/controllers/contributions/replies_controller_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
RSpec.describe Contributions::RepliesController, type: :controller do
1212
let!(:contribution) { create :contribution }
1313
let(:project) { contribution.project }
14+
let(:master) { project.master_branch }
15+
# TODO: Needed for successfully rendering view spec. Otherwise will fail
16+
# because calling #link_to_remote on root (which is nil).
17+
let!(:root) { create :vcs_file_in_branch, :root, branch: master }
1418
let(:default_params) do
1519
{
1620
profile_handle: project.owner.to_param,

0 commit comments

Comments
 (0)