Commit Graph

66 Commits

Author SHA1 Message Date
tiagonbotelho dd3addad48 renames :file_name to :file_path 2016-07-13 11:19:14 +01:00
tiagonbotelho 98c0eb4615 test for nil params :file_name 2016-07-12 15:55:16 +01:00
tiagonbotelho 893f3f2856 refactors update action to change commit_params with the correct path 2016-07-12 15:55:16 +01:00
tiagonbotelho cf96c7596a changes the usasge of path to file_path on blob_controller for compatibillity with the create action 2016-07-12 15:55:16 +01:00
tiagonbotelho 4deab9a540 fixes merge request edit bug where it would generate a cloned file and not remove the previous one 2016-07-12 15:54:17 +01:00
tiagonbotelho b0ce99f5b0 implements the form for renaming the new filename on the file edit page 2016-07-12 15:48:43 +01:00
tiagonbotelho fba72e1e0c creates the update_file method in repository.rb and applies changes accordingly 2016-07-12 15:48:24 +01:00
tiagonbotelho 09194eebff successfully adds the new version with the updated name on the projects repo 2016-07-12 15:46:14 +01:00
tiagonbotelho d9561118e8 implements the form for renaming the new filename on the file edit page 2016-07-12 15:46:14 +01:00
tiagonbotelho f85834bc96 remove prints and useless comments 2016-07-12 15:46:14 +01:00
tiagonbotelho 10954f93e9 successfully adds the new version with the updated name on the projects repo 2016-07-12 15:45:59 +01:00
tiagonbotelho 50613fc6d3 implements the form for renaming the new filename on the file edit page 2016-07-12 15:44:57 +01:00
tiagonbotelho fc747dc346 fixes merge request edit bug where it would generate a cloned file and not remove the previous one 2016-07-12 15:42:19 +01:00
tiagonbotelho 1d5d5b1a42 refactors blob_controller 2016-07-12 15:33:39 +01:00
tiagonbotelho 9951854648 creates the update_file method in repository.rb and applies changes accordingly 2016-07-12 15:24:17 +01:00
tiagonbotelho bb627b6fc2 implements the form for renaming the new filename on the file edit page 2016-07-12 15:23:35 +01:00
tiagonbotelho ea50760b02 remove prints and useless comments 2016-07-12 15:23:02 +01:00
tiagonbotelho ac30c60ad9 successfully adds the new version with the updated name on the projects repo 2016-07-12 15:22:54 +01:00
tiagonbotelho b34310ae9e implements the form for renaming the new filename on the file edit page 2016-07-12 15:22:17 +01:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Ruben Davila 7627cc1989 Validate presence of essential params for diff rendering
This will avoid application errors generated by the assumption of the
presence of these params.
2016-06-24 16:20:53 -05:00
Robert Speicher 8c454b3624 Add a `Blob` model that wraps `Gitlab::Git::Blob`
This allows us to take advantage of Rails' `to_partial_path` to render
the correct partial based on the Blob type, rather than cluttering the
view with conditionals.

It also allows (and will allow in the future) better encapsulation for
Blob-related logic which makes sense for our Rails app but might not
make as much sense for the core `gitlab_git` library, such as detecting
if the blob is an SVG.
2016-02-18 22:45:30 -05:00
Jacob Vosmaer 51574d779c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into lazy-blobs 2016-02-01 13:51:05 +01:00
Jacob Vosmaer 64c8ee47c9 WIP lazy blobs 2016-02-01 10:41:52 +01:00
Douwe Maan 150b4f66e6 Make sure non-highlighted diffs are still escaped 2016-01-22 01:47:17 +01:00
Douwe Maan 8dfad143d4 Add inline diff markers in highlighted diffs. 2016-01-14 22:28:07 +01:00
Rubén Dávila c476395b4d Reuse existent vars with ref and path. #3945 2016-01-12 11:14:41 -05:00
Rubén Dávila 21b602c60a Change strategy to highlight diffs. #3945
Now we apply syntax highlighting to the whole old and new files.
This basically help us to highlight adequately multiline content.
2016-01-07 22:37:01 -05:00
Rubén Dávila 3fbcf52ec8 Apply syntax highlighting when expanding diff plus some refactor. #3945 2015-12-31 01:05:52 -05:00
Douwe Maan d9c82d679f Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
Douwe Maan df6750d3d6 Default target branch to patch-n when editing file in protected branch 2015-12-08 16:42:10 +01:00
Douwe Maan f3cfd20952 DRY up code 2015-11-18 17:17:38 +01:00
Douwe Maan e945ec0280 Add "Start a new merge request" option to every commit form 2015-11-17 18:53:56 +01:00
Douwe Maan 0b540a0fad Merge branch 'master' into dirceu/gitlab-ce-new-merge-request-from-file-edit 2015-11-17 17:01:28 +01:00
Ben Ford 3be9d2c422 Add ability to create directories in the editor
Simply type a name with a `/` directory separator and new directories
will be created. This does not do the fancy UI work that github.com
does, but it will get the job done.

I could not find tests for file creation, so I didn't add a test for
this slight behaviour modification. I did test directory traversals
though, using both absolute paths like `/tmp/foo.txt` and relative paths
like `../../foo.txt`. Neither case escaped the repository, though
attempting to traverse with a relative path resulted in a 500 error that
did not affect application stability upon reload.
2015-10-29 15:49:07 +01:00
Dirceu Pereira Tiegs 3d50b99d01 Add option to create merge request when editing/creating a file 2015-10-19 20:25:35 -02:00
Valery Sizov 8346dde052 Only render 404 page from /public 2015-10-13 20:12:34 +03:00
Stan Hu 0ab6ca93aa Add directory feature button
Change "+" icon under "Files" section to have three options:

* Create file
* Upload file
* New directory

Upload file is no longer accessible from the "Create file" page.
Users can now select a target branch in upload file as well.

Closes #2799: Fixes a bug where file modes were overwritten after a commit

Closes https://github.com/gitlabhq/gitlabhq/issues/8253: Existing files
can no longer be overwritten in the "Create file" section.

Closes #2557
2015-10-07 04:22:55 -07:00
Stan Hu ac855e5ed3 Move partial locals out of controller 2015-09-17 07:24:45 -07:00
Stan Hu d9af6f79ed Change the replace placeholder to use the filename
Dynamically adjust placedholder for uploads and fix Dropzone event handlers

Override error handler to prevent error messages from being inserted underneath image preview

Fix tests

Use regexp instead of startsWith for better browser compatibility

Remove duplicate code in _replace.html.haml and use one template

Remove files upon error and retain alert messages until user adds a new file
2015-09-15 13:07:32 -07:00
liyakun e2ece2bc35 Add "Replace" and "Upload" features
Refactor upload and replace functionality

    Rename file and move CSS

    Fix typo

    Make dropzone a div

    Remove unnecessary file

    Change color of "upload existing one"

    Add missing changes
2015-09-15 02:12:56 +02:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets d4cfa0bf76
Revert "Refactor web editor"
This reverts commit dfccb06dda.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 11:49:09 +02:00
Dmitriy Zaporozhets dfccb06dda
Refactor web editor
* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-05 15:01:38 +02:00
Jeroen van Baarsen 5a4ebfb47a Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-04-20 15:39:37 +02:00
Valery Sizov 71a844cdae Web Editor: save to new branch 2015-02-24 11:43:20 +02:00
Vinnie Okada 2a9eed6620 Merge branch 'master' into rails-4.1.9
Conflicts:
	app/views/projects/commits/_commit.html.haml
	app/views/projects/issues/_issue.html.haml
	app/views/projects/issues/_issue_context.html.haml
	app/views/projects/merge_requests/_merge_request.html.haml
	app/views/projects/merge_requests/show/_context.html.haml
2015-02-21 12:55:28 -07:00
Douwe Maan 00408f37e3 Move 'require_non_empty_project' filter to front so 'assign_ref_vars' doesn't 404. 2015-02-20 17:20:03 +01:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Dmitriy Zaporozhets cc39bca3fa Rubocop: Style/AlignHash enabled 2015-02-02 21:15:44 -08:00