Commit a2dd511b authored by Bob Van Landuyt's avatar Bob Van Landuyt

Show fork information on the project panel

parent 2a5ce8d4
- empty_repo = @project.empty_repo? - empty_repo = @project.empty_repo?
- fork_network = @project.fork_network
- forked_from_project = @project.forked_from_project || fork_network&.root_project
.project-home-panel.text-center{ class: ("empty-project" if empty_repo) } .project-home-panel.text-center{ class: ("empty-project" if empty_repo) }
.limit-container-width{ class: container_class } .limit-container-width{ class: container_class }
.avatar-container.s70.project-avatar .avatar-container.s70.project-avatar
...@@ -12,11 +14,16 @@ ...@@ -12,11 +14,16 @@
- if @project.description.present? - if @project.description.present?
= markdown_field(@project, :description) = markdown_field(@project, :description)
- if forked_from_project = @project.forked_from_project - if @project.forked?
%p %p
- if forked_from_project
#{ s_('ForkedFromProjectPath|Forked from') } #{ s_('ForkedFromProjectPath|Forked from') }
= link_to project_path(forked_from_project) do = link_to project_path(forked_from_project) do
= forked_from_project.namespace.try(:name) = forked_from_project.full_name
- else
- deleted_message = s_('ForkedFromProjectPath|Forked from %{project_name} (deleted)')
= deleted_message % { project_name: fork_network.deleted_root_project_name }
- if @project.mirror? - if @project.mirror?
- import_url = @project.safe_import_url - import_url = @project.safe_import_url
%p %p
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-04 17:48+0100\n" "POT-Creation-Date: 2017-10-06 22:39+0200\n"
"PO-Revision-Date: 2017-10-04 17:48+0100\n" "PO-Revision-Date: 2017-10-06 22:39+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -439,6 +439,9 @@ msgstr "" ...@@ -439,6 +439,9 @@ msgstr ""
msgid "CiStatus|running" msgid "CiStatus|running"
msgstr "" msgstr ""
msgid "Clone repository"
msgstr ""
msgid "Close" msgid "Close"
msgstr "" msgstr ""
...@@ -700,6 +703,9 @@ msgstr[1] "" ...@@ -700,6 +703,9 @@ msgstr[1] ""
msgid "ForkedFromProjectPath|Forked from" msgid "ForkedFromProjectPath|Forked from"
msgstr "" msgstr ""
msgid "ForkedFromProjectPath|Forked from %{project_name} (deleted)"
msgstr ""
msgid "Format" msgid "Format"
msgstr "" msgstr ""
...@@ -796,6 +802,11 @@ msgstr "" ...@@ -796,6 +802,11 @@ msgstr ""
msgid "Install a Runner compatible with GitLab CI" msgid "Install a Runner compatible with GitLab CI"
msgstr "" msgstr ""
msgid "Instance"
msgid_plural "Instances"
msgstr[0] ""
msgstr[1] ""
msgid "Interval Pattern" msgid "Interval Pattern"
msgstr "" msgstr ""
...@@ -878,6 +889,12 @@ msgid_plural "Limited to showing %d events at most" ...@@ -878,6 +889,12 @@ msgid_plural "Limited to showing %d events at most"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Lock"
msgstr ""
msgid "Locked"
msgstr ""
msgid "Locked Files" msgid "Locked Files"
msgstr "" msgstr ""
...@@ -1018,9 +1035,15 @@ msgstr "" ...@@ -1018,9 +1035,15 @@ msgstr ""
msgid "OfSearchInADropdown|Filter" msgid "OfSearchInADropdown|Filter"
msgstr "" msgstr ""
msgid "Only project members can comment."
msgstr ""
msgid "OpenedNDaysAgo|Opened" msgid "OpenedNDaysAgo|Opened"
msgstr "" msgstr ""
msgid "Opens in a new window"
msgstr ""
msgid "Options" msgid "Options"
msgstr "" msgstr ""
...@@ -1045,6 +1068,9 @@ msgstr "" ...@@ -1045,6 +1068,9 @@ msgstr ""
msgid "Password" msgid "Password"
msgstr "" msgstr ""
msgid "People without permission will never get a notification and won\\'t be able to comment."
msgstr ""
msgid "Pipeline" msgid "Pipeline"
msgstr "" msgstr ""
...@@ -1371,6 +1397,9 @@ msgstr[1] "" ...@@ -1371,6 +1397,9 @@ msgstr[1] ""
msgid "Snippets" msgid "Snippets"
msgstr "" msgstr ""
msgid "Something went wrong trying to change the locked state of this ${this.issuableDisplayName(this.issuableType)}"
msgstr ""
msgid "SortOptions|Access level, ascending" msgid "SortOptions|Access level, ascending"
msgstr "" msgstr ""
...@@ -1565,12 +1594,24 @@ msgstr "" ...@@ -1565,12 +1594,24 @@ msgstr ""
msgid "There are problems accessing Git storage: " msgid "There are problems accessing Git storage: "
msgstr "" msgstr ""
msgid "This is a confidential issue."
msgstr ""
msgid "This is the author's first Merge Request to this project." msgid "This is the author's first Merge Request to this project."
msgstr "" msgstr ""
msgid "This issue is confidential and locked."
msgstr ""
msgid "This issue is locked."
msgstr ""
msgid "This means you can not push code until you create an empty repository or import existing one." msgid "This means you can not push code until you create an empty repository or import existing one."
msgstr "" msgstr ""
msgid "This merge request is locked."
msgstr ""
msgid "Time before an issue gets scheduled" msgid "Time before an issue gets scheduled"
msgstr "" msgstr ""
...@@ -1649,9 +1690,6 @@ msgstr "" ...@@ -1649,9 +1690,6 @@ msgstr ""
msgid "Timeago|a week ago" msgid "Timeago|a week ago"
msgstr "" msgstr ""
msgid "Timeago|a while"
msgstr ""
msgid "Timeago|a year ago" msgid "Timeago|a year ago"
msgstr "" msgstr ""
...@@ -1703,6 +1741,9 @@ msgstr "" ...@@ -1703,6 +1741,9 @@ msgstr ""
msgid "Timeago|in 1 year" msgid "Timeago|in 1 year"
msgstr "" msgstr ""
msgid "Timeago|in a while"
msgstr ""
msgid "Timeago|less than a minute ago" msgid "Timeago|less than a minute ago"
msgstr "" msgstr ""
...@@ -1728,6 +1769,12 @@ msgstr "" ...@@ -1728,6 +1769,12 @@ msgstr ""
msgid "Track activity with Contribution Analytics." msgid "Track activity with Contribution Analytics."
msgstr "" msgstr ""
msgid "Unlock"
msgstr ""
msgid "Unlocked"
msgstr ""
msgid "Unstar" msgid "Unstar"
msgstr "" msgstr ""
...@@ -1896,6 +1943,9 @@ msgstr "" ...@@ -1896,6 +1943,9 @@ msgstr ""
msgid "Wiki|Wiki Pages" msgid "Wiki|Wiki Pages"
msgstr "" msgstr ""
msgid "With contribution analytics you can have an overview for the activity of issues, merge requests and push events of your organization and its members."
msgstr ""
msgid "Withdraw Access Request" msgid "Withdraw Access Request"
msgstr "" msgstr ""
...@@ -1944,6 +1994,9 @@ msgstr "" ...@@ -1944,6 +1994,9 @@ msgstr ""
msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile" msgid "You won't be able to pull or push project code via SSH until you %{add_ssh_key_link} to your profile"
msgstr "" msgstr ""
msgid "Your comment will not be visible to the public."
msgstr ""
msgid "Your name" msgid "Your name"
msgstr "" msgstr ""
......
...@@ -77,6 +77,55 @@ feature 'Project' do ...@@ -77,6 +77,55 @@ feature 'Project' do
end end
end end
describe 'showing information about source of a project fork' do
let(:user) { create(:user) }
let(:base_project) { create(:project, :public, :repository) }
let(:forked_project) { fork_project(base_project, user, repository: true) }
before do
sign_in user
end
it 'shows a link to the source project when it is available' do
visit project_path(forked_project)
expect(page).to have_content('Forked from')
expect(page).to have_link(base_project.full_name)
end
it 'does not contain fork network information for the root project' do
forked_project
visit project_path(base_project)
expect(page).not_to have_content('In fork network of')
expect(page).not_to have_content('Forked from')
end
it 'shows the name of the deleted project when the source was deleted' do
forked_project
Projects::DestroyService.new(base_project, base_project.owner).execute
visit project_path(forked_project)
expect(page).to have_content("Forked from #{base_project.full_name} (deleted)")
end
context 'a fork of a fork' do
let(:fork_of_fork) { fork_project(forked_project, user, repository: true) }
it 'links to the base project if the source project is removed' do
fork_of_fork
Projects::DestroyService.new(forked_project, user).execute
visit project_path(fork_of_fork)
expect(page).to have_content("Forked from")
expect(page).to have_link(base_project.full_name)
end
end
end
describe 'removal', js: true do describe 'removal', js: true do
let(:user) { create(:user, username: 'test', name: 'test') } let(:user) { create(:user, username: 'test', name: 'test') }
let(:project) { create(:project, namespace: user.namespace, name: 'project1') } let(:project) { create(:project, namespace: user.namespace, name: 'project1') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment