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

Commit

Permalink
Merge branch 'hotfix-0.36.1'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FinnWoelm committed Feb 18, 2019
2 parents 870ca0d + 14ba809 commit a7b0fe2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v0.36.1 (Feb 18, 2019)

**Fixes:**
- Add page layout for contribution discussion page to have the project
and contribution navigation rendered

## v0.36 (Feb 18, 2019)

**Features:**
Expand Down
61 changes: 30 additions & 31 deletions app/views/contributions/_head.slim
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
.page-subheading.gray.lighten-3.no-padding-bottom.no-margin-bottom
.container
.row.no-margin-bottom
.col.s12
p.flow-text.no-margin
b = contribution.title
p.no-margin
' proposed by
=> link_to profile_path(contribution.creator)
= contribution.creator.name
| ·
=<> time_ago_in_words(contribution.created_at)
| ago
- if contribution.accepted?
= ' '
| &middot; accepted
.container
.row.no-margin-bottom
.col.s12
p.flow-text.no-margin
b = contribution.title
p.no-margin
' proposed by
=> link_to profile_path(contribution.creator)
= contribution.creator.name
| &middot;
=<> time_ago_in_words(contribution.created_at)
| ago
- if contribution.accepted?
= ' '
| &middot; accepted

div.tabs.static.no-margin-top
div.tab
= link_to 'Discussion', profile_project_contribution_path(project.owner, project, contribution),
class: ('active' if active_tab == :discussion)
div.tab
= link_to 'Files', profile_project_contribution_root_folder_path(project.owner, project, contribution),
class: ('active' if active_tab == :files)
div.tab
= link_to 'Review', profile_project_contribution_review_path(project.owner, project, contribution),
class: ('active' if active_tab == :review)
- if contribution.files.root&.link_to_remote.present?
div.tabs.static.no-margin-top
div.tab
= link_to contribution.files.root.link_to_remote, target: '_blank' do
svg style="width:24px;height:24px" viewBox="0 0 24 24" class="left"
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"
| Open in Drive
end
= link_to 'Discussion', profile_project_contribution_path(project.owner, project, contribution),
class: ('active' if active_tab == :discussion)
div.tab
= link_to 'Files', profile_project_contribution_root_folder_path(project.owner, project, contribution),
class: ('active' if active_tab == :files)
div.tab
= link_to 'Review', profile_project_contribution_review_path(project.owner, project, contribution),
class: ('active' if active_tab == :review)
- if contribution.files.root&.link_to_remote.present?
div.tab
= link_to contribution.files.root.link_to_remote, target: '_blank' do
svg style="width:24px;height:24px" viewBox="0 0 24 24" class="left"
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"
| Open in Drive
3 changes: 0 additions & 3 deletions app/views/contributions/replies/index.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
= render partial: '/contributions/head', object: @contribution, as: :contribution,
locals: { project: @project, active_tab: :discussion }

.spacing.v32px

.container
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/contributions/replies.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
= render partial: 'contributions/head', object: @contribution, as: :contribution,
locals: { project: @project, active_tab: :discussion }

= yield

= parent_layout 'contribution'
4 changes: 4 additions & 0 deletions spec/controllers/contributions/replies_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
RSpec.describe Contributions::RepliesController, type: :controller do
let!(:contribution) { create :contribution }
let(:project) { contribution.project }
let(:master) { project.master_branch }
# TODO: Needed for successfully rendering view spec. Otherwise will fail
# because calling #link_to_remote on root (which is nil).
let!(:root) { create :vcs_file_in_branch, :root, branch: master }
let(:default_params) do
{
profile_handle: project.owner.to_param,
Expand Down

0 comments on commit a7b0fe2

Please sign in to comment.