Commit Graph

143 Commits (57f1476093e011e628493e50ec4bbc9de31356b2)

Author SHA1 Message Date
Matthias Loibl 030ba2894f
Add tests for EllipsisString() and fix bug if param length < 3
Matthias Loibl f81711f40d
Test AvatarLink and refactor with tests passing
Matthias Loibl 11c9160cd3
Start to add tests for modules/base/tool
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs ()
Unknwon dadd35b636 fix template error
Unknwon 780cc2d110 router/repo: code refactoring
Thibault Meyer 7eafe3213f Fix : commit tag shortener ()
* Fix : commit tag shortener

* Check short commit

* remove debug

* Edit unit tests

* Show 10-char short SHA
Unknwon 99385db0c4 code cleanup
Sandro Santilli 90dd0657b5 Add support for federated avatars ()
* Add support for federated avatars

Fixes 

Removes avatar fetching duplication code
Adds an "Enable Federated Avatar" checkbox in user settings
(defaults to unchecked)

Moves avatar settings all in the same form, making
local and remote avatars mutually exclusive

Renames UploadAvatarForm to AvatarForm
as it's not anymore only for uploading

* Run gofmt on all modified files

* Move Avatar form in its own page

* Add go-libravatar dependency to vendor/ dir

Hopefully helps with accepting the contribution.
See also 

* Revert "Add go-libravatar dependency to vendor/ dir"

This reverts commit a8cb93ae640bbb90f7d25012fc257bda9fae9b82.

* Make federated avatar setting a global configuration

Removes the per-user setting

* Move avatar handling back to base tool, disable federated avatar in offline mode

* Format, handle error

* Properly set fallback host

* Use unsupported github.com mirror for importing go-libravatar

* Remove comment showing life exists outside of github.com

... pity, but contribution would not be accepted otherwise

* Use Combo for Get and Post methods over /avatar

* FEDERATED_AVATAR -> ENABLE_FEDERATED_AVATAR

* Fix persistance of federated avatar lookup checkbox at install time

* Federated Avatars -> Enable Federated Avatars

* Use len(string) == 0 instead of string == ""

* Move import line where it belong

See
https://github.com/Unknwon/go-code-convention/blob/master/en-US/import_packages.md

Pity the import url is still the unofficial one, but oh well...

* Save a line (and waste much more expensive time)

* Remove redundant parens

* Remove an empty line

* Remove empty lines

* Reorder lines to make diff smaller

* Remove another newline

Unknwon review got me start a fight against newlines

* Move DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR after OFFLINE_MODE

On re-reading the diff I figured what Unknwon meant here:
https://github.com/gogits/gogs/pull/3320/files#r73741106

* Remove newlines that weren't there before my intervention
Sandro Santilli 8a248696e9 Use a gopher as default avatar (rather than the gravatar logo) ()
Also changes the avatar from a jpeg to a png, to allow for
transparent background. The indexed png is also smaller in size.

Note that at the moment the default avatar is only used when
the user requested a custom avatar and the custom avatar file
is not found (should never happen).

In the future the default avatar could be used as a default
return when by-mail avatar lookups fail too (both gravatar
and libravatar support passing a default)
Kim Carlbäcker 3df8eb60e3 PDF-Previews in file-lists now working ()
Unknwon 5267dce210 Fix ref comment from commit create empty feed
Unknwon a2f13eae55 some avatar setting changes
- Allow to delete current avatar
Unknwon d5a3021a7d Make markdown as an independent module
Unknwon 58e004f7da Remove cache avatar support and add its tests
Kim "BKC" Carlbäcker 1ab8a60d73 Not working, but slightly better...
Kim "BKC" Carlbäcker 3a9fd81f59 Custom URL-Schemas for Markdown
Kim "BKC" Carlbäcker a1a4f1103c Made Sanitizer-setup cleaner
Kim "BKC" Carlbäcker 8e09e03127 Checklist-rendering implemented
Unknwon f43cc90841 Truncate repository name if too long
Unknwon 4993ab1a76 fall back to use custom chardet lib
Unknwon 44637f03cc fast detection of utf-8
Unknwon 93f03707a7 set text/plain for non-binary files in raw mode
Unknwon 85af36332b fix utf-8 recognized as windows-1252
Unknwon 95f9c85bcc use Go sub-repo to detect encoding
Unknwon 7f9598141b fix
Unknwon 1d57f0d64f Show custom avatars in commits
Unknwon c8d92fad30 pushing new branch will rereference issues in previous branch
Hongcai Deng e4d4662074 add regexp to restrict `<code class=""></code>`
Hongcai Deng 357c002c03 add allow attribute `class` to `<code>`
Unknwon a329bbc215 new org dashboard issues
Unknwon 6c2536b89c fix timezone
Unknwon a5b09b30d0 print time to debug
Unknwon 390027496c use UTC for TimeSince
Unknwon 133b19d0c5 finish view comments on issue page
Unknwon 922f3f3062 finish create issue with labels
Unknwon b72e75e522 : OFFLINE_MODE Still Uses Gravatar
Peter Smit 7759b9ee6e Remove the "PHP" style formatting function
The "PHP" formatting function doesn't add anything, except an undocumented date format.

All usages in the templates have been replaced with DateFmtShort and DateFmtLong for convenience.
Unknwon ee6786216a modules/base: clean code with
Unknwon 9ee80e3e54 fix compile error
Mageti e321469884 remove unused code in BasicAuthDecode
Mageti b7ebbb4064 Correction for
Correction for 
Bug was : decode failed if the password contains ```:```
Andrew Burns 35b02997f8 Fix Gravatar images in web view (like commit listing)
Related to 

In the original bug report it was referencing only the sytem avatar images for setup users (like in the header); however the problem also persists with things like commit history.

This commit fixes the `tool.AvatarLink` function so that it also uses the already existing `avatar.HashEmail` function.

I also refactored the `tool.AvatarLink` method some to make the control flow more apparent and adhere better to DRY (there were multiple calls to the `EncodeMd5` function that the `HashEmail` function call replaced, now there is only one.)
Unknwon 340a4595dd support duoshuo mirror of gravatar
Unknwon 8c9338a537 add personal access token panel
Unknwon abc57b6e43 work on
Unknwon f1d8746264 Fix fork repo and macaron API broken
Unknwon 263d409326 Basic xss prevention
Martin van Beurden bb05ef907b Fix AvatarLink when using a suburl and gravatar is disabled or avatars are cached
无闻 568c9b353e Merge pull request from nuss-justin/issue/281
Fix . Add mouse-over precise time and on-click switch listener.
Unknwon 7bbf644dd5 Convert captcha, cache, csrf as middlewares
Justin Nuß 91480f3791 Merge branch 'dev' of https://github.com/gogits/Gogs into issue/281
Conflicts:
	modules/base/tool.go
Unknwon 8dd07c0ddd New UI merge in progress
Justin Nuß 835e85b5ce Fix . Add mouse-over precise time and on-click switch listener.
Unknown 63cc14062a Paging function for users and repositories
slene 4ee6bc4fca fix for new git api
Unknown 688ec6ecbd Fixed
Unknown a641854cad command dump
Christopher Brickley b9a1d13c29 change gravatar image to match URL scheme
Unknown 9d983f27d6 go vet
Unknown e2fe220905 Work on comment
Unknown e7c8a3cb8d Add salt for every single user
Unknown eb803ec5eb Add transfer repository
Unknown 8282828820 Fix action email bug
Lunny Xiao a726c125b5 Add PushCommit
Unknown eb6021f73f Fix issue pages URL params
Unknown dd6246877d Almost done diff page
Unknown ed9b7d2db9 More on diff page
Unknown d3b8e9daa1 Add notify watcher action
Unknown 2fa8d0c8dd Added create issue
skyblue 4bac361605 merge with branch master
Unknown 97debac185 SSL enable config option
Unknown c386bb4bd3 Bug fix
Unknown 1eb078d0a8 Fix action
Gogs 964e537479 append route to web
slene 5edd57e482 Merge branch 'master' of github.com:gogits/gogs
slene 076fc98d98 add csrf check
Unknown fd1831052c Update session
Unknown 35d473f04a Finish verify email
Unknown ddbd2ce152 Add register mail tpl
Unknown de087c7b4a Add send register confirm mail
Unknown fbbae2b721 Working on register mail confirmation
Unknown 0f68930892 Add latest commit in repo viewer
Unknown ec65be79f0 Fix commit feed ui
Unknown 48b2425c1d Push feed
Unknown 8fb4b3afad Add template func FileSize
Unknown 4224ef142e Add template func FileSize
slene fa5ad1e465 move templateFuncs to one file, add middleware context.
slene 06deed820d Add HomeLink and AvatarLink to User model. Please use .SignedUser in template.
Unknown adb17791bd Add basic render of public act
Unknown d50e18ab6d Clean code
Unknown bd6542c2f1 Add TimeSince
Unknown 5a05d6633d Merge utils to modules