12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945 |
- $ git diff > ./UPGRADE-NOTES/git-diff
- diff --cc .gitignore
- index c523952,a13d346..0000000
- --- a/.gitignore
- +++ b/.gitignore
- @@@ -26,16 -12,9 +12,15 @@@ public/img/avatar
- *.exe~
- /gogs
- profile/
- - __pycache__
- *.pem
- output*
- - config.codekit
- - .brackets.json
- - docker/fig.yml
- - docker/docker/Dockerfile
- - docker/docker/init_gogs.sh
- gogs.sublime-project
- gogs.sublime-workspace
- ++<<<<<<< HEAD
- +debian/gogs
- +debian/build
- +debian/files
- ++=======
- + /release
- + vendor
- ++>>>>>>> upstream/master
- diff --cc cmd/web.go
- index f80792c,5dad862..0000000
- --- a/cmd/web.go
- +++ b/cmd/web.go
- @@@ -184,71 -191,29 +191,83 @@@ func runWeb(ctx *cli.Context) error
-
- m := newMacaron()
-
- - reqSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true})
- - ignSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: setting.Service.RequireSignInView})
- - ignSignInAndCsrf := middleware.Toggle(&middleware.ToggleOptions{DisableCsrf: true})
- - reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
- + reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
- + ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
- + ignSignInAndCsrf := context.Toggle(&context.ToggleOptions{DisableCSRF: true})
- + reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true})
-
- - bind := binding.Bind
- bindIgnErr := binding.BindIgnErr
-
- + // FIXME: not all routes need go through same middlewares.
- + // Especially some AJAX requests, we can reduce middleware number to improve performance.
- // Routers.
- m.Get("/", ignSignIn, routers.Home)
- ++<<<<<<< HEAD
- + m.Get("/explore", ignSignIn, routers.Explore)
- + m.Get("/help", ignSignIn, routers.Help)
- + m.Get("/about", ignSignIn, routers.About)
- + m.Get("/tos", ignSignIn, routers.Tos)
- + m.Get("/outages", ignSignIn, routers.Outages)
- + m.Combo("/install", routers.InstallInit).
- + Get(routers.Install).
- + Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
- + m.Group("", func() {
- + m.Get("/pulls", user.Pulls)
- + m.Get("/issues", user.Issues)
- + }, reqSignIn)
- +
- + // API.
- + // FIXME: custom form error response.
- + m.Group("/api", func() {
- + m.Group("/v1", func() {
- + // Miscellaneous.
- + m.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown)
- + m.Post("/markdown/raw", v1.MarkdownRaw)
- +
- + // Users.
- + m.Group("/users", func() {
- + m.Get("/search", v1.SearchUsers)
- +
- + m.Group("/:username", func() {
- + m.Get("", v1.GetUserInfo)
- +
- + m.Group("/tokens", func() {
- + m.Combo("").Get(v1.ListAccessTokens).Post(bind(v1.CreateAccessTokenForm{}), v1.CreateAccessToken)
- + }, middleware.ApiReqBasicAuth())
- + })
- + })
- +
- + // Repositories.
- + m.Combo("/user/repos", middleware.ApiReqToken()).Get(v1.ListMyRepos).Post(bind(api.CreateRepoOption{}), v1.CreateRepo)
- + m.Post("/org/:org/repos", middleware.ApiReqToken(), bind(api.CreateRepoOption{}), v1.CreateOrgRepo)
- + m.Group("/repos", func() {
- + m.Get("/search", v1.SearchRepos)
- + m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.MigrateRepo)
- +
- + m.Group("/:username/:reponame", func() {
- + m.Combo("/hooks").Get(v1.ListRepoHooks).Post(bind(api.CreateHookOption{}), v1.CreateRepoHook)
- + m.Patch("/hooks/:id:int", bind(api.EditHookOption{}), v1.EditRepoHook)
- + m.Get("/raw/*", middleware.RepoRef(), v1.GetRepoRawFile)
- + }, middleware.ApiRepoAssignment(), middleware.ApiReqToken())
- + })
- +
- + m.Any("/*", func(ctx *middleware.Context) {
- + ctx.HandleAPI(404, "Page not found")
- + })
- ++=======
- + m.Group("/explore", func() {
- + m.Get("", func(ctx *context.Context) {
- + ctx.Redirect(setting.AppSubUrl + "/explore/repos")
- ++>>>>>>> upstream/master
- })
- - })
- + m.Get("/repos", routers.ExploreRepos)
- + m.Get("/users", routers.ExploreUsers)
- + }, ignSignIn)
- + m.Combo("/install", routers.InstallInit).Get(routers.Install).
- + Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
- + m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues)
-
- - // User.
- + // ***** START: User *****
- m.Group("/user", func() {
- m.Get("/login", user.SignIn)
- m.Post("/login", bindIgnErr(auth.SignInForm{}), user.SignInPost)
- diff --cc models/issue.go
- index 367205a,189b207..0000000
- --- a/models/issue.go
- +++ b/models/issue.go
- @@@ -50,39 -51,159 +51,169 @@@ type Issue struct
- RenderedContent string `xorm:"-"`
- Priority int
- NumComments int
- - Deadline time.Time
- - Created time.Time `xorm:"CREATED"`
- - Updated time.Time `xorm:"UPDATED"`
- +
- + Deadline time.Time `xorm:"-"`
- + DeadlineUnix int64
- + Created time.Time `xorm:"-"`
- + CreatedUnix int64
- + Updated time.Time `xorm:"-"`
- + UpdatedUnix int64
- +
- + Attachments []*Attachment `xorm:"-"`
- + Comments []*Comment `xorm:"-"`
- }
-
- ++<<<<<<< HEAD
- +func (i *Issue) GetPoster() (err error) {
- + i.Poster, err = GetUserById(i.PosterId)
- + if err == ErrUserNotExist {
- + i.Poster = &User{Name: "DeletedUser"}
- + return nil
- + }
- + return err
- ++=======
- + func (i *Issue) BeforeInsert() {
- + i.CreatedUnix = time.Now().UTC().Unix()
- + i.UpdatedUnix = i.CreatedUnix
- ++>>>>>>> upstream/master
- }
-
- - func (i *Issue) GetLabels() error {
- - if len(i.LabelIds) < 3 {
- - return nil
- + func (i *Issue) BeforeUpdate() {
- + i.UpdatedUnix = time.Now().UTC().Unix()
- + i.DeadlineUnix = i.Deadline.UTC().Unix()
- + }
- +
- + func (issue *Issue) loadAttributes(e Engine) (err error) {
- + issue.Repo, err = getRepositoryByID(e, issue.RepoID)
- + if err != nil {
- + return fmt.Errorf("getRepositoryByID: %v", err)
- }
-
- - strIds := strings.Split(strings.TrimSuffix(i.LabelIds[1:], "|"), "|$")
- - i.Labels = make([]*Label, 0, len(strIds))
- - for _, strId := range strIds {
- - id, _ := com.StrTo(strId).Int64()
- - if id > 0 {
- - l, err := GetLabelById(id)
- - if err != nil {
- - if err == ErrLabelNotExist {
- - continue
- - }
- - return err
- + return nil
- + }
- +
- + func (issue *Issue) LoadAttributes() (err error) {
- + return issue.loadAttributes(x)
- + }
- +
- + func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
- + var err error
- + switch colName {
- + case "id":
- + i.Attachments, err = GetAttachmentsByIssueID(i.ID)
- + if err != nil {
- + log.Error(3, "GetAttachmentsByIssueID[%d]: %v", i.ID, err)
- + }
- +
- + i.Comments, err = GetCommentsByIssueID(i.ID)
- + if err != nil {
- + log.Error(3, "GetCommentsByIssueID[%d]: %v", i.ID, err)
- + }
- +
- + i.Labels, err = GetLabelsByIssueID(i.ID)
- + if err != nil {
- + log.Error(3, "GetLabelsByIssueID[%d]: %v", i.ID, err)
- + }
- +
- + case "poster_id":
- + i.Poster, err = GetUserByID(i.PosterID)
- + if err != nil {
- + if IsErrUserNotExist(err) {
- + i.PosterID = -1
- + i.Poster = NewFakeUser()
- + } else {
- + log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
- }
- - i.Labels = append(i.Labels, l)
- + return
- + }
- +
- + case "milestone_id":
- + if i.MilestoneID == 0 {
- + return
- + }
- +
- + i.Milestone, err = GetMilestoneByID(i.MilestoneID)
- + if err != nil {
- + log.Error(3, "GetMilestoneById[%d]: %v", i.ID, err)
- + }
- +
- + case "assignee_id":
- + if i.AssigneeID == 0 {
- + return
- + }
- +
- + i.Assignee, err = GetUserByID(i.AssigneeID)
- + if err != nil {
- + log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
- }
- +
- + case "deadline_unix":
- + i.Deadline = time.Unix(i.DeadlineUnix, 0).Local()
- + case "created_unix":
- + i.Created = time.Unix(i.CreatedUnix, 0).Local()
- + case "updated_unix":
- + i.Updated = time.Unix(i.UpdatedUnix, 0).Local()
- + }
- + }
- +
- + // HashTag returns unique hash tag for issue.
- + func (i *Issue) HashTag() string {
- + return "issue-" + com.ToStr(i.ID)
- + }
- +
- + // State returns string representation of issue status.
- + func (i *Issue) State() string {
- + if i.IsClosed {
- + return "closed"
- + }
- + return "open"
- + }
- +
- + func (issue *Issue) FullLink() string {
- + return fmt.Sprintf("%s/issues/%d", issue.Repo.FullLink(), issue.Index)
- + }
- +
- + // IsPoster returns true if given user by ID is the poster.
- + func (i *Issue) IsPoster(uid int64) bool {
- + return i.PosterID == uid
- + }
- +
- + func (i *Issue) hasLabel(e Engine, labelID int64) bool {
- + return hasIssueLabel(e, i.ID, labelID)
- + }
- +
- + // HasLabel returns true if issue has been labeled by given ID.
- + func (i *Issue) HasLabel(labelID int64) bool {
- + return i.hasLabel(x, labelID)
- + }
- +
- + func (i *Issue) addLabel(e *xorm.Session, label *Label) error {
- + return newIssueLabel(e, i, label)
- + }
- +
- + // AddLabel adds new label to issue by given ID.
- + func (i *Issue) AddLabel(label *Label) (err error) {
- + sess := x.NewSession()
- + defer sessionRelease(sess)
- + if err = sess.Begin(); err != nil {
- + return err
- + }
- +
- + if err = i.addLabel(sess, label); err != nil {
- + return err
- + }
- +
- + return sess.Commit()
- + }
- +
- + func (i *Issue) getLabels(e Engine) (err error) {
- + if len(i.Labels) > 0 {
- + return nil
- + }
- +
- + i.Labels, err = getLabelsByIssueID(e, i.ID)
- + if err != nil {
- + return fmt.Errorf("getLabelsByIssueID: %v", err)
- }
- return nil
- }
- diff --cc models/repo.go
- index 4a39e2d,f8782db..0000000
- --- a/models/repo.go
- +++ b/models/repo.go
- @@@ -253,24 -518,31 +518,36 @@@ func (repo *Repository) CloneLink() (c
- }
-
- var (
- ++<<<<<<< HEAD
- + illegalEquals = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", "about", "tos", "error", "outages", "DeletedUser" }
- + illegalSuffixs = []string{".git", ".keys"}
- ++=======
- + reservedNames = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", ".", ".."}
- + reservedPatterns = []string{"*.git", "*.keys", "*.wiki"}
- ++>>>>>>> upstream/master
- )
-
- - // IsLegalName returns false if name contains illegal characters.
- - func IsLegalName(repoName string) bool {
- - repoName = strings.ToLower(repoName)
- - for _, char := range illegalEquals {
- - if repoName == char {
- - return false
- + // IsUsableName checks if name is reserved or pattern of name is not allowed.
- + func IsUsableName(name string) error {
- + name = strings.TrimSpace(strings.ToLower(name))
- + if utf8.RuneCountInString(name) == 0 {
- + return ErrNameEmpty
- + }
- +
- + for i := range reservedNames {
- + if name == reservedNames[i] {
- + return ErrNameReserved{name}
- }
- }
- - for _, char := range illegalSuffixs {
- - if strings.HasSuffix(repoName, char) {
- - return false
- +
- + for _, pat := range reservedPatterns {
- + if pat[0] == '*' && strings.HasSuffix(name, pat[1:]) ||
- + (pat[len(pat)-1] == '*' && strings.HasPrefix(name, pat[:len(pat)-1])) {
- + return ErrNamePatternNotAllowed{pat}
- }
- }
- - return true
- +
- + return nil
- }
-
- // Mirror represents a mirror information of repository.
- @@@ -351,33 -711,75 +716,81 @@@ func MigrateRepository(u *User, opts Mi
- repo.NumWatches = 1
- }
-
- - repo.IsBare = false
- - if mirror {
- - if err = MirrorRepository(repo.Id, u.Name, repo.Name, repoPath, url); err != nil {
- - return repo, err
- + os.RemoveAll(repoPath)
- + if err = git.Clone(opts.RemoteAddr, repoPath, git.CloneRepoOptions{
- + Mirror: true,
- + Quiet: true,
- + Timeout: time.Duration(setting.Git.Timeout.Migrate) * time.Second,
- + }); err != nil {
- + return repo, fmt.Errorf("Clone: %v", err)
- + }
- +
- + // Check if repository is empty.
- + _, stderr, err := com.ExecCmdDir(repoPath, "git", "log", "-1")
- + if err != nil {
- + if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {
- + repo.IsBare = true
- + } else {
- + return repo, fmt.Errorf("check bare: %v - %s", err, stderr)
- + }
- + }
- +
- + if !repo.IsBare {
- + // Try to get HEAD branch and set it as default branch.
- + gitRepo, err := git.OpenRepository(repoPath)
- + if err != nil {
- + return repo, fmt.Errorf("OpenRepository: %v", err)
- + }
- + headBranch, err := gitRepo.GetHEADBranch()
- + if err != nil {
- + return repo, fmt.Errorf("GetHEADBranch: %v", err)
- + }
- + if headBranch != nil {
- + repo.DefaultBranch = headBranch.Name
- + }
- + }
- +
- + if opts.IsMirror {
- + if _, err = x.InsertOne(&Mirror{
- + RepoID: repo.ID,
- + Interval: 24,
- + EnablePrune: true,
- + NextUpdate: time.Now().Add(24 * time.Hour),
- + }); err != nil {
- + return repo, fmt.Errorf("InsertOne: %v", err)
- }
- +
- repo.IsMirror = true
- return repo, UpdateRepository(repo, false)
- - } else {
- - os.RemoveAll(repoPath)
- }
-
- - // FIXME: this command could for both migrate and mirror
- - _, stderr, err := process.ExecTimeout(10*time.Minute,
- - fmt.Sprintf("MigrateRepository: %s", repoPath),
- - "git", "clone", "--mirror", "--bare", url, repoPath)
- + return CleanUpMigrateInfo(repo, repoPath)
- + }
- +
- + // Finish migrating repository with things that don't need to be done for mirrors.
- + func CleanUpMigrateInfo(repo *Repository, repoPath string) (*Repository, error) {
- + if err := createUpdateHook(repoPath); err != nil {
- + return repo, fmt.Errorf("createUpdateHook: %v", err)
- + }
- +
- + // Clean up mirror info which prevents "push --all".
- + // This also removes possible user credentials.
- + configPath := repo.GitConfigPath()
- + cfg, err := ini.Load(configPath)
- if err != nil {
- - return repo, fmt.Errorf("git clone --mirror --bare: %v", stderr)
- - } else if err = createUpdateHook(repoPath); err != nil {
- - return repo, fmt.Errorf("create update hook: %v", err)
- + return repo, fmt.Errorf("open config file: %v", err)
- + }
- + cfg.DeleteSection("remote \"origin\"")
- + if err = cfg.SaveToIndent(configPath, "\t"); err != nil {
- + return repo, fmt.Errorf("save config file: %v", err)
- }
-
- + // Default to 'master' branch if it exists
- + gitrepo, err := git.OpenRepository(repoPath)
- + if gitrepo.IsBranchExist("master") {
- + repo.DefaultBranch = "master"
- + }
- +
- return repo, UpdateRepository(repo, false)
- }
-
- diff --cc models/user.go
- index cfa14f8,e8e79f2..0000000
- --- a/models/user.go
- +++ b/models/user.go
- @@@ -54,9 -55,8 +55,14 @@@ type User struct
- LowerName string `xorm:"UNIQUE NOT NULL"`
- Name string `xorm:"UNIQUE NOT NULL"`
- FullName string
- ++<<<<<<< HEAD
- + // Email is the primary email address (to be used for communication).
- + Email string `xorm:"UNIQUE(s) NOT NULL"`
- + HideEmail bool
- ++=======
- + // Email is the primary email address (to be used for communication)
- + Email string `xorm:"NOT NULL"`
- ++>>>>>>> upstream/master
- Passwd string `xorm:"NOT NULL"`
- LoginType LoginType
- LoginSource int64 `xorm:"NOT NULL DEFAULT 0"`
- diff --cc modules/auth/user_form.go
- index be74ef0,57451d9..0000000
- --- a/modules/auth/user_form.go
- +++ b/modules/auth/user_form.go
- @@@ -77,13 -88,12 +88,22 @@@ func (f *SignInForm) Validate(ctx *maca
- // \/ \/ \/ \/ \/
-
- type UpdateProfileForm struct {
- ++<<<<<<< HEAD
- + UserName string `form:"uname" binding:"Required;MaxSize(35)"`
- + FullName string `form:"fullname" binding:"MaxSize(100)"`
- + Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
- + HideEmail bool `form:"hideemail"`
- + Website string `form:"website" binding:"Url;MaxSize(100)"`
- + Location string `form:"location" binding:"MaxSize(50)"`
- + Avatar string `form:"avatar" binding:"Required;Email;MaxSize(50)"`
- ++=======
- + Name string `binding:"OmitEmpty;MaxSize(35)"`
- + FullName string `binding:"MaxSize(100)"`
- + Email string `binding:"Required;Email;MaxSize(254)"`
- + Website string `binding:"Url;MaxSize(100)"`
- + Location string `binding:"MaxSize(50)"`
- + Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"`
- ++>>>>>>> upstream/master
- }
-
- func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
- diff --cc modules/mailer/mailer.go
- index d031ac1,80a6926..0000000
- --- a/modules/mailer/mailer.go
- +++ b/modules/mailer/mailer.go
- @@@ -7,9 -7,8 +7,12 @@@ package maile
- import (
- "crypto/tls"
- "fmt"
- ++<<<<<<< HEAD
- + "time"
- ++=======
- + "io"
- ++>>>>>>> upstream/master
- "net"
- - "net/mail"
- "net/smtp"
- "os"
- "strings"
- @@@ -19,63 -22,75 +26,87 @@@
- )
-
- type Message struct {
- - To []string
- - From string
- - Subject string
- - Body string
- - Type string
- - Massive bool
- - Info string
- + Info string // Message information for log purpose.
- + *gomail.Message
- }
-
- - // create mail content
- - func (m Message) Content() string {
- - // set mail type
- - contentType := "text/plain; charset=UTF-8"
- - if m.Type == "html" {
- - contentType = "text/html; charset=UTF-8"
- + // NewMessageFrom creates new mail message object with custom From header.
- + func NewMessageFrom(to []string, from, subject, htmlBody string) *Message {
- + log.Trace("NewMessageFrom (htmlBody):\n%s", htmlBody)
- +
- + msg := gomail.NewMessage()
- + msg.SetHeader("From", from)
- + msg.SetHeader("To", to...)
- + msg.SetHeader("Subject", subject)
- + msg.SetDateHeader("Date", time.Now())
- +
- + body, err := html2text.FromString(htmlBody)
- + if err != nil {
- + log.Error(4, "html2text.FromString: %v", err)
- + msg.SetBody("text/html", htmlBody)
- + } else {
- + msg.SetBody("text/plain", body)
- + if setting.MailService.EnableHTMLAlternative {
- + msg.AddAlternative("text/html", htmlBody)
- + }
- }
-
- ++<<<<<<< HEAD
- + // get and format current time for email headers
- + date := time.Now().Format(time.RFC1123Z)
- +
- + // generate a message-id for the email
- + messageid := fmt.Sprintf("%v@%s", time.Now().UnixNano(), setting.Domain)
- +
- + // create mail content
- + content := "From: " + m.From + "\r\nMessage-Id: " + messageid + "\r\nDate: " + date + "\r\nSubject: " + m.Subject + "\r\nContent-Type: " + contentType + "\r\n\r\n" + m.Body
- + return content
- ++=======
- + return &Message{
- + Message: msg,
- + }
- ++>>>>>>> upstream/master
- }
-
- - var mailQueue chan *Message
- + // NewMessage creates new mail message object with default From header.
- + func NewMessage(to []string, subject, body string) *Message {
- + return NewMessageFrom(to, setting.MailService.From, subject, body)
- + }
-
- - func NewMailerContext() {
- - mailQueue = make(chan *Message, setting.Cfg.Section("mailer").Key("SEND_BUFFER_LEN").MustInt(10))
- - go processMailQueue()
- + type loginAuth struct {
- + username, password string
- }
-
- - func processMailQueue() {
- - for {
- - select {
- - case msg := <-mailQueue:
- - num, err := Send(msg)
- - tos := strings.Join(msg.To, "; ")
- - info := ""
- - if err != nil {
- - if len(msg.Info) > 0 {
- - info = ", info: " + msg.Info
- - }
- - log.Error(4, fmt.Sprintf("Async sent email %d succeed, not send emails: %s%s err: %s", num, tos, info, err))
- - } else {
- - log.Trace(fmt.Sprintf("Async sent email %d succeed, sent emails: %s%s", num, tos, info))
- - }
- + // SMTP AUTH LOGIN Auth Handler
- + func LoginAuth(username, password string) smtp.Auth {
- + return &loginAuth{username, password}
- + }
- +
- + func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
- + return "LOGIN", []byte{}, nil
- + }
- +
- + func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
- + if more {
- + switch string(fromServer) {
- + case "Username:":
- + return []byte(a.username), nil
- + case "Password:":
- + return []byte(a.password), nil
- + default:
- + return nil, fmt.Errorf("unknwon fromServer: %s", string(fromServer))
- }
- }
- + return nil, nil
- }
-
- - // sendMail allows mail with self-signed certificates.
- - func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) error {
- - host, port, err := net.SplitHostPort(settings.Host)
- + type Sender struct {
- + }
- +
- + func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
- + opts := setting.MailService
- +
- + host, port, err := net.SplitHostPort(opts.Host)
- if err != nil {
- return err
- }
- diff --cc routers/home.go
- index 71e821e,1696752..0000000
- --- a/routers/home.go
- +++ b/routers/home.go
- @@@ -17,13 -19,10 +19,17 @@@ import
- const (
- HOME base.TplName = "home"
- EXPLORE_REPOS base.TplName = "explore/repos"
- ++<<<<<<< HEAD
- + HELP base.TplName = "help"
- + ABOUT base.TplName = "about"
- + TOS base.TplName = "tos"
- + OUTAGES base.TplName = "outages"
- ++=======
- + EXPLORE_USERS base.TplName = "explore/users"
- ++>>>>>>> upstream/master
- )
-
- - func Home(ctx *middleware.Context) {
- + func Home(ctx *context.Context) {
- if ctx.IsSigned {
- if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {
- ctx.Data["Title"] = ctx.Tr("auth.active_your_account")
- @@@ -67,34 -98,89 +105,117 @@@ func RenderRepoSearch(ctx *context.Cont
- }
- ctx.Data["Repos"] = repos
-
- - ctx.HTML(200, EXPLORE_REPOS)
- + ctx.HTML(200, opts.TplName)
- + }
- +
- + func ExploreRepos(ctx *context.Context) {
- + ctx.Data["Title"] = ctx.Tr("explore")
- + ctx.Data["PageIsExplore"] = true
- + ctx.Data["PageIsExploreRepositories"] = true
- +
- + RenderRepoSearch(ctx, &RepoSearchOptions{
- + Counter: models.CountPublicRepositories,
- + Ranger: models.GetRecentUpdatedRepositories,
- + PageSize: setting.ExplorePagingNum,
- + OrderBy: "updated_unix DESC",
- + TplName: EXPLORE_REPOS,
- + })
- + }
- +
- + type UserSearchOptions struct {
- + Type models.UserType
- + Counter func() int64
- + Ranger func(int, int) ([]*models.User, error)
- + PageSize int
- + OrderBy string
- + TplName base.TplName
- + }
- +
- + func RenderUserSearch(ctx *context.Context, opts *UserSearchOptions) {
- + page := ctx.QueryInt("page")
- + if page <= 1 {
- + page = 1
- + }
- +
- + var (
- + users []*models.User
- + count int64
- + err error
- + )
- +
- + keyword := ctx.Query("q")
- + if len(keyword) == 0 {
- + users, err = opts.Ranger(page, opts.PageSize)
- + if err != nil {
- + ctx.Handle(500, "opts.Ranger", err)
- + return
- + }
- + count = opts.Counter()
- + } else {
- + users, count, err = models.SearchUserByName(&models.SearchUserOptions{
- + Keyword: keyword,
- + Type: opts.Type,
- + OrderBy: opts.OrderBy,
- + Page: page,
- + PageSize: opts.PageSize,
- + })
- + if err != nil {
- + ctx.Handle(500, "SearchUserByName", err)
- + return
- + }
- + }
- + ctx.Data["Keyword"] = keyword
- + ctx.Data["Total"] = count
- + ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5)
- + ctx.Data["Users"] = users
- +
- + ctx.HTML(200, opts.TplName)
- + }
- +
- + func ExploreUsers(ctx *context.Context) {
- + ctx.Data["Title"] = ctx.Tr("explore")
- + ctx.Data["PageIsExplore"] = true
- + ctx.Data["PageIsExploreUsers"] = true
- +
- + RenderUserSearch(ctx, &UserSearchOptions{
- + Type: models.USER_TYPE_INDIVIDUAL,
- + Counter: models.CountUsers,
- + Ranger: models.Users,
- + PageSize: setting.ExplorePagingNum,
- + OrderBy: "updated_unix DESC",
- + TplName: EXPLORE_USERS,
- + })
- }
-
- ++<<<<<<< HEAD
- +func Help(ctx *middleware.Context) {
- + ctx.Data["Title"] = ctx.Tr("help")
- +
- + ctx.HTML(200, HELP)
- +}
- +
- +func About(ctx *middleware.Context) {
- + ctx.Data["Title"] = ctx.Tr("about")
- +
- + ctx.HTML(200, ABOUT)
- +}
- +
- +func Tos(ctx *middleware.Context) {
- + ctx.Data["Title"] = ctx.Tr("tos")
- +
- + ctx.HTML(200, TOS)
- +}
- +
- +func Outages(ctx *middleware.Context) {
- + ctx.Data["Title"] = ctx.Tr("outages")
- +
- + ctx.HTML(200, OUTAGES)
- +}
- +
- +func NotFound(ctx *middleware.Context) {
- ++=======
- + func NotFound(ctx *context.Context) {
- ++>>>>>>> upstream/master
- ctx.Data["Title"] = "Page Not Found"
- ctx.Handle(404, "home.NotFound", nil)
- }
- diff --cc routers/repo/issue.go
- index c4d3043,5252429..0000000
- --- a/routers/repo/issue.go
- +++ b/routers/repo/issue.go
- @@@ -383,48 -481,109 +481,117 @@@ func UploadIssueAttachment(ctx *context
- return
- }
-
- - // Get all collaborators.
- - ctx.Data["Collaborators"], err = ctx.Repo.Repository.GetCollaborators()
- + log.Trace("New attachment uploaded: %s", attach.UUID)
- + ctx.JSON(200, map[string]string{
- + "uuid": attach.UUID,
- + })
- + }
- +
- + func ViewIssue(ctx *context.Context) {
- + ctx.Data["RequireDropzone"] = true
- + renderAttachmentSettings(ctx)
- +
- + issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
- if err != nil {
- - ctx.Handle(500, "issue.CreateIssue(GetCollaborators)", err)
- + if models.IsErrIssueNotExist(err) {
- + ctx.Handle(404, "GetIssueByIndex", err)
- + } else {
- + ctx.Handle(500, "GetIssueByIndex", err)
- + }
- return
- }
- + ctx.Data["Title"] = issue.Name
-
- - if ctx.IsSigned {
- - // Update issue-user.
- - if err = models.UpdateIssueUserPairByRead(ctx.User.Id, issue.Id); err != nil {
- - ctx.Handle(500, "issue.ViewIssue(UpdateIssueUserPairByRead): %v", err)
- + // Make sure type and URL matches.
- + if ctx.Params(":type") == "issues" && issue.IsPull {
- + ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(issue.Index))
- + return
- + } else if ctx.Params(":type") == "pulls" && !issue.IsPull {
- + ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
- + return
- + }
- +
- + if issue.IsPull {
- + MustAllowPulls(ctx)
- + if ctx.Written() {
- + return
- + }
- + ctx.Data["PageIsPullList"] = true
- +
- + if err = issue.GetPullRequest(); err != nil {
- + ctx.Handle(500, "GetPullRequest", err)
- + return
- + }
- +
- + ctx.Data["PageIsPullConversation"] = true
- + } else {
- + MustEnableIssues(ctx)
- + if ctx.Written() {
- return
- }
- + ctx.Data["PageIsIssueList"] = true
- }
-
- - // Get poster and Assignee.
- - if err = issue.GetPoster(); err != nil {
- - ctx.Handle(500, "issue.ViewIssue(GetPoster): %v", err)
- - return
- - } else if err = issue.GetAssignee(); err != nil {
- - ctx.Handle(500, "issue.ViewIssue(GetAssignee): %v", err)
- - return
- + issue.RenderedContent = string(markdown.Render([]byte(issue.Content), ctx.Repo.RepoLink,
- + ctx.Repo.Repository.ComposeMetas()))
- +
- + repo := ctx.Repo.Repository
- +
- + // Get more information if it's a pull request.
- + if issue.IsPull {
- + if issue.HasMerged {
- + ctx.Data["DisableStatusChange"] = issue.HasMerged
- + PrepareMergedViewPullInfo(ctx, issue)
- + } else {
- + PrepareViewPullInfo(ctx, issue)
- + }
- + if ctx.Written() {
- + return
- + }
- }
- - issue.RenderedContent = string(base.RenderMarkdown([]byte(issue.Content), ctx.Repo.RepoLink))
-
- - // Get comments.
- - comments, err := models.GetIssueComments(issue.Id)
- + // Metas.
- + // Check labels.
- + labelIDMark := make(map[int64]bool)
- + for i := range issue.Labels {
- + labelIDMark[issue.Labels[i].ID] = true
- + }
- + labels, err := models.GetLabelsByRepoID(repo.ID)
- if err != nil {
- - ctx.Handle(500, "issue.ViewIssue(GetIssueComments): %v", err)
- + ctx.Handle(500, "GetLabelsByRepoID: %v", err)
- return
- }
- + hasSelected := false
- + for i := range labels {
- + if labelIDMark[labels[i].ID] {
- + labels[i].IsChecked = true
- + hasSelected = true
- + }
- + }
- + ctx.Data["HasSelectedLabel"] = hasSelected
- + ctx.Data["Labels"] = labels
-
- ++<<<<<<< HEAD
- + // Get posters.
- + for i := range comments {
- + u, err := models.GetUserById(comments[i].PosterId)
- + if err != nil {
- + u = &models.User{Name: "DeletedUser"}
- ++=======
- + // Check milestone and assignee.
- + if ctx.Repo.IsWriter() {
- + RetrieveRepoMilestonesAndAssignees(ctx, repo)
- + if ctx.Written() {
- + return
- ++>>>>>>> upstream/master
- }
- - comments[i].Poster = u
- + }
-
- - if comments[i].Type == models.COMMENT_TYPE_COMMENT {
- - comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink))
- + if ctx.IsSigned {
- + // Update issue-user.
- + if err = issue.ReadBy(ctx.User.Id); err != nil {
- + ctx.Handle(500, "ReadBy", err)
- + return
- }
- }
-
- diff --cc routers/repo/setting.go
- index d08c563,c5772dc..0000000
- --- a/routers/repo/setting.go
- +++ b/routers/repo/setting.go
- @@@ -210,137 -241,64 +241,93 @@@ func SettingsPost(ctx *context.Context
- }
- }
-
- - ctx.Flash.Success(ctx.Tr("repo.settings.add_collaborator_success"))
- - ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
- - return
- - }
- + if err := models.DeleteRepository(ctx.Repo.Owner.Id, repo.ID); err != nil {
- + ctx.Handle(500, "DeleteRepository", err)
- + return
- + }
- + log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)
-
- - // Delete collaborator.
- - remove := strings.ToLower(ctx.Query("remove"))
- - if len(remove) > 0 && remove != ctx.Repo.Owner.LowerName {
- - u, err := models.GetUserByName(remove)
- - if err != nil {
- - ctx.Handle(500, "GetUserByName", err)
- + ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
- + ctx.Redirect(ctx.Repo.Owner.DashboardLink())
- +
- + case "delete-wiki":
- + if !ctx.Repo.IsOwner() {
- + ctx.Error(404)
- return
- }
- - if err := ctx.Repo.Repository.DeleteCollaborator(u); err != nil {
- - ctx.Handle(500, "DeleteCollaborator", err)
- + if repo.Name != form.RepoName {
- + ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
- return
- }
- - ctx.Flash.Success(ctx.Tr("repo.settings.remove_collaborator_success"))
- - ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
- - return
- - }
- -
- - users, err := ctx.Repo.Repository.GetCollaborators()
- - if err != nil {
- - ctx.Handle(500, "GetCollaborators", err)
- - return
- - }
-
- - ctx.Data["Collaborators"] = users
- - ctx.HTML(200, COLLABORATION)
- - }
- + if ctx.Repo.Owner.IsOrganization() {
- + if !ctx.Repo.Owner.IsOwnedBy(ctx.User.Id) {
- + ctx.Error(404)
- + return
- + }
- + }
-
- - func Webhooks(ctx *middleware.Context) {
- - ctx.Data["Title"] = ctx.Tr("repo.settings")
- - ctx.Data["PageIsSettingsHooks"] = true
- + repo.DeleteWiki()
- + log.Trace("Repository wiki deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)
-
- - // Delete web hook.
- - remove := com.StrTo(ctx.Query("remove")).MustInt64()
- - if remove > 0 {
- - if err := models.DeleteWebhook(remove); err != nil {
- - ctx.Handle(500, "DeleteWebhook", err)
- + repo.EnableWiki = false
- + if err := models.UpdateRepository(repo, false); err != nil {
- + ctx.Handle(500, "UpdateRepository", err)
- return
- }
- - ctx.Flash.Success(ctx.Tr("repo.settings.remove_hook_success"))
- - ctx.Redirect(ctx.Repo.RepoLink + "/settings/hooks")
- - return
- - }
-
- - ws, err := models.GetWebhooksByRepoId(ctx.Repo.Repository.Id)
- - if err != nil {
- - ctx.Handle(500, "GetWebhooksByRepoId", err)
- - return
- + ctx.Flash.Success(ctx.Tr("repo.settings.wiki_deletion_success"))
- + ctx.Redirect(ctx.Repo.RepoLink + "/settings")
- }
- ++<<<<<<< HEAD
- +
- + ctx.Data["Webhooks"] = ws
- + ctx.HTML(200, HOOKS)
- +}
- +
- ++=======
- + }
- ++>>>>>>> upstream/master
-
- - func WebHooksNew(ctx *middleware.Context) {
- + func Collaboration(ctx *context.Context) {
- ctx.Data["Title"] = ctx.Tr("repo.settings")
- ++<<<<<<< HEAD
- + ctx.Data["PageIsSettingsHooks"] = true
- + ctx.Data["PageIsSettingsHooksNew"] = true
- + ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
- + ctx.Data["HookType"] = "Gogs"
- + orCtx, err := getOrgRepoCtx(ctx)
- + if err != nil {
- + ctx.Handle(500, "WebHooksNew(getOrgRepoCtx)", err)
- + return
- + }
- +
- + ctx.HTML(200, orCtx.NewTemplate)
- +}
- +
- +func WebHooksNewPost(ctx *middleware.Context, form auth.NewWebhookForm) {
- + ctx.Data["Title"] = ctx.Tr("repo.settings")
- + ctx.Data["PageIsSettingsHooks"] = true
- + ctx.Data["PageIsSettingsHooksNew"] = true
- + ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
- ++=======
- + ctx.Data["PageIsSettingsCollaboration"] = true
- ++>>>>>>> upstream/master
-
- - orCtx, err := getOrgRepoCtx(ctx)
- + users, err := ctx.Repo.Repository.GetCollaborators()
- if err != nil {
- - ctx.Handle(500, "WebHooksNewPost(getOrgRepoCtx)", err)
- - return
- - }
- -
- - if ctx.HasError() {
- - ctx.HTML(200, orCtx.NewTemplate)
- - return
- - }
- -
- - // FIXME: code too old here, sync with APIs
- - ct := models.JSON
- - if form.ContentType == "2" {
- - ct = models.FORM
- - }
- -
- - w := &models.Webhook{
- - RepoId: orCtx.RepoId,
- - Url: form.PayloadUrl,
- - ContentType: ct,
- - Secret: form.Secret,
- - HookEvent: &models.HookEvent{
- - PushOnly: form.PushOnly,
- - },
- - IsActive: form.Active,
- - HookTaskType: models.GOGS,
- - Meta: "",
- - OrgId: orCtx.OrgId,
- - }
- -
- - if err := w.UpdateEvent(); err != nil {
- - ctx.Handle(500, "UpdateEvent", err)
- - return
- - } else if err := models.CreateWebhook(w); err != nil {
- - ctx.Handle(500, "CreateWebhook", err)
- + ctx.Handle(500, "GetCollaborators", err)
- return
- }
- + ctx.Data["Collaborators"] = users
-
- - ctx.Flash.Success(ctx.Tr("repo.settings.add_hook_success"))
- - ctx.Redirect(orCtx.Link + "/settings/hooks")
- + ctx.HTML(200, COLLABORATION)
- }
-
- - func WebHooksEdit(ctx *middleware.Context) {
- - ctx.Data["Title"] = ctx.Tr("repo.settings")
- - ctx.Data["PageIsSettingsHooks"] = true
- - ctx.Data["PageIsSettingsHooksEdit"] = true
- -
- - hookId := com.StrTo(ctx.Params(":id")).MustInt64()
- - if hookId == 0 {
- - ctx.Handle(404, "setting.WebHooksEdit", nil)
- + func CollaborationPost(ctx *context.Context) {
- + name := strings.ToLower(ctx.Query("collaborator"))
- + if len(name) == 0 || ctx.Repo.Owner.LowerName == name {
- + ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
- return
- }
-
- diff --cc routers/user/auth.go
- index f5fcc85,df79ecb..0000000
- --- a/routers/user/auth.go
- +++ b/routers/user/auth.go
- @@@ -5,9 -5,11 +5,14 @@@
- package user
-
- import (
- + "fmt"
- "net/url"
- - "strings"
-
- ++<<<<<<< HEAD
- ++=======
- + "github.com/go-macaron/captcha"
- +
- ++>>>>>>> upstream/master
- "github.com/gogits/gogs/models"
- "github.com/gogits/gogs/modules/auth"
- "github.com/gogits/gogs/modules/base"
- @@@ -185,14 -155,11 +158,15 @@@ func SignUp(ctx *context.Context)
- ctx.HTML(200, SIGNUP)
- }
-
- ++<<<<<<< HEAD
- +func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) {
- ++=======
- + func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterForm) {
- ++>>>>>>> upstream/master
- ctx.Data["Title"] = ctx.Tr("sign_up")
-
- + ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha
- +
- if setting.Service.DisableRegistration {
- ctx.Error(403)
- return
- @@@ -224,11 -170,12 +177,15 @@@
- return
- }
-
- - if ctx.HasError() {
- - ctx.HTML(200, SIGNUP)
- ++<<<<<<< HEAD
- ++=======
- + if setting.Service.EnableCaptcha && !cpt.VerifyReq(ctx.Req) {
- + ctx.Data["Err_Captcha"] = true
- + ctx.RenderWithErr(ctx.Tr("form.captcha_incorrect"), SIGNUP, &form)
- return
- }
-
- ++>>>>>>> upstream/master
- if form.Password != form.Retype {
- ctx.Data["Err_Password"] = true
- ctx.RenderWithErr(ctx.Tr("form.password_not_match"), SIGNUP, &form)
- diff --cc templates/.VERSION
- index eb5fd1e,545d782..0000000
- --- a/templates/.VERSION
- +++ b/templates/.VERSION
- @@@ -1,1 -1,1 +1,5 @@@
- -0.9.48.0722
- ++<<<<<<< HEAD
- +0.6.1.0325 Beta
- ++=======
- ++0.9.48.0722
- ++>>>>>>> upstream/master
- diff --cc templates/base/footer.tmpl
- index 9242295,677d908..0000000
- --- a/templates/base/footer.tmpl
- +++ b/templates/base/footer.tmpl
- @@@ -1,13 -1,54 +1,69 @@@
- ++<<<<<<< HEAD
- +<div class="wrapper-push"></div>
- +</div>
- +<footer id="footer">
- + <div class="container footer-wrap">
- + <div class="row">
- + <div class="col-md-6">
- + <p class="left"><a href="/about">About us</a></p>
- + </div>
- + </div>
- + </div>
- +</footer>
- +</body>
- ++=======
- + {{/*
- + <html>
- + <body>
- + <div>
- + */}}
- + </div>
- + <footer>
- + <div class="ui container">
- + <div class="ui left">
- + © 2016 Gogs {{if (or .ShowFooterVersion .PageIsAdmin)}}{{.i18n.Tr "version"}}: {{AppVer}}{{end}} {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong>
- + </div>
- + <div class="ui right links">
- + {{if .ShowFooterBranding}}
- + <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a>
- + <a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i><span class="sr-only">Twitter</span></a>
- + <a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i><span class="sr-only">Sina Weibo</span></a>
- + {{end}}
- + <div class="ui language bottom floating slide up dropdown link item">
- + <i class="world icon"></i>
- + <div class="text">{{.LangName}}</div>
- + <div class="menu">
- + {{range .AllLangs}}
- + <a class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>
- + {{end}}
- + </div>
- + </div>
- + <a target="_blank" href="http://gogs.io">{{.i18n.Tr "website"}}</a>
- + {{if (or .ShowFooterVersion .PageIsAdmin)}}<span class="version">{{GoVer}}</span>{{end}}
- + </div>
- + </div>
- + </footer>
- + </body>
- +
- + <!-- Third-party libraries -->
- + {{if .RequireHighlightJS}}
- + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/highlight-9.2.0/github.css">
- + <script src="{{AppSubUrl}}/plugins/highlight-9.2.0/highlight.pack.js"></script>
- + {{end}}
- + {{if .RequireMinicolors}}
- + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">
- + <script src="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js"></script>
- + {{end}}
- + {{if .RequireDatetimepicker}}
- + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css">
- + <script src="{{AppSubUrl}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js"></script>
- + {{end}}
- + {{if .RequireDropzone}}
- + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.css">
- + <script src="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.js"></script>
- + {{end}}
- + <script src="{{AppSubUrl}}/js/libs/emojify-1.1.0.min.js"></script>
- + <script src="{{AppSubUrl}}/js/libs/clipboard-1.5.9.min.js"></script>
- +
- ++>>>>>>> upstream/master
- </html>
- diff --cc templates/base/head.tmpl
- index 99f9c7a,1fb91e9..0000000
- --- a/templates/base/head.tmpl
- +++ b/templates/base/head.tmpl
- @@@ -13,18 -16,27 +16,32 @@@
-
- <link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
-
- ++<<<<<<< HEAD
- + <script src="{{AppSubUrl}}/js/jquery-1.11.2.min.js"></script>
- + <link rel="stylesheet" href="{{AppSubUrl}}/css/font-awesome.min.css">
- ++=======
- + <script src="{{AppSubUrl}}/js/jquery-1.11.3.min.js"></script>
- + <script src="{{AppSubUrl}}/js/jquery.are-you-sure.js"></script>
- + <link rel="stylesheet" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css">
- + <link rel="stylesheet" href="{{AppSubUrl}}/assets/octicons-4.3.0/octicons.min.css">
- +
- + {{if .RequireSimpleMDE}}
- + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.css">
- + <script src="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.js"></script>
- + {{end}}
- ++>>>>>>> upstream/master
-
- <!-- Stylesheet -->
- - <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic.min.css">
- - <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.min.css">
- + <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic-2.2.1.min.css">
- + <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{MD5 AppVer}}">
-
- <!-- JavaScript -->
- - <script src="{{AppSubUrl}}/js/semantic.min.js"></script>
- - <script src="{{AppSubUrl}}/js/gogs.js"></script>
- + <script src="{{AppSubUrl}}/js/semantic-2.2.1.min.js"></script>
- + <script src="{{AppSubUrl}}/js/gogs.js?v={{MD5 AppVer}}"></script>
-
- <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
- +
- + <meta name="theme-color" content="{{ThemeColorMetaTag}}">
- </head>
- <body>
- <div class="full height">
- diff --cc templates/home.tmpl
- index f485da4,5bbc8d2..0000000
- --- a/templates/home.tmpl
- +++ b/templates/home.tmpl
- @@@ -1,38 -1,280 +1,321 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div id="promo-wrapper">
- + <div class="container clear">
- + <div id="promo-logo" class="left">
- + <img src="{{AppSubUrl}}/img/notabug-lg.png" alt="logo" />
- + </div>
- + <div id="promo-content">
- + <h1>NotABug.org</h1>
- + <h2>Free code hosting</h2>
- + <form id="promo-form" action="{{AppSubUrl}}/user/login" method="post">
- + {{.CsrfTokenHtml}}
- + <input class="ipt ipt-large" id="username" name="uname" type="text" placeholder="{{.i18n.Tr "home.uname_holder"}}"/>
- + <input class="ipt ipt-large" name="password" type="password" placeholder="{{.i18n.Tr "home.password_holder"}}"/>
- + <input name="from" type="hidden" value="home">
- + <button class="btn btn-black btn-large">{{.i18n.Tr "sign_in"}}</button>
- + {{if .ShowRegistrationButton}}
- + <button class="btn btn-green btn-large" id="register-button">{{.i18n.Tr "register"}}</button>
- + {{end}}
- + </form>
- + </div>
- + </div>
- +</div>
- +<div id="feature-wrapper">
- + <div class="container clear">
- + <div class="grid-1-2 left">
- + <img src="{{AppSubUrl}}/img/hack.png" alt="peers-logo" width="52px" />
- + <b>Peers</b>
- + <p>NotABug.org is a <a href="http://peers.community">Peers Community</a> project</p>
- + </div>
- + <div class="grid-1-2 left">
- + <img src="{{AppSubUrl}}/img/gogs-lg.png" alt="gogs-logo" width="52px" />
- + <b>Powered by gogs</b>
- + <p>NotABug.org is powered by a <a href="{{AppSubUrl}}/hp/gogs/">locally modified</a> version of <a href="http://gogs.io">gogs</a></p>
- + </div>
- + </div>
- +</div>
- +{{template "ng/base/footer" .}}
- ++=======
- + {{template "base/head" .}}
- + <div class="home">
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="sixteen wide center aligned centered column">
- + <div>
- + <img class="logo" src="{{AppSubUrl}}/img/gogs-lg.png" />
- + </div>
- + <div class="hero">
- + <h1 class="ui icon header title">
- + Gogs - Go Git Service
- + </h1>
- + <h2>{{.i18n.Tr "app_desc"}}</h2>
- + </div>
- + </div>
- + </div>
- + {{if eq .Lang "de-DE"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Einfach zu installieren
- + </h1>
- + <p class="large">
- + Starte einfach <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">die Anwendung</a> für deine Plattform. Gogs gibt es auch für <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a>, <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a> oder als <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">Installationspaket</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Plattformübergreifend
- + </h1>
- + <p class="large">
- + Gogs läuft überall. <a target="_blank" href="http://golang.org/">Go</a> kompiliert für: Windows, Mac OS X, Linux, ARM, etc. Wähle dasjenige System, was dir am meisten gefällt!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Leichtgewicht
- + </h1>
- + <p class="large">
- + Gogs hat minimale Systemanforderungen und kann selbst auf einem günstigen und stromsparenden Raspberry Pi betrieben werden.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Quelloffen
- + </h1>
- + <p class="large">
- + Der komplette Code befindet sich auf <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Unterstütze uns bei der Verbesserung dieses Projekts. Trau dich!
- + </p>
- + </div>
- + </div>
- + {{else if eq .Lang "zh-CN"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> 易安装
- + </h1>
- + <p class="large">
- + 您除了可以根据操作系统平台通过 <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">二进制运行</a>,还可以通过 <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> 或 <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>,以及 <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">包管理</a> 安装。
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> 跨平台
- + </h1>
- + <p class="large">
- + 任何 <a target="_blank" href="http://golang.org/">Go 语言</a> 支持的平台都可以运行 Gogs,包括 Windows、Mac、Linux 以及 ARM。挑一个您喜欢的就行!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> 轻量级
- + </h1>
- + <p class="large">
- + 一个廉价的树莓派的配置足以满足 Gogs 的最低系统硬件要求。最大程度上节省您的服务器资源!
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> 开源化
- + </h1>
- + <p class="large">
- + 所有的代码都开源在 <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a> 上,赶快加入我们来共同发展这个伟大的项目!还等什么?成为贡献者吧!
- + </p>
- + </div>
- + </div>
- + {{else if eq .Lang "fr-FR"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Facile à installer
- + </h1>
- + <p class="large">
- + Il suffit de <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">lancer l'exécutable</a> correspondant à votre système.
- + Ou d'utiliser Gogs avec <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> ou
- + <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>
- + ou en l'installant depuis un <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">package</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Multi-plateforme
- + </h1>
- + <p class="large">
- + Gogs tourne partout où <a target="_blank" href="http://golang.org/">Go</a> peut être compilé : Windows, Mac OS X, Linux, ARM, etc. Choisissez votre préféré !
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Léger
- + </h1>
- + <p class="large">
- + Gogs utilise peu de ressources. Il peut même tourner sur un Raspberry Pi très bon marché. Économisez l'énergie de vos serveurs !
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Open Source
- + </h1>
- + <p class="large">
- + Toutes les sources sont sur <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a> ! Rejoignez-nous et contribuez à rendre ce projet encore meilleur.
- + </p>
- + </div>
- + </div>
- + {{else if eq .Lang "es-ES"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Fácil de instalar
- + </h1>
- + <p class="large">
- + Simplemente <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">arranca el binario</a> para tu plataforma. O usa Gogs con <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> o <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>, o utilice el <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">paquete</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Multiplatforma
- + </h1>
- + <p class="large">
- + Gogs funciona en cualquier parte, <a target="_blank" href="http://golang.org/">Go</a> puede compilarse en: Windows, Mac OS X, Linux, ARM, etc. !Elige tu favorita!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Ligero
- + </h1>
- + <p class="large">
- + Gogs tiene pocos requisitos y puede funcionar en una Raspberry Pi barata. !Ahorra energía!
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Open Source
- + </h1>
- + <p class="large">
- + ¡Está todo en <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Uniros contribuyendo a hacer este proyecto todavía mejor. ¡No seas tímido y colabora!
- + </p>
- + </div>
- + </div>
- + {{else if eq .Lang "pt-BR"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Fácil de instalar
- + </h1>
- + <p class="large">
- + Simplesmente <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">rode o executável</a> para o seu sistema operacional. Ou obtenha o Gogs com o <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> ou <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>, ou baixe o <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">pacote</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Multi-plataforma
- + </h1>
- + <p class="large">
- + Gogs roda em qualquer sistema operacional em que <a target="_blank" href="http://golang.org/">Go</a> consegue compilar: Windows, Mac OS X, Linux, ARM, etc. Escolha qual você gosta mais!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Leve e rápido
- + </h1>
- + <p class="large">
- + Gogs utiliza poucos recursos e consegue mesmo rodar no barato Raspberry Pi. Economize energia elétrica da sua máquina!
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Código aberto
- + </h1>
- + <p class="large">
- + Está tudo no <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Contribua e torne este projeto ainda melhor. Não tenha vergonha de contribuir!
- + </p>
- + </div>
- + </div>
- + {{else if eq .Lang "ru-RU"}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Простой в установке
- + </h1>
- + <p class="large">
- + Просто <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">запустите исполняемый файл</a> для вашей платформы. Изпользуйте Gogs с <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> или <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>, или загрузите <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">пакет</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Кроссплатформенный
- + </h1>
- + <p class="large">
- + Gogs работает на любой операционной системе, которая может компилировать <a target="_blank" href="http://golang.org/">Go</a>: Windows, Mac OS X, Linux, ARM и т. д. Выбирайте, что вам больше нравится!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Легковесный
- + </h1>
- + <p class="large">
- + Gogs имеет низкие системные требования и может работать на недорогом Raspberry Pi. Экономьте энергию вашей машины!
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Открытый исходный код
- + </h1>
- + <p class="large">
- + Всё это на <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Присоединяйтесь к нам, внося вклад, чтобы сделать этот проект еще лучше. Не бойтесь помогать!
- + </p>
- + </div>
- + </div>
- + {{else}}
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-flame"></i> Easy to install
- + </h1>
- + <p class="large">
- + Simply <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">run the binary</a> for your platform. Or ship Gogs with <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> or <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>, or get it <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">packaged</a>.
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-device-desktop"></i> Cross-platform
- + </h1>
- + <p class="large">
- + Gogs runs anywhere <a target="_blank" href="http://golang.org/">Go</a> can compile for: Windows, Mac OS X, Linux, ARM, etc. Choose the one you love!
- + </p>
- + </div>
- + </div>
- + <div class="ui stackable middle very relaxed page grid">
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-rocket"></i> Lightweight
- + </h1>
- + <p class="large">
- + Gogs has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!
- + </p>
- + </div>
- + <div class="eight wide center column">
- + <h1 class="hero ui icon header">
- + <i class="octicon octicon-code"></i> Open Source
- + </h1>
- + <p class="large">
- + It's all on <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Join us by contributing to make this project even better. Don't be shy to be a contributor!
- + </p>
- + </div>
- + </div>
- + {{end}}
- + </div>
- + {{template "base/footer" .}}
- ++>>>>>>> upstream/master
- diff --cc templates/repo/issue/list.tmpl
- index b165afa,ce8fd64..0000000
- --- a/templates/repo/issue/list.tmpl
- +++ b/templates/repo/issue/list.tmpl
- @@@ -1,120 -1,155 +1,255 @@@
- ++<<<<<<< HEAD
- +{{template "base/head_old" .}}
- +{{template "base/navbar" .}}
- +{{template "repo/nav" .}}
- +{{template "repo/toolbar" .}}
- +<div id="body" class="container">
- + <div id="issue">
- + <div class="col-md-3 filters">
- + <div class="filter-list">
- + <ul class="list-unstyled">
- + <li><a href="{{.RepoLink}}/issues?state={{.State}}"{{if eq .ViewType "all"}} class="active"{{end}}>All Issues <strong class="pull-right">{{.IssueStats.AllCount}}</strong></a></li>
- + <li><a href="{{.RepoLink}}/issues?type=assigned&state={{.State}}"{{if eq .ViewType "assigned"}} class="active"{{end}}>Assigned to you <strong class="pull-right">{{.IssueStats.AssignCount}}</strong></a></li>
- + <li><a href="{{.RepoLink}}/issues?type=created_by&state={{.State}}"{{if eq .ViewType "created_by"}} class="active"{{end}}>Created by you <strong class="pull-right">{{.IssueStats.CreateCount}}</strong></a></li>
- + <li><a href="{{.RepoLink}}/issues?type=mentioned&state={{.State}}"{{if eq .ViewType "mentioned"}} class="active"{{end}}>Mentioning you <strong class="pull-right">{{.IssueStats.MentionCount}}</strong></a></li>
- + </ul>
- + </div>
- + <div class="label-filter">
- + <h4>Label</h4>
- + <ul class="list-unstyled" id="label-list" data-ajax="{{$.RepoLink}}/issues/labels/delete">
- + {{range .Labels}}
- + <li class="label-item{{if eq $.SelectLabels .Id}} label-selected{{end}}" id="label-{{.Id}}" data-id="{{.Id}}">
- + <a href="?type={{$.ViewType}}&state={{$.State}}{{if not (eq $.SelectLabels .Id)}}&labels={{.Id}}{{end}}">
- + <span class="pull-right count">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</span>
- + <span class="color" style="background-color: {{.Color}}" data-color="{{.Color}}"></span>
- + <span class="name">{{.Name}}</span>
- + </a>
- + <a class="del pull-right" href="#" data-id="{{.Id}}"><i class="fa fa-times-circle-o"></i></a>
- + </li>
- + {{end}}
- + {{if or .IsRepositoryOwner .IsAdmin}}
- + <li class="label-change-li" style="display: none">
- + <form id="label-change-form" action="{{$.RepoLink}}/issues/labels/edit" method="post">
- + {{.CsrfTokenHtml}}
- + <div class="input-group label-change-color-picker form-group" style="margin-bottom: 2px">
- + <input type="text" class="form-control" name="title" required="required" id="label-name-change-ipt"/>
- + <input type="hidden" name="color" id="label-color-change-ipt" value="#444444"/>
- + <span class="input-group-addon"><i></i></span>
- + <input type="hidden" name="id" id="label-change-id-ipt" value="0"/>
- + </div>
- + <div class="form-group text-right">
- + <input class="form-control input-sm" type="text" id="label-color-change-ipt2" value="#444444"/>
- + <button class="btn btn-default btn-sm">Save</button>
- + </div>
- + </form>
- + </li>
- + {{end}}
- + </ul>
- + {{if or .IsRepositoryOwner .IsAdmin}}
- + <button class="btn btn-default btn-block label-button" id="label-manage-btn">Manage Labels</button>
- + <hr/>
- + <form id="label-add-form" action="{{$.RepoLink}}/issues/labels/new" method="post">
- + {{.CsrfTokenHtml}}
- + <h5><strong>New Label</strong></h5>
- + <div class="input-group label-color-picker form-group">
- + <input type="text" class="form-control" name="title" required="required" id="label-name-ipt"/>
- + <input type="hidden" name="color" id="label-color-ipt" value="#444444"/>
- + <span class="input-group-addon"><i></i></span>
- + </div>
- + <div class="form-group text-right">
- + <input class="form-control input-sm" type="text" id="label-color-ipt2" value="#444444"/>
- + <button class="btn btn-default btn-sm">Create</button>
- + </div>
- + </form>
- + {{end}}
- + </div>
- + </div>
- + <div class="col-md-9">
- + {{template "base/alert" .}}
- + <div class="filter-option">
- + <div class="btn-group">
- + <a class="btn btn-default issue-open{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}">{{.IssueStats.OpenCount}} Open</a>
- + <a class="btn btn-default issue-close{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}&state=closed">{{.IssueStats.ClosedCount}} Closed</a>
- + </div>
- + </div>
- + <div class="issues list-group">
- + {{range .Issues}}{{if .Poster}}
- + <div class="list-group-item issue-item{{if not .IsRead}} unread{{end}}" id="issue-{{.Id}}">
- + <span class="number pull-right">#{{.Index}}</span>
- + <h5 class="title">
- + <a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a>
- + <span class="labels">
- + {{range .Labels}}
- + <span class="label" style="background-color: {{.Color}}">{{.Name}}</span>
- + {{end}}
- + </span>
- + </h5>
- + <p class="info">
- + <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/>
- + <a href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a></span>
- + <span class="time">{{TimeSince .Created $.Lang}}</span>
- + <span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span>
- + </p>
- + </div>
- + {{end}}{{end}}
- + </div>
- + </div>
- + </div>
- + </div>
- ++=======
- + {{template "base/head" .}}
- + <div class="repository">
- + {{template "repo/header" .}}
- + <div class="ui container">
- + <div class="navbar">
- + {{template "repo/issue/navbar" .}}
- + <div class="ui right">
- + {{if .PageIsIssueList}}
- + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
- + {{else}}
- + <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.Repository.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">{{.i18n.Tr "repo.pulls.new"}}</a>
- + {{end}}
- + </div>
- + </div>
- + <div class="ui divider"></div>
- + <div class="ui tiny basic status buttons">
- + <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
- + <i class="octicon octicon-issue-opened"></i>
- + {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
- + </a>
- + <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
- + <i class="octicon octicon-issue-closed"></i>
- + {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
- + </a>
- + </div>
- + <div class="ui right floated secondary filter menu">
- + <!-- Label -->
- + <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
- + <span class="text">
- + {{.i18n.Tr "repo.issues.filter_label"}}
- + <i class="dropdown icon"></i>
- + </span>
- + <div class="menu">
- + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
- + {{range .Labels}}
- + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
- + {{end}}
- + </div>
- + </div>
- +
- + <!-- Milestone -->
- + <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
- + <span class="text">
- + {{.i18n.Tr "repo.issues.filter_milestone"}}
- + <i class="dropdown icon"></i>
- + </span>
- + <div class="menu">
- + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
- + {{range .Milestones}}
- + <a class="{{if eq $.MilestoneID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a>
- + {{end}}
- + </div>
- + </div>
- +
- + <!-- Assignee -->
- + <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
- + <span class="text">
- + {{.i18n.Tr "repo.issues.filter_assignee"}}
- + <i class="dropdown icon"></i>
- + </span>
- + <div class="menu">
- + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
- + {{range .Assignees}}
- + <a class="{{if eq $.AssigneeID .Id}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.Id}}"><img src="{{.AvatarLink}}"> {{.Name}}</a>
- + {{end}}
- + </div>
- + </div>
- +
- + <!-- Type -->
- + <div class="ui dropdown type jump item">
- + <span class="text">
- + {{.i18n.Tr "repo.issues.filter_type"}}
- + <i class="dropdown icon"></i>
- + </span>
- + <div class="menu">
- + <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a>
- + <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
- + <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a>
- + <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a>
- + </div>
- + </div>
- +
- + <!-- Sort -->
- + <div class="ui dropdown type jump item">
- + <span class="text">
- + {{.i18n.Tr "repo.issues.filter_sort"}}
- + <i class="dropdown icon"></i>
- + </span>
- + <div class="menu">
- + <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
- + <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
- + <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
- + <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
- + <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
- + <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
- + </div>
- + </div>
- + </div>
- +
- + <div class="issue list">
- + {{range .Issues}}
- + {{ $timeStr:= TimeSince .Created $.Lang }}
- + <li class="item">
- + <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
- + <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Name}}</a>
- +
- + {{range .Labels}}
- + <a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name}}</a>
- + {{end}}
- +
- + {{if .NumComments}}
- + <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
- + {{end}}
- +
- + <p class="desc">
- + {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
- + {{if .Milestone}}
- + <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
- + <span class="octicon octicon-milestone"></span> {{.Milestone.Name}}
- + </a>
- + {{end}}
- + {{if .Assignee}}
- + <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
- + <img class="ui avatar image" src="{{.Assignee.AvatarLink}}">
- + </a>
- + {{end}}
- + </p>
- + </li>
- + {{end}}
- +
- + {{with .Page}}
- + {{if gt .TotalPages 1}}
- + <div class="center page buttons">
- + <div class="ui borderless pagination menu">
- + <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
- + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
- + </a>
- + {{range .Pages}}
- + {{if eq .Num -1}}
- + <a class="disabled item">...</a>
- + {{else}}
- + <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
- + {{end}}
- + {{end}}
- + <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
- + {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
- + </a>
- + </div>
- + </div>
- + {{end}}
- + {{end}}
- + </div>
- + </div>
- ++>>>>>>> upstream/master
- </div>
- - <script src="/js/bootstrap-colorpicker.min.js"></script>
- - <script>
- - $(function(){
- - $('.label-color-picker').colorpicker({
- - input: $('#label-color-ipt')
- - }).on('changeColor', function (ev) {
- - var $ipt = $('#label-color-ipt2');
- - if ($ipt.val().length != 4) {
- - $ipt.val(ev.color.toHex());
- - }
- - });
- - $('.label-change-color-picker').colorpicker({
- - input:$('#label-color-change-ipt')
- - }).on('changeColor', function (ev) {
- - var $ipt = $('#label-color-change-ipt2');
- - if ($ipt.val().length != 4) {
- - $ipt.val(ev.color.toHex());
- - }
- - });
- - });
- - </script>
- - {{template "base/footer_old" .}}
- + {{template "base/footer" .}}
- diff --cc templates/repo/issue/view.tmpl
- index 4ece2ab,2260f17..0000000
- --- a/templates/repo/issue/view.tmpl
- +++ b/templates/repo/issue/view.tmpl
- @@@ -1,282 -1,29 +1,312 @@@
- ++<<<<<<< HEAD
- +{{template "base/head_old" .}}
- +{{template "base/navbar" .}}
- +{{template "repo/nav" .}}
- +{{template "repo/toolbar" .}}
- +<div id="body" class="container">
- + <div id="issue" data-id="{{.Issue.Id}}">
- + <div id="issue-{{.Issue.Id}}" class="issue-whole issue-is-opening">
- + <div class="issue-wrap col-md-10">
- + <div class="issue-head clearfix">
- + <div class="number pull-right">#{{.Issue.Index}}</div>
- + <a class="author pull-left" href="{{AppSubUrl}}/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a>
- + <h1 class="title pull-left">{{.Issue.Name}}</h1>
- + <input id="issue-edit-title" class="form-control input-lg pull-left hidden" type="text" value="{{.Issue.Name}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="title"/>
- + <input type="hidden" value="{{.Issue.Id}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/>
- + <p class="info pull-left">
- + {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a>
- + <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a>
- + <a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}}
- + <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span>
- + <a href="{{AppSubUrl}}/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue
- + <span class="time">{{TimeSince .Issue.Created $.Lang}}</span> · {{.Issue.NumComments}} comments
- + </p>
- + </div>
- + <div class="issue-main">
- + <div class="panel panel-default issue-content">
- + <div class="panel-body">
- + <div class="content markdown">
- + {{Str2html .Issue.RenderedContent}}
- + </div>
- + <div class="issue-edit-content hidden">
- + <div class="form-group">
- + <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
- + </div>
- + <ul class="nav nav-tabs" data-init="tabs">
- + <li class="issue-write active"><a href="#issue-edit-textarea" data-toggle="tab">Write</a></li>
- + <li class="issue-preview"><a href="#issue-edit-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-edit-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-edit-preview">Preview</a></li>
- + </ul>
- + <div class="tab-content">
- + <div class="tab-pane active" id="issue-edit-textarea">
- + <div class="form-group">
- + <input type="hidden" value="1" name="issueIndex">
- + <textarea class="form-control" name="content" id="issue-edit-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-edit-preview" data-ajax-val="val" data-ajax-field="text">{{.Issue.Content}}</textarea>
- + </div>
- + </div>
- + <div class="tab-pane issue-preview-content" id="issue-edit-preview">Loading...</div>
- + </div>
- + </div>
- + </div>
- + </div>
- + {{with $attachments := .Issue.Attachments}}
- + {{if $attachments}}
- + <div class="attachments">
- + <span class="attachment-label label label-info">Attachments:</span>
- +
- + {{range $attachments}}
- + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
- + {{end}}
- + </div>
- + {{end}}
- + {{end}}
- + </div>
- + {{range .Comments}}
- + {{/* 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE, 4 = COMMIT, 5 = PULL */}}
- + {{if eq .Type 0}}
- + <div class="issue-child" id="issue-comment-{{.Id}}">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
- + <div class="issue-content panel panel-default">
- + <div class="panel-heading">
- + <a href="{{AppSubUrl}}/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created $.Lang}}</span>
- + <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a>
- + <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> -->
- + <!-- <span class="role label label-default pull-right">Owner</span> -->
- + </div>
- + <div class="panel-body markdown">
- + {{if len .Content}}
- + {{Str2html .Content}}
- + {{else}}
- + <i>No comment entered</i>
- + {{end}}
- + </div>
- + {{with $attachments := .Attachments}}
- + {{if $attachments}}
- + <div class="attachments">
- + <span class="attachment-label label label-info">Attachments:</span>
- +
- + {{range $attachments}}
- + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
- + {{end}}
- + </div>
- + {{end}}
- + {{end}}
- + </div>
- + </div>
- + {{else if eq .Type 1}}
- + <div class="issue-child issue-opened">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a>
- + <div class="issue-content">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
- + </div>
- + </div>
- + {{else if eq .Type 2}}
- + <div class="issue-child issue-closed">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
- + <div class="issue-content">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
- + </div>
- + </div>
- + {{else if eq .Type 4}}
- + <div class="issue-child issue-reference issue-reference-commit">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
- + <div class="issue-content">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-primary">Referenced</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
- + <p>
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
- + {{.ContentHtml}}
- + </p>
- + </div>
- + </div>
- + {{end}}
- + {{end}}
- + <hr class="issue-line"/>
- + {{if .SignedUser}}<div class="issue-child issue-reply">
- + <a class="user pull-left" href="{{AppSubUrl}}/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a>
- + <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post" enctype="multipart/form-data">
- + {{.CsrfTokenHtml}}
- + <div class="panel-body">
- + <div class="form-group">
- + <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
- + </div>
- + <ul class="nav nav-tabs" data-init="tabs">
- + <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
- + <li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
- + </ul>
- + <div class="tab-content">
- + <div class="tab-pane" id="issue-textarea">
- + <div class="form-group">
- + <div id="submit-error" class="text-danger"></div>
- + <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/>
- + <textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
- + </div>
- + </div>
- + <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div>
- + </div>
- + </div>
- + {{if .AttachmentsEnabled}}
- + <div id="attached">
- + <div id="attached-list">
- + <b>Attachments:</b>
- + </div>
- + </div>
- + {{end}}
- + <div class="text-right">
- + <div class="form-group">
- + {{if .AttachmentsEnabled}}
- + <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
- + <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
- + {{end}}
- + {{if .IsIssueOwner}}{{if .Issue.IsClosed}}
- + <input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}}
- + <input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}}{{end}}
- + <button class="btn-success btn" id="issue-reply-btn">Comment</button>
- + </div>
- + </div>
- + </div>
- + </form>
- + </div>{{else}}<div class="alert alert-warning"><a class="btn btn-success btn-lg" href="{{AppSubUrl}}/user/sign_up">Sign up for free</a> to join this conversation. Already have an account? <a href="{{AppSubUrl}}/user/login">Sign in to comment</a></div>{{end}}
- + </div>
- + </div>
- +
- + <div class="issue-bar col-md-2">
- + <div class="labels" data-ajax="{{.Issue.Index}}/label">
- + {{if .IsRepositoryOwner}}
- + <div class="pull-right action">
- + <button class="btn btn-default btn-sm" data-toggle="dropdown">
- + <i class="fa fa-tags"></i>
- + <span class="caret"></span>
- + </button>
- + <div class="dropdown-menu dropdown-menu-right no">
- + <ul class="list-unstyled">
- + {{range .Labels}}
- + <li class="{{if not .IsChecked}}no-{{end}}checked" data-id="{{.Id}}">
- + {{if .IsChecked}}<span class="check pull-left"><i class="fa fa-check"></i></span>{{end}}
- + <span class="color" style="background-color: {{.Color}}"></span>
- + <span class="name">{{.Name}}</span>
- + </li>
- + {{end}}
- + </ul>
- + </div>
- + </div>
- + {{end}}
- + <h4>Labels</h4>
- + {{if .Issue.Labels}}
- + {{range .Issue.Labels}}
- + <p id="label-{{.Id}}" class="label-item label-white" style="background-color: {{.Color}}"><strong>{{.Name}}</strong></p>
- + {{end}}
- + {{else}}
- + <p>None yet</p>
- + {{end}}
- + </div>
- + <div class="milestone" data-milestone="{{.Milestone.Id}}" data-ajax="{{.Issue.Index}}/milestone">
- + <div class="pull-right action">
- + {{if .IsRepositoryOwner}}
- + <button class="btn btn-default btn-sm" data-toggle="dropdown">
- + <i class="fa fa-check-square-o"></i>
- + <span class="caret"></span>
- + </button>
- + <div class="dropdown-menu dropdown-menu-right">
- + <ul class="list-unstyled">
- + <li data-id="0" class="clear-milestone milestone-item hidden"><i class="fa fa-times-circle-o"></i> Clear milestone </li>
- + <li class="milestone-list">
- + <ul class="nav nav-tabs" data-init="tabs">
- + <li class="active"><a href="#milestone-open" data-toggle="tab">Open</a></li>
- + <li><a href="#milestone-close" data-toggle="tab">Closed</a></li>
- + </ul>
- + <div class="tab-content">
- + <div class="tab-pane active" id="milestone-open">
- + {{if not .OpenMilestones}}
- + <p class="milestone-item">Nothing to show</p>
- + {{else}}
- + <ul class="list-unstyled">
- + {{range .OpenMilestones}}
- + <li class="milestone-item" data-id="{{.Id}}">
- + <p><strong>{{.Name}}</strong></p>
- + <!-- <p>due to 3 days later</p> -->
- + </li>
- + {{end}}
- + </ul>
- + {{end}}
- + </div>
- +
- + <div class="tab-pane" id="milestone-close">
- + {{if not .ClosedMilestones}}
- + <p class="milestone-item">Nothing to show</p>
- + {{else}}
- + <ul class="list-unstyled">
- + {{range .ClosedMilestones}}
- + <li class="milestone-item" data-id="{{.Id}}">
- + <p><strong>{{.Name}}</strong></p>
- + <p>Closed {{TimeSince .ClosedDate $.Lang}}</p>
- + </li>
- + {{end}}
- + </ul>
- + {{end}}
- + </div>
- + </div>
- + </li>
- + </ul>
- + </div>
- + {{end}}
- + </div>
- + <h4>Milestone</h4>
- + {{if .Milestone}}
- + <p class="completion{{if eq .Milestone.Completeness 0}} hidden{{end}}"><span style="width:{{.Milestone.Completeness}}%"> </span></p>
- + <p class="name"><strong><a href="{{$.RepoLink}}/issues?milestone={{.Milestone.Index}}{{if $.Issue.IsClosed}}&state=closed{{end}}">{{.Milestone.Name}}</a></strong></p>
- + {{else}}
- + <p class="name">No milestone</p>
- + {{end}}
- + </div>
- +
- + <div class="assignee" data-assigned="{{if .Issue.Assignee}}{{.Issue.Assignee.Id}}{{else}}0{{end}}" data-ajax="{{.Issue.Index}}/assignee">{{if .IsRepositoryOwner}}
- + <div class="pull-right action">
- + <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
- + <i class="fa fa-group"></i>
- + <span class="caret"></span>
- + </button>
- + <div class="dropdown-menu dropdown-menu-right">
- + <ul class="list-unstyled">
- + <li data-uid="0" class="clear-assignee hidden"><i class="fa fa-times-circle-o"></i> Clear assignee</li>
- + {{range .Collaborators}}
- + <li data-uid="{{.Id}}"><img src="{{.AvatarLink}}"><strong>{{.Name}}</strong></li>
- + {{end}}
- + </ul>
- + </div>
- + </div>{{end}}
- + <h4>Assignee</h4>
- + <p>{{if .Issue.Assignee}}<img src="{{.Issue.Assignee.AvatarLink}}"><strong>{{.Issue.Assignee.Name}}</strong>{{else}}No one assigned{{end}}</p>
- + </div>
- + </div>
- + </div>
- + </div>
- ++=======
- + {{template "base/head" .}}
- + <div class="repository view issue pull">
- + {{template "repo/header" .}}
- + <div class="ui container">
- + <div class="navbar">
- + {{template "repo/issue/navbar" .}}
- + <div class="ui right">
- + {{if .PageIsIssueList}}
- + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
- + {{else}}
- + <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.PullRequestCtx.HeadInfo}}">{{.i18n.Tr "repo.pulls.new"}}</a>
- + {{end}}
- + </div>
- + </div>
- + <div class="ui divider"></div>
- + {{if .Issue.IsPull}}
- + {{template "repo/issue/view_title" .}}
- + {{template "repo/pulls/tab_menu" .}}
- + <div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}">
- + {{template "repo/issue/view_content" .}}
- + </div>
- + {{else}}
- + <div>
- + {{template "repo/issue/view_content" .}}
- + </div>
- + {{end}}
- + </div>
- ++>>>>>>> upstream/master
- </div>
- - {{template "base/footer_old" .}}
- + {{template "base/footer" .}}
- diff --cc templates/repo/settings/hook_new.tmpl
- index d37e4a1,9612352..0000000
- --- a/templates/repo/settings/hook_new.tmpl
- +++ b/templates/repo/settings/hook_new.tmpl
- @@@ -1,36 -1,28 +1,64 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div id="repo-wrapper">
- + {{template "repo/header" .}}
- + <div id="setting-wrapper" class="main-wrapper">
- + <div id="repo-setting" class="container clear">
- + {{template "repo/settings/nav" .}}
- + <div class="grid-4-5 left">
- + <div class="setting-content">
- + {{template "ng/base/alert" .}}
- + <div id="setting-content">
- + <div id="repo-hooks-panel" class="panel panel-radius">
- + <div class="panel-header">
- + <strong>{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</strong>
- + </div>
- + {{template "repo/settings/hook_gogs" .}}
- + </div>
- + </div>
- + {{if .PageIsSettingsHooksEdit}}
- + <br>
- + <div id="setting-content">
- + <div id="repo-hooks-history-panel" class="panel panel-radius">
- + <div class="panel-header">
- + <strong>{{.i18n.Tr "repo.settings.recent_deliveries"}}</strong>
- + </div>
- + <ul class="panel-body setting-list">
- + <li>Coming soon!</li>
- + </ul>
- + </div>
- + </div>
- + {{end}}
- + </div>
- + </div>
- ++=======
- + {{template "base/head" .}}
- + <div class="repository settings new webhook">
- + {{template "repo/header" .}}
- + <div class="ui container">
- + <div class="ui grid">
- + {{template "repo/settings/navbar" .}}
- + <div class="twelve wide column content">
- + {{template "base/alert" .}}
- + <h4 class="ui top attached header">
- + {{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
- + <div class="ui right">
- + {{if eq .HookType "gogs"}}
- + <img class="img-13" src="{{AppSubUrl}}/img/favicon.png">
- + {{else if eq .HookType "slack"}}
- + <img class="img-13" src="{{AppSubUrl}}/img/slack.png">
- + {{end}}
- + </div>
- + </h4>
- + <div class="ui attached segment">
- + {{template "repo/settings/hook_gogs" .}}
- + {{template "repo/settings/hook_slack" .}}
- + </div>
- +
- + {{template "repo/settings/hook_history" .}}
- + </div>
- ++>>>>>>> upstream/master
- </div>
- </div>
- </div>
- diff --cc templates/status/404.tmpl
- index 78a7cdf,776f4fb..0000000
- --- a/templates/status/404.tmpl
- +++ b/templates/status/404.tmpl
- @@@ -1,10 -1,9 +1,20 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div class="container text-center">
- + <p style="margin-top: 100px"><img src="{{AppSubUrl}}/img/404.png" alt="404"/></p>
- + <hr/>
- + <br>
- + <p>Application Version: {{AppVer}}</p>
- + <p>If you think this is an error, please open an issue <a href="{{AppSubUrl}}/hp/gogs/issues/new">Here</a>.</p>
- ++=======
- + {{template "base/head" .}}
- + <div class="ui container center">
- + <p style="margin-top: 100px"><img src="{{AppSubUrl}}/img/404.png" alt="404"/></p>
- + <div class="ui divider"></div>
- + <br>
- + {{if .ShowFooterVersion}}<p>Application Version: {{AppVer}}</p>{{end}}
- + <p>If you think this is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p>
- ++>>>>>>> upstream/master
- </div>
- - {{template "ng/base/footer" .}}
- + {{template "base/footer" .}}
- diff --cc templates/user/auth/signup.tmpl
- index dbcb642,86c020d..0000000
- --- a/templates/user/auth/signup.tmpl
- +++ b/templates/user/auth/signup.tmpl
- @@@ -1,41 -1,56 +1,100 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div id="sign-wrapper">
- + <form class="form-align form panel panel-radius sign-panel sign-form container" id="sign-up-form" action="{{AppSubUrl}}/user/sign_up" method="post">
- + <div class="panel-header">
- + <h2>{{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_up"}}{{end}}</h2>
- + </div>
- + <div class="panel-content">
- + {{template "ng/base/alert" .}}
- + {{if .DisableRegistration}}
- + <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
- + {{else}}
- + <div class="field">
- + <label class="req" for="username">{{.i18n.Tr "username"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.uname}}" required/>
- + </div>
- + <div class="field">
- + <label class="req" for="email">{{.i18n.Tr "email"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.email}}" required />
- + </div>
- + <div class="field">
- + <label class="req" for="password">{{.i18n.Tr "password"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="password" name="password" type="password" value="{{.password}}" required/>
- + </div>
- + <div class="field">
- + <label class="req" for="re-type">{{.i18n.Tr "re_type"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="re-type" name="retype" type="password" required/>
- + </div>
- + <div class="field">
- + <span class="form-label"></span>
- + <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.create_new_account"}}</button>
- + </div>
- + <div class="field">
- + <span class="form-label"></span>
- + <a href="{{AppSubUrl}}/user/login">{{if .IsSocialLogin}}{{.i18n.Tr "auth.social_register_hepler_msg"}}{{else}}{{.i18n.Tr "auth.register_hepler_msg"}}{{end}}</a>
- + </div>
- + {{end}}
- + </div>
- + </form>
- +</div>
- +{{template "ng/base/footer" .}}
- ++=======
- + {{template "base/head" .}}
- + <div class="user signup">
- + <div class="ui middle very relaxed page grid">
- + <div class="column">
- + <form class="ui form" action="{{.Link}}" method="post">
- + {{.CsrfTokenHtml}}
- + <h3 class="ui top attached header">
- + {{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_up"}}{{end}}
- + </h3>
- + <div class="ui attached segment">
- + {{template "base/alert" .}}
- + {{if .DisableRegistration}}
- + <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
- + {{else}}
- + <div class="required inline field {{if .Err_UserName}}error{{end}}">
- + <label for="user_name">{{.i18n.Tr "username"}}</label>
- + <input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
- + </div>
- + <div class="required inline field {{if .Err_Email}}error{{end}}">
- + <label for="email">{{.i18n.Tr "email"}}</label>
- + <input id="email" name="email" type="email" value="{{.email}}" required>
- + </div>
- + <div class="required inline field {{if .Err_Password}}error{{end}}">
- + <label for="password">{{.i18n.Tr "password"}}</label>
- + <input id="password" name="password" type="password" value="{{.password}}" required>
- + </div>
- + <div class="required inline field {{if .Err_Password}}error{{end}}">
- + <label for="retype">{{.i18n.Tr "re_type"}}</label>
- + <input id="retype" name="retype" type="password" value="{{.retype}}" required>
- + </div>
- + {{if .EnableCaptcha}}
- + <div class="inline field">
- + <label></label>
- + {{.Captcha.CreateHtml}}
- + </div>
- + <div class="required inline field {{if .Err_Captcha}}error{{end}}">
- + <label for="captcha">{{.i18n.Tr "captcha"}}</label>
- + <input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
- + </div>
- + {{end}}
- +
- + <div class="inline field">
- + <label></label>
- + <button class="ui green button">{{.i18n.Tr "auth.create_new_account"}}</button>
- + </div>
- + <div class="inline field">
- + <label></label>
- + <a href="{{AppSubUrl}}/user/login">{{if .IsSocialLogin}}{{.i18n.Tr "auth.social_register_hepler_msg"}}{{else}}{{.i18n.Tr "auth.register_hepler_msg"}}{{end}}</a>
- + </div>
- + {{end}}
- + </div>
- + </form>
- + </div>
- + </div>
- + </div>
- + {{template "base/footer" .}}
- ++>>>>>>> upstream/master
- diff --cc templates/user/dashboard/feeds.tmpl
- index d7c8a08,00982e5..0000000
- --- a/templates/user/dashboard/feeds.tmpl
- +++ b/templates/user/dashboard/feeds.tmpl
- @@@ -1,45 -1,82 +1,128 @@@
- {{range .Feeds}}
- ++<<<<<<< HEAD
- +<div class="news clear">
- + <div class="avatar left">
- + <img class="avatar-30" src="{{.ActAvatar}}" alt="">
- + </div>
- + <div class="content left {{if eq .GetOpType 5}}push-news{{end}} grid-4-5">
- + <p class="text-bold">
- + <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a>
- + {{if eq .GetOpType 1}}
- + {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}}
- + {{else if eq .GetOpType 5}}
- + {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
- + {{else if eq .GetOpType 6}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
- + {{else if eq .GetOpType 8}}
- + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
- + {{else if eq .GetOpType 9}}
- + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
- + {{else if eq .GetOpType 10}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
- + {{end}}
- + </p>
- + {{if eq .GetOpType 5}}
- + <div class="news-content content">
- + <ul class="list-no-style">
- + {{ $push := ActionContent2Commits .}}
- + {{ $repoLink := .GetRepoLink}}
- + {{range $push.Commits}}
- + <li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text-truncate grid-4-5">{{.Message}}</span></li>
- + {{end}}
- + {{if $push.CompareUrl}}<li><a href="{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}}
- + </ul>
- + </div>
- + {{else if eq .GetOpType 6}}
- + <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
- + {{else if eq .GetOpType 10}}
- + <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
- + {{end}}
- + <p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p>
- + </div>
- + <i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i>
- +</div>
- ++=======
- + <div class="news">
- + <div class="ui left">
- + <img class="ui avatar image" src="{{.ActAvatar}}" alt="">
- + </div>
- + <div class="ui grid">
- + <div class="ui fifteen wide column">
- + <div class="{{if eq .GetOpType 5}}push news{{end}}">
- + <p>
- + <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.ShortActUserName}}</a>
- + {{if eq .GetOpType 1}}
- + {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 2}}
- + {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 5}}
- + {{ $branchLink := .GetBranch | EscapePound}}
- + {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 6}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 7}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 8}}
- + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 9}}
- + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 10}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 11}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 12}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 13}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 14}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{else if eq .GetOpType 15}}
- + {{ $index := index .GetIssueInfos 0}}
- + {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
- + {{end}}
- + </p>
- + {{if eq .GetOpType 5}}
- + <div class="content">
- + <ul>
- + {{ $push := ActionContent2Commits .}}
- + {{ $repoLink := .GetRepoLink}}
- + {{if $push.Commits}}
- + {{range $push.Commits}}
- + <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey has-emoji">{{.Message}}</span></li>
- + {{end}}
- + {{end}}
- + {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
- + </ul>
- + </div>
- + {{else if eq .GetOpType 6}}
- + <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
- + {{else if eq .GetOpType 7}}
- + <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
- + {{else if eq .GetOpType 10}}
- + <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
- + <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
- + {{else if eq .GetOpType 11}}
- + <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
- + {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
- + <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
- + {{end}}
- + <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
- + </div>
- + </div>
- + <div class="ui one wide column">
- + <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
- + </div>
- + </div>
- + <div class="ui divider"></div>
- + </div>
- ++>>>>>>> upstream/master
- {{end}}
- diff --cc templates/user/profile.tmpl
- index 59d8d21,8f68e93..0000000
- --- a/templates/user/profile.tmpl
- +++ b/templates/user/profile.tmpl
- @@@ -1,104 -1,99 +1,204 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div class="main-wrapper">
- + <div id="user-profile-page" class="container clear">
- + <div class="grid-1-5 left">
- + <div>
- + {{if .Owner.UseCustomAvatar}}
- + <a href="{{AppSubUrl}}/user/settings" id="profile-avatar" original-title="{{.i18n.Tr "user.change_custom_avatar"}}">
- + {{else}}
- + <a href="http://gravatar.com/emails/" id="profile-avatar" original-title="{{.i18n.Tr "user.change_avatar"}}">
- + {{end}}
- + <img class="profile-avatar" src="{{.Owner.AvatarLink}}?s=200"title="{{.Owner.Name}}"/>
- + </a>
- + <div class="text-center" id="profile-name">
- + {{if .Owner.FullName}}<span id="profile-fullname" class="center-block">{{.Owner.FullName}}</span><br>{{end}}
- + <span class="center-block" id="profile-username">{{.Owner.Name}}</span>
- + </div>
- + </div>
- + <div class="profile-info">
- + <hr>
- + <ul class="list-no-style">
- + {{if .Owner.Location}}
- + <li class="list-group-item"><i class="octicon octicon-location"></i> {{.Owner.Location}}</li>
- + {{end}}
- + {{if .Owner.Email}}
- + {{if not .Owner.HideEmail}}
- + <li class="list-group-item"><i class="octicon octicon-mail"></i> <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a></li>
- + {{end}}
- + {{end}}
- + {{if .Owner.Website}}
- + <li class="list-group-item"><i class="octicon octicon-link"></i> <a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li>
- + {{end}}
- + <li class="list-group-item"><i class="octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
- + </ul>
- + <hr>
- + <ul class="list-no-style">
- + <li class="list-group-item profile-rel">
- + <a class="text-black" href="">
- + <strong>{{.Owner.NumFollowers}}</strong>
- + <p>{{.i18n.Tr "user.followers"}}</p>
- + </a>
- + </li>
- + <li class="list-group-item profile-rel">
- + <a class="text-black" href="">
- + <strong>{{.Owner.NumStars}}</strong>
- + <p>{{.i18n.Tr "user.starred"}}</p>
- + </a>
- + </li>
- + <li class="list-group-item profile-rel">
- + <a class="text-black" href="">
- + <strong>{{.Owner.NumFollowings}}</strong>
- + <p>{{.i18n.Tr "user.following"}}</p>
- + </a>
- + </li>
- + </ul>
- + <hr>
- + </div>
- + </div>
- + <div class="grid-4-5 left">
- + <div id="profile-body">
- + <ul class="menu menu-line" id="profile-header">
- + <li>
- + <a {{if not .TabName}}class="current"{{end}} href="{{.Owner.HomeLink}}"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}</a>
- + </li>
- + <li>
- + <a {{if eq .TabName "activity"}}class="current"{{end}} href="{{.Owner.HomeLink}}?tab=activity"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.activity"}}</a>
- + </li>
- + </ul>
- + <div class="tab-content">
- + {{if eq .TabName "activity"}}
- + <div class="tab-pane active" id="dashboard-news">
- + <br>
- + {{template "user/dashboard/feeds" .}}
- + </div>
- + {{else}}
- + <div class="tab-pane active">
- + <div id="org-repo-list">
- + {{range .Repos}}
- + {{if or (not .IsPrivate) (.HasAccess $.SignedUser)}}
- + <div class="org-repo-item">
- + <ul class="org-repo-status right">
- + <li><i class="octicon octicon-star"></i> {{.NumStars}}</li>
- + <li><i class="octicon octicon-git-branch"></i> {{.NumForks}}</li>
- + </ul>
- + <h2>
- + <a href="{{AppSubUrl}}/{{$.Owner.Name}}/{{.Name}}">{{.Name}}</a>
- + {{if .IsPrivate}}
- + <span class="text-gold"><i class="octicon octicon-lock"></i></span>
- + {{end}}
- + </h2>
- + <p class="org-repo-description">{{.Description}}</p>
- + <p class="org-repo-updated">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
- + </div>
- + {{end}}
- + {{end}}
- + </div>
- + </div>
- + {{end}}
- + </div>
- + </div>
- + </div>
- + </div>
- ++=======
- + {{template "base/head" .}}
- + <div class="user profile">
- + <div class="ui container">
- + <div class="ui grid">
- + <div class="ui five wide column">
- + <div class="ui card">
- + {{if eq .SignedUserName .Owner.Name}}
- + <a class="image poping up" href="{{AppSubUrl}}/user/settings" id="profile-avatar" data-content="{{.i18n.Tr "user.change_avatar"}}" data-variation="inverted tiny" data-position="bottom center">
- + <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
- + </a>
- + {{else}}
- + <span class="image">
- + <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
- + </span>
- + {{end}}
- + <div class="content">
- + {{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
- + <span class="username text center">{{.Owner.Name}}</span>
- + </div>
- + <div class="extra content">
- + <ul class="text black">
- + {{if .Owner.Location}}
- + <li><i class="octicon octicon-location"></i> {{.Owner.Location}}</li>
- + {{end}}
- + {{if and .Owner.Email .IsSigned}}
- + <li>
- + <i class="octicon octicon-mail"></i>
- + <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
- + </li>
- + {{end}}
- + {{if .Owner.Website}}
- + <li>
- + <i class="octicon octicon-link"></i>
- + <a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a>
- + </li>
- + {{end}}
- + <li><i class="octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
- + <li>
- + <i class="octicon octicon-person"></i>
- + <a href="{{.Owner.HomeLink}}/followers">
- + {{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}}
- + </a>
- + -
- + <a href="{{.Owner.HomeLink}}/following">
- + {{.Owner.NumFollowing}} {{.i18n.Tr "user.following"}}
- + </a>
- + </li>
- + {{/*
- + <li>
- + <i class="octicon octicon-star"></i>
- + <a href="{{.Owner.HomeLink}}/stars">
- + {{.Owner.NumStars}} {{.i18n.Tr "user.starred"}}
- + </a>
- + </li>
- + */}}
- + {{if .Orgs}}
- + <li>
- + {{range .Orgs}}
- + <a href="{{.HomeLink}}"><img class="ui mini image poping up" src="{{.AvatarLink}}" data-content="{{.Name}}" data-position="top center" data-variation="tiny inverted"></a>
- + {{end}}
- + </li>
- + {{end}}
- + {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
- + <li class="follow">
- + {{if .SignedUser.IsFollowing .Owner.Id}}
- + <a class="ui basic red button" href="{{.Link}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.unfollow"}}</a>
- + {{else}}
- + <a class="ui basic green button" href="{{.Link}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.follow"}}</a>
- + {{end}}
- + </li>
- + {{end}}
- + </ul>
- + </div>
- + </div>
- + </div>
- + <div class="ui eleven wide column">
- + <div class="ui secondary pointing menu">
- + <a class="{{if ne .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}">
- + <i class="octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}
- + </a>
- + <a class="item">
- + <a class="{{if eq .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}?tab=activity">
- + <i class="octicon octicon-rss"></i> {{.i18n.Tr "user.activity"}}
- + </a>
- + </a>
- + </div>
- + {{if ne .TabName "activity"}}
- + {{template "explore/repo_list" .}}
- + {{else}}
- + <br>
- + <div class="feeds">
- + {{template "user/dashboard/feeds" .}}
- + </div>
- + {{end}}
- + </div>
- + </div>
- + </div>
- ++>>>>>>> upstream/master
- </div>
- - {{template "ng/base/footer" .}}
- + {{template "base/footer" .}}
- diff --cc templates/user/settings/profile.tmpl
- index 1e07d89,a1328a2..0000000
- --- a/templates/user/settings/profile.tmpl
- +++ b/templates/user/settings/profile.tmpl
- @@@ -1,86 -1,75 +1,164 @@@
- ++<<<<<<< HEAD
- +{{template "ng/base/head" .}}
- +{{template "ng/base/header" .}}
- +<div id="setting-wrapper" class="main-wrapper">
- + <div id="user-profile-setting" class="container clear">
- + {{template "user/settings/nav" .}}
- + <div class="grid-4-5 left">
- + <div class="setting-content">
- + {{template "ng/base/alert" .}}
- + <div id="setting-content">
- + <div id="user-profile-setting-content" class="panel panel-radius">
- + <div class="panel-header">
- + <strong>{{.i18n.Tr "settings.public_profile"}}</strong>
- + </div>
- + <div class="panel-body">
- + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings" method="post">
- + {{.CsrfTokenHtml}}
- + <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</div>
- + <div class="field">
- + <label>{{.i18n.Tr "settings.uid"}}</label>
- + <label class="text-left">{{.SignedUser.Id}}</label>
- + </div>
- + <div class="field">
- + <label class="req" for="username">{{.i18n.Tr "username"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.SignedUser.Name}}" data-uname="{{.SignedUser.Name}}" required />
- + </div>
- + <div class="white-popup-block mfp-hide" id="change-username-modal">
- + <h1 class="text-red">{{.i18n.Tr "settings.change_username"}}</h1>
- + <p>{{.i18n.Tr "settings.change_username_desc"}}</p>
- + <br>
- + <button class="btn btn-red btn-large btn-radius" id="change-username-submit">{{.i18n.Tr "settings.continue"}}</button>
- + <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
- + </div>
- + <div class="field">
- + <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.SignedUser.FullName}}" />
- + </div>
- + <div class="field">
- + <label class="req" for="email">{{.i18n.Tr "email"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.SignedUser.Email}}" required />
- + </div>
- + <div class="field">
- + <label for="hideemail">Hide E-mail address</label>
- + <input class="ipt-chk" id="hideemail" name="hideemail" type="checkbox" {{if .SignedUser.HideEmail}}checked{{end}} />
- + </div>
- + <div class="field">
- + <label for="website">{{.i18n.Tr "settings.website"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.SignedUser.Website}}" />
- + </div>
- + <div class="field">
- + <label for="location">{{.i18n.Tr "settings.location"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.SignedUser.Location}}" />
- + </div>
- + <div class="field {{if DisableGravatar}}hide{{end}}">
- + <label class="req" for="gravatar-email">Gravatar {{.i18n.Tr "email"}}</label>
- + <input class="ipt ipt-large ipt-radius {{if .Err_Avatar}}ipt-error{{end}}" id="gravatar-email" name="avatar" type="text" value="{{.SignedUser.AvatarEmail}}" />
- + </div>
- + <div class="field">
- + <label></label>
- + <button class="btn btn-green btn-large btn-radius" id="change-username-btn" href="#change-username-modal">{{.i18n.Tr "settings.update_profile"}}</button>
- + </div>
- + </form>
- + <hr>
- + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings/avatar" method="post" enctype="multipart/form-data">
- + {{.CsrfTokenHtml}}
- + <div class="field">
- + <label for="enable">{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
- + <input class="ipt-chk" id="enable" name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}} />
- + <span>{{.i18n.Tr "settings.enable_custom_avatar_helper"}}</span>
- + </div>
- + <div class="field">
- + <label>{{.i18n.Tr "settings.choose_new_avatar"}}</label>
- + <input name="avatar" type="file" />
- + </div>
- + <div class="field">
- + <label></label>
- + <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.update_avatar"}}</button>
- + </div>
- + </form>
- + </div>
- + </div>
- + </div>
- + </div>
- + </div>
- + </div>
- +</div>
- +{{template "ng/base/footer" .}}
- ++=======
- + {{template "base/head" .}}
- + <div class="user settings profile">
- + <div class="ui container">
- + <div class="ui grid">
- + {{template "user/settings/navbar" .}}
- + <div class="twelve wide column content">
- + {{template "base/alert" .}}
- + <h4 class="ui top attached header">
- + {{.i18n.Tr "settings.public_profile"}}
- + </h4>
- + <div class="ui attached segment">
- + <p>{{.i18n.Tr "settings.profile_desc"}}</p>
- + <form class="ui form" action="{{.Link}}" method="post">
- + {{.CsrfTokenHtml}}
- + <div class="required field {{if .Err_Name}}error{{end}}">
- + <label for="username">{{.i18n.Tr "username"}}<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
- + <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if not .SignedUser.IsLocal}}disabled{{end}}>
- + {{if not .SignedUser.IsLocal}}
- + <p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
- + {{end}}
- + </div>
- + <div class="field {{if .Err_FullName}}error{{end}}">
- + <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
- + <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
- + </div>
- + <div class="required field {{if .Err_Email}}error{{end}}">
- + <label for="email">{{.i18n.Tr "email"}}</label>
- + <input id="email" name="email" value="{{.SignedUser.Email}}">
- + </div>
- + <div class="field {{if .Err_Website}}error{{end}}">
- + <label for="website">{{.i18n.Tr "settings.website"}}</label>
- + <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
- + </div>
- + <div class="field">
- + <label for="location">{{.i18n.Tr "settings.location"}}</label>
- + <input id="location" name="location" value="{{.SignedUser.Location}}">
- + </div>
- + {{if not DisableGravatar}}
- + <div class="field {{if .Err_Gravatar}}error{{end}}">
- + <label for="gravatar">Gravatar {{.i18n.Tr "email"}}</label>
- + <input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" />
- + </div>
- + {{end}}
- +
- + <div class="field">
- + <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button>
- + </div>
- + </form>
- +
- + <div class="ui divider"></div>
- +
- + <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
- + {{.CsrfTokenHtml}}
- + <div class="inline field">
- + <div class="ui checkbox">
- + <input name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
- + <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
- + </div>
- + </div>
- + <div class="inline field">
- + <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
- + <input name="avatar" type="file" >
- + </div>
- +
- + <div class="field">
- + <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
- + <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
- + </div>
- + </form>
- + </div>
- + </div>
- + </div>
- + </div>
- + </div>
- + {{template "base/footer" .}}
- ++>>>>>>> upstream/master
- * Unmerged path modules/base/template.go
- * Unmerged path modules/git/commit.go
- * Unmerged path routers/api/v1/repo.go
- * Unmerged path routers/api/v1/repo_hooks.go
- * Unmerged path routers/api/v1/user.go
- * Unmerged path templates/ng/base/footer.tmpl
- * Unmerged path templates/ng/base/head.tmpl
- * Unmerged path templates/ng/base/header.tmpl
|