gitlab-org--gitlab-foss/app/controllers/projects
Dmitriy Zaporozhets 76b7e24f85 Merge branch 'edit-on-fork' into 'master'
Automatically fork a project when not allowed to edit a file.

Fixes #3215.

To do:

- [ ] Add tests

-----

## "Edit" button on file in a project the user does NOT have write access to

![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png)

## Clicking will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the edit page on the original project with a notice

![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png)

## The user cannot change the target branch and is informed that editing will start an MR

![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png)

## Hitting "Commit changes" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png)

-----

## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to

![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png)

## Clicking any of these options will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the tree page on the original project with a notice

![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png)

## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR

![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png)

## Hitting "Create directory" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png)

cc @dzaporozhets @skyruler

See merge request !2145
2015-12-24 12:24:57 +00:00
..
application_controller.rb Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
avatars_controller.rb Only render 404 page from /public 2015-10-13 20:12:34 +03:00
blame_controller.rb Fix blame view line groupings 2015-08-20 01:27:29 -07:00
blob_controller.rb Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
branches_controller.rb Add authorization to new branch/tag pages. 2015-12-03 18:53:17 +01:00
builds_controller.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
commit_controller.rb Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
commits_controller.rb Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork 2015-10-22 18:38:00 +02:00
compare_controller.rb Merge branch 'compare-first-commit' into 'master' 2015-11-17 18:51:40 +00:00
deploy_keys_controller.rb Redirect to a default path if HTTP_REFERER is not set 2015-10-20 07:45:48 -07:00
forks_controller.rb Add tests for new functionality 2015-12-21 11:57:51 +01:00
graphs_controller.rb Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
hooks_controller.rb Migrate CI::Services and CI::WebHooks to Services and WebHooks 2015-12-10 16:04:08 +01:00
imports_controller.rb Fix specs and behavior for LFS files 2015-12-18 16:14:12 +01:00
issues_controller.rb Implement new sidebar for merge request page 2015-12-11 20:11:23 +01:00
labels_controller.rb Fix 403 Access Denied error messages when accessing Labels section in a project that has MRs disabled but issues enabled 2015-06-18 03:15:05 -07:00
merge_requests_controller.rb Merge branch 'fix-merge-immediately' into 'master' 2015-12-16 17:51:25 +00:00
milestones_controller.rb Improve performance of sorting milestone issues 2015-10-19 11:37:14 +02:00
network_controller.rb Fix network graph when branch name has single quotes 2015-07-29 23:29:47 -07:00
notes_controller.rb base implementation of emoji picker [ci skip] 2015-12-22 23:12:23 +02:00
project_members_controller.rb Fix only 20 group members showing on project member page 2015-12-09 01:43:57 +01:00
protected_branches_controller.rb Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
raw_controller.rb Add specs for showing lfs object in UI. 2015-12-07 15:03:50 +01:00
refs_controller.rb Fix error preventing displaying of commit data for a directory with a leading dot 2015-10-12 22:24:19 -07:00
releases_controller.rb Refactor release code a bit 2015-11-09 15:30:50 +01:00
repositories_controller.rb Let gitlab-git-http-server handle archive downloads 2015-10-08 17:12:00 +02:00
runner_projects_controller.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
runners_controller.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
services_controller.rb Backport JIRA service 2015-12-18 14:19:48 -06:00
snippets_controller.rb Update style of snippets pages 2015-10-18 13:03:26 +02:00
tags_controller.rb Add authorization to new branch/tag pages. 2015-12-03 18:53:17 +01:00
tree_controller.rb Fix specs and behavior for LFS files 2015-12-18 16:14:12 +01:00
triggers_controller.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
uploads_controller.rb Only render 404 page from /public 2015-10-13 20:12:34 +03:00
variables_controller.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
wikis_controller.rb Fix rubocop warnings in app 2015-10-03 00:56:37 -05:00