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?
- 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) }
.limit-container-width{ class: container_class }
.avatar-container.s70.project-avatar
......@@ -12,11 +14,16 @@
- if @project.description.present?
= markdown_field(@project, :description)
- if forked_from_project = @project.forked_from_project
- if @project.forked?
%p
#{ s_('ForkedFromProjectPath|Forked from') }
= link_to project_path(forked_from_project) do
= forked_from_project.namespace.try(:name)
- if forked_from_project
#{ s_('ForkedFromProjectPath|Forked from') }
= link_to project_path(forked_from_project) do
= 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?
- import_url = @project.safe_import_url
%p
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-04 17:48+0100\n"
"PO-Revision-Date: 2017-10-04 17:48+0100\n"
"POT-Creation-Date: 2017-10-06 22:39+0200\n"
"PO-Revision-Date: 2017-10-06 22:39+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
......@@ -439,6 +439,9 @@ msgstr ""
msgid "CiStatus|running"
msgstr ""
msgid "Clone repository"
msgstr ""
msgid "Close"
msgstr ""
......@@ -700,6 +703,9 @@ msgstr[1] ""
msgid "ForkedFromProjectPath|Forked from"
msgstr ""
msgid "ForkedFromProjectPath|Forked from %{project_name} (deleted)"
msgstr ""
msgid "Format"
msgstr ""
......@@ -796,6 +802,11 @@ msgstr ""
msgid "Install a Runner compatible with GitLab CI"
msgstr ""
msgid "Instance"
msgid_plural "Instances"
msgstr[0] ""
msgstr[1] ""
msgid "Interval Pattern"
msgstr ""
......@@ -878,6 +889,12 @@ msgid_plural "Limited to showing %d events at most"
msgstr[0] ""
msgstr[1] ""
msgid "Lock"
msgstr ""
msgid "Locked"
msgstr ""
msgid "Locked Files"
msgstr ""
......@@ -1018,9 +1035,15 @@ msgstr ""
msgid "OfSearchInADropdown|Filter"
msgstr ""
msgid "Only project members can comment."
msgstr ""
msgid "OpenedNDaysAgo|Opened"
msgstr ""
msgid "Opens in a new window"
msgstr ""
msgid "Options"
msgstr ""
......@@ -1045,6 +1068,9 @@ msgstr ""
msgid "Password"
msgstr ""
msgid "People without permission will never get a notification and won\\'t be able to comment."
msgstr ""
msgid "Pipeline"
msgstr ""
......@@ -1371,6 +1397,9 @@ msgstr[1] ""
msgid "Snippets"
msgstr ""
msgid "Something went wrong trying to change the locked state of this ${this.issuableDisplayName(this.issuableType)}"
msgstr ""
msgid "SortOptions|Access level, ascending"
msgstr ""
......@@ -1565,12 +1594,24 @@ msgstr ""
msgid "There are problems accessing Git storage: "
msgstr ""
msgid "This is a confidential issue."
msgstr ""
msgid "This is the author's first Merge Request to this project."
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."
msgstr ""
msgid "This merge request is locked."
msgstr ""
msgid "Time before an issue gets scheduled"
msgstr ""
......@@ -1649,9 +1690,6 @@ msgstr ""
msgid "Timeago|a week ago"
msgstr ""
msgid "Timeago|a while"
msgstr ""
msgid "Timeago|a year ago"
msgstr ""
......@@ -1703,6 +1741,9 @@ msgstr ""
msgid "Timeago|in 1 year"
msgstr ""
msgid "Timeago|in a while"
msgstr ""
msgid "Timeago|less than a minute ago"
msgstr ""
......@@ -1728,6 +1769,12 @@ msgstr ""
msgid "Track activity with Contribution Analytics."
msgstr ""
msgid "Unlock"
msgstr ""
msgid "Unlocked"
msgstr ""
msgid "Unstar"
msgstr ""
......@@ -1896,6 +1943,9 @@ msgstr ""
msgid "Wiki|Wiki Pages"
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"
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"
msgstr ""
msgid "Your comment will not be visible to the public."
msgstr ""
msgid "Your name"
msgstr ""
......
......@@ -77,6 +77,55 @@ feature 'Project' do
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
let(:user) { create(:user, username: 'test', name: 'test') }
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