-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlink icons (#1416) #3826
Symlink icons (#1416) #3826
Conversation
Signed-off-by: Tris Forster <[email protected]>
Signed-off-by: Tris Forster <[email protected]>
I have some tests to add before this is merged but I need some advice as to the cleanest way to add a repository to the test server (gitea-repositories-meta, fixtures etc). Is there an easy way to spin up the test server, push a new repository and spit out the fixtures? |
Codecov Report
@@ Coverage Diff @@
## master #3826 +/- ##
=========================================
Coverage ? 20.21%
=========================================
Files ? 145
Lines ? 29014
Branches ? 0
=========================================
Hits ? 5864
Misses ? 22259
Partials ? 891
Continue to review full report at Codecov.
|
You can add git repositories in: https://github.com/go-gitea/gitea/tree/master/integrations/gitea-repositories-meta and use it later in integration tests |
I tried just adding a bare repo at |
Yes you have to add needed database records in fixtures yml files |
Signed-off-by: Tris Forster <[email protected]>
Have not tested yet but does opening link also go to link target? |
No, behaviour is identical github.
See https://github.com/tf198/symlink_test It would be easy to add an |
Just a note: editing of symlinks is allowed on GitHub, and I think it should be kept this way (there may be a broken symlink because the dst directory changed - should be reasonable to keep the ability to change the symlink) Please do add the |
Thanks for doing this! Suggestions:
|
LGTM |
Here's a patch for the directory symlink color: diff --git a/public/less/_repository.less b/public/less/_repository.less
index 3bbfe33ef..cb6245908 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -237,7 +237,8 @@
&.octicon-mail-reply {
margin-right: 10px;
}
- &.octicon-file-directory, &.octicon-file-submodule {
+ &.octicon-file-directory, &.octicon-file-submodule,
+ &.octicon-file-symlink-directory {
color: #1e70bf;
}
} After applying, run |
Signed-off-by: Tris Forster <[email protected]>
Have applied the css patch from @silverwind - looks pretty smart now! @thehowl - I am corrected, github currently allows editing of symlinks but gitea doesn't (existing behaviour). Suggest a new issue is opened for modifying this behaviour. |
We could just avoid nested symlinks (if the target is a dir then it's a dir, otherwise if it's a file, symlink, or anything else, it's a file). Hacky, sure, but should suffice most use cases. |
Uses the octicon icons for directory and file symlinks.
Directory symlinks will only be rendered if the target is present in the repository. Broken links, targets outside the repo and links to other links will just be rendered as
file-symlink-file
.