With the usage of a port of github's linguist functionality to Go,
which I have made as a separate library and is hosted here:
https://github.com/generaltso/linguist
And a quick design I made, I have hacked a language statistics bar
into gogs
I wasn't sure where to put everything so it's sitting directly
on the view router and the CSS is inlined into a new template file
Based on the structure of this project I would fully expect this
feature to belong in its own sub-package
Also, even though determining language stats on-the-fly is pretty
fast, caching the results in the database for large codebases
would probably be a much better strategy, especially if the top
language were to be displayed in the "Explore" view like GitHub has
I also had difficulty trying to figure out how to do:
if len(something) == 1 ? '' : 's'
with go templates for plurals (1 Commit vs 2 Commits), and I kinda
gave up there...
Consider following LDAP search query example:
(&(objectClass=Person)(|(uid=%s)(mail=%s)))
Right now on first login attempt Gogs will use the text supplied on login form
as the newly created user name. In example query above the text matches against
both e-mail or user name. So if user puts the e-mail then the new Gogs user
name will be e-mail which may be undesired.
Using optional user name attribute setting we can explicitly say we want Gogs
user name to be certain LDAP attribute eg. `uid`, so even user will use e-mail
to login 1st time, the new account will receive correct user name.